Merge "Improve global actions dialog animation" into rvc-dev am: 0e1d99ca0f am: 6a9ce0ed22
Change-Id: I6f5b7fc343e050e7e78bac9c4911c880a4f6c137
This commit is contained in:
@@ -129,7 +129,6 @@ import com.android.systemui.statusbar.policy.KeyguardStateController;
|
|||||||
import com.android.systemui.util.EmergencyDialerConstants;
|
import com.android.systemui.util.EmergencyDialerConstants;
|
||||||
import com.android.systemui.util.RingerModeTracker;
|
import com.android.systemui.util.RingerModeTracker;
|
||||||
import com.android.systemui.util.leak.RotationUtils;
|
import com.android.systemui.util.leak.RotationUtils;
|
||||||
import com.android.systemui.volume.SystemUIInterpolators.LogAccelerateInterpolator;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -1899,6 +1898,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
|||||||
|
|
||||||
private ControlsUiController mControlsUiController;
|
private ControlsUiController mControlsUiController;
|
||||||
private ViewGroup mControlsView;
|
private ViewGroup mControlsView;
|
||||||
|
private ViewGroup mContainer;
|
||||||
|
|
||||||
ActionsDialog(Context context, MyAdapter adapter, MyOverflowAdapter overflowAdapter,
|
ActionsDialog(Context context, MyAdapter adapter, MyOverflowAdapter overflowAdapter,
|
||||||
GlobalActionsPanelPlugin.PanelViewController plugin,
|
GlobalActionsPanelPlugin.PanelViewController plugin,
|
||||||
@@ -2051,6 +2051,11 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
|||||||
});
|
});
|
||||||
mGlobalActionsLayout.setRotationListener(this::onRotate);
|
mGlobalActionsLayout.setRotationListener(this::onRotate);
|
||||||
mGlobalActionsLayout.setAdapter(mAdapter);
|
mGlobalActionsLayout.setAdapter(mAdapter);
|
||||||
|
mContainer = findViewById(com.android.systemui.R.id.global_actions_container);
|
||||||
|
// Some legacy dialog layouts don't have the outer container
|
||||||
|
if (mContainer == null) {
|
||||||
|
mContainer = mGlobalActionsLayout;
|
||||||
|
}
|
||||||
|
|
||||||
mOverflowPopup = createPowerOverflowPopup();
|
mOverflowPopup = createPowerOverflowPopup();
|
||||||
|
|
||||||
@@ -2177,10 +2182,10 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
|||||||
mHadTopUi = mNotificationShadeWindowController.getForceHasTopUi();
|
mHadTopUi = mNotificationShadeWindowController.getForceHasTopUi();
|
||||||
mNotificationShadeWindowController.setForceHasTopUi(true);
|
mNotificationShadeWindowController.setForceHasTopUi(true);
|
||||||
mBackgroundDrawable.setAlpha(0);
|
mBackgroundDrawable.setAlpha(0);
|
||||||
mGlobalActionsLayout.setTranslationX(mGlobalActionsLayout.getAnimationOffsetX());
|
mContainer.setTranslationX(mGlobalActionsLayout.getAnimationOffsetX());
|
||||||
mGlobalActionsLayout.setTranslationY(mGlobalActionsLayout.getAnimationOffsetY());
|
mContainer.setTranslationY(mGlobalActionsLayout.getAnimationOffsetY());
|
||||||
mGlobalActionsLayout.setAlpha(0);
|
mContainer.setAlpha(0);
|
||||||
mGlobalActionsLayout.animate()
|
mContainer.animate()
|
||||||
.alpha(1)
|
.alpha(1)
|
||||||
.translationX(0)
|
.translationX(0)
|
||||||
.translationY(0)
|
.translationY(0)
|
||||||
@@ -2212,16 +2217,16 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
|||||||
@Override
|
@Override
|
||||||
public void dismiss() {
|
public void dismiss() {
|
||||||
dismissWithAnimation(() -> {
|
dismissWithAnimation(() -> {
|
||||||
mGlobalActionsLayout.setTranslationX(0);
|
mContainer.setTranslationX(0);
|
||||||
mGlobalActionsLayout.setTranslationY(0);
|
mContainer.setTranslationY(0);
|
||||||
mGlobalActionsLayout.setAlpha(1);
|
mContainer.setAlpha(1);
|
||||||
mGlobalActionsLayout.animate()
|
mContainer.animate()
|
||||||
.alpha(0)
|
.alpha(0)
|
||||||
.translationX(mGlobalActionsLayout.getAnimationOffsetX())
|
.translationX(mGlobalActionsLayout.getAnimationOffsetX())
|
||||||
.translationY(mGlobalActionsLayout.getAnimationOffsetY())
|
.translationY(mGlobalActionsLayout.getAnimationOffsetY())
|
||||||
.setDuration(550)
|
.setDuration(450)
|
||||||
.withEndAction(this::completeDismiss)
|
.withEndAction(this::completeDismiss)
|
||||||
.setInterpolator(new LogAccelerateInterpolator())
|
.setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
|
||||||
.setUpdateListener(animation -> {
|
.setUpdateListener(animation -> {
|
||||||
float animatedValue = 1f - animation.getAnimatedFraction();
|
float animatedValue = 1f - animation.getAnimatedFraction();
|
||||||
int alpha = (int) (animatedValue * mScrimAlpha * 255);
|
int alpha = (int) (animatedValue * mScrimAlpha * 255);
|
||||||
|
|||||||
Reference in New Issue
Block a user