summaryrefslogtreecommitdiffstats
path: root/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-05-27 07:23:13 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-05-27 07:23:13 +0000
commitdf0843e569b93e77355990f7a71fe39746b43493 (patch)
treeb5fb050ecef07e3f2020513a526f6a99f46554c4 /quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
parent4ac63b28ced5d5b09eaae39adca68377a2a7ef5b (diff)
parentaea65680e6f3da83636dbc6af2ef1381de06d2a8 (diff)
downloadandroid_packages_apps_Trebuchet-df0843e569b93e77355990f7a71fe39746b43493.tar.gz
android_packages_apps_Trebuchet-df0843e569b93e77355990f7a71fe39746b43493.tar.bz2
android_packages_apps_Trebuchet-df0843e569b93e77355990f7a71fe39746b43493.zip
Snap for 4807121 from aea65680e6f3da83636dbc6af2ef1381de06d2a8 to pi-release
Change-Id: Id61934dcc353f297ad35ca1fbd7ffe385a2503a3
Diffstat (limited to 'quickstep/src/com/android/quickstep/views/RecentsViewContainer.java')
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsViewContainer.java30
1 files changed, 25 insertions, 5 deletions
diff --git a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
index 429432b2f..31c8b6448 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
@@ -23,12 +23,14 @@ import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.FloatProperty;
-import android.view.Gravity;
import android.view.MotionEvent;
+import android.view.View;
import com.android.launcher3.InsettableFrameLayout;
import com.android.launcher3.R;
+import java.util.ArrayList;
+
public class RecentsViewContainer extends InsettableFrameLayout {
public static final FloatProperty<RecentsViewContainer> CONTENT_ALPHA =
new FloatProperty<RecentsViewContainer>("contentAlpha") {
@@ -64,14 +66,18 @@ public class RecentsViewContainer extends InsettableFrameLayout {
});
mRecentsView = findViewById(R.id.overview_panel);
- final InsettableFrameLayout.LayoutParams params =
- (InsettableFrameLayout.LayoutParams) mClearAllButton.getLayoutParams();
- params.gravity = Gravity.TOP | (RecentsView.FLIP_RECENTS ? Gravity.START : Gravity.END);
- mClearAllButton.setLayoutParams(params);
mClearAllButton.forceHasOverlappingRendering(false);
mRecentsView.setClearAllButton(mClearAllButton);
mClearAllButton.setRecentsView(mRecentsView);
+
+ if (mRecentsView.isRtl()) {
+ mClearAllButton.setNextFocusRightId(mRecentsView.getId());
+ mRecentsView.setNextFocusLeftId(mClearAllButton.getId());
+ } else {
+ mClearAllButton.setNextFocusLeftId(mRecentsView.getId());
+ mRecentsView.setNextFocusRightId(mClearAllButton.getId());
+ }
}
@Override
@@ -104,4 +110,18 @@ public class RecentsViewContainer extends InsettableFrameLayout {
mRecentsView.setContentAlpha(alpha);
setVisibility(alpha > 0 ? VISIBLE : GONE);
}
+
+ @Override
+ public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
+ 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