mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Add Hotseat items to Taskbar
- Currently supports WorkspaceItemInfo (e.g. normal app icons including hotseat predictions and pinned deep shortcuts). - Currently doesn't support Folders, Notification dots, or long press. Some technical details: - Always allow HotseatPredictionController updates given the Hotseat is always showing even when Launcher is stopped. - Represent Taskbar Hotseat items as BubbleTextViews, to allow for normal click handling etc. When the hotseat is updated, we reuse the same BubbleTextViews that were initially inflated, and just reapply the new info. - Add new BubbleTextView iconDisplay for Taskbar, to allow for different treatment such as icon size. Bug: 171917176 Change-Id: I325eb39051f2dc69228b39b5c40ed0cbdad8e200
This commit is contained in:
@@ -92,6 +92,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
private static final int DISPLAY_ALL_APPS = 1;
|
||||
private static final int DISPLAY_FOLDER = 2;
|
||||
private static final int DISPLAY_HERO_APP = 5;
|
||||
protected static final int DISPLAY_TASKBAR = 6;
|
||||
|
||||
private static final int[] STATE_PRESSED = new int[]{android.R.attr.state_pressed};
|
||||
private static final float HIGHLIGHT_SCALE = 1.16f;
|
||||
@@ -140,7 +141,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
private Drawable mIcon;
|
||||
private boolean mCenterVertically;
|
||||
|
||||
private final int mDisplay;
|
||||
protected final int mDisplay;
|
||||
|
||||
private final CheckLongPressHelper mLongPressHelper;
|
||||
|
||||
@@ -206,6 +207,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
defaultIconSize = grid.folderChildIconSizePx;
|
||||
} else if (mDisplay == DISPLAY_HERO_APP) {
|
||||
defaultIconSize = grid.allAppsIconSizePx;
|
||||
} else if (mDisplay == DISPLAY_TASKBAR) {
|
||||
defaultIconSize = grid.iconSizePx;
|
||||
} else {
|
||||
// widget_selection or shortcut_popup
|
||||
defaultIconSize = grid.iconSizePx;
|
||||
@@ -487,6 +490,10 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
* @param canvas The canvas to draw to.
|
||||
*/
|
||||
protected void drawDotIfNecessary(Canvas canvas) {
|
||||
if (mDisplay == DISPLAY_TASKBAR) {
|
||||
// TODO: support notification dots in Taskbar
|
||||
return;
|
||||
}
|
||||
if (!mForceHideDot && (hasDot() || mDotParams.scale > 0)) {
|
||||
getIconBounds(mDotParams.iconBounds);
|
||||
Utilities.scaleRectAboutCenter(mDotParams.iconBounds,
|
||||
|
||||
Reference in New Issue
Block a user