mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Fade back button in and out tied with the overview/shelf (2/3)
Back button changes opacity when moving the shelf during swipe up between home screen and overview. The alpha changes depending on the progress of the swipe up animation. When going from app to home and vice versa, the fade animation does not tie with the swipe up progress. The fade animation also masks the back button drawable when ime visibility changes. Change-Id: I51e42930640ba711e81880b385bb722d7ee8ad33 Fixes: 74581837 Fixes: 76900236 Test: swipe up from home screen to overview
This commit is contained in:
@@ -25,9 +25,11 @@ import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.LauncherStateManager.AnimationConfig;
|
||||
import com.android.launcher3.LauncherStateManager.StateHandler;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.AnimationSuccessListener;
|
||||
import com.android.launcher3.anim.AnimatorSetBuilder;
|
||||
import com.android.launcher3.anim.PropertySetter;
|
||||
import com.android.launcher3.uioverrides.UiFactory;
|
||||
import com.android.launcher3.util.Themes;
|
||||
import com.android.launcher3.views.ScrimView;
|
||||
|
||||
@@ -182,6 +184,13 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
|
||||
anim.setDuration(config.duration);
|
||||
anim.setInterpolator(builder.getInterpolator(ANIM_VERTICAL_PROGRESS, interpolator));
|
||||
anim.addListener(getProgressAnimatorListener());
|
||||
if (toState.hideBackButton) {
|
||||
anim.addUpdateListener(animation -> {
|
||||
final float alpha = (float) animation.getAnimatedValue();
|
||||
UiFactory.setBackButtonAlpha(mLauncher, 1 - Utilities.boundToRange(alpha, 0, 1),
|
||||
false /* animate */);
|
||||
});
|
||||
}
|
||||
|
||||
builder.play(anim);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user