diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 421a58f..96b7967 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -109,6 +109,8 @@ public class NavigationBarView extends FrameLayout implements
private Rect mBackButtonBounds = new Rect();
private Rect mRecentsButtonBounds = new Rect();
private Rect mRotationButtonBounds = new Rect();
+ private Rect mVolumeAddButtonBounds = new Rect();
+ private Rect mVolumeSubButtonBounds = new Rect();
private final Region mActiveRegion = new Region();
private int[] mTmpPosition = new int[2];
@@ -878,6 +880,8 @@ public class NavigationBarView extends FrameLayout implements
updateButtonLocation(getBackButton(), mBackButtonBounds, true);
updateButtonLocation(getHomeButton(), mHomeButtonBounds, false);
updateButtonLocation(getRecentsButton(), mRecentsButtonBounds, false);
+ updateButtonLocation(getVolumeAddButton(), mVolumeAddButtonBounds, false);
+ updateButtonLocation(getVolumeSubButton(), mVolumeSubButtonBounds, false);
updateButtonLocation(getRotateSuggestionButton(), mRotationButtonBounds, true);
// TODO: Handle button visibility changes
mOverviewProxyService.onActiveNavBarRegionChanges(mActiveRegion);
@@ -924,6 +928,13 @@ public class NavigationBarView extends FrameLayout implements
}
private void updateCurrentView() {
+ if (mCurrentRotation == Surface.ROTATION_0
+ || mCurrentRotation == Surface.ROTATION_180) {
+ setPadding(650, 0, 650, 0);
+ } else if (mCurrentRotation == Surface.ROTATION_90
+ || mCurrentRotation == Surface.ROTATION_270) {
+ setPadding(230, 0, 230, 0);
+ }
resetViews();
mCurrentView = mIsVertical ? mVertical : mHorizontal;
mCurrentView.setVisibility(View.VISIBLE);
@@ -1173,8 +1184,17 @@ public class NavigationBarView extends FrameLayout implements
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
int leftInset = insets.getSystemWindowInsetLeft();
int rightInset = insets.getSystemWindowInsetRight();
- setPadding(leftInset, insets.getSystemWindowInsetTop(), rightInset,
- insets.getSystemWindowInsetBottom());
+// setPadding(leftInset, insets.getSystemWindowInsetTop(), rightInset,
+// insets.getSystemWindowInsetBottom());
+ if (mCurrentRotation == Surface.ROTATION_0
+ || mCurrentRotation == Surface.ROTATION_180) {
+ setPadding(650, insets.getSystemWindowInsetTop(), 650,
+ insets.getSystemWindowInsetBottom());
+ } else if (mCurrentRotation == Surface.ROTATION_90
+ || mCurrentRotation == Surface.ROTATION_270) {
+ setPadding(230, insets.getSystemWindowInsetTop(), 230,
+ insets.getSystemWindowInsetBottom());
+ }
// we're passing the insets onto the gesture handler since the back arrow is only
// conditionally added and doesn't always get all the insets.
mEdgeBackGestureHandler.setInsets(leftInset, rightInset);
Android 10 导航栏按钮图标点击范围过大
最新推荐文章于 2024-10-15 14:56:18 发布