mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Shorten app title in overview icon app chip menu." into main
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.android.quickstep;
|
||||
|
||||
import static com.android.launcher3.Flags.enableOverviewIconMenu;
|
||||
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
@@ -120,6 +121,7 @@ public class TaskIconCache implements DisplayInfoChangeListener {
|
||||
public void handleResult(TaskCacheEntry result) {
|
||||
task.icon = result.icon;
|
||||
task.titleDescription = result.contentDescription;
|
||||
task.title = result.title;
|
||||
callback.accept(task);
|
||||
dispatchIconUpdate(task.key.id);
|
||||
}
|
||||
@@ -190,6 +192,10 @@ public class TaskIconCache implements DisplayInfoChangeListener {
|
||||
if (activityInfo != null) {
|
||||
entry.contentDescription = getBadgedContentDescription(
|
||||
activityInfo, task.key.userId, task.taskDescription);
|
||||
if (enableOverviewIconMenu()) {
|
||||
entry.title = Utilities.trim(
|
||||
activityInfo.applicationInfo.loadLabel(mContext.getPackageManager()));
|
||||
}
|
||||
}
|
||||
|
||||
mIconCache.put(task.key, entry);
|
||||
@@ -280,6 +286,7 @@ public class TaskIconCache implements DisplayInfoChangeListener {
|
||||
private static class TaskCacheEntry {
|
||||
public Drawable icon;
|
||||
public String contentDescription = "";
|
||||
public String title = "";
|
||||
}
|
||||
|
||||
void registerTaskVisualsChangeListener(TaskVisualsChangeListener newListener) {
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.android.launcher3.util.TransformingTouchDelegate;
|
||||
import com.android.quickstep.RecentsModel;
|
||||
import com.android.quickstep.TaskIconCache;
|
||||
import com.android.quickstep.TaskThumbnailCache;
|
||||
import com.android.quickstep.TaskUtils;
|
||||
import com.android.quickstep.util.CancellableTask;
|
||||
import com.android.quickstep.util.RecentsOrientedState;
|
||||
import com.android.quickstep.util.SplitSelectStateController;
|
||||
@@ -170,7 +169,7 @@ public class GroupedTaskView extends TaskView {
|
||||
(task) -> {
|
||||
setIcon(mIconView2, task.icon);
|
||||
if (enableOverviewIconMenu()) {
|
||||
setText(mIconView2, TaskUtils.getTitle(getContext(), task));
|
||||
setText(mIconView2, task.title);
|
||||
}
|
||||
mDigitalWellBeingToast2.initialize(mSecondaryTask);
|
||||
mDigitalWellBeingToast2.setSplitConfiguration(mSplitBoundsConfig);
|
||||
|
||||
@@ -1096,7 +1096,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
(task) -> {
|
||||
setIcon(mIconView, task.icon);
|
||||
if (enableOverviewIconMenu()) {
|
||||
setText(mIconView, TaskUtils.getTitle(getContext(), task));
|
||||
setText(mIconView, task.title);
|
||||
}
|
||||
mDigitalWellBeingToast.initialize(task);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user