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

Commit d4378f7a authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Android (Google) Code Review
Browse files

Merge "Fixes race condition in animation on Ringer Status."

parents 66b0919d 3f78933e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|bottom"
        android:gravity="center_vertical"
        android:visibility="invisible">
        android:alpha="0">

        <ImageView
            android:id="@+id/next_alarm_icon"
+6 −21
Original line number Diff line number Diff line
@@ -547,39 +547,24 @@ public class QuickStatusBarHeader extends RelativeLayout implements

    /**
     * Fades in the updated status text. Note that if there's already a status showing, this will
     * immediately hide it and fade in the updated status.
     * immediately fade it out and fade in the updated status.
     */
    private void showStatus() {
        mStatusContainer.setAlpha(0f);
        mStatusContainer.setVisibility(View.VISIBLE);

        // Animate the alarm back in. Make sure to clear the animator listener for the animation!
        mStatusContainer.animate()
                .alpha(1f)
                .setDuration(FADE_ANIMATION_DURATION_MS)
                .setListener(null)
                .start();
    }

    /** Fades out and hides the status text. */
    /** Fades out the status text. */
    private void hideStatusText() {
        if (mStatusContainer.getVisibility() == View.VISIBLE) {
        mStatusContainer.animate()
                .alpha(0f)
                    .setListener(new AnimatorListenerAdapter() {
                        @Override
                        public void onAnimationEnd(Animator animation) {
                            if (DEBUG) Log.d(TAG, "hideAlarmText: Hid alarm text");

                            // Reset the alpha regardless of how the animation ends for the next
                            // time we show this view/want to animate it.
                            mStatusContainer.setVisibility(View.INVISIBLE);
                            mStatusContainer.setAlpha(1f);
                        }
                    })
                .setDuration(FADE_ANIMATION_DURATION_MS)
                .start();
    }
    }

    public void updateEverything() {
        post(() -> setClickable(false));