summaryrefslogtreecommitdiffstats
path: root/quickstep
diff options
context:
space:
mode:
authorVadim Tryshev <vadimt@google.com>2018-05-23 12:54:27 -0700
committerVadim Tryshev <vadimt@google.com>2018-05-24 13:06:18 -0700
commit1b0c5032d1b773d93fed3b1b14587163b86ca521 (patch)
tree15ca439b5604f86e78833323767fe0a38936a4ae /quickstep
parent1ab656460b7baf9ac9233eab3e9582abb8d6941c (diff)
downloadandroid_packages_apps_Trebuchet-1b0c5032d1b773d93fed3b1b14587163b86ca521.tar.gz
android_packages_apps_Trebuchet-1b0c5032d1b773d93fed3b1b14587163b86ca521.tar.bz2
android_packages_apps_Trebuchet-1b0c5032d1b773d93fed3b1b14587163b86ca521.zip
Fixing keyboard navigation when Overview list is empty
Bug: 80155387 Change-Id: Ife86fe4b718ef01291a04b21020155110d75fa7b Testing: Manual
Diffstat (limited to 'quickstep')
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java7
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/OverviewState.java5
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsView.java12
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsViewContainer.java13
4 files changed, 12 insertions, 25 deletions
diff --git a/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java b/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java
index d86ba6aa6..1eaa8bc92 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java
@@ -18,8 +18,6 @@ package com.android.launcher3.uioverrides;
import static com.android.launcher3.LauncherAnimUtils.ALL_APPS_TRANSITION_MS;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
-import android.view.View;
-
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
@@ -62,11 +60,6 @@ public class AllAppsState extends LauncherState {
}
@Override
- public View getFinalFocus(Launcher launcher) {
- return launcher.getAppsView();
- }
-
- @Override
public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
float[] scaleAndTranslation = LauncherState.OVERVIEW.getWorkspaceScaleAndTranslation(
launcher);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
index 0116a8e0e..9169ffbc1 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
@@ -83,11 +83,6 @@ public class OverviewState extends LauncherState {
DiscoveryBounce.showForOverviewIfNeeded(launcher);
}
- @Override
- public View getFinalFocus(Launcher launcher) {
- return launcher.getOverviewPanel();
- }
-
public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
return new PageAlphaProvider(DEACCEL_2) {
@Override
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 4f169fb47..4d6b89cff 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -271,6 +271,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
.getDimensionPixelSize(R.dimen.recents_empty_message_text_padding);
setWillNotDraw(false);
updateEmptyMessage();
+ setFocusable(false);
}
public boolean isRtl() {
@@ -931,16 +932,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
return true;
}
- @Override
- public void onVisibilityAggregated(boolean isVisible) {
- super.onVisibilityAggregated(isVisible);
- if (isVisible && !isFocused()) {
- // Having focus, even in touch mode, keeps us from losing [Alt+]Tab by preventing
- // switching to keyboard mode.
- requestFocus();
- }
- }
-
private void runDismissAnimation(PendingAnimation pendingAnim) {
AnimatorPlaybackController controller = AnimatorPlaybackController.wrap(
pendingAnim.anim, DISMISS_TASK_DURATION);
@@ -1285,6 +1276,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
private void onChildViewsChanged() {
final int childCount = getChildCount();
mClearAllButton.setVisibility(childCount == 0 ? INVISIBLE : VISIBLE);
+ setFocusable(childCount != 0);
}
public void revealClearAllButton() {
diff --git a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
index 3391214de..31c8b6448 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
@@ -113,8 +113,15 @@ public class RecentsViewContainer extends InsettableFrameLayout {
@Override
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
- // Carousel is first in tab order.
- views.add(mRecentsView);
- views.add(mClearAllButton);
+ if (mRecentsView.getChildCount() > 0) {
+ // Carousel is first in tab order.
+ views.add(mRecentsView);
+ views.add(mClearAllButton);
+ }
+ }
+
+ public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
+ return mRecentsView.requestFocus(direction, previouslyFocusedRect) ||
+ super.requestFocus(direction, previouslyFocusedRect);
}
} \ No newline at end of file