Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d82b3750 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Implementing Recents focus states. (Bug 16950262)" into lmp-dev

parents 3caecc6e a0e88b50
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?android:attr/colorControlHighlight">
    <item android:drawable="@android:color/transparent" />
</ripple>
 No newline at end of file
+1 −3
Original line number Diff line number Diff line
@@ -26,8 +26,7 @@
        android:id="@+id/task_view_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/recents_task_bar_height"
        android:layout_gravity="top|center_horizontal"
        android:background="@color/recents_task_bar_default_background_color">
        android:layout_gravity="top|center_horizontal">
        <com.android.systemui.recents.views.FixedSizeImageView
            android:id="@+id/application_icon"
            android:layout_width="@dimen/recents_task_view_application_icon_size"
@@ -69,7 +68,6 @@
        android:layout_gravity="bottom|right"
        android:layout_marginRight="15dp"
        android:layout_marginBottom="15dp"
        android:translationZ="50dp"
        android:contentDescription="@string/recents_lock_to_app_button_label"
        android:background="@drawable/recents_lock_to_task_button_bg">
        <ImageView
+2 −0
Original line number Diff line number Diff line
@@ -147,6 +147,8 @@
    <integer name="recents_max_task_stack_view_dim">96</integer>
    <!-- The number of tasks that RecentsTaskLoader should load. -->
    <integer name="recents_max_num_tasks_to_load">50</integer>
    <!-- The delay to enforce between each alt-tab key press. -->
    <integer name="recents_alt_tab_key_delay">200</integer>
    <!-- Transposes the recents layout in landscape. -->
    <bool name="recents_transpose_layout_with_orientation">true</bool>

+7 −6
Original line number Diff line number Diff line
@@ -345,8 +345,8 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
     * Creates the activity options for an app->recents transition.  If this method sets the static
     * screenshot, then we will use that for the transition.
     */
    ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask) {

    ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask,
            boolean isTopTaskHome) {
        if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
            // Recycle the last screenshot
            consumeLastScreenshot();
@@ -365,7 +365,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
        Bitmap firstThumbnail = mSystemServicesProxy.getTaskThumbnail(topTask.id);
        if (firstThumbnail != null) {
            // Update the destination rect
            Rect toTaskRect = getThumbnailTransitionRect(topTask.id);
            Rect toTaskRect = getThumbnailTransitionRect(topTask.id, isTopTaskHome);
            if (toTaskRect.width() > 0 && toTaskRect.height() > 0) {
                // Create the new thumbnail for the animation down
                // XXX: We should find a way to optimize this so we don't need to create a new bitmap
@@ -389,7 +389,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    }

    /** Returns the transition rect for the given task id. */
    Rect getThumbnailTransitionRect(int runningTaskId) {
    Rect getThumbnailTransitionRect(int runningTaskId, boolean isTopTaskHome) {
        // Get the stack of tasks that we are animating into
        TaskStack stack = RecentsTaskLoader.getShallowTaskStack(mSystemServicesProxy, -1);
        if (stack.getTaskCount() == 0) {
@@ -401,7 +401,8 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
        TaskStackViewLayoutAlgorithm algo = tsv.getStackAlgorithm();
        Rect taskStackBounds = new Rect(mTaskStackBounds);
        taskStackBounds.bottom -= mSystemInsets.bottom;
        tsv.computeRects(mWindowRect.width(), mWindowRect.height(), taskStackBounds, mTriggeredFromAltTab);
        tsv.computeRects(mWindowRect.width(), mWindowRect.height(), taskStackBounds,
                mTriggeredFromAltTab, isTopTaskHome);
        tsv.getScroller().setStackScrollToInitialState();

        // Find the running task in the TaskStack
@@ -442,7 +443,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta

        if (useThumbnailTransition) {
            // Try starting with a thumbnail transition
            ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask);
            ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask, isTopTaskHome);
            if (opts != null) {
                if (sLastScreenshot != null) {
                    startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_FULL_SCREENSHOT);
+28 −11
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView

    RecentsConfiguration mConfig;
    boolean mVisible;
    long mLastTabKeyEventTime;

    // Top level views
    RecentsView mRecentsView;
@@ -512,18 +513,34 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_TAB) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_TAB: {
                boolean hasRepKeyTimeElapsed = (System.currentTimeMillis() -
                        mLastTabKeyEventTime) > mConfig.altTabKeyDelay;
                if (event.getRepeatCount() <= 0 || hasRepKeyTimeElapsed) {
                    // Focus the next task in the stack
                    final boolean backward = event.isShiftPressed();
                    mRecentsView.focusNextTask(!backward);
                    mLastTabKeyEventTime = System.currentTimeMillis();
                }
                return true;
        } else if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
            }
            case KeyEvent.KEYCODE_DPAD_UP: {
                mRecentsView.focusNextTask(true);
                return true;
        } else if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
            }
            case KeyEvent.KEYCODE_DPAD_DOWN: {
                mRecentsView.focusNextTask(false);
                return true;
            }
            case KeyEvent.KEYCODE_DEL:
            case KeyEvent.KEYCODE_FORWARD_DEL: {
                mRecentsView.dismissFocusedTask();
                return true;
            }
            default:
                break;
        }
        // Pass through the debug trigger
        mDebugTrigger.onKeyEvent(keyCode);
        return super.onKeyDown(keyCode, event);
Loading