Loading quickstep/res/layout/task.xml +4 −1 Original line number Diff line number Diff line Loading @@ -13,9 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. --> <com.android.quickstep.views.TaskView xmlns:android="http://schemas.android.com/apk/res/android" <com.android.quickstep.views.TaskView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="false" android:elevation="4dp"> <com.android.quickstep.views.TaskThumbnailView Loading @@ -29,5 +31,6 @@ android:layout_width="@dimen/task_thumbnail_icon_size" android:layout_height="@dimen/task_thumbnail_icon_size" android:importantForAccessibility="no" android:focusable="false" android:layout_gravity="top|center_horizontal" /> </com.android.quickstep.views.TaskView> No newline at end of file quickstep/src/com/android/quickstep/views/ClearAllButton.java +9 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.quickstep.views; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS; import android.content.Context; import android.graphics.Rect; import android.os.Bundle; import android.support.annotation.Nullable; import android.util.AttributeSet; Loading @@ -43,4 +44,12 @@ public class ClearAllButton extends Button { } return res; } @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(focused, direction, previouslyFocusedRect); if (focused) { mRecentsView.revealClearAllButton(); } } } quickstep/src/com/android/quickstep/views/RecentsView.java +25 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Handler; import android.os.UserHandle; import android.support.annotation.Nullable; import android.text.Layout; import android.text.StaticLayout; import android.text.TextPaint; Loading Loading @@ -973,6 +974,13 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_TAB: if (!event.isAltPressed() && getNextPage() == (event.isShiftPressed() ? 0 : getChildCount() - 1)) { // If not Alt-Tab navigation, don't loop forever in the carousel and leave // it once we reached the end. return false; } snapToPageRelative(event.isShiftPressed() ? -1 : 1); return true; case KeyEvent.KEYCODE_DPAD_RIGHT: Loading @@ -998,6 +1006,22 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl return super.dispatchKeyEvent(event); } @Override protected void onFocusChanged(boolean gainFocus, int direction, @Nullable Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); if (gainFocus && getChildCount() > 0) { switch (direction) { case FOCUS_FORWARD: setCurrentPage(0); break; case FOCUS_BACKWARD: setCurrentPage(getChildCount() - 1); break; } } } public void snapToTaskAfterNext() { snapToPageRelative(1); } Loading Loading @@ -1309,6 +1333,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl } public void revealClearAllButton() { setCurrentPage(getChildCount() - 1); // Loads tasks info if needed. scrollTo(mIsRtl ? 0 : computeMaxScrollX(), 0); } Loading quickstep/src/com/android/quickstep/views/RecentsViewContainer.java +10 −0 Original line number Diff line number Diff line Loading @@ -25,10 +25,13 @@ 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") { Loading Loading @@ -104,4 +107,11 @@ public class RecentsViewContainer extends InsettableFrameLayout { mRecentsView.setContentAlpha(alpha); setVisibility(alpha > 0 ? VISIBLE : GONE); } @Override public void addFocusables(ArrayList<View> views, int direction, int focusableMode) { // Carousel is first in tab order. views.add(mRecentsView); views.add(mClearAllButton); } } No newline at end of file res/layout/all_apps.xml +1 −2 Original line number Diff line number Diff line Loading @@ -23,8 +23,7 @@ android:layout_height="match_parent" android:clipChildren="true" android:clipToPadding="false" android:focusable="true" android:focusableInTouchMode="true" android:focusable="false" android:saveEnabled="false" > <include layout="@layout/all_apps_rv_layout" /> Loading Loading
quickstep/res/layout/task.xml +4 −1 Original line number Diff line number Diff line Loading @@ -13,9 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. --> <com.android.quickstep.views.TaskView xmlns:android="http://schemas.android.com/apk/res/android" <com.android.quickstep.views.TaskView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="false" android:elevation="4dp"> <com.android.quickstep.views.TaskThumbnailView Loading @@ -29,5 +31,6 @@ android:layout_width="@dimen/task_thumbnail_icon_size" android:layout_height="@dimen/task_thumbnail_icon_size" android:importantForAccessibility="no" android:focusable="false" android:layout_gravity="top|center_horizontal" /> </com.android.quickstep.views.TaskView> No newline at end of file
quickstep/src/com/android/quickstep/views/ClearAllButton.java +9 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.quickstep.views; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS; import android.content.Context; import android.graphics.Rect; import android.os.Bundle; import android.support.annotation.Nullable; import android.util.AttributeSet; Loading @@ -43,4 +44,12 @@ public class ClearAllButton extends Button { } return res; } @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(focused, direction, previouslyFocusedRect); if (focused) { mRecentsView.revealClearAllButton(); } } }
quickstep/src/com/android/quickstep/views/RecentsView.java +25 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Handler; import android.os.UserHandle; import android.support.annotation.Nullable; import android.text.Layout; import android.text.StaticLayout; import android.text.TextPaint; Loading Loading @@ -973,6 +974,13 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_TAB: if (!event.isAltPressed() && getNextPage() == (event.isShiftPressed() ? 0 : getChildCount() - 1)) { // If not Alt-Tab navigation, don't loop forever in the carousel and leave // it once we reached the end. return false; } snapToPageRelative(event.isShiftPressed() ? -1 : 1); return true; case KeyEvent.KEYCODE_DPAD_RIGHT: Loading @@ -998,6 +1006,22 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl return super.dispatchKeyEvent(event); } @Override protected void onFocusChanged(boolean gainFocus, int direction, @Nullable Rect previouslyFocusedRect) { super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); if (gainFocus && getChildCount() > 0) { switch (direction) { case FOCUS_FORWARD: setCurrentPage(0); break; case FOCUS_BACKWARD: setCurrentPage(getChildCount() - 1); break; } } } public void snapToTaskAfterNext() { snapToPageRelative(1); } Loading Loading @@ -1309,6 +1333,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl } public void revealClearAllButton() { setCurrentPage(getChildCount() - 1); // Loads tasks info if needed. scrollTo(mIsRtl ? 0 : computeMaxScrollX(), 0); } Loading
quickstep/src/com/android/quickstep/views/RecentsViewContainer.java +10 −0 Original line number Diff line number Diff line Loading @@ -25,10 +25,13 @@ 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") { Loading Loading @@ -104,4 +107,11 @@ public class RecentsViewContainer extends InsettableFrameLayout { mRecentsView.setContentAlpha(alpha); setVisibility(alpha > 0 ? VISIBLE : GONE); } @Override public void addFocusables(ArrayList<View> views, int direction, int focusableMode) { // Carousel is first in tab order. views.add(mRecentsView); views.add(mClearAllButton); } } No newline at end of file
res/layout/all_apps.xml +1 −2 Original line number Diff line number Diff line Loading @@ -23,8 +23,7 @@ android:layout_height="match_parent" android:clipChildren="true" android:clipToPadding="false" android:focusable="true" android:focusableInTouchMode="true" android:focusable="false" android:saveEnabled="false" > <include layout="@layout/all_apps_rv_layout" /> Loading