Loading quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java +18 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,18 @@ package com.android.launcher3.uioverrides; import android.app.Person; import android.appwidget.AppWidgetHost; import android.content.pm.ShortcutInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.Utilities; import com.android.launcher3.widget.LauncherAppWidgetHost; /** * A wrapper for the hidden API calls */ public class ApiWrapper { public static final boolean TASKBAR_DRAWN_IN_PROCESS = true; Loading @@ -29,4 +37,14 @@ public class ApiWrapper { Person[] persons = si.getPersons(); return persons == null ? Utilities.EMPTY_PERSON_ARRAY : persons; } /** * Set the interaction handler for the host * @param host AppWidgetHost that needs the interaction handler * @param handler InteractionHandler for the views in the host */ public static void setHostInteractionHandler(@NonNull AppWidgetHost host, @Nullable LauncherAppWidgetHost.LauncherWidgetInteractionHandler handler) { host.setInteractionHandler(handler::onInteraction); } } quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java +3 −1 Original line number Diff line number Diff line Loading @@ -33,10 +33,12 @@ import com.android.launcher3.Utilities; import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.util.ActivityOptionsWrapper; import com.android.launcher3.widget.LauncherAppWidgetHost; import com.android.launcher3.widget.LauncherAppWidgetHostView; /** Provides a Quickstep specific animation when launching an activity from an app widget. */ class QuickstepInteractionHandler implements RemoteViews.InteractionHandler { class QuickstepInteractionHandler implements LauncherAppWidgetHost.LauncherWidgetInteractionHandler { private static final String TAG = "QuickstepInteractionHandler"; Loading quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +2 −1 Original line number Diff line number Diff line Loading @@ -490,7 +490,8 @@ public class QuickstepLauncher extends Launcher { protected LauncherAppWidgetHost createAppWidgetHost() { LauncherAppWidgetHost appWidgetHost = super.createAppWidgetHost(); appWidgetHost.setInteractionHandler(new QuickstepInteractionHandler(this)); ApiWrapper.setHostInteractionHandler(appWidgetHost, new QuickstepInteractionHandler(this)); return appWidgetHost; } Loading src/com/android/launcher3/widget/LauncherAppWidgetHost.java +20 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.widget; import static android.app.Activity.RESULT_CANCELED; import android.app.PendingIntent; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHostView; import android.appwidget.AppWidgetManager; Loading @@ -28,6 +29,7 @@ import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.util.SparseArray; import android.view.View; import android.widget.RemoteViews; import android.widget.Toast; Loading Loading @@ -80,6 +82,24 @@ public class LauncherAppWidgetHost extends AppWidgetHost { private IntConsumer mAppWidgetRemovedCallback = null; /** * This serves for the purpose of getting rid of the hidden API calling of InteractionHandler */ public interface LauncherWidgetInteractionHandler { /** * Invoked when the user performs an interaction on the View. * * @param view the View with which the user interacted * @param pendingIntent the base PendingIntent associated with the view * @param response the response to the interaction, which knows how to fill in the * attached PendingIntent */ boolean onInteraction( View view, PendingIntent pendingIntent, RemoteViews.RemoteResponse response); } public LauncherAppWidgetHost(Context context) { this(context, null); } Loading src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java +18 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,18 @@ package com.android.launcher3.uioverrides; import android.app.Person; import android.appwidget.AppWidgetHost; import android.content.pm.ShortcutInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.Utilities; import com.android.launcher3.widget.LauncherAppWidgetHost; /** * A wrapper for the hidden API calls */ public class ApiWrapper { public static final boolean TASKBAR_DRAWN_IN_PROCESS = false; Loading @@ -28,4 +36,14 @@ public class ApiWrapper { public static Person[] getPersons(ShortcutInfo si) { return Utilities.EMPTY_PERSON_ARRAY; } /** * Set the interaction handler for the host * @param host AppWidgetHost that needs the interaction handler * @param handler InteractionHandler for the views in the host */ public static void setHostInteractionHandler(@NonNull AppWidgetHost host, @Nullable LauncherAppWidgetHost.LauncherWidgetInteractionHandler handler) { // No-op } } Loading
quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java +18 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,18 @@ package com.android.launcher3.uioverrides; import android.app.Person; import android.appwidget.AppWidgetHost; import android.content.pm.ShortcutInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.Utilities; import com.android.launcher3.widget.LauncherAppWidgetHost; /** * A wrapper for the hidden API calls */ public class ApiWrapper { public static final boolean TASKBAR_DRAWN_IN_PROCESS = true; Loading @@ -29,4 +37,14 @@ public class ApiWrapper { Person[] persons = si.getPersons(); return persons == null ? Utilities.EMPTY_PERSON_ARRAY : persons; } /** * Set the interaction handler for the host * @param host AppWidgetHost that needs the interaction handler * @param handler InteractionHandler for the views in the host */ public static void setHostInteractionHandler(@NonNull AppWidgetHost host, @Nullable LauncherAppWidgetHost.LauncherWidgetInteractionHandler handler) { host.setInteractionHandler(handler::onInteraction); } }
quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java +3 −1 Original line number Diff line number Diff line Loading @@ -33,10 +33,12 @@ import com.android.launcher3.Utilities; import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.util.ActivityOptionsWrapper; import com.android.launcher3.widget.LauncherAppWidgetHost; import com.android.launcher3.widget.LauncherAppWidgetHostView; /** Provides a Quickstep specific animation when launching an activity from an app widget. */ class QuickstepInteractionHandler implements RemoteViews.InteractionHandler { class QuickstepInteractionHandler implements LauncherAppWidgetHost.LauncherWidgetInteractionHandler { private static final String TAG = "QuickstepInteractionHandler"; Loading
quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +2 −1 Original line number Diff line number Diff line Loading @@ -490,7 +490,8 @@ public class QuickstepLauncher extends Launcher { protected LauncherAppWidgetHost createAppWidgetHost() { LauncherAppWidgetHost appWidgetHost = super.createAppWidgetHost(); appWidgetHost.setInteractionHandler(new QuickstepInteractionHandler(this)); ApiWrapper.setHostInteractionHandler(appWidgetHost, new QuickstepInteractionHandler(this)); return appWidgetHost; } Loading
src/com/android/launcher3/widget/LauncherAppWidgetHost.java +20 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.widget; import static android.app.Activity.RESULT_CANCELED; import android.app.PendingIntent; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHostView; import android.appwidget.AppWidgetManager; Loading @@ -28,6 +29,7 @@ import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.util.SparseArray; import android.view.View; import android.widget.RemoteViews; import android.widget.Toast; Loading Loading @@ -80,6 +82,24 @@ public class LauncherAppWidgetHost extends AppWidgetHost { private IntConsumer mAppWidgetRemovedCallback = null; /** * This serves for the purpose of getting rid of the hidden API calling of InteractionHandler */ public interface LauncherWidgetInteractionHandler { /** * Invoked when the user performs an interaction on the View. * * @param view the View with which the user interacted * @param pendingIntent the base PendingIntent associated with the view * @param response the response to the interaction, which knows how to fill in the * attached PendingIntent */ boolean onInteraction( View view, PendingIntent pendingIntent, RemoteViews.RemoteResponse response); } public LauncherAppWidgetHost(Context context) { this(context, null); } Loading
src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java +18 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,18 @@ package com.android.launcher3.uioverrides; import android.app.Person; import android.appwidget.AppWidgetHost; import android.content.pm.ShortcutInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.Utilities; import com.android.launcher3.widget.LauncherAppWidgetHost; /** * A wrapper for the hidden API calls */ public class ApiWrapper { public static final boolean TASKBAR_DRAWN_IN_PROCESS = false; Loading @@ -28,4 +36,14 @@ public class ApiWrapper { public static Person[] getPersons(ShortcutInfo si) { return Utilities.EMPTY_PERSON_ARRAY; } /** * Set the interaction handler for the host * @param host AppWidgetHost that needs the interaction handler * @param handler InteractionHandler for the views in the host */ public static void setHostInteractionHandler(@NonNull AppWidgetHost host, @Nullable LauncherAppWidgetHost.LauncherWidgetInteractionHandler handler) { // No-op } }