Temorarily changing the long press action on the homescreen to show a popup menu
Change-Id: If160a2e4d0f73e2e1ecb424a0625d642b8775ada
This commit is contained in:
1 parent
3e4d95d33d
commit
a5ace71d91
3 files changed
+49
-6
No files matched your search
@@ -60,6 +60,7 @@ import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
@@ -123,6 +124,7 @@ import com.android.launcher3.popup.PopupDataProvider;
|
||||
import com.android.launcher3.shortcuts.DeepShortcutManager;
|
||||
import com.android.launcher3.states.AllAppsState;
|
||||
import com.android.launcher3.states.InternalStateHandler;
|
||||
import com.android.launcher3.uioverrides.UiFactory;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
|
||||
@@ -2062,11 +2064,16 @@ public class Launcher extends BaseActivity
|
||||
intent.setPackage(pickerPackage);
|
||||
}
|
||||
|
||||
intent.setSourceBounds(getViewBounds(v));
|
||||
final Bundle launchOptions;
|
||||
if (v != null) {
|
||||
intent.setSourceBounds(getViewBounds(v));
|
||||
// If there is no target package, use the default intent chooser animation
|
||||
launchOptions = hasTargetPackage ? getActivityLaunchOptions(v) : null;
|
||||
} else {
|
||||
launchOptions = null;
|
||||
}
|
||||
try {
|
||||
startActivityForResult(intent, REQUEST_PICK_WALLPAPER,
|
||||
// If there is no target package, use the default intent chooser animation
|
||||
hasTargetPackage ? getActivityLaunchOptions(v) : null);
|
||||
startActivityForResult(intent, REQUEST_PICK_WALLPAPER, launchOptions);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
setWaitingForResult(null);
|
||||
Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
|
||||
@@ -2222,7 +2229,7 @@ public class Launcher extends BaseActivity
|
||||
getUserEventDispatcher().logActionOnContainer(Action.Touch.LONGPRESS,
|
||||
Action.Direction.NONE, ContainerType.WORKSPACE,
|
||||
mWorkspace.getCurrentPage());
|
||||
getStateManager().goToState(OVERVIEW);
|
||||
UiFactory.onWorkspaceLongPress(this);
|
||||
mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
|
||||
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
|
||||
return true;
|
||||
@@ -2259,7 +2266,7 @@ public class Launcher extends BaseActivity
|
||||
getUserEventDispatcher().logActionOnContainer(Action.Touch.LONGPRESS,
|
||||
Action.Direction.NONE, ContainerType.WORKSPACE,
|
||||
mWorkspace.getCurrentPage());
|
||||
getStateManager().goToState(OVERVIEW);
|
||||
UiFactory.onWorkspaceLongPress(this);
|
||||
}
|
||||
mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
|
||||
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
|
||||
|
||||
Reference in new issue
Block a user