Merge "Remove corner cutout tracking from HeadsUpStatusBarView" into sc-dev am: 8261dc7483
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14722672 Change-Id: Ic441e412ed59140f3617f1743fb48c33083fe778
This commit is contained in:
@@ -35,7 +35,6 @@ import com.android.systemui.plugins.DarkIconDispatcher;
|
|||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry.OnSensitivityChangedListener;
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry.OnSensitivityChangedListener;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The view in the statusBar that contains part of the heads-up information
|
* The view in the statusBar that contains part of the heads-up information
|
||||||
@@ -55,10 +54,8 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout {
|
|||||||
private int[] mTmpPosition = new int[2];
|
private int[] mTmpPosition = new int[2];
|
||||||
private boolean mFirstLayout = true;
|
private boolean mFirstLayout = true;
|
||||||
private int mMaxWidth;
|
private int mMaxWidth;
|
||||||
private View mRootView;
|
|
||||||
private int mSysWinInset;
|
private int mSysWinInset;
|
||||||
private int mCutOutInset;
|
private int mCutOutInset;
|
||||||
private List<Rect> mCutOutBounds;
|
|
||||||
private Rect mIconDrawingRect = new Rect();
|
private Rect mIconDrawingRect = new Rect();
|
||||||
private Point mDisplaySize;
|
private Point mDisplaySize;
|
||||||
private Runnable mOnDrawingRectChangedListener;
|
private Runnable mOnDrawingRectChangedListener;
|
||||||
@@ -197,19 +194,7 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout {
|
|||||||
int targetPadding = mAbsoluteStartPadding + mSysWinInset + mCutOutInset;
|
int targetPadding = mAbsoluteStartPadding + mSysWinInset + mCutOutInset;
|
||||||
boolean isRtl = isLayoutRtl();
|
boolean isRtl = isLayoutRtl();
|
||||||
int start = isRtl ? (mDisplaySize.x - right) : left;
|
int start = isRtl ? (mDisplaySize.x - right) : left;
|
||||||
|
|
||||||
if (start != targetPadding) {
|
if (start != targetPadding) {
|
||||||
if (mCutOutBounds != null) {
|
|
||||||
for (Rect cutOutRect : mCutOutBounds) {
|
|
||||||
int cutOutStart = (isRtl)
|
|
||||||
? (mDisplaySize.x - cutOutRect.right) : cutOutRect.left;
|
|
||||||
if (start > cutOutStart) {
|
|
||||||
start -= cutOutRect.width();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int newPadding = targetPadding - start + getPaddingStart();
|
int newPadding = targetPadding - start + getPaddingStart();
|
||||||
setPaddingRelative(newPadding, 0, mEndMargin, 0);
|
setPaddingRelative(newPadding, 0, mEndMargin, 0);
|
||||||
}
|
}
|
||||||
@@ -252,12 +237,6 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout {
|
|||||||
|
|
||||||
getDisplaySize();
|
getDisplaySize();
|
||||||
|
|
||||||
mCutOutBounds = null;
|
|
||||||
if (displayCutout != null && displayCutout.getSafeInsetRight() == 0
|
|
||||||
&& displayCutout.getSafeInsetLeft() == 0) {
|
|
||||||
mCutOutBounds = displayCutout.getBoundingRects();
|
|
||||||
}
|
|
||||||
|
|
||||||
// For Double Cut Out mode, the System window navigation bar is at the right
|
// For Double Cut Out mode, the System window navigation bar is at the right
|
||||||
// side of the left cut out. In this condition, mSysWinInset include the left cut
|
// side of the left cut out. In this condition, mSysWinInset include the left cut
|
||||||
// out width so we set mCutOutInset to be 0. For RTL, the condition is the same.
|
// out width so we set mCutOutInset to be 0. For RTL, the condition is the same.
|
||||||
|
|||||||
Reference in New Issue
Block a user