Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3cd8686 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix touchable region calculation in NavigationBarController (2nd)" into...

Merge "Fix touchable region calculation in NavigationBarController (2nd)" into tm-dev am: baae0bcf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17951295



Change-Id: I7eff54de5f4d27b08cc9ee40379feca2af784816
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 24263521 baae0bcf
Loading
Loading
Loading
Loading
+13 −5
Original line number Original line Diff line number Diff line
@@ -152,6 +152,7 @@ final class NavigationBarController {
        private boolean mDrawLegacyNavigationBarBackground;
        private boolean mDrawLegacyNavigationBarBackground;


        private final Rect mTempRect = new Rect();
        private final Rect mTempRect = new Rect();
        private final int[] mTempPos = new int[2];


        Impl(@NonNull InputMethodService inputMethodService) {
        Impl(@NonNull InputMethodService inputMethodService) {
            mService = inputMethodService;
            mService = inputMethodService;
@@ -259,21 +260,28 @@ final class NavigationBarController {
                switch (originalInsets.touchableInsets) {
                switch (originalInsets.touchableInsets) {
                    case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME:
                    case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME:
                        if (inputFrame.getVisibility() == View.VISIBLE) {
                        if (inputFrame.getVisibility() == View.VISIBLE) {
                            inputFrame.getBoundsOnScreen(mTempRect);
                            inputFrame.getLocationInWindow(mTempPos);
                            mTempRect.set(mTempPos[0], mTempPos[1],
                                    mTempPos[0] + inputFrame.getWidth(),
                                    mTempPos[1] + inputFrame.getHeight());
                            touchableRegion = new Region(mTempRect);
                            touchableRegion = new Region(mTempRect);
                        }
                        }
                        break;
                        break;
                    case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT:
                    case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT:
                        if (inputFrame.getVisibility() == View.VISIBLE) {
                        if (inputFrame.getVisibility() == View.VISIBLE) {
                            inputFrame.getBoundsOnScreen(mTempRect);
                            inputFrame.getLocationInWindow(mTempPos);
                            mTempRect.top = originalInsets.contentTopInsets;
                            mTempRect.set(mTempPos[0], originalInsets.contentTopInsets,
                                    mTempPos[0] + inputFrame.getWidth() ,
                                    mTempPos[1] + inputFrame.getHeight());
                            touchableRegion = new Region(mTempRect);
                            touchableRegion = new Region(mTempRect);
                        }
                        }
                        break;
                        break;
                    case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_VISIBLE:
                    case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_VISIBLE:
                        if (inputFrame.getVisibility() == View.VISIBLE) {
                        if (inputFrame.getVisibility() == View.VISIBLE) {
                            inputFrame.getBoundsOnScreen(mTempRect);
                            inputFrame.getLocationInWindow(mTempPos);
                            mTempRect.top = originalInsets.visibleTopInsets;
                            mTempRect.set(mTempPos[0], originalInsets.visibleTopInsets,
                                    mTempPos[0] + inputFrame.getWidth(),
                                    mTempPos[1] + inputFrame.getHeight());
                            touchableRegion = new Region(mTempRect);
                            touchableRegion = new Region(mTempRect);
                        }
                        }
                        break;
                        break;