Use activity options in debug mode only

pull/204/head
M66B 3 years ago
parent b5394a77ab
commit fc8a553762

@ -152,13 +152,13 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
@Override @Override
protected void onExecuted(Bundle args, Boolean hasAccounts) { protected void onExecuted(Bundle args, Boolean hasAccounts) {
Bundle options; Bundle options = null;
try { try {
options = ActivityOptions.makeCustomAnimation(ActivityMain.this, if (BuildConfig.DEBUG)
R.anim.activity_open_enter, 0).toBundle(); options = ActivityOptions.makeCustomAnimation(ActivityMain.this,
R.anim.activity_open_enter, 0).toBundle();
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);
options = new Bundle();
} }
if (hasAccounts) { if (hasAccounts) {
@ -167,12 +167,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
Intent saved = args.getParcelable("intent"); Intent saved = args.getParcelable("intent");
if (saved == null) { if (saved == null) {
try { startActivity(view, options);
startActivity(view, options);
} catch (Throwable ex) {
Log.e(ex);
startActivity(view);
}
if (sync_on_launch) if (sync_on_launch)
ServiceUI.sync(ActivityMain.this, null); ServiceUI.sync(ActivityMain.this, null);
} else } else
@ -193,12 +188,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
} else { } else {
Intent setup = new Intent(ActivityMain.this, ActivitySetup.class) Intent setup = new Intent(ActivityMain.this, ActivitySetup.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try { startActivity(setup, options);
startActivity(setup, options);
} catch (Throwable ex) {
Log.e(ex);
startActivity(setup);
}
} }
long end = new Date().getTime(); long end = new Date().getTime();

Loading…
Cancel
Save