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

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

Merge "Indicator for task auto-select"

parents 1d0f17b4 b124d560
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
<!--
     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.
@@ -63,4 +64,12 @@
        android:background="@drawable/recents_button_bg"
        android:visibility="invisible"
        android:src="@drawable/recents_dismiss_light" />
    <ProgressBar
        android:id="@+id/focus_timer_indicator"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="5dp"
        android:layout_gravity="bottom"
        android:indeterminateOnly="false"
        android:visibility="invisible" />
</com.android.systemui.recents.views.TaskViewHeader>
+3 −0
Original line number Diff line number Diff line
@@ -177,6 +177,9 @@
    <!-- The animation duration for scrolling the stack to a particular item. -->
    <integer name="recents_animate_task_stack_scroll_duration">200</integer>

    <!-- The animation duration for scrolling the stack to a particular item. -->
    <integer name="recents_auto_advance_duration">2000</integer>

    <!-- The animation duration for entering and exiting the history. -->
    <integer name="recents_history_transition_duration">250</integer>

+5 −0
Original line number Diff line number Diff line
@@ -1173,6 +1173,11 @@
    <!-- Description for the toggle for fast-toggling recents via the recents button. DO NOT TRANSLATE -->
    <string name="overview_fast_toggle_via_button_desc">Enable launch timeout while paging</string>

    <!-- Toggles the fast-toggling indicator. DO NOT TRANSLATE -->
    <string name="overview_fast_toggle_indicator">Enable fast toggle indicator</string>
    <!-- Description for the fast-toggling indicator. DO NOT TRANSLATE -->
    <string name="overview_fast_toggle_indicator_desc">Show an indicator for the launch timeout</string>

    <!-- Toggle to set the initial scroll state to be paging or stack. DO NOT TRANSLATE -->
    <string name="overview_initial_state_paging">Initialize to paging</string>
    <!-- Description for the toggle to set the initial scroll state to be paging or stack. DO NOT TRANSLATE -->
+6 −0
Original line number Diff line number Diff line
@@ -84,6 +84,12 @@
            android:title="@string/overview_fast_toggle_via_button"
            android:summary="@string/overview_fast_toggle_via_button_desc" />

        <com.android.systemui.tuner.TunerSwitch
            android:key="overview_fast_toggle_indicator"
            android:title="@string/overview_fast_toggle_indicator"
            android:summary="@string/overview_fast_toggle_indicator_desc"
            android:dependency="overview_fast_toggle_via_button" />

    </PreferenceScreen>

    <SwitchPreference
+27 −16
Original line number Diff line number Diff line
@@ -113,12 +113,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
    private FinishRecentsRunnable mFinishLaunchHomeRunnable;

    // The trigger to automatically launch the current task
    private DozeTrigger mIterateTrigger = new DozeTrigger(500, new Runnable() {
        @Override
        public void run() {
            dismissRecentsToFocusedTask();
        }
    });
    private int mFocusTimerDuration;
    private DozeTrigger mIterateTrigger;

    /**
     * A common Runnable to finish Recents by launching Home with an animation depending on the
@@ -218,8 +214,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        boolean animateStatusBarScrim = launchState.launchedFromHome;
        boolean hasNavBarScrim = (stack.getStackTaskCount() > 0) && !config.hasTransposedNavBar;
        boolean animateNavBarScrim = true;
        mScrimViews.prepareEnterRecentsAnimation(hasStatusBarScrim, animateStatusBarScrim, hasNavBarScrim,
                animateNavBarScrim);
        mScrimViews.prepareEnterRecentsAnimation(hasStatusBarScrim, animateStatusBarScrim,
                hasNavBarScrim, animateNavBarScrim);

        // Keep track of whether we launched from the nav bar button or via alt-tab
        if (launchState.launchedWithAltTab) {
@@ -357,6 +353,14 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        getWindow().getAttributes().privateFlags |=
                WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY;

        mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration);
        mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() {
            @Override
            public void run() {
                dismissRecentsToFocusedTask();
            }
        });

        // Create the home intent runnable
        Intent homeIntent = new Intent(Intent.ACTION_MAIN, null);
        homeIntent.addCategory(Intent.CATEGORY_HOME);
@@ -543,7 +547,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
                    if (backward) {
                        EventBus.getDefault().send(new FocusPreviousTaskViewEvent());
                    } else {
                        EventBus.getDefault().send(new FocusNextTaskViewEvent());
                        EventBus.getDefault().send(
                                new FocusNextTaskViewEvent(false /* showTimerIndicator */));
                    }
                    mLastTabKeyEventTime = SystemClock.elapsedRealtime();

@@ -555,7 +560,8 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
                return true;
            }
            case KeyEvent.KEYCODE_DPAD_UP: {
                EventBus.getDefault().send(new FocusNextTaskViewEvent());
                EventBus.getDefault().send(
                        new FocusNextTaskViewEvent(false /* showTimerIndicator */));
                return true;
            }
            case KeyEvent.KEYCODE_DPAD_DOWN: {
@@ -579,7 +585,9 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD

    @Override
    public void onUserInteraction() {
        EventBus.getDefault().send(new UserInteractionEvent());
        final RecentsDebugFlags debugFlags = Recents.getDebugFlags();
        EventBus.getDefault().send(new UserInteractionEvent(debugFlags.isFastToggleRecentsEnabled()
                && debugFlags.isFastToggleIndicatorEnabled()));
    }

    @Override
@@ -603,11 +611,14 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD

    public final void onBusEvent(IterateRecentsEvent event) {
        if (!dismissHistory()) {
            final RecentsDebugFlags debugFlags = Recents.getDebugFlags();

            // Focus the next task
            EventBus.getDefault().send(new FocusNextTaskViewEvent());
            EventBus.getDefault().send(
                    new FocusNextTaskViewEvent(debugFlags.isFastToggleRecentsEnabled()
                            && debugFlags.isFastToggleIndicatorEnabled()));

            // Start dozing after the recents button is clicked
            RecentsDebugFlags debugFlags = Recents.getDebugFlags();
            if (debugFlags.isFastToggleRecentsEnabled()) {
                if (!mIterateTrigger.isDozing()) {
                    mIterateTrigger.startDozing();
Loading