summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-06-15 14:24:21 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-06-15 14:25:12 -0700
commit5606e070592521c80033381fc0536d4aa1351695 (patch)
tree20e2be508689b4be20c0b40a995e97e96683bf0a /src
parent2de667d3af3328a3c3bd8cc32a45e7e543375fee (diff)
downloadandroid_packages_apps_Trebuchet-5606e070592521c80033381fc0536d4aa1351695.tar.gz
android_packages_apps_Trebuchet-5606e070592521c80033381fc0536d4aa1351695.tar.bz2
android_packages_apps_Trebuchet-5606e070592521c80033381fc0536d4aa1351695.zip
Removing long press support from page-indicator
Bug: 62445549 Bug: 38163974 Change-Id: Ic0ae44ded7e4755c5401f327ce0d98a9ea96b2ab
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Hotseat.java1
-rw-r--r--src/com/android/launcher3/Launcher.java39
-rw-r--r--src/com/android/launcher3/LauncherStateTransitionAnimation.java9
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java11
-rw-r--r--src/com/android/launcher3/allapps/AllAppsTransitionController.java8
-rw-r--r--src/com/android/launcher3/allapps/SearchUiManager.java12
-rw-r--r--src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java12
-rw-r--r--src/com/android/launcher3/pageindicators/PageIndicatorCaretLandscape.java1
-rw-r--r--src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java1
9 files changed, 12 insertions, 82 deletions
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index ab82c988e..af3abebb4 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -151,7 +151,6 @@ public class Hotseat extends FrameLayout
mLauncher.setAllAppsButton(allAppsButton);
allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener());
allAppsButton.setOnClickListener(mLauncher);
- allAppsButton.setOnLongClickListener(mLauncher);
allAppsButton.setOnFocusChangeListener(mLauncher.mFocusHandler);
}
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index dd0d2b804..bd006c718 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -979,8 +979,7 @@ public class Launcher extends BaseActivity
// Don't update the predicted apps if the user is returning to launcher in the apps
// view after launching an app, as they may be depending on the UI to be static to
// switch to another app, otherwise, if it was
- showAppsView(false /* animated */, !launchedFromApp /* updatePredictedApps */,
- mAppsView.shouldRestoreImeState() /* focusSearchBar */);
+ showAppsView(false /* animated */, !launchedFromApp /* updatePredictedApps */);
} else if (mOnResumeState == State.WIDGETS) {
showWidgetsView(false, false);
}
@@ -2351,18 +2350,7 @@ public class Launcher extends BaseActivity
if (!isAppsViewVisible()) {
getUserEventDispatcher().logActionOnControl(Action.Touch.TAP,
ControlType.ALL_APPS_BUTTON);
- showAppsView(true /* animated */, true /* updatePredictedApps */,
- false /* focusSearchBar */);
- }
- }
-
- protected void onLongClickAllAppsButton(View v) {
- if (LOGD) Log.d(TAG, "onLongClickAllAppsButton");
- if (!isAppsViewVisible()) {
- getUserEventDispatcher().logActionOnControl(Action.Touch.LONGPRESS,
- ControlType.ALL_APPS_BUTTON);
- showAppsView(true /* animated */,
- true /* updatePredictedApps */, true /* focusSearchBar */);
+ showAppsView(true /* animated */, true /* updatePredictedApps */);
}
}
@@ -2750,13 +2738,6 @@ public class Launcher extends BaseActivity
if (isWorkspaceLocked()) return false;
if (mState != State.WORKSPACE) return false;
- if ((FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && v instanceof PageIndicator) ||
- (v == mAllAppsButton && mAllAppsButton != null)) {
- onLongClickAllAppsButton(v);
- return true;
- }
-
-
boolean ignoreLongPressToOverview =
mDeviceProfile.shouldIgnoreLongPressToOverview(mLastDispatchTouchEventX);
@@ -2956,13 +2937,12 @@ public class Launcher extends BaseActivity
/**
* Shows the apps view.
*/
- public void showAppsView(boolean animated, boolean updatePredictedApps,
- boolean focusSearchBar) {
+ public void showAppsView(boolean animated, boolean updatePredictedApps) {
markAppsViewShown();
if (updatePredictedApps) {
tryAndUpdatePredictedApps();
}
- showAppsOrWidgets(State.APPS, animated, focusSearchBar);
+ showAppsOrWidgets(State.APPS, animated);
}
/**
@@ -2973,7 +2953,7 @@ public class Launcher extends BaseActivity
if (resetPageToZero) {
mWidgetsView.scrollToTop();
}
- showAppsOrWidgets(State.WIDGETS, animated, false);
+ showAppsOrWidgets(State.WIDGETS, animated);
mWidgetsView.post(new Runnable() {
@Override
@@ -2990,7 +2970,7 @@ public class Launcher extends BaseActivity
*/
// TODO: calling method should use the return value so that when {@code false} is returned
// the workspace transition doesn't fall into invalid state.
- private boolean showAppsOrWidgets(State toState, boolean animated, boolean focusSearchBar) {
+ private boolean showAppsOrWidgets(State toState, boolean animated) {
if (!(mState == State.WORKSPACE ||
mState == State.APPS_SPRING_LOADED ||
mState == State.WIDGETS_SPRING_LOADED ||
@@ -3008,7 +2988,7 @@ public class Launcher extends BaseActivity
}
if (toState == State.APPS) {
- mStateTransitionAnimation.startAnimationToAllApps(animated, focusSearchBar);
+ mStateTransitionAnimation.startAnimationToAllApps(animated);
} else {
mStateTransitionAnimation.startAnimationToWidgets(animated);
}
@@ -3081,8 +3061,7 @@ public class Launcher extends BaseActivity
public void exitSpringLoadedDragMode() {
if (mState == State.APPS_SPRING_LOADED) {
- showAppsView(true /* animated */,
- false /* updatePredictedApps */, false /* focusSearchBar */);
+ showAppsView(true /* animated */, false /* updatePredictedApps */);
} else if (mState == State.WIDGETS_SPRING_LOADED) {
showWidgetsView(true, false);
} else if (mState == State.WORKSPACE_SPRING_LOADED) {
@@ -4095,7 +4074,7 @@ public class Launcher extends BaseActivity
switch (keyCode) {
case KeyEvent.KEYCODE_A:
if (mState == State.WORKSPACE) {
- showAppsView(true, true, false);
+ showAppsView(true, true);
return true;
}
break;
diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
index 85467e06a..e7349f040 100644
--- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java
+++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
@@ -127,12 +127,8 @@ public class LauncherStateTransitionAnimation {
/**
* Starts an animation to the apps view.
- *
- * @param startSearchAfterTransition Immediately starts app search after the transition to
- * All Apps is completed.
*/
- public void startAnimationToAllApps(
- final boolean animated, final boolean startSearchAfterTransition) {
+ public void startAnimationToAllApps(final boolean animated) {
final AllAppsContainerView toView = mLauncher.getAppsView();
final View buttonView = mLauncher.getStartViewForAllAppsRevealAnimation();
PrivateTransitionCallbacks cb = new PrivateTransitionCallbacks(1f) {
@@ -156,9 +152,6 @@ public class LauncherStateTransitionAnimation {
@Override
void onTransitionComplete() {
mLauncher.getUserEventDispatcher().resetElapsedContainerMillis();
- if (startSearchAfterTransition) {
- toView.startAppsSearch();
- }
}
};
int animType = CIRCULAR_REVEAL;
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index c3df07360..051c1612d 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -196,13 +196,6 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
}
/**
- * Focuses the search field and begins an app search.
- */
- public void startAppsSearch() {
- mSearchUiManager.startAppsSearch();
- }
-
- /**
* Resets the state of AllApps.
*/
public void reset() {
@@ -372,10 +365,6 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
targetParent.containerType = mAppsRecyclerView.getContainerType(v);
}
- public boolean shouldRestoreImeState() {
- return mSearchUiManager.shouldRestoreImeState();
- }
-
@Override
public void setInsets(Rect insets) {
DeviceProfile grid = mLauncher.getDeviceProfile();
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index d79b0d19d..2d8310bbe 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -227,9 +227,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
Action.Direction.UP,
containerType);
}
- mLauncher.showAppsView(true /* animated */,
- false /* updatePredictedApps */,
- false /* focusSearchBar */);
+ mLauncher.showAppsView(true /* animated */, false /* updatePredictedApps */);
if (hasSpringAnimationHandler()) {
mSpringAnimationHandler.animateToFinalPosition(0);
}
@@ -250,9 +248,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
Action.Direction.UP,
containerType);
}
- mLauncher.showAppsView(true, /* animated */
- false /* updatePredictedApps */,
- false /* focusSearchBar */);
+ mLauncher.showAppsView(true, /* animated */ false /* updatePredictedApps */);
}
}
}
diff --git a/src/com/android/launcher3/allapps/SearchUiManager.java b/src/com/android/launcher3/allapps/SearchUiManager.java
index 0d013c73f..c0d78508f 100644
--- a/src/com/android/launcher3/allapps/SearchUiManager.java
+++ b/src/com/android/launcher3/allapps/SearchUiManager.java
@@ -44,18 +44,6 @@ public interface SearchUiManager {
*/
void preDispatchKeyEvent(KeyEvent keyEvent);
- /**
- * Returns true if the IME should be brought back.
- * TODO: Remove when removing support for opening all-apps in search mode.
- */
- boolean shouldRestoreImeState();
-
- /**
- * Starts the search UI
- * TODO: Remove when removing support for opening all-apps in search mode.
- */
- void startAppsSearch();
-
void addOnScrollRangeChangeListener(OnScrollRangeChangeListener listener);
/**
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index cb3b066fe..8e5452ee5 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -153,18 +153,6 @@ public class AppsSearchContainerLayout extends FrameLayout
}
@Override
- public boolean shouldRestoreImeState() {
- return !TextUtils.isEmpty(mSearchInput.getText());
- }
-
- @Override
- public void startAppsSearch() {
- if (mApps != null) {
- mSearchBarController.focusSearchField();
- }
- }
-
- @Override
public void onSearchResult(String query, ArrayList<ComponentKey> apps) {
if (apps != null) {
mApps.setOrderedFilter(apps);
diff --git a/src/com/android/launcher3/pageindicators/PageIndicatorCaretLandscape.java b/src/com/android/launcher3/pageindicators/PageIndicatorCaretLandscape.java
index ae10aedee..8bcb9794a 100644
--- a/src/com/android/launcher3/pageindicators/PageIndicatorCaretLandscape.java
+++ b/src/com/android/launcher3/pageindicators/PageIndicatorCaretLandscape.java
@@ -50,7 +50,6 @@ public class PageIndicatorCaretLandscape extends PageIndicator {
Launcher l = Launcher.getLauncher(context);
setOnTouchListener(l.getHapticFeedbackTouchListener());
setOnClickListener(l);
- setOnLongClickListener(l);
setOnFocusChangeListener(l.mFocusHandler);
}
diff --git a/src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java b/src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java
index 91fc1f04a..6b992fc22 100644
--- a/src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java
+++ b/src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java
@@ -137,7 +137,6 @@ public class PageIndicatorLineCaret extends PageIndicator {
mAllAppsHandle.setImageDrawable(getCaretDrawable());
mAllAppsHandle.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener());
mAllAppsHandle.setOnClickListener(mLauncher);
- mAllAppsHandle.setOnLongClickListener(mLauncher);
mAllAppsHandle.setOnFocusChangeListener(mLauncher.mFocusHandler);
mLauncher.setAllAppsButton(mAllAppsHandle);
}