LSW: Properly set page transition and cleanup definitions on the way

Set slide animation by default and use it in all pages.
Fix wrong/missing slide animations on various transitions like WiFi
and the backup subpage.

Change-Id: I78c87f38eb615379d39c89b43a016ed2ffb98695
This commit is contained in:
Christian Oder
2020-11-09 17:14:42 +01:00
committed by Alessandro Astone
parent b05350b920
commit cff638652a
16 changed files with 20 additions and 99 deletions

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -89,7 +89,7 @@ public abstract class BaseSetupWizardActivity extends Activity implements Naviga
private boolean mIsFirstRun = true; private boolean mIsFirstRun = true;
protected boolean mIsGoingBack = false; protected boolean mIsGoingBack = false;
private boolean mIsPrimaryUser; private boolean mIsPrimaryUser;
private int mResultCode = 0; protected int mResultCode = 0;
private Intent mResultData; private Intent mResultData;
@Override @Override
@@ -520,7 +520,7 @@ public abstract class BaseSetupWizardActivity extends Activity implements Naviga
} }
protected int getTransition() { protected int getTransition() {
return TRANSITION_ID_DEFAULT; return TRANSITION_ID_SLIDE;
} }
protected boolean tryEnablingWifi() { protected boolean tryEnablingWifi() {

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -54,11 +54,6 @@ public class CaptivePortalSetupActivity extends SubBaseActivity {
.checkForCaptivePortal(mCaptivePortalUrl, this, true); .checkForCaptivePortal(mCaptivePortalUrl, this, true);
} }
@Override
protected int getSubactivityNextTransition() {
return TRANSITION_ID_FADE;
}
private static class CheckForCaptivePortalTask extends AsyncTask<Void, Void, Boolean> { private static class CheckForCaptivePortalTask extends AsyncTask<Void, Void, Boolean> {
private final URL captivePortalUrl; private final URL captivePortalUrl;

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2018,2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -229,11 +229,6 @@ public class ChooseDataSimActivity extends BaseSetupWizardActivity {
} }
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
private void checkForRadioReady() { private void checkForRadioReady() {
if (mRadioReady) { if (mRadioReady) {
mHandler.removeCallbacks(mRadioReadyRunnable); mHandler.removeCallbacks(mRadioReadyRunnable);

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2018,2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -159,11 +159,6 @@ public class DateTimeActivity extends BaseSetupWizardActivity implements
unregisterReceiver(mIntentReceiver); unregisterReceiver(mIntentReceiver);
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
@Override @Override
protected int getLayoutResId() { protected int getLayoutResId() {
return R.layout.setup_datetime_page; return R.layout.setup_datetime_page;

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2018,2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -70,10 +70,4 @@ public class FingerprintActivity extends SubBaseActivity {
getString(R.string.settings_fingerprint_setup_details)); getString(R.string.settings_fingerprint_setup_details));
startSubactivity(intent, REQUEST_CODE_SETUP_FINGERPRINT); startSubactivity(intent, REQUEST_CODE_SETUP_FINGERPRINT);
} }
@Override
protected int getSubactivityNextTransition() {
return TRANSITION_ID_SLIDE;
}
} }

View File

@@ -72,11 +72,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
setNextText(R.string.start); setNextText(R.string.start);
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
@Override @Override
protected int getLayoutResId() { protected int getLayoutResId() {
return R.layout.finish_activity; return R.layout.finish_activity;
@@ -85,7 +80,9 @@ public class FinishActivity extends BaseSetupWizardActivity {
@Override @Override
public void finish() { public void finish() {
super.finish(); super.finish();
overridePendingTransition(R.anim.translucent_enter, R.anim.translucent_exit); if (!isResumed() || mResultCode != RESULT_CANCELED) {
overridePendingTransition(R.anim.translucent_enter, R.anim.translucent_exit);
}
} }
@Override @Override

View File

@@ -139,11 +139,6 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
nextAction(NEXT_REQUEST, intent); nextAction(NEXT_REQUEST, intent);
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
@Override @Override
protected int getLayoutResId() { protected int getLayoutResId() {
return R.layout.setup_lineage_settings; return R.layout.setup_lineage_settings;

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2018,2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -105,11 +105,6 @@ public class LocaleActivity extends BaseSetupWizardActivity {
} }
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
@Override @Override
protected int getLayoutResId() { protected int getLayoutResId() {
return R.layout.setup_locale; return R.layout.setup_locale;

View File

@@ -59,11 +59,6 @@ public class LocationSettingsActivity extends BaseSetupWizardActivity {
mLocationAccess.setChecked(mLocationManager.isLocationEnabled()); mLocationAccess.setChecked(mLocationManager.isLocationEnabled());
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
@Override @Override
protected int getLayoutResId() { protected int getLayoutResId() {
return R.layout.location_settings; return R.layout.location_settings;

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2018,2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -179,11 +179,6 @@ public class MobileDataActivity extends BaseSetupWizardActivity {
mPhoneMonitor.removeListener(mSubscriptionStateListener); mPhoneMonitor.removeListener(mSubscriptionStateListener);
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
private void hideWaitForRadio() { private void hideWaitForRadio() {
if (mProgressBar.isShown()) { if (mProgressBar.isShown()) {
mHandler.removeCallbacks(mRadioReadyRunnable); mHandler.removeCallbacks(mRadioReadyRunnable);

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -51,11 +51,6 @@ public class ScreenLockActivity extends SubBaseActivity {
}); });
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
@Override @Override
protected int getLayoutResId() { protected int getLayoutResId() {
return R.layout.setup_lockscreen; return R.layout.setup_lockscreen;
@@ -81,11 +76,6 @@ public class ScreenLockActivity extends SubBaseActivity {
startSubactivity(intent, REQUEST_CODE_SETUP_LOCKSCREEN); startSubactivity(intent, REQUEST_CODE_SETUP_LOCKSCREEN);
} }
@Override
protected int getSubactivityNextTransition() {
return TRANSITION_ID_SLIDE;
}
private boolean isKeyguardSecure() { private boolean isKeyguardSecure() {
return getSystemService(KeyguardManager.class).isKeyguardSecure(); return getSystemService(KeyguardManager.class).isKeyguardSecure();
} }

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -67,11 +67,6 @@ public class SimMissingActivity extends BaseSetupWizardActivity {
} }
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
@Override @Override
protected int getLayoutResId() { protected int getLayoutResId() {
return R.layout.sim_missing_page; return R.layout.sim_missing_page;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -148,16 +148,11 @@ public abstract class SubBaseActivity extends BaseSetupWizardActivity {
} }
protected int getSubactivityPreviousTransition() { protected int getSubactivityPreviousTransition() {
return TRANSITION_ID_DEFAULT; return TRANSITION_ID_SLIDE;
} }
protected int getSubactivityNextTransition() { protected int getSubactivityNextTransition() {
return TRANSITION_ID_DEFAULT; return TRANSITION_ID_SLIDE;
}
@Override
protected int getTransition() {
return TRANSITION_ID_FADE;
} }
@Override @Override

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2018,2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -52,11 +52,6 @@ public class WelcomeActivity extends BaseSetupWizardActivity {
startEmergencyDialer(); startEmergencyDialer();
} }
@Override
protected int getTransition() {
return TRANSITION_ID_SLIDE;
}
@Override @Override
protected int getLayoutResId() { protected int getLayoutResId() {
return R.layout.welcome_activity; return R.layout.welcome_activity;

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 The CyanogenMod Project * Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project * Copyright (C) 2017-2018,2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -40,10 +40,4 @@ public class WifiSetupActivity extends SubBaseActivity {
intent.putExtra(SetupWizardApp.EXTRA_PREFS_SET_BACK_TEXT, (String) null); intent.putExtra(SetupWizardApp.EXTRA_PREFS_SET_BACK_TEXT, (String) null);
startSubactivity(intent, REQUEST_CODE_SETUP_WIFI); startSubactivity(intent, REQUEST_CODE_SETUP_WIFI);
} }
@Override
protected int getSubactivityNextTransition() {
return TRANSITION_ID_SLIDE;
}
} }

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (C) 2019-2020 The Calyx Institute * Copyright (C) 2019-2020 The Calyx Institute
* Copyright (C) 2020 The LineageOS Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -47,11 +48,6 @@ public class RestoreIntroActivity extends SubBaseActivity {
return R.drawable.ic_restore; return R.drawable.ic_restore;
} }
@Override
protected int getSubactivityNextTransition() {
return TRANSITION_ID_SLIDE;
}
private void launchRestore() { private void launchRestore() {
Intent intent = new Intent(ACTION_RESTORE_FROM_BACKUP); Intent intent = new Intent(ACTION_RESTORE_FROM_BACKUP);
startSubactivity(intent, REQUEST_CODE_RESTORE); startSubactivity(intent, REQUEST_CODE_RESTORE);