mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Track bottom of the app window when ENABLE_OVERVIEW_ACTIONS is true" into ub-launcher3-master
This commit is contained in:
committed by
Android (Google) Code Review
commit
14bd192275
@@ -17,6 +17,7 @@ package com.android.quickstep;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL_1_5;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
|
||||
@@ -75,9 +76,11 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
|
||||
protected static final Rect TEMP_RECT = new Rect();
|
||||
|
||||
// Start resisting when swiping past this factor of mTransitionDragLength.
|
||||
private static final float DRAG_LENGTH_FACTOR_START_PULLBACK = 1.4f;
|
||||
private static final float DRAG_LENGTH_FACTOR_START_PULLBACK = ENABLE_OVERVIEW_ACTIONS.get()
|
||||
? 2.8f : 1.4f;
|
||||
// This is how far down we can scale down, where 0f is full screen and 1f is recents.
|
||||
private static final float DRAG_LENGTH_FACTOR_MAX_PULLBACK = 1.8f;
|
||||
private static final float DRAG_LENGTH_FACTOR_MAX_PULLBACK = ENABLE_OVERVIEW_ACTIONS.get()
|
||||
? 3.6f : 1.8f;
|
||||
private static final Interpolator PULLBACK_INTERPOLATOR = DEACCEL;
|
||||
|
||||
// The distance needed to drag to reach the task size in recents.
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.quickstep.util;
|
||||
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -26,7 +28,6 @@ import androidx.annotation.IntDef;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.quickstep.SysUINavigationMode;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -58,7 +59,7 @@ public class LayoutUtils {
|
||||
} else {
|
||||
Resources res = context.getResources();
|
||||
|
||||
if (FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get()) {
|
||||
if (ENABLE_OVERVIEW_ACTIONS.get()) {
|
||||
//TODO: this needs to account for the swipe gesture height and accessibility
|
||||
// UI when shown.
|
||||
extraSpace = 0;
|
||||
@@ -111,7 +112,7 @@ public class LayoutUtils {
|
||||
final int paddingResId;
|
||||
if (dp.isVerticalBarLayout()) {
|
||||
paddingResId = R.dimen.landscape_task_card_horz_space;
|
||||
} else if (FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get()) {
|
||||
} else if (ENABLE_OVERVIEW_ACTIONS.get()) {
|
||||
paddingResId = R.dimen.portrait_task_card_horz_space_big_overview;
|
||||
} else {
|
||||
paddingResId = R.dimen.portrait_task_card_horz_space;
|
||||
@@ -146,6 +147,11 @@ public class LayoutUtils {
|
||||
|
||||
public static int getShelfTrackingDistance(Context context, DeviceProfile dp) {
|
||||
// Track the bottom of the window.
|
||||
if (ENABLE_OVERVIEW_ACTIONS.get()) {
|
||||
Rect taskSize = new Rect();
|
||||
calculateLauncherTaskSize(context, dp, taskSize);
|
||||
return (dp.heightPx - taskSize.height()) / 2;
|
||||
}
|
||||
int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom;
|
||||
int spaceBetweenShelfAndRecents = (int) context.getResources().getDimension(
|
||||
R.dimen.task_card_vert_space);
|
||||
@@ -157,7 +163,7 @@ public class LayoutUtils {
|
||||
* @return the margin in pixels.
|
||||
*/
|
||||
public static int thumbnailBottomMargin(Resources resources) {
|
||||
if (FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get()) {
|
||||
if (ENABLE_OVERVIEW_ACTIONS.get()) {
|
||||
return resources.getDimensionPixelSize(R.dimen.overview_actions_height);
|
||||
} else {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user