Merge "Fix brightness animation in split shade" into sc-v2-dev am: 41e02db201
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15853554 Change-Id: I5ff9fd24c044cf36aae1cd73fb2610c496d68d1c
This commit is contained in:
@@ -409,21 +409,8 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
}
|
||||
|
||||
if (mAllowFancy) {
|
||||
// Make brightness appear static position and alpha in through second half.
|
||||
View brightness = mQsPanelController.getBrightnessView();
|
||||
if (brightness != null) {
|
||||
firstPageBuilder.addFloat(brightness, "translationY",
|
||||
brightness.getMeasuredHeight() * 0.5f, 0);
|
||||
mBrightnessAnimator = new TouchAnimator.Builder()
|
||||
.addFloat(brightness, "alpha", 0, 1)
|
||||
.addFloat(brightness, "sliderScaleY", 0.3f, 1)
|
||||
.setInterpolator(Interpolators.ALPHA_IN)
|
||||
.setStartDelay(0.3f)
|
||||
.build();
|
||||
mAllViews.add(brightness);
|
||||
} else {
|
||||
mBrightnessAnimator = null;
|
||||
}
|
||||
animateBrightnessSlider(firstPageBuilder);
|
||||
|
||||
mFirstPageAnimator = firstPageBuilder
|
||||
.setListener(this)
|
||||
.build();
|
||||
@@ -474,20 +461,53 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
|
||||
.addFloat(tileLayout, "alpha", 0, 1).build();
|
||||
}
|
||||
|
||||
private void animateBrightnessSlider(Builder firstPageBuilder) {
|
||||
View qsBrightness = mQsPanelController.getBrightnessView();
|
||||
View qqsBrightness = mQuickQSPanelController.getBrightnessView();
|
||||
if (qqsBrightness != null && qqsBrightness.getVisibility() == View.VISIBLE) {
|
||||
// animating in split shade mode
|
||||
mAnimatedQsViews.add(qsBrightness);
|
||||
mAllViews.add(qqsBrightness);
|
||||
int translationY = getRelativeTranslationY(qsBrightness, qqsBrightness);
|
||||
mBrightnessAnimator = new Builder()
|
||||
// we need to animate qs brightness even if animation will not be visible,
|
||||
// as we might start from sliderScaleY set to 0.3 if device was in collapsed QS
|
||||
// portrait orientation before
|
||||
.addFloat(qsBrightness, "sliderScaleY", 0.3f, 1)
|
||||
.addFloat(qqsBrightness, "translationY", 0, translationY)
|
||||
.build();
|
||||
} else if (qsBrightness != null) {
|
||||
firstPageBuilder.addFloat(qsBrightness, "translationY",
|
||||
qsBrightness.getMeasuredHeight() * 0.5f, 0);
|
||||
mBrightnessAnimator = new Builder()
|
||||
.addFloat(qsBrightness, "alpha", 0, 1)
|
||||
.addFloat(qsBrightness, "sliderScaleY", 0.3f, 1)
|
||||
.setInterpolator(Interpolators.ALPHA_IN)
|
||||
.setStartDelay(0.3f)
|
||||
.build();
|
||||
mAllViews.add(qsBrightness);
|
||||
} else {
|
||||
mBrightnessAnimator = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateQQSFooterAnimation() {
|
||||
int[] qsPosition = new int[2];
|
||||
int[] qqsPosition = new int[2];
|
||||
View commonView = mQs.getView();
|
||||
getRelativePositionInt(qsPosition, mQSFooterActions, commonView);
|
||||
getRelativePositionInt(qqsPosition, mQQSFooterActions, commonView);
|
||||
int translationY = (qsPosition[1] - qqsPosition[1])
|
||||
- mQuickStatusBarHeader.getOffsetTranslation();
|
||||
int translationY = getRelativeTranslationY(mQSFooterActions, mQQSFooterActions);
|
||||
mQQSFooterActionsAnimator = new TouchAnimator.Builder()
|
||||
.addFloat(mQQSFooterActions, "translationY", 0, translationY)
|
||||
.build();
|
||||
mAnimatedQsViews.add(mQSFooterActions);
|
||||
}
|
||||
|
||||
private int getRelativeTranslationY(View view1, View view2) {
|
||||
int[] qsPosition = new int[2];
|
||||
int[] qqsPosition = new int[2];
|
||||
View commonView = mQs.getView();
|
||||
getRelativePositionInt(qsPosition, view1, commonView);
|
||||
getRelativePositionInt(qqsPosition, view2, commonView);
|
||||
return (qsPosition[1] - qqsPosition[1]) - mQuickStatusBarHeader.getOffsetTranslation();
|
||||
}
|
||||
|
||||
private boolean isIconInAnimatedRow(int count) {
|
||||
if (mPagedLayout == null) {
|
||||
return false;
|
||||
|
||||
@@ -258,10 +258,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
|
||||
return mView.isLayoutRtl();
|
||||
}
|
||||
|
||||
public View getBrightnessView() {
|
||||
return mView.getBrightnessView();
|
||||
}
|
||||
|
||||
/** */
|
||||
public void setPageListener(PagedTileLayout.PageListener listener) {
|
||||
mView.setPageListener(listener);
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.annotation.Nullable;
|
||||
import android.content.ComponentName;
|
||||
import android.content.res.Configuration;
|
||||
import android.metrics.LogMaker;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
@@ -405,6 +406,10 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
|
||||
mUsingHorizontalLayoutChangedListener = listener;
|
||||
}
|
||||
|
||||
public View getBrightnessView() {
|
||||
return mView.getBrightnessView();
|
||||
}
|
||||
|
||||
/** */
|
||||
public static final class TileRecord extends QSPanel.Record {
|
||||
public QSTile tile;
|
||||
|
||||
Reference in New Issue
Block a user