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

Commit 345cb6fe authored by Selim Cinek's avatar Selim Cinek
Browse files

Made usages of animate().setListener() call safer

Because those listeners persist, they could have negative
consequences for future animate() calls.

Fixes: 204559512
Test: manual
Change-Id: Ib07bf42c077e7c094d060bc9be9b790ddefacdc9
parent f9c7a7de
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2368,7 +2368,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                            message.animate()
                                    .alpha(0f)
                                    .setDuration(TOAST_FADE_TIME)
                                    .setStartDelay(visibleTime);
                                    .setStartDelay(visibleTime)
                                    .setListener(null);
                        }
                    });
        }
+9 −0
Original line number Diff line number Diff line
@@ -289,6 +289,9 @@ public abstract class MediaOutputBaseAdapter extends
                        public void onAnimationEnd(Animator animation) {
                            to.requireViewById(R.id.volume_indeterminate_progress).setVisibility(
                                    View.VISIBLE);
                            // Unset the listener, otherwise this may persist for another view
                            // property animation
                            toTitleText.animate().setListener(null);
                        }
                    });
            // Animation for seek bar
@@ -312,8 +315,14 @@ public abstract class MediaOutputBaseAdapter extends
                                        public void onAnimationEnd(Animator animation) {
                                            mIsAnimating = false;
                                            notifyDataSetChanged();
                                            // Unset the listener, otherwise this may persist for
                                            // another view property animation
                                            fromTitleText.animate().setListener(null);
                                        }
                                    });
                            // Unset the listener, otherwise this may persist for another view
                            // property animation
                            fromSeekBar.animate().setListener(null);
                        }
                    });
        }
+2 −0
Original line number Diff line number Diff line
@@ -745,6 +745,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
        public void onAnimationEnd(Animator animation) {
            mHeaderAnimating = false;
            updateQsState();
            // Unset the listener, otherwise this may persist for another view property animation
            getView().animate().setListener(null);
        }
    };

+3 −0
Original line number Diff line number Diff line
@@ -716,6 +716,9 @@ public class KeyguardIndicationController {
                                        textView.setTranslationY(BOUNCE_ANIMATION_FINAL_Y);
                                        ViewClippingUtil.setClippingDeactivated(textView, false,
                                                mClippingParams);
                                        // Unset the listener, otherwise this may persist for
                                        // another view property animation
                                        textView.animate().setListener(null);
                                    }
                                });
                    }
+3 −0
Original line number Diff line number Diff line
@@ -124,6 +124,9 @@ public class LightsOutNotifController {
                        public void onAnimationEnd(Animator a) {
                            mLightsOutNotifView.setAlpha(showDot ? 1 : 0);
                            mLightsOutNotifView.setVisibility(showDot ? View.VISIBLE : View.GONE);
                            // Unset the listener, otherwise this may persist for
                            // another view property animation
                            mLightsOutNotifView.animate().setListener(null);
                        }
                    })
                    .start();
Loading