Loading packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java +9 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.support.annotation.VisibleForTesting; import android.text.TextUtils; import android.text.format.DateUtils; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.widget.RelativeLayout; import android.widget.TextView; Loading Loading @@ -61,6 +62,8 @@ import java.util.Locale; */ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue.Callbacks, View.OnClickListener, NextAlarmController.NextAlarmChangeCallback { private static final String TAG = "QuickStatusBarHeader"; private static final boolean DEBUG = false; /** Delay for auto fading out the long press tooltip after it's fully visible (in ms). */ private static final long AUTO_FADE_OUT_DELAY_MS = DateUtils.SECOND_IN_MILLIS * 6; Loading Loading @@ -293,6 +296,7 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue @Override public void onNextAlarmChanged(AlarmManager.AlarmClockInfo nextAlarm) { mNextAlarmText = nextAlarm != null ? formatNextAlarm(nextAlarm) : null; if (mNextAlarmText != null) { hideLongPressTooltip(true /* shouldFadeInAlarmText */); } else { Loading Loading @@ -352,6 +356,7 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue .setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { if (DEBUG) Log.d(TAG, "hideLongPressTooltip: Hid long press tip"); mLongPressTooltipView.setVisibility(View.INVISIBLE); if (shouldShowAlarmText) { Loading @@ -362,7 +367,6 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue .start(); } else { mLongPressTooltipView.setVisibility(View.INVISIBLE); if (shouldShowAlarmText) { showAlarmText(); } Loading @@ -378,9 +382,11 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue mNextAlarmView.setVisibility(View.VISIBLE); mNextAlarmTextView.setText(mNextAlarmText); // Animate the alarm back in. Make sure to clear the animator listener for the animation! mNextAlarmView.animate() .alpha(1f) .setDuration(FADE_ANIMATION_DURATION_MS) .setListener(null) .start(); } Loading @@ -395,6 +401,8 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue .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. mNextAlarmView.setVisibility(View.INVISIBLE); Loading Loading
packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java +9 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.support.annotation.VisibleForTesting; import android.text.TextUtils; import android.text.format.DateUtils; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.widget.RelativeLayout; import android.widget.TextView; Loading Loading @@ -61,6 +62,8 @@ import java.util.Locale; */ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue.Callbacks, View.OnClickListener, NextAlarmController.NextAlarmChangeCallback { private static final String TAG = "QuickStatusBarHeader"; private static final boolean DEBUG = false; /** Delay for auto fading out the long press tooltip after it's fully visible (in ms). */ private static final long AUTO_FADE_OUT_DELAY_MS = DateUtils.SECOND_IN_MILLIS * 6; Loading Loading @@ -293,6 +296,7 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue @Override public void onNextAlarmChanged(AlarmManager.AlarmClockInfo nextAlarm) { mNextAlarmText = nextAlarm != null ? formatNextAlarm(nextAlarm) : null; if (mNextAlarmText != null) { hideLongPressTooltip(true /* shouldFadeInAlarmText */); } else { Loading Loading @@ -352,6 +356,7 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue .setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { if (DEBUG) Log.d(TAG, "hideLongPressTooltip: Hid long press tip"); mLongPressTooltipView.setVisibility(View.INVISIBLE); if (shouldShowAlarmText) { Loading @@ -362,7 +367,6 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue .start(); } else { mLongPressTooltipView.setVisibility(View.INVISIBLE); if (shouldShowAlarmText) { showAlarmText(); } Loading @@ -378,9 +382,11 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue mNextAlarmView.setVisibility(View.VISIBLE); mNextAlarmTextView.setText(mNextAlarmText); // Animate the alarm back in. Make sure to clear the animator listener for the animation! mNextAlarmView.animate() .alpha(1f) .setDuration(FADE_ANIMATION_DURATION_MS) .setListener(null) .start(); } Loading @@ -395,6 +401,8 @@ public class QuickStatusBarHeader extends RelativeLayout implements CommandQueue .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. mNextAlarmView.setVisibility(View.INVISIBLE); Loading