mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -12,96 +12,96 @@ using Xamarin.Forms.Platform.Android.AppLinks;
|
|||
|
||||
namespace TINK.Droid
|
||||
{
|
||||
[Activity(Label = "Sharee", Icon = "@drawable/sharee", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
[Activity(Label = "Sharee", Icon = "@drawable/sharee", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
|
||||
[IntentFilter(new[] { Intent.ActionView },
|
||||
Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault },
|
||||
DataScheme = "https",
|
||||
DataHost = "sharee.bike",
|
||||
DataPathPrefix = "/sharee",
|
||||
AutoVerify = true)]
|
||||
[IntentFilter(new[] { Intent.ActionView },
|
||||
Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault },
|
||||
DataScheme = "https",
|
||||
DataHost = "sharee.bike",
|
||||
DataPathPrefix = "/sharee",
|
||||
AutoVerify = true)]
|
||||
|
||||
[IntentFilter(new[] { Intent.ActionView },
|
||||
Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault },
|
||||
DataScheme = "http",
|
||||
DataHost = "sharee.bike",
|
||||
DataPathPrefix = "/sharee",
|
||||
AutoVerify = true)]
|
||||
[IntentFilter(new[] { Intent.ActionView },
|
||||
Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault },
|
||||
DataScheme = "http",
|
||||
DataHost = "sharee.bike",
|
||||
DataPathPrefix = "/sharee",
|
||||
AutoVerify = true)]
|
||||
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
private void initFontScale()
|
||||
{
|
||||
Configuration configuration = Resources.Configuration;
|
||||
configuration.FontScale = (float)1;
|
||||
//0.85 small, 1 standard, 1.15 big,1.3 more bigger ,1.45 supper big
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
WindowManager.DefaultDisplay.GetMetrics(metrics);
|
||||
metrics.ScaledDensity = configuration.FontScale * metrics.Density;
|
||||
BaseContext.Resources.UpdateConfiguration(configuration, metrics);
|
||||
}
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
initFontScale();
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
private void initFontScale()
|
||||
{
|
||||
Configuration configuration = Resources.Configuration;
|
||||
configuration.FontScale = (float)1;
|
||||
//0.85 small, 1 standard, 1.15 big,1.3 more bigger ,1.45 supper big
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
WindowManager.DefaultDisplay.GetMetrics(metrics);
|
||||
metrics.ScaledDensity = configuration.FontScale * metrics.Density;
|
||||
BaseContext.Resources.UpdateConfiguration(configuration, metrics);
|
||||
}
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
initFontScale();
|
||||
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
|
||||
base.OnCreate(bundle);
|
||||
base.OnCreate(bundle);
|
||||
|
||||
global::Xamarin.Forms.Forms.Init(this, bundle);
|
||||
global::Xamarin.Forms.Forms.Init(this, bundle);
|
||||
|
||||
FirebaseApp.InitializeApp(this);
|
||||
AndroidAppLinks.Init(this);
|
||||
FirebaseApp.InitializeApp(this);
|
||||
AndroidAppLinks.Init(this);
|
||||
|
||||
// Initialize xamarin.essentials, see https://docs.microsoft.com/en-us/xamarin/essentials/get-started?tabs=macos%2Candroid.
|
||||
Xamarin.Essentials.Platform.Init(this, bundle);
|
||||
// Initialize xamarin.essentials, see https://docs.microsoft.com/en-us/xamarin/essentials/get-started?tabs=macos%2Candroid.
|
||||
Xamarin.Essentials.Platform.Init(this, bundle);
|
||||
|
||||
// Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/
|
||||
Xamarin.FormsGoogleMaps.Init(this, bundle);
|
||||
// Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/
|
||||
Xamarin.FormsGoogleMaps.Init(this, bundle);
|
||||
|
||||
// Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings.
|
||||
Xamarin.FormsGoogleMapsBindings.Init();
|
||||
// Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings.
|
||||
Xamarin.FormsGoogleMapsBindings.Init();
|
||||
|
||||
// Get version name of app.
|
||||
Context context = ApplicationContext;
|
||||
new Model.Device.AppInfo(context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName);
|
||||
// Get version name of app.
|
||||
Context context = ApplicationContext;
|
||||
new Model.Device.AppInfo(context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName);
|
||||
|
||||
Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) =>
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(e.View.AutomationId))
|
||||
{
|
||||
e.NativeView.ContentDescription = e.View.AutomationId;
|
||||
}
|
||||
};
|
||||
Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) =>
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(e.View.AutomationId))
|
||||
{
|
||||
e.NativeView.ContentDescription = e.View.AutomationId;
|
||||
}
|
||||
};
|
||||
|
||||
LoadApplication(new App());
|
||||
}
|
||||
LoadApplication(new App());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles opening the dialog to request for permissions.
|
||||
/// </summary>
|
||||
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
|
||||
{
|
||||
if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Essentials.Permissions))
|
||||
{
|
||||
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
else if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Plugin.Permissions))
|
||||
{
|
||||
// Bug in 3.0.244 and earlier versions of sharee.bike app: Call of PermissionsImplementation.Current.OnRequestedPermission result was missing.
|
||||
// see https://dev.azure.com/TeilRad/sharee.bike%20Buchungsplattform/_workitems/edit/136 for further details.
|
||||
PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
/// <summary>
|
||||
/// Handles opening the dialog to request for permissions.
|
||||
/// </summary>
|
||||
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
|
||||
{
|
||||
if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Essentials.Permissions))
|
||||
{
|
||||
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
else if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Plugin.Permissions))
|
||||
{
|
||||
// Bug in 3.0.244 and earlier versions of sharee.bike app: Call of PermissionsImplementation.Current.OnRequestedPermission result was missing.
|
||||
// see https://dev.azure.com/TeilRad/sharee.bike%20Buchungsplattform/_workitems/edit/136 for further details.
|
||||
PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
[Export("TapStation")]
|
||||
public void TapStation(string stationNr)
|
||||
{
|
||||
BackdoorMethodHelpers.DoTapPage(stationNr);
|
||||
}
|
||||
}
|
||||
[Export("TapStation")]
|
||||
public void TapStation(string stationNr)
|
||||
{
|
||||
BackdoorMethodHelpers.DoTapPage(stationNr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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}";
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.hauffware.sharee" android:versionName="3.0.337" android:versionCode="337">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.338" android:versionCode="338">
|
||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
|
||||
<!-- Google Maps related permissions -->
|
||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||
|
|
592
TINK/TINK.Android/Resources/Resource.Designer.cs
generated
592
TINK/TINK.Android/Resources/Resource.Designer.cs
generated
File diff suppressed because it is too large
Load diff
BIN
TINK/TINK.Android/Resources/drawable/bike_Cargo_Pedelec_Two.png
Normal file
BIN
TINK/TINK.Android/Resources/drawable/bike_Cargo_Pedelec_Two.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 76 KiB |
|
@ -303,6 +303,18 @@
|
|||
<Generator>MSBuild:UpdateGeneratedFiles</Generator>
|
||||
</AndroidResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\bike_City_SoleHumanPowered_Two.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\bike_Cargo_SoleHumanPowered_Two.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\bike_Cargo_SoleHumanPowered_Trike.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\bike_Cargo_Pedelec_Two.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\battery_undefined.png" />
|
||||
</ItemGroup>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue