FinishActivity: prevent jumping layout when finishing
When setting up the finishing sequence, the navigation bar gets hidden, resulting in the layout adjusting and moving. Once the start button is pressed, pressing back on the navigation bar is ignored. Change-Id: Ibb961ab059c2b8be38e88db691d4293e180f3b1c Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
This commit is contained in:
committed by
Jan Altensen (Stricted)
parent
78b01d53c8
commit
f85129e80b
@@ -259,9 +259,7 @@ public abstract class BaseSetupWizardActivity extends Activity implements Naviga
|
|||||||
|
|
||||||
protected void hideNextButton() {
|
protected void hideNextButton() {
|
||||||
if (mNavigationBar != null) {
|
if (mNavigationBar != null) {
|
||||||
Animation fadeOut = AnimationUtils.loadAnimation(this, android.R.anim.fade_out);
|
|
||||||
final Button next = mNavigationBar.getNextButton();
|
final Button next = mNavigationBar.getNextButton();
|
||||||
next.startAnimation(fadeOut);
|
|
||||||
next.setVisibility(INVISIBLE);
|
next.setVisibility(INVISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -32,6 +32,7 @@ import static org.lineageos.setupwizard.SetupWizardApp.NAVIGATION_OPTION_KEY;
|
|||||||
import static org.lineageos.setupwizard.SetupWizardApp.UPDATE_RECOVERY_PROP;
|
import static org.lineageos.setupwizard.SetupWizardApp.UPDATE_RECOVERY_PROP;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.WallpaperManager;
|
import android.app.WallpaperManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -51,7 +52,6 @@ import android.view.View;
|
|||||||
import android.view.ViewAnimationUtils;
|
import android.view.ViewAnimationUtils;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import com.google.android.setupcompat.util.SystemBarHelper;
|
|
||||||
import com.google.android.setupcompat.util.WizardManagerHelper;
|
import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||||
|
|
||||||
import org.lineageos.setupwizard.util.SetupWizardUtils;
|
import org.lineageos.setupwizard.util.SetupWizardUtils;
|
||||||
@@ -81,6 +81,13 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
|||||||
setNextText(R.string.start);
|
setNextText(R.string.start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (!mIsFinishing) {
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutResId() {
|
protected int getLayoutResId() {
|
||||||
return R.layout.finish_activity;
|
return R.layout.finish_activity;
|
||||||
@@ -113,7 +120,7 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
|||||||
sendBroadcastAsUser(i, getCallingUserHandle(), FINISH_SETUP);
|
sendBroadcastAsUser(i, getCallingUserHandle(), FINISH_SETUP);
|
||||||
|
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
||||||
SystemBarHelper.hideSystemBars(getWindow());
|
hideNextButton();
|
||||||
finishSetup();
|
finishSetup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +154,7 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
|||||||
Animator anim =
|
Animator anim =
|
||||||
ViewAnimationUtils.createCircularReveal(mReveal, cx, cy, 0, finalRadius);
|
ViewAnimationUtils.createCircularReveal(mReveal, cx, cy, 0, finalRadius);
|
||||||
anim.setDuration(900);
|
anim.setDuration(900);
|
||||||
anim.addListener(new Animator.AnimatorListener() {
|
anim.addListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animator animation) {
|
public void onAnimationStart(Animator animation) {
|
||||||
mReveal.setVisibility(View.VISIBLE);
|
mReveal.setVisibility(View.VISIBLE);
|
||||||
@@ -162,14 +169,6 @@ public class FinishActivity extends BaseSetupWizardActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationCancel(Animator animation) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationRepeat(Animator animation) {
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
anim.start();
|
anim.start();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user