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

Commit 72f9375a authored by Pinyao Ting's avatar Pinyao Ting
Browse files

Tips Gesture Navigation Tutorial [Part 2]

include actual implementation of gesture tutorial.

Bug: 146173041
Test: adb shell am start -a \
"com.android.quickstep.action.BACK_GESTURE_TUTORIAL"
Change-Id: Ic166f0a10d8efc22d9684f089142de164ca24c90
parent 0fd48b51
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -91,6 +91,17 @@
                  android:taskAffinity="${packageName}.locktask"
                  android:directBootAware="true" />

        <activity
            android:name="com.android.quickstep.interaction.BackGestureTutorialActivity"
            android:autoRemoveFromRecents="true"
            android:excludeFromRecents="true"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="com.android.quickstep.action.BACK_GESTURE_TUTORIAL" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

    </application>

</manifest>
+0 −29
Original line number Diff line number Diff line
<!--
    Copyright (C) 2020 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="192dp"
    android:height="192dp"
    android:viewportWidth="192"
    android:viewportHeight="192">
    <path
        android:pathData="M96,90.01"
        android:strokeWidth="2.4297"
        android:fillColor="#00000000"
        android:strokeColor="#FFC800"/>
    <path
        android:pathData="M153.24,48.09c-0.5,-1.51 -0.99,-2.86 -1.51,-4.12c-3.03,-7.1 -7.26,-13.45 -12.59,-18.88C127.68,13.42 112.4,7 96.1,7c-14,0 -27.66,4.93 -38.45,13.87C47,29.69 39.61,41.99 36.82,55.51c-0.76,3.9 -1.14,7.86 -1.14,11.78c0,16.39 6.36,31.77 17.9,43.3c2.65,2.65 5.59,5.08 8.74,7.23l0.09,24.14v22.03c0,5.33 4.82,10.01 10.32,10.01h0.41h3.85v0c0,6.23 4.53,10.93 10.53,10.93h16.94c6.01,0 10.54,-4.7 10.54,-10.93v0h4.31c5.56,0 10.26,-4.5 10.26,-9.83v-22.01c0.01,-0.06 0.01,-0.13 0.01,-0.2v-23.74c16.75,-11.15 26.73,-30.15 26.73,-50.94C156.31,60.76 155.28,54.3 153.24,48.09zM118.51,111.08l-0.46,0.29l-0.46,0.29v0.55v0.55v4.38v22.77l-14.12,0V95.9h14h2v-2v-8.5v-2h-2H74.53h-2v2v8.5v2h2h14v44.02l-14.13,0l-0.09,-23.21l-0.02,-4.3l0,-0.54l0,-0.54l-0.45,-0.29l-0.45,-0.29l-3.6,-2.36c-2.81,-1.84 -5.41,-3.95 -7.73,-6.28c-9.27,-9.26 -14.38,-21.63 -14.38,-34.82c0,-3.14 0.3,-6.31 0.9,-9.43C53.25,35.35 73.23,19 96.1,19c13.05,0 25.3,5.15 34.48,14.5c4.27,4.34 7.66,9.43 10.08,15.1c0.39,0.96 0.78,2.03 1.18,3.24c1.64,5 2.47,10.2 2.47,15.45c0,17.1 -8.27,32.58 -22.11,41.43L118.51,111.08z"
        android:fillColor="#4285F4"/>
</vector>
 No newline at end of file
+0 −7
Original line number Diff line number Diff line
@@ -69,13 +69,6 @@
    <!-- Content description for a close button. [CHAR LIMIT=NONE] -->
    <string name="back_gesture_tutorial_close_button_content_description" translatable="false">Close</string>

    <!-- Title shown on the notification of Back gesture tutorial. [CHAR LIMIT=30] -->
    <string name="back_gesture_tutorial_notification_title" translatable="false">Try the new back gesture</string>
    <!-- Subtitle shown on the notification of Back gesture tutorial. [CHAR LIMIT=60] -->
    <string name="back_gesture_tutorial_notification_subtitle" translatable="false">Learn how to go back while using your apps</string>
    <!-- Action text shown on the notification of Back gesture tutorial. [CHAR LIMIT=14] -->
    <string name="back_gesture_tutorial_notification_action_label" translatable="false">Try it</string>

    <!-- Title shown during interactive part of Back gesture tutorial for right edge. [CHAR LIMIT=30] -->
    <string name="back_gesture_tutorial_playground_title_swipe_inward_right_edge" translatable="false">Try the back gesture</string>
    <!-- Subtitle shown during interactive parts of Back gesture tutorial for right edge. [CHAR LIMIT=60] -->
+0 −19
Original line number Diff line number Diff line
<!--
    Copyright (C) 2020 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.
-->
<alias xmlns:android="http://schemas.android.com/apk/res/android">
    <intent
        android:action="com.android.quickstep.action.BACK_GESTURE_TUTORIAL" />
</alias>
 No newline at end of file
+73 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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.
 */
package com.android.quickstep.interaction;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.Window;

import androidx.fragment.app.FragmentActivity;

import com.android.launcher3.R;
import com.android.quickstep.interaction.BackGestureTutorialFragment.TutorialStep;
import com.android.quickstep.interaction.BackGestureTutorialFragment.TutorialType;

import java.util.Optional;

/** Shows the Back gesture interactive tutorial in full screen mode. */
public class BackGestureTutorialActivity extends FragmentActivity {

    Optional<BackGestureTutorialFragment> mFragment = Optional.empty();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.back_gesture_tutorial_activity);

        mFragment = Optional.of(BackGestureTutorialFragment.newInstance(TutorialStep.ENGAGED,
                TutorialType.RIGHT_EDGE_BACK_NAVIGATION));
        getSupportFragmentManager().beginTransaction()
                .add(R.id.back_gesture_tutorial_fragment_container, mFragment.get())
                .commit();
    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        if (hasFocus) {
            hideSystemUI();
        }
    }

    @Override
    public void onBackPressed() {
        if (mFragment.isPresent()) {
            mFragment.get().onBackPressed();
        }
    }

    private void hideSystemUI() {
        getWindow().getDecorView().setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                        | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                        | View.SYSTEM_UI_FLAG_FULLSCREEN);
        getWindow().setNavigationBarColor(Color.TRANSPARENT);
    }
}
Loading