mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Add support for launcher shortcuts.
- This CL has no UI but provides the necessary backing for one. - Adds new item type: ITEM_TYPE_DEEP_SHORTCUT, to distinguish from ITEM_TYPE_SHORTCUT. We can reconsider these names. - Adds ShortcutCache, using LruCache for up to 30 dynamic shortcuts (pinned shortcuts are always cached in a HashMap). - DeepShortcutManager queries for shortcuts and other things like pin them. In a future CL it will use the cache, but for now it simply makes an RPC for all queries. - LauncherModel maintains counts for pinned shortcuts, pinning and unpinning when counts reach 1 or 0, respectively. - LauncherModel maintains a map of components to lists of shortcut ids, which Launcher gets a copy of after it is changed in the background. This will allow us to know how many shortcuts an app has immediately, and query for details as the UI is animating. Change-Id: Ic526f374dd10d72a261bae67f07f098fca8d8bca
This commit is contained in:
@@ -158,7 +158,7 @@ public class BubbleTextView extends TextView
|
||||
if (info.isDisabled()) {
|
||||
iconDrawable.setState(FastBitmapDrawable.State.DISABLED);
|
||||
}
|
||||
setIcon(iconDrawable, mIconSize);
|
||||
setIcon(iconDrawable);
|
||||
if (info.contentDescription != null) {
|
||||
setContentDescription(info.contentDescription);
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public class BubbleTextView extends TextView
|
||||
if (info.isDisabled()) {
|
||||
iconDrawable.setState(FastBitmapDrawable.State.DISABLED);
|
||||
}
|
||||
setIcon(iconDrawable, mIconSize);
|
||||
setIcon(iconDrawable);
|
||||
setText(info.title);
|
||||
if (info.contentDescription != null) {
|
||||
setContentDescription(info.contentDescription);
|
||||
@@ -188,7 +188,7 @@ public class BubbleTextView extends TextView
|
||||
}
|
||||
|
||||
public void applyFromPackageItemInfo(PackageItemInfo info) {
|
||||
setIcon(mLauncher.createIconDrawable(info.iconBitmap), mIconSize);
|
||||
setIcon(mLauncher.createIconDrawable(info.iconBitmap));
|
||||
setText(info.title);
|
||||
if (info.contentDescription != null) {
|
||||
setContentDescription(info.contentDescription);
|
||||
@@ -205,7 +205,7 @@ public class BubbleTextView extends TextView
|
||||
*/
|
||||
public void applyDummyInfo() {
|
||||
ColorDrawable d = new ColorDrawable();
|
||||
setIcon(mLauncher.resizeIconDrawable(d), mIconSize);
|
||||
setIcon(mLauncher.resizeIconDrawable(d));
|
||||
setText("");
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ public class BubbleTextView extends TextView
|
||||
preloadDrawable = (PreloadIconDrawable) mIcon;
|
||||
} else {
|
||||
preloadDrawable = new PreloadIconDrawable(mIcon, getPreloaderTheme());
|
||||
setIcon(preloadDrawable, mIconSize);
|
||||
setIcon(preloadDrawable);
|
||||
}
|
||||
|
||||
preloadDrawable.setLevel(progressLevel);
|
||||
@@ -506,10 +506,10 @@ public class BubbleTextView extends TextView
|
||||
* Sets the icon for this view based on the layout direction.
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||
private Drawable setIcon(Drawable icon, int iconSize) {
|
||||
public void setIcon(Drawable icon) {
|
||||
mIcon = icon;
|
||||
if (iconSize != -1) {
|
||||
mIcon.setBounds(0, 0, iconSize, iconSize);
|
||||
if (mIconSize != -1) {
|
||||
mIcon.setBounds(0, 0, mIconSize, mIconSize);
|
||||
}
|
||||
if (mLayoutHorizontal) {
|
||||
if (Utilities.ATLEAST_JB_MR1) {
|
||||
@@ -520,7 +520,6 @@ public class BubbleTextView extends TextView
|
||||
} else {
|
||||
setCompoundDrawables(null, mIcon, null, null);
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user