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

Commit fb63fe85 authored by Tony Wickham's avatar Tony Wickham
Browse files

Add swipe up onboarding from apps

After launching 3 apps, we create a window at the bottom
attached to the nav bar to teach users to swipe for recents.
There is an X on this window to dismiss it, but we will keep
showing the onboarding every time they open apps until they
perform the swipe up action.

Test: manual

Bug: 70180942
Change-Id: I4b15fac918b7b1633a3c09ab0819f2acb1dce697
parent a17274fb
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2018 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
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/>
</vector>
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="48dp"
    android:layout_width="match_parent"
    android:background="@android:color/black"
    android:layout_gravity="center">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="@string/recents_swipe_up_onboarding"
        android:textColor="@android:color/white"
        android:drawableBottom="@drawable/ic_chevron_up"/>
    <ImageView
        android:id="@+id/dismiss"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:paddingTop="12dp"
        android:paddingBottom="12dp"
        android:paddingEnd="18dp"
        android:src="@drawable/ic_close_white"
        android:layout_gravity="center_vertical|end"/>
</FrameLayout>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -809,6 +809,8 @@
    <string name="recents_stack_action_button_label">Clear all</string>
    <!-- Recents: Hint text that shows on the drop targets to start multiwindow. [CHAR LIMIT=NONE] -->
    <string name="recents_drag_hint_message">Drag here to use split screen</string>
    <!-- Recents: Text that shows above the nav bar after launching a few apps. [CHAR LIMIT=NONE] -->
    <string name="recents_swipe_up_onboarding">Swipe up to switch apps</string>

    <!-- Recents: MultiStack add stack split horizontal radio button. [CHAR LIMIT=NONE] -->
    <string name="recents_multistack_add_stack_dialog_split_horizontal">Split Horizontal</string>
+6 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.app.ActivityManager.RecentTaskInfo;
import android.app.ActivityOptions;
import android.app.AppGlobals;
import android.app.IAssistDataReceiver;
import android.app.WindowConfiguration.ActivityType;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
@@ -96,11 +97,14 @@ public class ActivityManagerWrapper {
     * @return the top running task (can be {@code null}).
     */
    public ActivityManager.RunningTaskInfo getRunningTask() {
        return getRunningTask(ACTIVITY_TYPE_RECENTS /* ignoreActivityType */);
    }

    public ActivityManager.RunningTaskInfo getRunningTask(@ActivityType int ignoreActivityType) {
        // Note: The set of running tasks from the system is ordered by recency
        try {
            List<ActivityManager.RunningTaskInfo> tasks =
                    ActivityManager.getService().getFilteredTasks(1,
                            ACTIVITY_TYPE_RECENTS /* ignoreActivityType */,
                    ActivityManager.getService().getFilteredTasks(1, ignoreActivityType,
                            WINDOWING_MODE_PINNED /* ignoreWindowingMode */);
            if (tasks.isEmpty()) {
                return null;
+4 −0
Original line number Diff line number Diff line
@@ -195,6 +195,10 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        return mOverviewProxy;
    }

    public ComponentName getLauncherComponent() {
        return mLauncherComponentName;
    }

    private void disconnectFromLauncherService() {
        if (mOverviewProxy != null) {
            mOverviewProxy.asBinder().unlinkToDeath(mOverviewServiceDeathRcpt, 0);
Loading