mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-06-11 02:53:23 +02:00
Added: Open Wiki
This commit is contained in:
@ -81,6 +81,7 @@
|
||||
<Compile Include="Services\APIService.cs" />
|
||||
<Compile Include="Services\APIService_New.cs" />
|
||||
<Compile Include="Services\APIServiceConnection.cs" />
|
||||
<Compile Include="Services\BrowserService.cs" />
|
||||
<Compile Include="Services\PreferenceStorageService.cs" />
|
||||
<Compile Include="Services\SecretStorage.cs" />
|
||||
<Compile Include="Services\VersioningService.cs" />
|
||||
|
@ -1,5 +1,6 @@
|
||||
using Borepin.Droid.Services;
|
||||
using Borepin.Service;
|
||||
using Borepin.Service.Browser;
|
||||
using Borepin.Service.Storage;
|
||||
using Borepin.Service.Versioning;
|
||||
using Prism;
|
||||
@ -14,6 +15,7 @@ namespace Borepin.Droid
|
||||
containerRegistry.Register<IPreferenceStorageService, PreferenceStorageService>();
|
||||
containerRegistry.Register<ISecretStorageService, SecretStorage>();
|
||||
containerRegistry.Register<IVersioningService, VersioningService>();
|
||||
containerRegistry.Register<IBrowserService, BrowserService>();
|
||||
|
||||
containerRegistry.RegisterSingleton<IAPIService, APIService>();
|
||||
}
|
||||
|
51
Borepin/Borepin.Android/Services/BrowserService.cs
Normal file
51
Borepin/Borepin.Android/Services/BrowserService.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using Borepin.Service.Browser;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace Borepin.Droid.Services
|
||||
{
|
||||
public class BrowserService : IBrowserService
|
||||
{
|
||||
private Xamarin.Essentials.BrowserLaunchOptions ConvertBrowserLaunchOptions(Service.Browser.BrowserLaunchOptions browserLaunchOptions)
|
||||
{
|
||||
return new Xamarin.Essentials.BrowserLaunchOptions()
|
||||
{
|
||||
Flags = (Xamarin.Essentials.BrowserLaunchFlags)browserLaunchOptions.Flags,
|
||||
LaunchMode = (Xamarin.Essentials.BrowserLaunchMode)browserLaunchOptions.LaunchMode,
|
||||
PreferredControlColor = browserLaunchOptions.PreferredControlColor,
|
||||
PreferredToolbarColor = browserLaunchOptions.PreferredToolbarColor,
|
||||
TitleMode = (Xamarin.Essentials.BrowserTitleMode)browserLaunchOptions.TitleMode
|
||||
};
|
||||
}
|
||||
public async Task OpenAsync(string uri)
|
||||
{
|
||||
await Browser.OpenAsync(uri).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task OpenAsync(string uri, Service.Browser.BrowserLaunchMode browserLaunchMode)
|
||||
{
|
||||
await Browser.OpenAsync(uri, (Xamarin.Essentials.BrowserLaunchMode)browserLaunchMode).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task OpenAsync(string uri, Service.Browser.BrowserLaunchOptions browserLaunchOptions)
|
||||
{
|
||||
await Browser.OpenAsync(uri, ConvertBrowserLaunchOptions(browserLaunchOptions));
|
||||
}
|
||||
|
||||
public async Task OpenAsync(Uri uri)
|
||||
{
|
||||
await Browser.OpenAsync(uri).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task OpenAsync(Uri uri, Service.Browser.BrowserLaunchMode browserLaunchMode)
|
||||
{
|
||||
await Browser.OpenAsync(uri, (Xamarin.Essentials.BrowserLaunchMode)browserLaunchMode).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task OpenAsync(Uri uri, Service.Browser.BrowserLaunchOptions browserLaunchOptions)
|
||||
{
|
||||
await Browser.OpenAsync(uri, ConvertBrowserLaunchOptions(browserLaunchOptions));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user