use of com.android.systemui.stackdivider.DividerView in project platform_frameworks_base by android.
the class ShortcutKeyDispatcher method handleDockKey.
private void handleDockKey(long shortcutCode) {
try {
int dockSide = mWindowManagerService.getDockedStackSide();
if (dockSide == WindowManager.DOCKED_INVALID) {
// If there is no window docked, we dock the top-most window.
Recents recents = getComponent(Recents.class);
int dockMode = (shortcutCode == SC_DOCK_LEFT) ? ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT : ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
recents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE, dockMode, null, MetricsEvent.WINDOW_DOCK_SHORTCUTS);
} else {
// If there is already a docked window, we respond by resizing the docking pane.
DividerView dividerView = getComponent(Divider.class).getView();
DividerSnapAlgorithm snapAlgorithm = dividerView.getSnapAlgorithm();
int dividerPosition = dividerView.getCurrentPosition();
DividerSnapAlgorithm.SnapTarget currentTarget = snapAlgorithm.calculateNonDismissingSnapTarget(dividerPosition);
int increment = (shortcutCode == SC_DOCK_LEFT) ? -1 : 1;
DividerSnapAlgorithm.SnapTarget target = snapAlgorithm.cycleNonDismissTarget(currentTarget, increment);
dividerView.startDragging(true, /* animate */
false);
dividerView.stopDragging(target.position, 0f, true, /* avoidDismissStart */
true);
}
} catch (RemoteException e) {
Log.e(TAG, "handleDockKey() failed.");
}
}
use of com.android.systemui.stackdivider.DividerView in project android_frameworks_base by DirtyUnicorns.
the class ShortcutKeyDispatcher method handleDockKey.
private void handleDockKey(long shortcutCode) {
try {
int dockSide = mWindowManagerService.getDockedStackSide();
if (dockSide == WindowManager.DOCKED_INVALID) {
// If there is no window docked, we dock the top-most window.
Recents recents = getComponent(Recents.class);
int dockMode = (shortcutCode == SC_DOCK_LEFT) ? ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT : ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
recents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE, dockMode, null, MetricsEvent.WINDOW_DOCK_SHORTCUTS);
} else {
// If there is already a docked window, we respond by resizing the docking pane.
DividerView dividerView = getComponent(Divider.class).getView();
DividerSnapAlgorithm snapAlgorithm = dividerView.getSnapAlgorithm();
int dividerPosition = dividerView.getCurrentPosition();
DividerSnapAlgorithm.SnapTarget currentTarget = snapAlgorithm.calculateNonDismissingSnapTarget(dividerPosition);
int increment = (shortcutCode == SC_DOCK_LEFT) ? -1 : 1;
DividerSnapAlgorithm.SnapTarget target = snapAlgorithm.cycleNonDismissTarget(currentTarget, increment);
dividerView.startDragging(true, /* animate */
false);
dividerView.stopDragging(target.position, 0f, true, /* avoidDismissStart */
true);
}
} catch (RemoteException e) {
Log.e(TAG, "handleDockKey() failed.");
}
}
use of com.android.systemui.stackdivider.DividerView in project android_frameworks_base by ResurrectionRemix.
the class ShortcutKeyDispatcher method handleDockKey.
private void handleDockKey(long shortcutCode) {
try {
int dockSide = mWindowManagerService.getDockedStackSide();
if (dockSide == WindowManager.DOCKED_INVALID) {
// If there is no window docked, we dock the top-most window.
Recents recents = getComponent(Recents.class);
int dockMode = (shortcutCode == SC_DOCK_LEFT) ? ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT : ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
recents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE, dockMode, null, MetricsEvent.WINDOW_DOCK_SHORTCUTS);
} else {
// If there is already a docked window, we respond by resizing the docking pane.
DividerView dividerView = getComponent(Divider.class).getView();
DividerSnapAlgorithm snapAlgorithm = dividerView.getSnapAlgorithm();
int dividerPosition = dividerView.getCurrentPosition();
DividerSnapAlgorithm.SnapTarget currentTarget = snapAlgorithm.calculateNonDismissingSnapTarget(dividerPosition);
int increment = (shortcutCode == SC_DOCK_LEFT) ? -1 : 1;
DividerSnapAlgorithm.SnapTarget target = snapAlgorithm.cycleNonDismissTarget(currentTarget, increment);
dividerView.startDragging(true, /* animate */
false);
dividerView.stopDragging(target.position, 0f, true, /* avoidDismissStart */
true);
}
} catch (RemoteException e) {
Log.e(TAG, "handleDockKey() failed.");
}
}
use of com.android.systemui.stackdivider.DividerView in project android_frameworks_base by crdroidandroid.
the class ShortcutKeyDispatcher method handleDockKey.
private void handleDockKey(long shortcutCode) {
try {
int dockSide = mWindowManagerService.getDockedStackSide();
if (dockSide == WindowManager.DOCKED_INVALID) {
// If there is no window docked, we dock the top-most window.
Recents recents = getComponent(Recents.class);
int dockMode = (shortcutCode == SC_DOCK_LEFT) ? ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT : ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
recents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE, dockMode, null, MetricsEvent.WINDOW_DOCK_SHORTCUTS);
} else {
// If there is already a docked window, we respond by resizing the docking pane.
DividerView dividerView = getComponent(Divider.class).getView();
DividerSnapAlgorithm snapAlgorithm = dividerView.getSnapAlgorithm();
int dividerPosition = dividerView.getCurrentPosition();
DividerSnapAlgorithm.SnapTarget currentTarget = snapAlgorithm.calculateNonDismissingSnapTarget(dividerPosition);
int increment = (shortcutCode == SC_DOCK_LEFT) ? -1 : 1;
DividerSnapAlgorithm.SnapTarget target = snapAlgorithm.cycleNonDismissTarget(currentTarget, increment);
dividerView.startDragging(true, /* animate */
false);
dividerView.stopDragging(target.position, 0f, true, /* avoidDismissStart */
true);
}
} catch (RemoteException e) {
Log.e(TAG, "handleDockKey() failed.");
}
}
use of com.android.systemui.stackdivider.DividerView in project android_frameworks_base by AOSPA.
the class ShortcutKeyDispatcher method handleDockKey.
private void handleDockKey(long shortcutCode) {
try {
int dockSide = mWindowManagerService.getDockedStackSide();
if (dockSide == WindowManager.DOCKED_INVALID) {
// If there is no window docked, we dock the top-most window.
Recents recents = getComponent(Recents.class);
int dockMode = (shortcutCode == SC_DOCK_LEFT) ? ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT : ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
recents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE, dockMode, null, MetricsEvent.WINDOW_DOCK_SHORTCUTS);
} else {
// If there is already a docked window, we respond by resizing the docking pane.
DividerView dividerView = getComponent(Divider.class).getView();
DividerSnapAlgorithm snapAlgorithm = dividerView.getSnapAlgorithm();
int dividerPosition = dividerView.getCurrentPosition();
DividerSnapAlgorithm.SnapTarget currentTarget = snapAlgorithm.calculateNonDismissingSnapTarget(dividerPosition);
int increment = (shortcutCode == SC_DOCK_LEFT) ? -1 : 1;
DividerSnapAlgorithm.SnapTarget target = snapAlgorithm.cycleNonDismissTarget(currentTarget, increment);
dividerView.startDragging(true, /* animate */
false);
dividerView.stopDragging(target.position, 0f, true, /* avoidDismissStart */
true);
}
} catch (RemoteException e) {
Log.e(TAG, "handleDockKey() failed.");
}
}
Aggregations