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

Commit a9d2db38 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topics "draglayer-inline-qsb", "draglayer-search" into udc-qpr-dev

* changes:
  Allow LauncherState to define floating search side margins.
  Put the "floating" in ENABLE_FLOATING_SEARCH_BAR.
parents 167ff731 bd9a180f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -47,9 +47,9 @@ public class TaskbarAllAppsContainerView extends
    }

    @Override
    protected View inflateSearchBox() {
    protected View inflateSearchBar() {
        if (isSearchSupported()) {
            return super.inflateSearchBox();
            return super.inflateSearchBar();
        }

        // Remove top padding of header, since we do not have any search
+7 −0
Original line number Diff line number Diff line
@@ -169,6 +169,13 @@ public final class TaskbarAllAppsController {
    }

    private void cleanUpOverlay() {
        // Floating search bar is added to the drag layer in ActivityAllAppsContainerView onAttach;
        // removed here as this is a special case that we remove the all apps panel.
        if (mAppsView != null && mOverlayContext != null
                && mAppsView.getSearchUiDelegate().isSearchBarFloating()) {
            mOverlayContext.getDragLayer().removeView(mAppsView.getSearchView());
            mAppsView.getSearchUiDelegate().onDestroySearchBar();
        }
        if (mSearchSessionController != null) {
            mSearchSessionController.onDestroy();
            mSearchSessionController = null;
+30 −3
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAP

import android.content.Context;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
@@ -104,9 +105,35 @@ public class AllAppsState extends LauncherState {

    @Override
    public int getVisibleElements(Launcher launcher) {
        // Don't add HOTSEAT_ICONS for non-tablets in ALL_APPS state.
        return launcher.getDeviceProfile().isTablet ? ALL_APPS_CONTENT | HOTSEAT_ICONS
                : ALL_APPS_CONTENT;
        int elements = ALL_APPS_CONTENT | FLOATING_SEARCH_BAR;
        // Only add HOTSEAT_ICONS for tablets in ALL_APPS state.
        if (launcher.getDeviceProfile().isTablet) {
            elements |= HOTSEAT_ICONS;
        }
        return elements;
    }

    @Override
    public int getFloatingSearchBarRestingMarginBottom(Launcher launcher) {
        return 0;
    }

    @Override
    public int getFloatingSearchBarRestingMarginStart(Launcher launcher) {
        DeviceProfile dp = launcher.getDeviceProfile();
        return dp.allAppsLeftRightMargin + dp.getAllAppsIconStartMargin();
    }

    @Override
    public int getFloatingSearchBarRestingMarginEnd(Launcher launcher) {
        DeviceProfile dp = launcher.getDeviceProfile();
        return dp.allAppsLeftRightMargin + dp.getAllAppsIconStartMargin();
    }

    @Override
    public boolean shouldFloatingSearchBarUsePillWhenUnfocused(Launcher launcher) {
        DeviceProfile dp = launcher.getDeviceProfile();
        return dp.isPhone && !dp.isLandscape;
    }

    @Override
+26 −1
Original line number Diff line number Diff line
@@ -107,7 +107,32 @@ public class OverviewState extends LauncherState {

    @Override
    public int getVisibleElements(Launcher launcher) {
        return CLEAR_ALL_BUTTON | OVERVIEW_ACTIONS;
        int elements = CLEAR_ALL_BUTTON | OVERVIEW_ACTIONS;
        DeviceProfile dp = launcher.getDeviceProfile();
        boolean showFloatingSearch;
        if (dp.isPhone) {
            // Only show search in phone overview in portrait mode.
            showFloatingSearch = !dp.isLandscape;
        } else {
            // Only show search in tablet overview if taskbar is not visible.
            showFloatingSearch = !dp.isTaskbarPresent || isTaskbarStashed(launcher);
        }
        if (showFloatingSearch) {
            elements |= FLOATING_SEARCH_BAR;
        }
        return elements;
    }

    @Override
    public int getFloatingSearchBarRestingMarginBottom(Launcher launcher) {
        return areElementsVisible(launcher, FLOATING_SEARCH_BAR) ? 0
                : super.getFloatingSearchBarRestingMarginBottom(launcher);
    }

    @Override
    public boolean shouldFloatingSearchBarUsePillWhenUnfocused(Launcher launcher) {
        DeviceProfile dp = launcher.getDeviceProfile();
        return dp.isPhone && !dp.isLandscape;
    }

    @Override
+4 −0
Original line number Diff line number Diff line
@@ -811,6 +811,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
        VibratorWrapper.INSTANCE.get(mContext).vibrate(OVERVIEW_HAPTIC);
        maybeUpdateRecentsAttachedState(true);

        if (mActivity != null) {
            mActivity.getAppsView().getSearchUiManager().prepareToFocusEditText(mIsInAllAppsRegion);
        }

        // Draw active task below Launcher so that All Apps can appear over it.
        runActionOnRemoteHandles(remoteTargetHandle ->
                remoteTargetHandle.getTaskViewSimulator().setDrawsBelowRecents(isInAllAppsRegion));
Loading