mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
dont need splash activity
This commit is contained in:
parent
9ae08932c2
commit
a1a5d3b363
5 changed files with 4 additions and 68 deletions
|
@ -126,7 +126,6 @@
|
||||||
<Compile Include="Renderers\HybridWebViewRenderer.cs" />
|
<Compile Include="Renderers\HybridWebViewRenderer.cs" />
|
||||||
<Compile Include="Services\AndroidPushNotificationService.cs" />
|
<Compile Include="Services\AndroidPushNotificationService.cs" />
|
||||||
<Compile Include="Services\AndroidLogService.cs" />
|
<Compile Include="Services\AndroidLogService.cs" />
|
||||||
<Compile Include="SplashActivity.cs" />
|
|
||||||
<Compile Include="MainApplication.cs" />
|
<Compile Include="MainApplication.cs" />
|
||||||
<Compile Include="MainActivity.cs" />
|
<Compile Include="MainActivity.cs" />
|
||||||
<Compile Include="Resources\Resource.designer.cs" />
|
<Compile Include="Resources\Resource.designer.cs" />
|
||||||
|
|
|
@ -23,8 +23,8 @@ namespace Bit.Droid
|
||||||
[Activity(
|
[Activity(
|
||||||
Label = "Bitwarden",
|
Label = "Bitwarden",
|
||||||
Icon = "@mipmap/ic_launcher",
|
Icon = "@mipmap/ic_launcher",
|
||||||
Theme = "@style/LightTheme",
|
Theme = "@style/LightTheme.Splash",
|
||||||
Exported = false,
|
MainLauncher = true,
|
||||||
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||||
[Register("com.x8bit.bitwarden.MainActivity")]
|
[Register("com.x8bit.bitwarden.MainActivity")]
|
||||||
public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||||
|
@ -301,7 +301,7 @@ namespace Bit.Droid
|
||||||
|
|
||||||
private void RestartApp()
|
private void RestartApp()
|
||||||
{
|
{
|
||||||
var intent = new Intent(this, typeof(SplashActivity));
|
var intent = new Intent(this, typeof(MainActivity));
|
||||||
var pendingIntent = PendingIntent.GetActivity(this, 5923650, intent, PendingIntentFlags.CancelCurrent);
|
var pendingIntent = PendingIntent.GetActivity(this, 5923650, intent, PendingIntentFlags.CancelCurrent);
|
||||||
var alarmManager = GetSystemService(AlarmService) as AlarmManager;
|
var alarmManager = GetSystemService(AlarmService) as AlarmManager;
|
||||||
var triggerMs = Java.Lang.JavaSystem.CurrentTimeMillis() + 500;
|
var triggerMs = Java.Lang.JavaSystem.CurrentTimeMillis() + 500;
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:label="Bitwarden"
|
|
||||||
android:theme="@style/LightTheme"
|
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
tools:replace="android:allowBackup"
|
tools:replace="android:allowBackup"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
using Android.App;
|
|
||||||
using Android.Content.PM;
|
|
||||||
using Android.Runtime;
|
|
||||||
using Android.OS;
|
|
||||||
using Android.Support.V7.App;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Android.Content;
|
|
||||||
using Bit.App.Utilities;
|
|
||||||
|
|
||||||
namespace Bit.Droid
|
|
||||||
{
|
|
||||||
[Activity(
|
|
||||||
Label = "Bitwarden",
|
|
||||||
MainLauncher = true,
|
|
||||||
NoHistory = true,
|
|
||||||
Icon = "@mipmap/ic_launcher",
|
|
||||||
Theme = "@style/LightTheme.Splash",
|
|
||||||
WindowSoftInputMode = Android.Views.SoftInput.StateHidden,
|
|
||||||
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
|
||||||
[Register("com.x8bit.bitwarden.SplashActivity")]
|
|
||||||
public class SplashActivity : AppCompatActivity
|
|
||||||
{
|
|
||||||
public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState)
|
|
||||||
{
|
|
||||||
UpdateTheme(ThemeManager.GetTheme());
|
|
||||||
base.OnCreate(savedInstanceState, persistentState);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnResume()
|
|
||||||
{
|
|
||||||
base.OnResume();
|
|
||||||
var startupWork = new Task(() =>
|
|
||||||
{
|
|
||||||
var mainIntent = new Intent(Application.Context, typeof(MainActivity));
|
|
||||||
mainIntent.PutExtra("myVaultTile", Intent.GetBooleanExtra("myVaultTile", false));
|
|
||||||
StartActivity(mainIntent);
|
|
||||||
});
|
|
||||||
startupWork.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateTheme(string theme)
|
|
||||||
{
|
|
||||||
if(theme == "dark")
|
|
||||||
{
|
|
||||||
SetTheme(Resource.Style.DarkTheme_Splash);
|
|
||||||
}
|
|
||||||
else if(theme == "black")
|
|
||||||
{
|
|
||||||
SetTheme(Resource.Style.BlackTheme_Splash);
|
|
||||||
}
|
|
||||||
else if(theme == "nord")
|
|
||||||
{
|
|
||||||
SetTheme(Resource.Style.NordTheme_Splash);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetTheme(Resource.Style.LightTheme_Splash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -59,7 +59,7 @@ namespace Bit.Droid.Tile
|
||||||
|
|
||||||
private void LaunchMyVault()
|
private void LaunchMyVault()
|
||||||
{
|
{
|
||||||
var intent = new Intent(this, typeof(SplashActivity));
|
var intent = new Intent(this, typeof(MainActivity));
|
||||||
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.SingleTop | ActivityFlags.ClearTop);
|
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.SingleTop | ActivityFlags.ClearTop);
|
||||||
intent.PutExtra("myVaultTile", true);
|
intent.PutExtra("myVaultTile", true);
|
||||||
StartActivityAndCollapse(intent);
|
StartActivityAndCollapse(intent);
|
||||||
|
|
Loading…
Reference in a new issue