am 0c58bd97: Merge "Restore alpha animation to status bar rhs icons." into klp-dev
* commit '0c58bd97384498be14aa9795be9188ca93110e00': Restore alpha animation to status bar rhs icons.
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
|
import android.animation.AnimatorSet;
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -28,7 +29,6 @@ import android.view.MotionEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.accessibility.AccessibilityEvent;
|
import android.view.accessibility.AccessibilityEvent;
|
||||||
|
|
||||||
import com.android.systemui.BatteryMeterView;
|
|
||||||
import com.android.systemui.EventLogTags;
|
import com.android.systemui.EventLogTags;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
|
||||||
@@ -53,9 +53,7 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
private final int mTransparent;
|
private final int mTransparent;
|
||||||
private final float mAlphaWhenOpaque;
|
private final float mAlphaWhenOpaque;
|
||||||
private final float mAlphaWhenTransparent = 1;
|
private final float mAlphaWhenTransparent = 1;
|
||||||
private View mLeftSide;
|
private View mLeftSide, mStatusIcons, mSignalCluster, mClock;
|
||||||
private View mRightSide;
|
|
||||||
private BatteryMeterView mBattery;
|
|
||||||
|
|
||||||
public StatusBarTransitions(Context context) {
|
public StatusBarTransitions(Context context) {
|
||||||
super(context, PhoneStatusBarView.this);
|
super(context, PhoneStatusBarView.this);
|
||||||
@@ -66,8 +64,9 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
mLeftSide = findViewById(R.id.notification_icon_area);
|
mLeftSide = findViewById(R.id.notification_icon_area);
|
||||||
mRightSide = findViewById(R.id.system_icon_area);
|
mStatusIcons = findViewById(R.id.statusIcons);
|
||||||
mBattery = (BatteryMeterView) findViewById(R.id.battery);
|
mSignalCluster = findViewById(R.id.signal_battery_cluster);
|
||||||
|
mClock = findViewById(R.id.clock);
|
||||||
applyMode(getMode(), false /*animate*/);
|
applyMode(getMode(), false /*animate*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,16 +95,22 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void applyMode(int mode, boolean animate) {
|
private void applyMode(int mode, boolean animate) {
|
||||||
if (mLeftSide == null || mRightSide == null) return;
|
if (mLeftSide == null) return; // pre-init
|
||||||
float newAlpha = getAlphaFor(mode);
|
float newAlpha = getAlphaFor(mode);
|
||||||
if (animate) {
|
if (animate) {
|
||||||
ObjectAnimator lhs = animateTransitionTo(mLeftSide, newAlpha);
|
AnimatorSet anims = new AnimatorSet();
|
||||||
lhs.start();
|
anims.playTogether(
|
||||||
// TODO jspurlock - fix conflicting rhs animations on tablets
|
animateTransitionTo(mLeftSide, newAlpha),
|
||||||
mRightSide.setAlpha(newAlpha);
|
animateTransitionTo(mStatusIcons, newAlpha),
|
||||||
|
animateTransitionTo(mSignalCluster, newAlpha),
|
||||||
|
animateTransitionTo(mClock, newAlpha)
|
||||||
|
);
|
||||||
|
anims.start();
|
||||||
} else {
|
} else {
|
||||||
mLeftSide.setAlpha(newAlpha);
|
mLeftSide.setAlpha(newAlpha);
|
||||||
mRightSide.setAlpha(newAlpha);
|
mStatusIcons.setAlpha(newAlpha);
|
||||||
|
mSignalCluster.setAlpha(newAlpha);
|
||||||
|
mClock.setAlpha(newAlpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user