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

Commit 170306d5 authored by Alex Chau's avatar Alex Chau
Browse files

Update Split button visibility based on DeviceProfile change

- Updating Split button visibility in notifyPageSwitchListener() is sometimes too late and causes OverviewActions failed to re-center after removing Split button
- Instead, update Split button visibility based on DeviceProfile change in updateDimension(), which is the ultimate source of information impacting button visibility

Fix: 321291049
Test: Clear all tasks, fold, launch app, swipe up to Overivew
Flag: None
Change-Id: If518cb02429011fedfb8df3dd05dd7ab180d849a
parent f6867d48
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -243,13 +243,13 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo

    /**
     * Updates a batch of flags to hide and show actions buttons for tablet/non tablet case.
     * @param isSmallScreen True if the current display is a small screen.
     */
    public void updateForSmallScreen(boolean isSmallScreen) {
    private void updateForIsTablet() {
        assert mDp != null;
        // Update flags to see if split button should be hidden.
        updateSplitButtonHiddenFlags(FLAG_SMALL_SCREEN_HIDE_SPLIT, isSmallScreen);
        updateSplitButtonHiddenFlags(FLAG_SMALL_SCREEN_HIDE_SPLIT, !mDp.isTablet);
        // Update flags to see if save app pair button should be hidden.
        updateAppPairButtonHiddenFlags(FLAG_SMALL_SCREEN_HIDE_APP_PAIR, isSmallScreen);
        updateAppPairButtonHiddenFlags(FLAG_SMALL_SCREEN_HIDE_APP_PAIR, !mDp.isTablet);
    }

    /**
@@ -386,6 +386,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
        mDp = dp;
        mTaskSize.set(taskSize);
        updateVerticalMargin(DisplayController.getNavigationMode(getContext()));
        updateForIsTablet();

        requestLayout();

+0 −2
Original line number Diff line number Diff line
@@ -3962,8 +3962,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        // Update flags to see if actions bar should show buttons for a single task or a pair of
        // tasks.
        mActionsView.updateForGroupedTask(isCurrentSplit);
        // Update flags to see if actions bar should show buttons for tablets or phones.
        mActionsView.updateForSmallScreen(!mActivity.getDeviceProfile().isTablet);
        // Update flags for 1p/3p launchers
        mActionsView.updateFor3pLauncher(!supportsAppPairs());