App list: fixes from the pre-release audit
- Scrub from home works right after the launcher starts. The home edge band was measured from the alphabet's own view, which has no size until the app list has been shown once (emulator: it now opens at a letter straight after an install). It no longer takes over per-icon swipe gestures on icons at the edge. - Holding to scrub no longer undoes "Remember position", and the remembered place is saved and restored in the same unit. - Notification previews: no text Android itself would hide (secret notifications, and work-profile ones the ranking redacts); right after changes made while the launcher was in the background; also for rows held in the list's view cache; only redrawn when the line changed; read by TalkBack; set through BubbleTextView's own label handling. - Light theme: search results, the empty state and the search field are readable on the always-dark backdrop (emulator). - Hide app is not offered for Private Space apps, where it could not work, and Private Space adds no blank stop to the alphabet. - Canvas-drawn letters follow Android's Bold text setting. - TalkBack list positions ignore the letter headers; the one-column list stays one column on foldables in two-panel mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f79b503ffb
commit
4efe37ef9c
18 files changed
+525
-97
No files matched your search
@@ -17,6 +17,8 @@ package com.android.launcher3.allapps;
|
||||
|
||||
import static com.android.launcher3.model.data.AppInfo.COMPONENT_KEY_COMPARATOR;
|
||||
import static com.android.launcher3.model.data.AppInfo.EMPTY_ARRAY;
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED;
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_SHOW_DOWNLOAD_PROGRESS_MASK;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
@@ -26,10 +28,13 @@ import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.ItemInfoWithIcon;
|
||||
import com.android.launcher3.recyclerview.AllAppsRecyclerViewPool;
|
||||
import com.android.launcher3.util.ComponentKey;
|
||||
import com.android.launcher3.util.PackageUserKey;
|
||||
@@ -73,6 +78,33 @@ public class AllAppsStore<T extends Context & ActivityContext> {
|
||||
private boolean mUpdatePending = false;
|
||||
private final AllAppsRecyclerViewPool mAllAppsRecyclerViewPool = new AllAppsRecyclerViewPool();
|
||||
|
||||
// Flexera Launcher: an app row of the drawer list that scrolls back from the list's cache of
|
||||
// views is attached again without being bound. Dot and notification preview (PRD AD-11)
|
||||
// updates reach attached rows only, so a row that has a dot, or should have one now, looks
|
||||
// at both again whenever it is attached, which is also right after it is bound. Binding
|
||||
// describes a download, or an archived app, after the dot, so such a row keeps the
|
||||
// description it has. Rows without a dot are left as bound.
|
||||
private final RecyclerView.OnChildAttachStateChangeListener mDotRefresher =
|
||||
new RecyclerView.OnChildAttachStateChangeListener() {
|
||||
@Override
|
||||
public void onChildViewAttachedToWindow(@NonNull View view) {
|
||||
if (view instanceof BubbleTextView icon
|
||||
&& icon.getTag(R.id.flexera_drawer_row) != null
|
||||
&& icon.getTag() instanceof ItemInfoWithIcon info
|
||||
&& (icon.hasDot() || mContext.getDotInfoForItem(info) != null)) {
|
||||
CharSequence description = icon.getContentDescription();
|
||||
icon.applyDotState(info, false /* animate */);
|
||||
if ((info.runtimeStatusFlags
|
||||
& (FLAG_ARCHIVED | FLAG_SHOW_DOWNLOAD_PROGRESS_MASK)) != 0) {
|
||||
icon.setContentDescription(description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChildViewDetachedFromWindow(@NonNull View view) { }
|
||||
};
|
||||
|
||||
private final T mContext;
|
||||
|
||||
public AppInfo[] getApps() {
|
||||
@@ -207,11 +239,19 @@ public class AllAppsStore<T extends Context & ActivityContext> {
|
||||
public void registerIconContainer(ViewGroup container) {
|
||||
if (container != null && !mIconContainers.contains(container)) {
|
||||
mIconContainers.add(container);
|
||||
// Flexera Launcher: see mDotRefresher.
|
||||
if (container instanceof RecyclerView list) {
|
||||
list.addOnChildAttachStateChangeListener(mDotRefresher);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterIconContainer(ViewGroup container) {
|
||||
mIconContainers.remove(container);
|
||||
// Flexera Launcher: see mDotRefresher.
|
||||
if (container instanceof RecyclerView list) {
|
||||
list.removeOnChildAttachStateChangeListener(mDotRefresher);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateNotificationDots(Predicate<PackageUserKey> updatedDots) {
|
||||
@@ -225,6 +265,20 @@ public class AllAppsStore<T extends Context & ActivityContext> {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Flexera Launcher: shows the latest notification text again under the names of the matching
|
||||
* rows of the drawer list (PRD AD-11), leaving their dots alone.
|
||||
*/
|
||||
public void updateNotificationPreviews(Predicate<PackageUserKey> updatedPreviews) {
|
||||
updateAllIcons((child) -> {
|
||||
if (child.getTag() instanceof ItemInfo info
|
||||
&& mTempKey.updateFromItemInfo(info) && updatedPreviews.test(mTempKey)) {
|
||||
app.flexera.drawer.FlexeraNotificationPreview.apply(
|
||||
child, info, mContext.getDotInfoForItem(info));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the AppInfo's associated icon's progress bar.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user