Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8345749 authored by Sean Pont's avatar Sean Pont Committed by Android (Google) Code Review
Browse files

Merge "Add animation for wallet resizing" into rvc-dev

parents 54c5cc1e fd537a58
Loading
Loading
Loading
Loading
+19 −1
Original line number Original line Diff line number Diff line
@@ -69,6 +69,9 @@ import android.telecom.TelecomManager;
import android.telephony.PhoneStateListener;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager;
import android.transition.AutoTransition;
import android.transition.TransitionManager;
import android.transition.TransitionSet;
import android.util.ArraySet;
import android.util.ArraySet;
import android.util.FeatureFlagUtils;
import android.util.FeatureFlagUtils;
import android.util.Log;
import android.util.Log;
@@ -2026,7 +2029,22 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
                        new FrameLayout.LayoutParams(
                        new FrameLayout.LayoutParams(
                                FrameLayout.LayoutParams.MATCH_PARENT,
                                FrameLayout.LayoutParams.MATCH_PARENT,
                                FrameLayout.LayoutParams.MATCH_PARENT);
                                FrameLayout.LayoutParams.MATCH_PARENT);
                panelContainer.addView(mPanelController.getPanelContent(), panelParams);
                View walletView = mPanelController.getPanelContent();
                panelContainer.addView(walletView, panelParams);
                // Smooth transitions when wallet is resized, which can happen when a card is added
                ViewGroup root = findViewById(com.android.systemui.R.id.global_actions_grid_root);
                if (root != null) {
                    walletView.addOnLayoutChangeListener((v, l, t, r, b, ol, ot, or, ob) -> {
                        int oldHeight = ob - ot;
                        int newHeight = b - t;
                        if (oldHeight > 0 && oldHeight != newHeight) {
                            TransitionSet transition = new AutoTransition()
                                    .setDuration(250)
                                    .setOrdering(TransitionSet.ORDERING_TOGETHER);
                            TransitionManager.beginDelayedTransition(root, transition);
                        }
                    });
                }
            }
            }
        }
        }