Highlighting sectioned apps on fast-scroll.
- This CL fixes an old assumption we had about the height
of rows in AllApps, and ensures that we account for the
difference in height between the predictive icons and the
normal icons.
- In addition, we refactor FastBitmapDrawable to have multiple
states, which it manages in drawing itself, including the
press state and fast scroll focus states. And we also refactor
some of the fast scroll logic in the all apps recycler view
out to its own class.
Change-Id: I1988159b2767df733bbbfc7dc601859cde6c9943
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index e97f017..370f695 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -46,6 +46,7 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
@@ -4677,6 +4678,18 @@
UserHandleCompat.myUserHandle());
}
+ /**
+ * Generates a dummy AppInfo for us to use to calculate BubbleTextView sizes.
+ */
+ public AppInfo createDummyAppInfo() {
+ Intent intent = new Intent();
+ intent.setComponent(new ComponentName(this, Launcher.class));
+ PackageManager pm = getPackageManager();
+ ResolveInfo info = pm.resolveActivity(intent, 0);
+ return new AppInfo(this, LauncherActivityInfoCompat.fromResolveInfo(info, this),
+ UserHandleCompat.myUserHandle(), mIconCache);
+ }
+
// TODO: This method should be a part of LauncherSearchCallback
public void startDrag(View dragView, ItemInfo dragInfo, DragSource source) {
dragView.setTag(dragInfo);