Search in sources :

Example 1 with Mode

use of com.android.quickstep.SysUINavigationMode.Mode in project android_packages_apps_Launcher3 by AOSPA.

the class QuickstepLauncher method createTouchControllers.

@Override
public TouchController[] createTouchControllers() {
    Mode mode = SysUINavigationMode.getMode(this);
    ArrayList<TouchController> list = new ArrayList<>();
    list.add(getDragController());
    switch(mode) {
        case NO_BUTTON:
            list.add(new NoButtonQuickSwitchTouchController(this));
            list.add(new NavBarToHomeTouchController(this));
            list.add(new NoButtonNavbarToOverviewTouchController(this));
            break;
        case TWO_BUTTONS:
            list.add(new TwoButtonNavbarTouchController(this));
            list.add(getDeviceProfile().isVerticalBarLayout() ? new TransposedQuickSwitchTouchController(this) : new QuickSwitchTouchController(this));
            list.add(new PortraitStatesTouchController(this));
            break;
        case THREE_BUTTONS:
        default:
            list.add(new PortraitStatesTouchController(this));
    }
    if (!getDeviceProfile().isMultiWindowMode) {
        list.add(new StatusBarTouchController(this));
    }
    list.add(new LauncherTaskViewController(this));
    return list.toArray(new TouchController[list.size()]);
}
Also used : NoButtonNavbarToOverviewTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonNavbarToOverviewTouchController) TwoButtonNavbarTouchController(com.android.launcher3.uioverrides.touchcontrollers.TwoButtonNavbarTouchController) StatusBarTouchController(com.android.launcher3.uioverrides.touchcontrollers.StatusBarTouchController) SysUINavigationMode(com.android.quickstep.SysUINavigationMode) Mode(com.android.quickstep.SysUINavigationMode.Mode) ArrayList(java.util.ArrayList) TransposedQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController) NavBarToHomeTouchController(com.android.launcher3.uioverrides.touchcontrollers.NavBarToHomeTouchController) PortraitStatesTouchController(com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController) NoButtonQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonQuickSwitchTouchController) TransposedQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController) StatusBarTouchController(com.android.launcher3.uioverrides.touchcontrollers.StatusBarTouchController) NoButtonNavbarToOverviewTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonNavbarToOverviewTouchController) TwoButtonNavbarTouchController(com.android.launcher3.uioverrides.touchcontrollers.TwoButtonNavbarTouchController) TouchController(com.android.launcher3.util.TouchController) QuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.QuickSwitchTouchController) TaskViewTouchController(com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchController) PortraitStatesTouchController(com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController) NoButtonQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonQuickSwitchTouchController) NoButtonQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonQuickSwitchTouchController) TransposedQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController) QuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.QuickSwitchTouchController) NavBarToHomeTouchController(com.android.launcher3.uioverrides.touchcontrollers.NavBarToHomeTouchController)

Example 2 with Mode

use of com.android.quickstep.SysUINavigationMode.Mode in project android_packages_apps_Launcher3 by AOSPA.

the class BaseQuickstepLauncher method shouldBackButtonBeHidden.

public boolean shouldBackButtonBeHidden(LauncherState toState) {
    Mode mode = SysUINavigationMode.getMode(this);
    boolean shouldBackButtonBeHidden = mode.hasGestures && toState.hasFlag(FLAG_HIDE_BACK_BUTTON) && hasWindowFocus() && (getActivityFlags() & ACTIVITY_STATE_TRANSITION_ACTIVE) == 0;
    if (shouldBackButtonBeHidden) {
        // Show the back button if there is a floating view visible.
        shouldBackButtonBeHidden = AbstractFloatingView.getTopOpenViewWithType(this, TYPE_ALL & ~TYPE_HIDE_BACK_BUTTON) == null;
    }
    return shouldBackButtonBeHidden;
}
Also used : SysUINavigationMode(com.android.quickstep.SysUINavigationMode) Mode(com.android.quickstep.SysUINavigationMode.Mode)

Example 3 with Mode

use of com.android.quickstep.SysUINavigationMode.Mode in project android_packages_apps_Trebuchet by LineageOS.

the class QuickstepLauncher method createTouchControllers.

@Override
public TouchController[] createTouchControllers() {
    if (TestProtocol.sDebugTracing) {
        Log.d(TestProtocol.PAUSE_NOT_DETECTED, "createTouchControllers.1");
    }
    Mode mode = SysUINavigationMode.getMode(this);
    ArrayList<TouchController> list = new ArrayList<>();
    list.add(getDragController());
    if (mode == NO_BUTTON) {
        list.add(new NoButtonQuickSwitchTouchController(this));
        list.add(new NavBarToHomeTouchController(this));
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.PAUSE_NOT_DETECTED, "createTouchControllers.2");
        }
        if (FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get()) {
            if (TestProtocol.sDebugTracing) {
                Log.d(TestProtocol.PAUSE_NOT_DETECTED, "createTouchControllers.3");
            }
            list.add(new NoButtonNavbarToOverviewTouchController(this));
        } else {
            list.add(new FlingAndHoldTouchController(this));
        }
    } else {
        if (getDeviceProfile().isVerticalBarLayout()) {
            list.add(new OverviewToAllAppsTouchController(this));
            list.add(new LandscapeEdgeSwipeController(this));
            if (mode.hasGestures) {
                list.add(new TransposedQuickSwitchTouchController(this));
            }
        } else {
            list.add(new PortraitStatesTouchController(this, mode.hasGestures));
            if (mode.hasGestures) {
                list.add(new QuickSwitchTouchController(this));
            }
        }
    }
    if (!getDeviceProfile().isMultiWindowMode) {
        list.add(new StatusBarTouchController(this));
    }
    list.add(new LauncherTaskViewController(this));
    return list.toArray(new TouchController[list.size()]);
}
Also used : NoButtonNavbarToOverviewTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonNavbarToOverviewTouchController) StatusBarTouchController(com.android.launcher3.uioverrides.touchcontrollers.StatusBarTouchController) OverviewToAllAppsTouchController(com.android.launcher3.uioverrides.touchcontrollers.OverviewToAllAppsTouchController) SysUINavigationMode(com.android.quickstep.SysUINavigationMode) Mode(com.android.quickstep.SysUINavigationMode.Mode) ArrayList(java.util.ArrayList) TransposedQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController) NavBarToHomeTouchController(com.android.launcher3.uioverrides.touchcontrollers.NavBarToHomeTouchController) OverviewToAllAppsTouchController(com.android.launcher3.uioverrides.touchcontrollers.OverviewToAllAppsTouchController) PortraitStatesTouchController(com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController) NoButtonQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonQuickSwitchTouchController) FlingAndHoldTouchController(com.android.launcher3.uioverrides.touchcontrollers.FlingAndHoldTouchController) TransposedQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController) StatusBarTouchController(com.android.launcher3.uioverrides.touchcontrollers.StatusBarTouchController) NoButtonNavbarToOverviewTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonNavbarToOverviewTouchController) TouchController(com.android.launcher3.util.TouchController) QuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.QuickSwitchTouchController) TaskViewTouchController(com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchController) PortraitStatesTouchController(com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController) NoButtonQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonQuickSwitchTouchController) FlingAndHoldTouchController(com.android.launcher3.uioverrides.touchcontrollers.FlingAndHoldTouchController) NoButtonQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.NoButtonQuickSwitchTouchController) TransposedQuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController) QuickSwitchTouchController(com.android.launcher3.uioverrides.touchcontrollers.QuickSwitchTouchController) NavBarToHomeTouchController(com.android.launcher3.uioverrides.touchcontrollers.NavBarToHomeTouchController) LandscapeEdgeSwipeController(com.android.launcher3.uioverrides.touchcontrollers.LandscapeEdgeSwipeController)

Example 4 with Mode

use of com.android.quickstep.SysUINavigationMode.Mode in project Neo-Launcher by NeoApplications.

the class UiFactory method enableLiveUIChanges.

public static Runnable enableLiveUIChanges(Launcher launcher) {
    NavigationModeChangeListener listener = m -> {
        launcher.getDragLayer().recreateControllers();
        launcher.getRotationHelper().setRotationHadDifferentUI(m != Mode.NO_BUTTON);
    };
    SysUINavigationMode mode = SysUINavigationMode.INSTANCE.get(launcher);
    SysUINavigationMode.Mode m = mode.addModeChangeListener(listener);
    launcher.getRotationHelper().setRotationHadDifferentUI(m != Mode.NO_BUTTON);
    return () -> mode.removeModeChangeListener(listener);
}
Also used : Context(android.content.Context) Bundle(android.os.Bundle) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Intent(android.content.Intent) OVERVIEW(com.android.launcher3.LauncherState.OVERVIEW) NavigationModeChangeListener(com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener) IntentSender(android.content.IntentSender) QuickstepAppTransitionManagerImpl(com.android.launcher3.QuickstepAppTransitionManagerImpl) TouchInteractionService(com.android.quickstep.TouchInteractionService) ProxyActivityStarter(com.android.launcher3.proxy.ProxyActivityStarter) StartActivityParams(com.android.launcher3.proxy.StartActivityParams) HOME_BOUNCE_SEEN(com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_SEEN) TYPE_ALL(com.android.launcher3.AbstractFloatingView.TYPE_ALL) AnimatorSet(android.animation.AnimatorSet) StateHandler(com.android.launcher3.LauncherStateManager.StateHandler) OverviewInteractionState(com.android.quickstep.OverviewInteractionState) SHELF_BOUNCE_SEEN(com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_SEEN) SHELF_BOUNCE_COUNT(com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_COUNT) Utilities(com.android.launcher3.Utilities) PrintWriter(java.io.PrintWriter) RESULT_CANCELED(android.app.Activity.RESULT_CANCELED) SysUINavigationMode(com.android.quickstep.SysUINavigationMode) BOUNCE_MAX_COUNT(com.android.launcher3.allapps.DiscoveryBounce.BOUNCE_MAX_COUNT) Launcher(com.android.launcher3.Launcher) ScaleAndTranslation(com.android.launcher3.LauncherState.ScaleAndTranslation) TYPE_HIDE_BACK_BUTTON(com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON) ShortcutInfo(android.content.pm.ShortcutInfo) Mode(com.android.quickstep.SysUINavigationMode.Mode) CancellationSignal(android.os.CancellationSignal) HOME_BOUNCE_COUNT(com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_COUNT) Deflater(java.util.zip.Deflater) LauncherState(com.android.launcher3.LauncherState) ALL_APPS(com.android.launcher3.LauncherState.ALL_APPS) ActivityCompat(com.android.systemui.shared.system.ActivityCompat) RecentsModel(com.android.quickstep.RecentsModel) RemoteFadeOutAnimationListener(com.android.quickstep.util.RemoteFadeOutAnimationListener) Base64(android.util.Base64) AbstractFloatingView(com.android.launcher3.AbstractFloatingView) Activity(android.app.Activity) LauncherStateManager(com.android.launcher3.LauncherStateManager) NORMAL(com.android.launcher3.LauncherState.NORMAL) ValueAnimator(android.animation.ValueAnimator) Mode(com.android.quickstep.SysUINavigationMode.Mode) NavigationModeChangeListener(com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener) SysUINavigationMode(com.android.quickstep.SysUINavigationMode)

Example 5 with Mode

use of com.android.quickstep.SysUINavigationMode.Mode in project android_packages_apps_Launcher3 by ProtonAOSP.

the class BaseQuickstepLauncher method shouldBackButtonBeHidden.

public boolean shouldBackButtonBeHidden(LauncherState toState) {
    Mode mode = SysUINavigationMode.getMode(this);
    boolean shouldBackButtonBeHidden = mode.hasGestures && toState.hasFlag(FLAG_HIDE_BACK_BUTTON) && hasWindowFocus() && (getActivityFlags() & ACTIVITY_STATE_TRANSITION_ACTIVE) == 0;
    if (shouldBackButtonBeHidden) {
        // Show the back button if there is a floating view visible.
        shouldBackButtonBeHidden = AbstractFloatingView.getTopOpenViewWithType(this, TYPE_ALL & ~TYPE_HIDE_BACK_BUTTON) == null;
    }
    return shouldBackButtonBeHidden;
}
Also used : SysUINavigationMode(com.android.quickstep.SysUINavigationMode) Mode(com.android.quickstep.SysUINavigationMode.Mode)

Aggregations

SysUINavigationMode (com.android.quickstep.SysUINavigationMode)18 Mode (com.android.quickstep.SysUINavigationMode.Mode)18 NavBarToHomeTouchController (com.android.launcher3.uioverrides.touchcontrollers.NavBarToHomeTouchController)7 NoButtonQuickSwitchTouchController (com.android.launcher3.uioverrides.touchcontrollers.NoButtonQuickSwitchTouchController)7 PortraitStatesTouchController (com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController)7 QuickSwitchTouchController (com.android.launcher3.uioverrides.touchcontrollers.QuickSwitchTouchController)7 StatusBarTouchController (com.android.launcher3.uioverrides.touchcontrollers.StatusBarTouchController)7 TaskViewTouchController (com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchController)7 TransposedQuickSwitchTouchController (com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController)7 TouchController (com.android.launcher3.util.TouchController)7 Context (android.content.Context)5 SharedPreferences (android.content.SharedPreferences)4 OnSharedPreferenceChangeListener (android.content.SharedPreferences.OnSharedPreferenceChangeListener)4 TypedArray (android.content.res.TypedArray)4 ArrayMap (android.util.ArrayMap)4 Log (android.util.Log)4 Xml (android.util.Xml)4 AutoInstallsLayout (com.android.launcher3.AutoInstallsLayout)4 R (com.android.launcher3.R)4 Utilities.getDevicePrefs (com.android.launcher3.Utilities.getDevicePrefs)4