Loading src/com/android/launcher3/InfoDropTarget.java +8 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.launcher3; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.graphics.Rect; import android.os.Bundle; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; Loading Loading @@ -60,6 +62,11 @@ public class InfoDropTarget extends UninstallDropTarget { */ public static boolean startDetailsActivityForInfo( ItemInfo info, Launcher launcher, DropTargetResultCallback callback) { return startDetailsActivityForInfo(info, launcher, callback, null, null); } public static boolean startDetailsActivityForInfo(ItemInfo info, Launcher launcher, DropTargetResultCallback callback, Rect sourceBounds, Bundle opts) { boolean result = false; ComponentName componentName = null; if (info instanceof AppInfo) { Loading @@ -74,7 +81,7 @@ public class InfoDropTarget extends UninstallDropTarget { if (componentName != null) { try { LauncherAppsCompat.getInstance(launcher) .showAppDetailsForProfile(componentName, info.user); .showAppDetailsForProfile(componentName, info.user, sourceBounds, opts); result = true; } catch (SecurityException | ActivityNotFoundException e) { Toast.makeText(launcher, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); Loading src/com/android/launcher3/Launcher.java +2 −2 Original line number Diff line number Diff line Loading @@ -2668,7 +2668,7 @@ public class Launcher extends BaseActivity } @TargetApi(Build.VERSION_CODES.M) private Bundle getActivityLaunchOptions(View v) { public Bundle getActivityLaunchOptions(View v) { if (Utilities.ATLEAST_MARSHMALLOW) { int left = 0, top = 0; int width = v.getMeasuredWidth(), height = v.getMeasuredHeight(); Loading @@ -2694,7 +2694,7 @@ public class Launcher extends BaseActivity return null; } private Rect getViewBounds(View v) { public Rect getViewBounds(View v) { int[] pos = new int[2]; v.getLocationOnScreen(pos); return new Rect(pos[0], pos[1], pos[0] + v.getWidth(), pos[1] + v.getHeight()); Loading src/com/android/launcher3/compat/LauncherAppsCompat.java +6 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,8 @@ public abstract class LauncherAppsCompat { Rect sourceBounds, Bundle opts); public abstract ApplicationInfo getApplicationInfo( String packageName, int flags, UserHandle user); public abstract void showAppDetailsForProfile(ComponentName component, UserHandle user); public abstract void showAppDetailsForProfile(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts); public abstract void addOnAppsChangedCallback(OnAppsChangedCallbackCompat listener); public abstract void removeOnAppsChangedCallback(OnAppsChangedCallbackCompat listener); public abstract boolean isPackageEnabledForProfile(String packageName, UserHandle user); Loading Loading @@ -142,4 +143,8 @@ public abstract class LauncherAppsCompat { return null; } } public void showAppDetailsForProfile(ComponentName component, UserHandle user) { showAppDetailsForProfile(component, user, null, null); } } src/com/android/launcher3/compat/LauncherAppsCompatVL.java +3 −2 Original line number Diff line number Diff line Loading @@ -95,8 +95,9 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat { } @Override public void showAppDetailsForProfile(ComponentName component, UserHandle user) { mLauncherApps.startAppDetailsActivity(component, user, null, null); public void showAppDetailsForProfile(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { mLauncherApps.startAppDetailsActivity(component, user, sourceBounds, opts); } @Override Loading src/com/android/launcher3/popup/SystemShortcut.java +5 −1 Original line number Diff line number Diff line package com.android.launcher3.popup; import android.content.Context; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.View; import com.android.launcher3.AbstractFloatingView; Loading Loading @@ -82,7 +84,9 @@ public abstract class SystemShortcut { return new View.OnClickListener() { @Override public void onClick(View view) { InfoDropTarget.startDetailsActivityForInfo(itemInfo, launcher, null); Rect sourceBounds = launcher.getViewBounds(view); Bundle opts = launcher.getActivityLaunchOptions(view); InfoDropTarget.startDetailsActivityForInfo(itemInfo, launcher, null, sourceBounds, opts); } }; } Loading Loading
src/com/android/launcher3/InfoDropTarget.java +8 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.launcher3; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.graphics.Rect; import android.os.Bundle; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; Loading Loading @@ -60,6 +62,11 @@ public class InfoDropTarget extends UninstallDropTarget { */ public static boolean startDetailsActivityForInfo( ItemInfo info, Launcher launcher, DropTargetResultCallback callback) { return startDetailsActivityForInfo(info, launcher, callback, null, null); } public static boolean startDetailsActivityForInfo(ItemInfo info, Launcher launcher, DropTargetResultCallback callback, Rect sourceBounds, Bundle opts) { boolean result = false; ComponentName componentName = null; if (info instanceof AppInfo) { Loading @@ -74,7 +81,7 @@ public class InfoDropTarget extends UninstallDropTarget { if (componentName != null) { try { LauncherAppsCompat.getInstance(launcher) .showAppDetailsForProfile(componentName, info.user); .showAppDetailsForProfile(componentName, info.user, sourceBounds, opts); result = true; } catch (SecurityException | ActivityNotFoundException e) { Toast.makeText(launcher, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); Loading
src/com/android/launcher3/Launcher.java +2 −2 Original line number Diff line number Diff line Loading @@ -2668,7 +2668,7 @@ public class Launcher extends BaseActivity } @TargetApi(Build.VERSION_CODES.M) private Bundle getActivityLaunchOptions(View v) { public Bundle getActivityLaunchOptions(View v) { if (Utilities.ATLEAST_MARSHMALLOW) { int left = 0, top = 0; int width = v.getMeasuredWidth(), height = v.getMeasuredHeight(); Loading @@ -2694,7 +2694,7 @@ public class Launcher extends BaseActivity return null; } private Rect getViewBounds(View v) { public Rect getViewBounds(View v) { int[] pos = new int[2]; v.getLocationOnScreen(pos); return new Rect(pos[0], pos[1], pos[0] + v.getWidth(), pos[1] + v.getHeight()); Loading
src/com/android/launcher3/compat/LauncherAppsCompat.java +6 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,8 @@ public abstract class LauncherAppsCompat { Rect sourceBounds, Bundle opts); public abstract ApplicationInfo getApplicationInfo( String packageName, int flags, UserHandle user); public abstract void showAppDetailsForProfile(ComponentName component, UserHandle user); public abstract void showAppDetailsForProfile(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts); public abstract void addOnAppsChangedCallback(OnAppsChangedCallbackCompat listener); public abstract void removeOnAppsChangedCallback(OnAppsChangedCallbackCompat listener); public abstract boolean isPackageEnabledForProfile(String packageName, UserHandle user); Loading Loading @@ -142,4 +143,8 @@ public abstract class LauncherAppsCompat { return null; } } public void showAppDetailsForProfile(ComponentName component, UserHandle user) { showAppDetailsForProfile(component, user, null, null); } }
src/com/android/launcher3/compat/LauncherAppsCompatVL.java +3 −2 Original line number Diff line number Diff line Loading @@ -95,8 +95,9 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat { } @Override public void showAppDetailsForProfile(ComponentName component, UserHandle user) { mLauncherApps.startAppDetailsActivity(component, user, null, null); public void showAppDetailsForProfile(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) { mLauncherApps.startAppDetailsActivity(component, user, sourceBounds, opts); } @Override Loading
src/com/android/launcher3/popup/SystemShortcut.java +5 −1 Original line number Diff line number Diff line package com.android.launcher3.popup; import android.content.Context; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.View; import com.android.launcher3.AbstractFloatingView; Loading Loading @@ -82,7 +84,9 @@ public abstract class SystemShortcut { return new View.OnClickListener() { @Override public void onClick(View view) { InfoDropTarget.startDetailsActivityForInfo(itemInfo, launcher, null); Rect sourceBounds = launcher.getViewBounds(view); Bundle opts = launcher.getActivityLaunchOptions(view); InfoDropTarget.startDetailsActivityForInfo(itemInfo, launcher, null, sourceBounds, opts); } }; } Loading