* commit 'bbedfa0036f8de393c05b2ad981695ae74e7ab42': Tale of status bar on crespo, part 3 Bug #6541079
This commit is contained in:
@@ -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"
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
@@ -816,16 +817,31 @@ 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);
|
||||
|
||||
|
||||
final View nlo = mStatusBarView.findViewById(R.id.notification_lights_out);
|
||||
final boolean showDot = (any&&!areLightsOn());
|
||||
if (showDot != (nlo.getAlpha() == 1.0f)) {
|
||||
|
||||
Reference in New Issue
Block a user