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

Commit fbe582ba authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Don't account for floating window region in nav bar touchable region"...

Merge "Don't account for floating window region in nav bar touchable region" into sc-dev am: 824f5cf9

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

Change-Id: I536a9254b77d7d6001eb642bf983b85d08d57699
parents 9f6137f2 824f5cf9
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -281,7 +281,7 @@ public class NavigationBarView extends FrameLayout implements
        // When in gestural and the IME is showing, don't use the nearest region since it will take
        // When in gestural and the IME is showing, don't use the nearest region since it will take
        // gesture space away from the IME
        // gesture space away from the IME
        info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
        info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
        info.touchableRegion.set(getButtonLocations(false /* includeFloatingRotationButton */,
        info.touchableRegion.set(getButtonLocations(false /* includeFloatingButtons */,
                false /* inScreen */, false /* useNearestRegion */));
                false /* inScreen */, false /* useNearestRegion */));
    };
    };


@@ -982,7 +982,7 @@ public class NavigationBarView extends FrameLayout implements
     */
     */
    public void notifyActiveTouchRegions() {
    public void notifyActiveTouchRegions() {
        mOverviewProxyService.onActiveNavBarRegionChanges(
        mOverviewProxyService.onActiveNavBarRegionChanges(
                getButtonLocations(true /* includeFloatingRotationButton */, true /* inScreen */,
                getButtonLocations(true /* includeFloatingButtons */, true /* inScreen */,
                        true /* useNearestRegion */));
                        true /* useNearestRegion */));
    }
    }


@@ -995,14 +995,14 @@ public class NavigationBarView extends FrameLayout implements
    }
    }


    /**
    /**
     * @param includeFloatingRotationButton Whether to include the floating rotation button in the
     * @param includeFloatingButtons Whether to include the floating rotation and overlay button in
     *                                      region for all the buttons
     *                               the region for all the buttons
     * @param inScreenSpace Whether to return values in screen space or window space
     * @param inScreenSpace Whether to return values in screen space or window space
     * @param useNearestRegion Whether to use the nearest region instead of the actual button bounds
     * @param useNearestRegion Whether to use the nearest region instead of the actual button bounds
     * @return
     * @return
     */
     */
    private Region getButtonLocations(boolean includeFloatingRotationButton,
    private Region getButtonLocations(boolean includeFloatingButtons, boolean inScreenSpace,
            boolean inScreenSpace, boolean useNearestRegion) {
            boolean useNearestRegion) {
        if (useNearestRegion && !inScreenSpace) {
        if (useNearestRegion && !inScreenSpace) {
            // We currently don't support getting the nearest region in anything but screen space
            // We currently don't support getting the nearest region in anything but screen space
            useNearestRegion = false;
            useNearestRegion = false;
@@ -1014,13 +1014,13 @@ public class NavigationBarView extends FrameLayout implements
        updateButtonLocation(getRecentsButton(), inScreenSpace, useNearestRegion);
        updateButtonLocation(getRecentsButton(), inScreenSpace, useNearestRegion);
        updateButtonLocation(getImeSwitchButton(), inScreenSpace, useNearestRegion);
        updateButtonLocation(getImeSwitchButton(), inScreenSpace, useNearestRegion);
        updateButtonLocation(getAccessibilityButton(), inScreenSpace, useNearestRegion);
        updateButtonLocation(getAccessibilityButton(), inScreenSpace, useNearestRegion);
        if (includeFloatingRotationButton && mFloatingRotationButton.isVisible()) {
        if (includeFloatingButtons && mFloatingRotationButton.isVisible()) {
            // Note: this button is floating so the nearest region doesn't apply
            // Note: this button is floating so the nearest region doesn't apply
            updateButtonLocation(mFloatingRotationButton.getCurrentView(), inScreenSpace);
            updateButtonLocation(mFloatingRotationButton.getCurrentView(), inScreenSpace);
        } else {
        } else {
            updateButtonLocation(getRotateSuggestionButton(), inScreenSpace, useNearestRegion);
            updateButtonLocation(getRotateSuggestionButton(), inScreenSpace, useNearestRegion);
        }
        }
        if (mNavBarOverlayController.isNavigationBarOverlayEnabled()
        if (includeFloatingButtons && mNavBarOverlayController.isNavigationBarOverlayEnabled()
                && mNavBarOverlayController.isVisible()) {
                && mNavBarOverlayController.isVisible()) {
            // Note: this button is floating so the nearest region doesn't apply
            // Note: this button is floating so the nearest region doesn't apply
            updateButtonLocation(mNavBarOverlayController.getCurrentView(), inScreenSpace);
            updateButtonLocation(mNavBarOverlayController.getCurrentView(), inScreenSpace);