Loading packages/SystemUI/res/layout/status_bar_notification_row.xml +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ <View android:id="@+id/top_glow" android:alpha="0" android:visibility="invisible" android:layout_width="match_parent" android:layout_height="@dimen/notification_divider_height" android:layout_gravity="top|center_horizontal" Loading Loading @@ -41,6 +42,7 @@ <View android:id="@+id/bottom_glow" android:alpha="0" android:visibility="invisible" android:layout_width="match_parent" android:layout_height="@dimen/notification_divider_height" android:layout_gravity="bottom|center_horizontal" Loading packages/SystemUI/src/com/android/systemui/ExpandHelper.java +31 −2 Original line number Diff line number Diff line Loading @@ -17,17 +17,17 @@ package com.android.systemui; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.RectF; import android.util.Log; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import com.android.internal.widget.SizeAdaptiveLayout; public class ExpandHelper implements Gefingerpoken, OnClickListener { public interface Callback { Loading Loading @@ -130,8 +130,28 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { mScaleAnimation = ObjectAnimator.ofFloat(mScaler, "height", 0f); mScaleAnimation.setDuration(EXPAND_DURATION); AnimatorListenerAdapter glowVisibilityController = new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { View target = (View) ((ObjectAnimator) animation).getTarget(); if (target.getAlpha() <= 0.0f) { target.setVisibility(View.VISIBLE); } } @Override public void onAnimationEnd(Animator animation) { View target = (View) ((ObjectAnimator) animation).getTarget(); if (target.getAlpha() <= 0.0f) { target.setVisibility(View.INVISIBLE); } } }; mGlowTopAnimation = ObjectAnimator.ofFloat(null, "alpha", 0f); mGlowTopAnimation.addListener(glowVisibilityController); mGlowBottomAnimation = ObjectAnimator.ofFloat(null, "alpha", 0f); mGlowBottomAnimation.addListener(glowVisibilityController); mGlowAnimationSet = new AnimatorSet(); mGlowAnimationSet.play(mGlowTopAnimation).with(mGlowBottomAnimation); mGlowAnimationSet.setDuration(GLOW_DURATION); Loading Loading @@ -225,10 +245,19 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { // set it explicitly in reponse to touches. mCurrViewTopGlow.setAlpha(glow); mCurrViewBottomGlow.setAlpha(glow); handleGlowVisibility(); } } } } private void handleGlowVisibility() { mCurrViewTopGlow.setVisibility(mCurrViewTopGlow.getAlpha() <= 0.0f ? View.INVISIBLE : View.VISIBLE); mCurrViewBottomGlow.setVisibility(mCurrViewBottomGlow.getAlpha() <= 0.0f ? View.INVISIBLE : View.VISIBLE); } public boolean onInterceptTouchEvent(MotionEvent ev) { if (DEBUG) Log.d(TAG, "interceptTouch: act=" + (ev.getAction()) + " stretching=" + mStretching); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +21 −5 Original line number Diff line number Diff line Loading @@ -360,6 +360,7 @@ public class PhoneStatusBar extends BaseStatusBar { mClearButton = mStatusBarWindow.findViewById(R.id.clear_all_button); mClearButton.setOnClickListener(mClearButtonListener); mClearButton.setAlpha(0f); mClearButton.setVisibility(View.INVISIBLE); mClearButton.setEnabled(false); mDateView = (DateView)mStatusBarWindow.findViewById(R.id.date); mSettingsButton = mStatusBarWindow.findViewById(R.id.settings_button); Loading Loading @@ -816,13 +817,28 @@ public class PhoneStatusBar extends BaseStatusBar { if (mClearButton.isShown()) { if (clearable != (mClearButton.getAlpha() == 1.0f)) { ObjectAnimator.ofFloat(mClearButton, "alpha", clearable ? 1.0f : 0.0f) .setDuration(250) .start(); ObjectAnimator clearAnimation = ObjectAnimator.ofFloat( mClearButton, "alpha", clearable ? 1.0f : 0.0f).setDuration(250); clearAnimation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { if (mClearButton.getAlpha() <= 0.0f) { mClearButton.setVisibility(View.INVISIBLE); } } @Override public void onAnimationStart(Animator animation) { if (mClearButton.getAlpha() <= 0.0f) { mClearButton.setVisibility(View.VISIBLE); } } }); clearAnimation.start(); } } else { mClearButton.setAlpha(clearable ? 1.0f : 0.0f); mClearButton.setVisibility(clearable ? View.VISIBLE : View.INVISIBLE); } mClearButton.setEnabled(clearable); Loading Loading
packages/SystemUI/res/layout/status_bar_notification_row.xml +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ <View android:id="@+id/top_glow" android:alpha="0" android:visibility="invisible" android:layout_width="match_parent" android:layout_height="@dimen/notification_divider_height" android:layout_gravity="top|center_horizontal" Loading Loading @@ -41,6 +42,7 @@ <View android:id="@+id/bottom_glow" android:alpha="0" android:visibility="invisible" android:layout_width="match_parent" android:layout_height="@dimen/notification_divider_height" android:layout_gravity="bottom|center_horizontal" Loading
packages/SystemUI/src/com/android/systemui/ExpandHelper.java +31 −2 Original line number Diff line number Diff line Loading @@ -17,17 +17,17 @@ package com.android.systemui; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.RectF; import android.util.Log; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import com.android.internal.widget.SizeAdaptiveLayout; public class ExpandHelper implements Gefingerpoken, OnClickListener { public interface Callback { Loading Loading @@ -130,8 +130,28 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { mScaleAnimation = ObjectAnimator.ofFloat(mScaler, "height", 0f); mScaleAnimation.setDuration(EXPAND_DURATION); AnimatorListenerAdapter glowVisibilityController = new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { View target = (View) ((ObjectAnimator) animation).getTarget(); if (target.getAlpha() <= 0.0f) { target.setVisibility(View.VISIBLE); } } @Override public void onAnimationEnd(Animator animation) { View target = (View) ((ObjectAnimator) animation).getTarget(); if (target.getAlpha() <= 0.0f) { target.setVisibility(View.INVISIBLE); } } }; mGlowTopAnimation = ObjectAnimator.ofFloat(null, "alpha", 0f); mGlowTopAnimation.addListener(glowVisibilityController); mGlowBottomAnimation = ObjectAnimator.ofFloat(null, "alpha", 0f); mGlowBottomAnimation.addListener(glowVisibilityController); mGlowAnimationSet = new AnimatorSet(); mGlowAnimationSet.play(mGlowTopAnimation).with(mGlowBottomAnimation); mGlowAnimationSet.setDuration(GLOW_DURATION); Loading Loading @@ -225,10 +245,19 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { // set it explicitly in reponse to touches. mCurrViewTopGlow.setAlpha(glow); mCurrViewBottomGlow.setAlpha(glow); handleGlowVisibility(); } } } } private void handleGlowVisibility() { mCurrViewTopGlow.setVisibility(mCurrViewTopGlow.getAlpha() <= 0.0f ? View.INVISIBLE : View.VISIBLE); mCurrViewBottomGlow.setVisibility(mCurrViewBottomGlow.getAlpha() <= 0.0f ? View.INVISIBLE : View.VISIBLE); } public boolean onInterceptTouchEvent(MotionEvent ev) { if (DEBUG) Log.d(TAG, "interceptTouch: act=" + (ev.getAction()) + " stretching=" + mStretching); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +21 −5 Original line number Diff line number Diff line Loading @@ -360,6 +360,7 @@ public class PhoneStatusBar extends BaseStatusBar { mClearButton = mStatusBarWindow.findViewById(R.id.clear_all_button); mClearButton.setOnClickListener(mClearButtonListener); mClearButton.setAlpha(0f); mClearButton.setVisibility(View.INVISIBLE); mClearButton.setEnabled(false); mDateView = (DateView)mStatusBarWindow.findViewById(R.id.date); mSettingsButton = mStatusBarWindow.findViewById(R.id.settings_button); Loading Loading @@ -816,13 +817,28 @@ public class PhoneStatusBar extends BaseStatusBar { if (mClearButton.isShown()) { if (clearable != (mClearButton.getAlpha() == 1.0f)) { ObjectAnimator.ofFloat(mClearButton, "alpha", clearable ? 1.0f : 0.0f) .setDuration(250) .start(); ObjectAnimator clearAnimation = ObjectAnimator.ofFloat( mClearButton, "alpha", clearable ? 1.0f : 0.0f).setDuration(250); clearAnimation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { if (mClearButton.getAlpha() <= 0.0f) { mClearButton.setVisibility(View.INVISIBLE); } } @Override public void onAnimationStart(Animator animation) { if (mClearButton.getAlpha() <= 0.0f) { mClearButton.setVisibility(View.VISIBLE); } } }); clearAnimation.start(); } } else { mClearButton.setAlpha(clearable ? 1.0f : 0.0f); mClearButton.setVisibility(clearable ? View.VISIBLE : View.INVISIBLE); } mClearButton.setEnabled(clearable); Loading