mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Merge "VisD update for the PipAppIconOverlay 2/N" into tm-qpr-dev
This commit is contained in:
@@ -172,7 +172,6 @@ import com.android.quickstep.views.FloatingTaskView;
|
||||
import com.android.quickstep.views.OverviewActionsView;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
import com.android.quickstep.views.TaskView;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.unfold.RemoteUnfoldSharedComponent;
|
||||
import com.android.systemui.unfold.UnfoldSharedComponent;
|
||||
@@ -192,7 +191,6 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -1219,11 +1217,18 @@ public class QuickstepLauncher extends Launcher {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeviceProfileInitiated() {
|
||||
super.onDeviceProfileInitiated();
|
||||
SystemUiProxy.INSTANCE.get(this).setLauncherAppIconSize(mDeviceProfile.iconSizePx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchDeviceProfileChanged() {
|
||||
super.dispatchDeviceProfileChanged();
|
||||
Trace.instantForTrack(TRACE_TAG_APP, "QuickstepLauncher#DeviceProfileChanged",
|
||||
getDeviceProfile().toSmallString());
|
||||
SystemUiProxy.INSTANCE.get(this).setLauncherAppIconSize(mDeviceProfile.iconSizePx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1602,6 +1602,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
.setContext(mContext)
|
||||
.setTaskId(runningTaskTarget.taskId)
|
||||
.setActivityInfo(taskInfo.topActivityInfo)
|
||||
.setAppIconSizePx(mDp.iconSizePx)
|
||||
.setLeash(runningTaskTarget.leash)
|
||||
.setSourceRectHint(
|
||||
runningTaskTarget.taskInfo.pictureInPictureParams.getSourceRectHint())
|
||||
|
||||
@@ -546,6 +546,19 @@ public class SystemUiProxy implements ISystemUiProxy {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the app icon size in pixel used by Launcher all apps.
|
||||
*/
|
||||
public void setLauncherAppIconSize(int iconSizePx) {
|
||||
if (mPip != null) {
|
||||
try {
|
||||
mPip.setLauncherAppIconSize(iconSizePx);
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "Failed call setLauncherAppIconSize", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Splitscreen
|
||||
//
|
||||
|
||||
@@ -94,6 +94,7 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim {
|
||||
* @param taskId Task id associated with this animator, see also {@link #getTaskId()}
|
||||
* @param activityInfo {@link ActivityInfo} associated with this animator,
|
||||
* see also {@link #getComponentName()}
|
||||
* @param appIconSizePx The size in pixel for the app icon in content overlay
|
||||
* @param leash {@link SurfaceControl} this animator operates on
|
||||
* @param sourceRectHint See the definition in {@link android.app.PictureInPictureParams}
|
||||
* @param appBounds Bounds of the application, sourceRectHint is based on this bounds
|
||||
@@ -111,6 +112,7 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim {
|
||||
private SwipePipToHomeAnimator(@NonNull Context context,
|
||||
int taskId,
|
||||
@NonNull ActivityInfo activityInfo,
|
||||
int appIconSizePx,
|
||||
@NonNull SurfaceControl leash,
|
||||
@Nullable Rect sourceRectHint,
|
||||
@NonNull Rect appBounds,
|
||||
@@ -153,7 +155,8 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim {
|
||||
if (SystemProperties.getBoolean(
|
||||
"persist.wm.debug.enable_pip_app_icon_overlay", true)) {
|
||||
mPipContentOverlay = new PipContentOverlay.PipAppIconOverlay(view.getContext(),
|
||||
mAppBounds, () -> new IconProvider(context).getIcon(mActivityInfo));
|
||||
mAppBounds, new IconProvider(context).getIcon(mActivityInfo),
|
||||
appIconSizePx);
|
||||
} else {
|
||||
mPipContentOverlay = new PipContentOverlay.PipColorOverlay(view.getContext());
|
||||
}
|
||||
@@ -317,6 +320,7 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim {
|
||||
private Context mContext;
|
||||
private int mTaskId;
|
||||
private ActivityInfo mActivityInfo;
|
||||
private int mAppIconSizePx;
|
||||
private SurfaceControl mLeash;
|
||||
private Rect mSourceRectHint;
|
||||
private Rect mDisplayCutoutInsets;
|
||||
@@ -345,6 +349,11 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAppIconSizePx(int appIconSizePx) {
|
||||
mAppIconSizePx = appIconSizePx;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setLeash(SurfaceControl leash) {
|
||||
mLeash = leash;
|
||||
return this;
|
||||
@@ -425,8 +434,8 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim {
|
||||
mAppBounds.inset(mDisplayCutoutInsets);
|
||||
}
|
||||
}
|
||||
return new SwipePipToHomeAnimator(mContext, mTaskId, mActivityInfo, mLeash,
|
||||
mSourceRectHint, mAppBounds,
|
||||
return new SwipePipToHomeAnimator(mContext, mTaskId, mActivityInfo, mAppIconSizePx,
|
||||
mLeash, mSourceRectHint, mAppBounds,
|
||||
mHomeToWindowPositionMap, mStartBounds, mDestinationBounds,
|
||||
mFromRotation, mDestinationBoundsTransformed,
|
||||
mCornerRadius, mShadowRadius, mAttachedView);
|
||||
|
||||
Reference in New Issue
Block a user