Merge changes I7b9e6e7f,I9729cd40 into sc-dev am: 51b35256d2 am: ae054d8584
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14800258 Change-Id: I775c0edcfe403c854a7c87104fa9aba78761f18d
This commit is contained in:
+11
-1
@@ -51,7 +51,7 @@ import com.android.quickstep.views.RecentsView;
|
||||
* first home screen instead of to Overview.
|
||||
*/
|
||||
public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouchController {
|
||||
|
||||
private static final float ONE_HANDED_ACTIVATED_SLOP_MULTIPLIER = 2.5f;
|
||||
|
||||
// How much of the movement to use for translating overview after swipe and hold.
|
||||
private static final float OVERVIEW_MOVEMENT_FACTOR = 0.25f;
|
||||
@@ -260,4 +260,14 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch
|
||||
private float dpiFromPx(float pixels) {
|
||||
return Utilities.dpiFromPx(pixels, mLauncher.getResources().getDisplayMetrics().densityDpi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOneHandedModeStateChanged(boolean activated) {
|
||||
if (activated) {
|
||||
mDetector.setTouchSlopMultiplier(ONE_HANDED_ACTIVATED_SLOP_MULTIPLIER);
|
||||
} else {
|
||||
// Reset touch slop multiplier to default 1.0f
|
||||
mDetector.setTouchSlopMultiplier(1f /* default */);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,6 +114,9 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
|
||||
public abstract void onAssistantVisibilityChanged(float visibility);
|
||||
|
||||
/** Called when one handed mode activated or deactivated. */
|
||||
public abstract void onOneHandedModeStateChanged(boolean activated);
|
||||
|
||||
public abstract AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState,
|
||||
boolean activityVisible, Consumer<AnimatorControllerWithResistance> callback);
|
||||
|
||||
|
||||
@@ -73,6 +73,11 @@ public final class FallbackActivityInterface extends
|
||||
// set to zero prior to this class becoming active.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOneHandedModeStateChanged(boolean activated) {
|
||||
// Do nothing for FallbackActivityInterface
|
||||
}
|
||||
|
||||
/** 6 */
|
||||
@Override
|
||||
public AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState,
|
||||
|
||||
@@ -104,6 +104,15 @@ public final class LauncherActivityInterface extends
|
||||
launcher.onAssistantVisibilityChanged(visibility);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOneHandedModeStateChanged(boolean activated) {
|
||||
Launcher launcher = getCreatedActivity();
|
||||
if (launcher == null) {
|
||||
return;
|
||||
}
|
||||
launcher.onOneHandedStateChanged(activated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState,
|
||||
boolean activityVisible, Consumer<AnimatorControllerWithResistance> callback) {
|
||||
|
||||
@@ -111,6 +111,11 @@ public final class OverviewComponentObserver {
|
||||
if (mDeviceState.isHomeDisabled() != mIsHomeDisabled) {
|
||||
updateOverviewTargets();
|
||||
}
|
||||
|
||||
// Notify ALL_APPS touch controller when one handed mode state activated or deactivated
|
||||
if (mDeviceState.isOneHandedModeEnabled()) {
|
||||
mActivityInterface.onOneHandedModeStateChanged(mDeviceState.isOneHandedModeActive());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateOverviewTargets(Intent unused) {
|
||||
|
||||
Reference in New Issue
Block a user