Generalize the icon popup menu types.

Generalized popup menu types and logic to allow wider uses outside of launcher.

Bug: 198438631
Test: long pressed launcher icons and pressed menu options
Change-Id: Iadcbb1796496c0061dcee362784e426ff55dc94a
This commit is contained in:
Schneider Victor-tulias
2021-10-15 14:43:54 -07:00
parent 22762d91cd
commit 16e04e29d2
10 changed files with 47 additions and 33 deletions
@@ -30,6 +30,7 @@ import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.FolderInfo;
@@ -298,7 +299,7 @@ public class HotseatEduController {
Log.e(TAG, "Unable to find suitable view for ArrowTip");
return false;
}
Rect bounds = mLauncher.getViewBounds(tipTargetView);
Rect bounds = Utilities.getViewBounds(tipTargetView);
new ArrowTipView(mLauncher).show(message, Gravity.END, bounds.centerX(), bounds.top);
return true;
}
@@ -377,7 +377,7 @@ public final class WellbeingModel extends BgObjectWithLooper {
/**
* Shortcut factory for generating wellbeing action
*/
public static final SystemShortcut.Factory SHORTCUT_FACTORY =
public static final SystemShortcut.Factory<BaseDraggingActivity> SHORTCUT_FACTORY =
(activity, info) -> (info.getTargetComponent() == null) ? null : INSTANCE.get(activity)
.getShortcutForApp(
info.getTargetComponent().getPackageName(), info.user.getIdentifier(),
@@ -128,7 +128,7 @@ public interface TaskShortcutFactory {
}
}
class MultiWindowSystemShortcut extends SystemShortcut {
class MultiWindowSystemShortcut extends SystemShortcut<BaseDraggingActivity> {
private Handler mHandler;
@@ -305,7 +305,7 @@ public interface TaskShortcutFactory {
return new PinSystemShortcut(activity, taskContainer);
};
class PinSystemShortcut extends SystemShortcut {
class PinSystemShortcut extends SystemShortcut<BaseDraggingActivity> {
private static final String TAG = "PinSystemShortcut";