1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-23 11:45:38 +01:00

dont need splash activity

This commit is contained in:
Kyle Spearrin 2019-06-05 15:09:13 -04:00
parent 9ae08932c2
commit a1a5d3b363
5 changed files with 4 additions and 68 deletions

View File

@ -126,7 +126,6 @@
<Compile Include="Renderers\HybridWebViewRenderer.cs" />
<Compile Include="Services\AndroidPushNotificationService.cs" />
<Compile Include="Services\AndroidLogService.cs" />
<Compile Include="SplashActivity.cs" />
<Compile Include="MainApplication.cs" />
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />

View File

@ -23,8 +23,8 @@ namespace Bit.Droid
[Activity(
Label = "Bitwarden",
Icon = "@mipmap/ic_launcher",
Theme = "@style/LightTheme",
Exported = false,
Theme = "@style/LightTheme.Splash",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
[Register("com.x8bit.bitwarden.MainActivity")]
public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
@ -301,7 +301,7 @@ namespace Bit.Droid
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 alarmManager = GetSystemService(AlarmService) as AlarmManager;
var triggerMs = Java.Lang.JavaSystem.CurrentTimeMillis() + 500;

View File

@ -19,8 +19,6 @@
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<application
android:label="Bitwarden"
android:theme="@style/LightTheme"
android:allowBackup="false"
tools:replace="android:allowBackup"
android:icon="@mipmap/ic_launcher"

View File

@ -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);
}
}
}
}

View File

@ -59,7 +59,7 @@ namespace Bit.Droid.Tile
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.PutExtra("myVaultTile", true);
StartActivityAndCollapse(intent);