Search in sources :

Example 6 with Mode

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

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 7 with Mode

use of com.android.quickstep.SysUINavigationMode.Mode in project android_packages_apps_404Launcher by P-404.

the class SettingsChangeLogger method logSnapshot.

/**
 * Takes snapshot of all eligible launcher settings and log them with the provided instance ID.
 */
public void logSnapshot(InstanceId snapshotInstanceId) {
    StatsLogger logger = mStatsLogManager.logger().withInstanceId(snapshotInstanceId);
    Optional.ofNullable(mNotificationDotsEvent).ifPresent(logger::log);
    Optional.ofNullable(mNavMode).map(mode -> mode.launcherEvent).ifPresent(logger::log);
    Optional.ofNullable(mHomeScreenSuggestionEvent).ifPresent(logger::log);
    Optional.ofNullable(new DeviceGridState(mContext).getWorkspaceSizeEvent()).ifPresent(logger::log);
    SharedPreferences prefs = getPrefs(mContext);
    if (FeatureFlags.ENABLE_THEMED_ICONS.get()) {
        logger.log(prefs.getBoolean(KEY_THEMED_ICONS, false) ? LAUNCHER_THEMED_ICON_ENABLED : LAUNCHER_THEMED_ICON_DISABLED);
    }
    mLoggablePrefs.forEach((key, lp) -> logger.log(() -> prefs.getBoolean(key, lp.defaultValue) ? lp.eventIdOn : lp.eventIdOff));
}
Also used : Context(android.content.Context) SettingsCache(com.android.launcher3.util.SettingsCache) LAUNCHER_NOTIFICATION_DOT_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_ENABLED) OnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener) LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_ENABLED) TypedArray(android.content.res.TypedArray) Utilities.getDevicePrefs(com.android.launcher3.Utilities.getDevicePrefs) NavigationModeChangeListener(com.android.quickstep.SysUINavigationMode.NavigationModeChangeListener) LAUNCHER_NOTIFICATION_DOT_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DOT_DISABLED) LAUNCHER_THEMED_ICON_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_DISABLED) LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_SCREEN_SUGGESTIONS_DISABLED) AutoInstallsLayout(com.android.launcher3.AutoInstallsLayout) LAST_PREDICTION_ENABLED_STATE(com.android.launcher3.model.QuickstepModelDelegate.LAST_PREDICTION_ENABLED_STATE) LAUNCHER_THEMED_ICON_ENABLED(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_THEMED_ICON_ENABLED) Log(android.util.Log) ArrayMap(android.util.ArrayMap) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) XmlPullParser(org.xmlpull.v1.XmlPullParser) MainThreadInitializedObject(com.android.launcher3.util.MainThreadInitializedObject) SysUINavigationMode(com.android.quickstep.SysUINavigationMode) NOTIFICATION_BADGING_URI(com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI) Xml(android.util.Xml) InstanceId(com.android.launcher3.logging.InstanceId) Mode(com.android.quickstep.SysUINavigationMode.Mode) FeatureFlags(com.android.launcher3.config.FeatureFlags) IOException(java.io.IOException) DeviceGridState(com.android.launcher3.model.DeviceGridState) XmlPullParserException(org.xmlpull.v1.XmlPullParserException) Utilities.getPrefs(com.android.launcher3.Utilities.getPrefs) SharedPreferences(android.content.SharedPreferences) StatsLogManager(com.android.launcher3.logging.StatsLogManager) R(com.android.launcher3.R) KEY_WORKSPACE_SIZE(com.android.launcher3.model.DeviceGridState.KEY_WORKSPACE_SIZE) Optional(java.util.Optional) KEY_THEMED_ICONS(com.android.launcher3.util.Themes.KEY_THEMED_ICONS) StatsLogger(com.android.launcher3.logging.StatsLogManager.StatsLogger) DeviceGridState(com.android.launcher3.model.DeviceGridState) SharedPreferences(android.content.SharedPreferences)

Example 8 with Mode

use of com.android.quickstep.SysUINavigationMode.Mode in project android_packages_apps_404Launcher by P-404.

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 9 with Mode

use of com.android.quickstep.SysUINavigationMode.Mode in project android_packages_apps_404Launcher by P-404.

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 10 with Mode

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

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