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