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()]);
}
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));
}
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()]);
}
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;
}
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;
}
Aggregations