Version 3.0.338

This commit is contained in:
Anja Müller-Meißner 2022-09-06 16:08:19 +02:00 committed by Anja
parent 573fe77e12
commit 0468955d49
751 changed files with 62747 additions and 60672 deletions

View file

@ -6,40 +6,40 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(AppInfo))]
namespace TINK.Droid.Model.Device
{
/// <summary> Holds information about the TINK- app. </summary>
public class AppInfo : IAppInfo
{
/// <summary> Holds the the version of the app.</summary>
private static Version m_oVersion = null;
/// <summary> Holds information about the TINK- app. </summary>
public class AppInfo : IAppInfo
{
/// <summary> Holds the the version of the app.</summary>
private static Version m_oVersion = null;
/// <summary> Constructs a app info object. </summary>
public AppInfo()
{
}
/// <summary> Constructs a app info object. </summary>
public AppInfo()
{
}
/// <summary> Constructs a app info object for initialization. </summary>
/// <param name="p_strVersionText"> Version to initializ object with.</param>
internal AppInfo(string p_strVersionText)
{
if (m_oVersion != null)
{
// Set version only once.
return;
}
/// <summary> Constructs a app info object for initialization. </summary>
/// <param name="p_strVersionText"> Version to initializ object with.</param>
internal AppInfo(string p_strVersionText)
{
if (m_oVersion != null)
{
// Set version only once.
return;
}
if (!Version.TryParse(p_strVersionText, out Version l_oVersion))
{
m_oVersion = new Version(0, 8);
}
if (!Version.TryParse(p_strVersionText, out Version l_oVersion))
{
m_oVersion = new Version(0, 8);
}
m_oVersion = l_oVersion;
}
m_oVersion = l_oVersion;
}
/// <summary> Get the version of the app. </summary>
public Version Version => m_oVersion ?? new Version(0, 9);
/// <summary> Get the version of the app. </summary>
public Version Version => m_oVersion ?? new Version(0, 9);
/// <summary> Gets the URL to the app store. </summary>
/// <value>The store URL.</value>
public string StoreUrl => $"https://play.google.com/store/apps/details?id={Android.App.Application.Context.PackageName}";
}
/// <summary> Gets the URL to the app store. </summary>
/// <value>The store URL.</value>
public string StoreUrl => $"https://play.google.com/store/apps/details?id={Android.App.Application.Context.PackageName}";
}
}

View file

@ -5,19 +5,19 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(TINK.Droid.Model.Device.Device))]
namespace TINK.Droid.Model.Device
{
public class Device : ISmartDevice
{
public string Manufacturer => DeviceInfo.Manufacturer;
public class Device : ISmartDevice
{
public string Manufacturer => DeviceInfo.Manufacturer;
public string Model => DeviceInfo.Model;
public string Model => DeviceInfo.Model;
public DevicePlatform Platform => DeviceInfo.Platform;
public DevicePlatform Platform => DeviceInfo.Platform;
public string VersionText => DeviceInfo.VersionString;
public string VersionText => DeviceInfo.VersionString;
/// <summary> Gets unitque device identifier. </summary>
/// <returns>Gets the identifies specifying device.</returns>
public string Identifier
=> Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
}
/// <summary> Gets unitque device identifier. </summary>
/// <returns>Gets the identifies specifying device.</returns>
public string Identifier
=> Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
}
}

View file

@ -6,18 +6,18 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(ExternalBrowseService))]
namespace TINK.Droid.Model.Device
{
public class ExternalBrowseService : IExternalBrowserService
{
/// <summary> Opens an external browser. </summary>
/// <param name="p_strUrl">Url to open.</param>
public void OpenUrl(string p_strUrl)
{
var uri = Android.Net.Uri.Parse(p_strUrl);
var intent = new Intent(Intent.ActionView, uri);
public class ExternalBrowseService : IExternalBrowserService
{
/// <summary> Opens an external browser. </summary>
/// <param name="p_strUrl">Url to open.</param>
public void OpenUrl(string p_strUrl)
{
var uri = Android.Net.Uri.Parse(p_strUrl);
var intent = new Intent(Intent.ActionView, uri);
intent.AddFlags(ActivityFlags.NewTask);
intent.AddFlags(ActivityFlags.NewTask);
Android.App.Application.Context.StartActivity(intent);
}
}
Android.App.Application.Context.StartActivity(intent);
}
}
}

View file

@ -16,15 +16,15 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(TINK.Droid.Model.Device.Gps))]
namespace TINK.Droid.Model.Device
{
public class Gps : IGeolodationDependent
{
public bool IsGeolcationEnabled
{
get
{
LocationManager locationManager = (LocationManager)Android.App.Application.Context.GetSystemService(Context.LocationService);
return locationManager.IsProviderEnabled(LocationManager.GpsProvider);
}
}
}
public class Gps : IGeolodationDependent
{
public bool IsGeolcationEnabled
{
get
{
LocationManager locationManager = (LocationManager)Android.App.Application.Context.GetSystemService(Context.LocationService);
return locationManager.IsProviderEnabled(LocationManager.GpsProvider);
}
}
}
}

View file

@ -6,44 +6,44 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(TINK.Droid.Model.Device.SpecialFolder))]
namespace TINK.Droid.Model.Device
{
public class SpecialFolder : ISpecialFolder
{
/// <summary> Get the folder name of external folder to write to. </summary>
/// <returns> Name of the external folder. </returns>
public string GetExternalFilesDir()
{
string baseFolderPath = string.Empty;
try
{
var context = Android.App.Application.Context;
Java.IO.File[] dirs = context.GetExternalFilesDirs(null);
public class SpecialFolder : ISpecialFolder
{
/// <summary> Get the folder name of external folder to write to. </summary>
/// <returns> Name of the external folder. </returns>
public string GetExternalFilesDir()
{
string baseFolderPath = string.Empty;
try
{
var context = Android.App.Application.Context;
Java.IO.File[] dirs = context.GetExternalFilesDirs(null);
foreach (Java.IO.File folder in dirs)
{
bool IsRemovable = Android.OS.Environment.InvokeIsExternalStorageRemovable(folder);
bool IsEmulated = Android.OS.Environment.InvokeIsExternalStorageEmulated(folder);
foreach (Java.IO.File folder in dirs)
{
bool IsRemovable = Android.OS.Environment.InvokeIsExternalStorageRemovable(folder);
bool IsEmulated = Android.OS.Environment.InvokeIsExternalStorageEmulated(folder);
if (IsRemovable
&& !IsEmulated)
{
baseFolderPath = folder.Path;
}
}
}
if (IsRemovable
&& !IsEmulated)
{
baseFolderPath = folder.Path;
}
}
}
catch (Exception l_oException)
{
Log.Error("Getting external files directory failed. {@l_oException}", l_oException);
}
catch (Exception l_oException)
{
Log.Error("Getting external files directory failed. {@l_oException}", l_oException);
}
return baseFolderPath;
}
return baseFolderPath;
}
/// <summary> Gets the folder name of the personal data folder dir on internal storage. </summary>
/// <returns>Directory name.</returns>
public string GetInternalPersonalDir()
{
return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
}
}
/// <summary> Gets the folder name of the personal data folder dir on internal storage. </summary>
/// <returns>Directory name.</returns>
public string GetInternalPersonalDir()
{
return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
}
}
}

View file

@ -4,13 +4,13 @@ using TINK.Model.Device;
[assembly: Xamarin.Forms.Dependency(typeof(TINK.Droid.Model.Device.WebView))]
namespace TINK.Droid.Model.Device
{
public class WebView : IWebView
{
/// <summary> Clears the cookie cache for all web views. </summary>
public void ClearCookies()
{
var cookieManager = CookieManager.Instance;
cookieManager.RemoveAllCookie();
}
}
public class WebView : IWebView
{
/// <summary> Clears the cookie cache for all web views. </summary>
public void ClearCookies()
{
var cookieManager = CookieManager.Instance;
cookieManager.RemoveAllCookie();
}
}
}