summaryrefslogtreecommitdiffstats
path: root/src
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 /src
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 'src')
-rw-r--r--src/com/android/launcher3/LauncherState.java6
-rw-r--r--src/com/android/launcher3/LauncherStateManager.java13
-rw-r--r--src/com/android/launcher3/states/SpringLoadedState.java6
3 files changed, 6 insertions, 19 deletions
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 76681f280..5b010dc2d 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -18,11 +18,11 @@ package com.android.launcher3;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
+
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.states.RotationHelper.REQUEST_NONE;
import android.graphics.Rect;
-import android.view.View;
import android.view.animation.Interpolator;
import com.android.launcher3.states.SpringLoadedState;
@@ -196,10 +196,6 @@ public class LauncherState {
public void onStateDisabled(Launcher launcher) { }
- public View getFinalFocus(Launcher launcher) {
- return launcher.getWorkspace();
- }
-
public int getVisibleElements(Launcher launcher) {
if (launcher.getDeviceProfile().isVerticalBarLayout()) {
return HOTSEAT_ICONS | VERTICAL_SWIPE_INDICATOR;
diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java
index 3fcdee934..f938e2412 100644
--- a/src/com/android/launcher3/LauncherStateManager.java
+++ b/src/com/android/launcher3/LauncherStateManager.java
@@ -17,6 +17,7 @@
package com.android.launcher3;
import static android.view.View.VISIBLE;
+
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCALE;
@@ -35,7 +36,6 @@ import android.animation.AnimatorSet;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.IntDef;
-import android.view.View;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
@@ -251,7 +251,7 @@ public class LauncherStateManager {
prepareForAtomicAnimation(mState, state, builder);
AnimatorSet animation = createAnimationToNewWorkspaceInternal(
state, builder, onCompleteRunnable);
- Runnable runnable = new StartAnimRunnable(animation, state.getFinalFocus(mLauncher));
+ Runnable runnable = new StartAnimRunnable(animation);
if (delay > 0) {
mUiHandler.postDelayed(runnable, delay);
} else {
@@ -397,6 +397,8 @@ public class LauncherStateManager {
}
UiFactory.onLauncherStateOrResumeChanged(mLauncher);
+
+ mLauncher.getDragLayer().requestFocus();
}
public void onWindowFocusChanged() {
@@ -480,11 +482,9 @@ public class LauncherStateManager {
private class StartAnimRunnable implements Runnable {
private final AnimatorSet mAnim;
- private final View mViewToFocus;
- public StartAnimRunnable(AnimatorSet anim, View viewToFocus) {
+ public StartAnimRunnable(AnimatorSet anim) {
mAnim = anim;
- mViewToFocus = viewToFocus;
}
@Override
@@ -492,9 +492,6 @@ public class LauncherStateManager {
if (mConfig.mCurrentAnimation != mAnim) {
return;
}
- if (mViewToFocus != null) {
- mViewToFocus.requestFocus();
- }
mAnim.start();
}
}
diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java
index aa7d0d5a3..35f7f8831 100644
--- a/src/com/android/launcher3/states/SpringLoadedState.java
+++ b/src/com/android/launcher3/states/SpringLoadedState.java
@@ -19,7 +19,6 @@ import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_TRANSITION_M
import static com.android.launcher3.states.RotationHelper.REQUEST_LOCK;
import android.graphics.Rect;
-import android.view.View;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InstallShortcutReceiver;
@@ -98,9 +97,4 @@ public class SpringLoadedState extends LauncherState {
InstallShortcutReceiver.disableAndFlushInstallQueue(
InstallShortcutReceiver.FLAG_DRAG_AND_DROP, launcher);
}
-
- @Override
- public View getFinalFocus(Launcher launcher) {
- return null;
- }
}