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

Commit 2238a900 authored by Michał Brzeziński's avatar Michał Brzeziński Committed by Android (Google) Code Review
Browse files

Merge changes I269a748e,I2135920f into main

* changes:
  Adding icons to buttons in touchpad tutorial
  Updating strings in touchpad/keyboard tutorial
parents 6dd7c258 1164f6b2
Loading
Loading
Loading
Loading
+26 −0
Original line number Original line Diff line number Diff line
<!--
  ~ Copyright (C) 2024 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:tint="?attr/colorControlNormal"
    android:viewportHeight="960"
    android:viewportWidth="960">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M240,760L360,760L360,520L600,520L600,760L720,760L720,400L480,220L240,400L240,760ZM160,840L160,360L480,120L800,360L800,840L520,840L520,600L440,600L440,840L160,840ZM480,490L480,490L480,490L480,490L480,490L480,490L480,490L480,490L480,490Z" />
</vector>
+27 −0
Original line number Original line Diff line number Diff line
<!--
  ~ Copyright (C) 2024 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:autoMirrored="true"
    android:tint="?attr/colorControlNormal"
    android:viewportHeight="960"
    android:viewportWidth="960">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M120,800Q87,800 63.5,776.5Q40,753 40,720L40,240Q40,207 63.5,183.5Q87,160 120,160L200,160Q233,160 256.5,183.5Q280,207 280,240L280,720Q280,753 256.5,776.5Q233,800 200,800L120,800ZM120,721L200,721Q200,721 200,721Q200,721 200,721L200,239Q200,239 200,239Q200,239 200,239L120,239Q120,239 120,239Q120,239 120,239L120,721Q120,721 120,721Q120,721 120,721ZM440,800Q407,800 383.5,776.5Q360,753 360,720L360,240Q360,207 383.5,183.5Q407,160 440,160L840,160Q873,160 896.5,183.5Q920,207 920,240L920,720Q920,753 896.5,776.5Q873,800 840,800L440,800ZM440,721L840,721Q840,721 840,721Q840,721 840,721L840,239Q840,239 840,239Q840,239 840,239L440,239Q440,239 440,239Q440,239 440,239L440,721Q440,721 440,721Q440,721 440,721ZM200,721Q200,721 200,721Q200,721 200,721L200,239Q200,239 200,239Q200,239 200,239L200,239Q200,239 200,239Q200,239 200,239L200,721Q200,721 200,721Q200,721 200,721ZM440,721Q440,721 440,721Q440,721 440,721L440,239Q440,239 440,239Q440,239 440,239L440,239Q440,239 440,239Q440,239 440,239L440,721Q440,721 440,721Q440,721 440,721Z" />
</vector>
+12 −13
Original line number Original line Diff line number Diff line
@@ -3752,9 +3752,9 @@


    <!-- TOUCHPAD TUTORIAL-->
    <!-- TOUCHPAD TUTORIAL-->
    <!-- Label for button opening tutorial for back gesture on touchpad [CHAR LIMIT=NONE] -->
    <!-- Label for button opening tutorial for back gesture on touchpad [CHAR LIMIT=NONE] -->
    <string name="touchpad_tutorial_back_gesture_button">Back gesture</string>
    <string name="touchpad_tutorial_back_gesture_button">Go back</string>
    <!-- Label for button opening tutorial for back gesture on touchpad [CHAR LIMIT=NONE] -->
    <!-- Label for button opening tutorial for back gesture on touchpad [CHAR LIMIT=NONE] -->
    <string name="touchpad_tutorial_home_gesture_button">Home gesture</string>
    <string name="touchpad_tutorial_home_gesture_button">Go home</string>
    <!-- Label for button opening tutorial for "view recent apps" gesture on touchpad [CHAR LIMIT=NONE] -->
    <!-- Label for button opening tutorial for "view recent apps" gesture on touchpad [CHAR LIMIT=NONE] -->
    <string name="touchpad_tutorial_recent_apps_gesture_button">View recent apps</string>
    <string name="touchpad_tutorial_recent_apps_gesture_button">View recent apps</string>
    <!-- Label for button finishing touchpad tutorial [CHAR LIMIT=NONE] -->
    <!-- Label for button finishing touchpad tutorial [CHAR LIMIT=NONE] -->
@@ -3763,26 +3763,25 @@
    <!-- Touchpad back gesture action name in tutorial [CHAR LIMIT=NONE] -->
    <!-- Touchpad back gesture action name in tutorial [CHAR LIMIT=NONE] -->
    <string name="touchpad_back_gesture_action_title">Go back</string>
    <string name="touchpad_back_gesture_action_title">Go back</string>
    <!-- Touchpad back gesture guidance in gestures tutorial [CHAR LIMIT=NONE] -->
    <!-- Touchpad back gesture guidance in gestures tutorial [CHAR LIMIT=NONE] -->
    <string name="touchpad_back_gesture_guidance">To go back, swipe left or right using three fingers anywhere on the touchpad.\n\nYou can also use the keyboard shortcut
    <string name="touchpad_back_gesture_guidance">Swipe left or right using three fingers on your touchpad</string>
Action + ESC for this.</string>
    <!-- Screen title after back gesture was done successfully [CHAR LIMIT=NONE] -->
    <!-- Screen title after back gesture was done successfully [CHAR LIMIT=NONE] -->
    <string name="touchpad_back_gesture_success_title">Great job!</string>
    <string name="touchpad_back_gesture_success_title">Nice!</string>
    <!-- Text shown to the user after they complete back gesture tutorial [CHAR LIMIT=NONE] -->
    <!-- Text shown to the user after they complete back gesture tutorial [CHAR LIMIT=NONE] -->
    <string name="touchpad_back_gesture_success_body">You completed the go back gesture.</string>
    <string name="touchpad_back_gesture_success_body">You completed the go back gesture.</string>
    <!-- HOME GESTURE -->
    <!-- HOME GESTURE -->
    <!-- Touchpad home gesture action name in tutorial [CHAR LIMIT=NONE] -->
    <!-- Touchpad home gesture action name in tutorial [CHAR LIMIT=NONE] -->
    <string name="touchpad_home_gesture_action_title">Go home</string>
    <string name="touchpad_home_gesture_action_title">Go home</string>
    <!-- Touchpad home gesture guidance in gestures tutorial [CHAR LIMIT=NONE] -->
    <!-- Touchpad home gesture guidance in gestures tutorial [CHAR LIMIT=NONE] -->
    <string name="touchpad_home_gesture_guidance">To go to your home screen at any time, swipe up with three fingers from the bottom of your screen.</string>
    <string name="touchpad_home_gesture_guidance">Swipe up with three fingers on your touchpad</string>
    <!-- Screen title after home gesture was done successfully [CHAR LIMIT=NONE] -->
    <!-- Screen title after home gesture was done successfully [CHAR LIMIT=NONE] -->
    <string name="touchpad_home_gesture_success_title">Nice!</string>
    <string name="touchpad_home_gesture_success_title">Great job!</string>
    <!-- Text shown to the user after they complete home gesture tutorial [CHAR LIMIT=NONE] -->
    <!-- Text shown to the user after they complete home gesture tutorial [CHAR LIMIT=NONE] -->
    <string name="touchpad_home_gesture_success_body">You completed the go home gesture.</string>
    <string name="touchpad_home_gesture_success_body">You completed the go home gesture</string>
    <!-- RECENT APPS GESTURE -->
    <!-- RECENT APPS GESTURE -->
    <!-- Touchpad recent apps gesture action name in tutorial [CHAR LIMIT=NONE] -->
    <!-- Touchpad recent apps gesture action name in tutorial [CHAR LIMIT=NONE] -->
    <string name="touchpad_recent_apps_gesture_action_title">View recent apps</string>
    <string name="touchpad_recent_apps_gesture_action_title">View recent apps</string>
    <!-- Touchpad recent apps gesture guidance in gestures tutorial [CHAR LIMIT=NONE] -->
    <!-- Touchpad recent apps gesture guidance in gestures tutorial [CHAR LIMIT=NONE] -->
    <string name="touchpad_recent_apps_gesture_guidance">Swipe up and hold using three fingers on your touchpad.</string>
    <string name="touchpad_recent_apps_gesture_guidance">Swipe up and hold using three fingers on your touchpad</string>
    <!-- Screen title after recent apps gesture was done successfully [CHAR LIMIT=NONE] -->
    <!-- Screen title after recent apps gesture was done successfully [CHAR LIMIT=NONE] -->
    <string name="touchpad_recent_apps_gesture_success_title">Great job!</string>
    <string name="touchpad_recent_apps_gesture_success_title">Great job!</string>
    <!-- Text shown to the user after they complete recent apps gesture tutorial [CHAR LIMIT=NONE] -->
    <!-- Text shown to the user after they complete recent apps gesture tutorial [CHAR LIMIT=NONE] -->
@@ -3790,13 +3789,13 @@ Action + ESC for this.</string>


    <!-- KEYBOARD TUTORIAL-->
    <!-- KEYBOARD TUTORIAL-->
    <!-- Action key tutorial title [CHAR LIMIT=NONE] -->
    <!-- Action key tutorial title [CHAR LIMIT=NONE] -->
    <string name="tutorial_action_key_title">Action key</string>
    <string name="tutorial_action_key_title">View all apps</string>
    <!-- Action key tutorial guidance[CHAR LIMIT=NONE] -->
    <!-- Action key tutorial guidance[CHAR LIMIT=NONE] -->
    <string name="tutorial_action_key_guidance">To access your apps, press the action key on your keyboard.</string>
    <string name="tutorial_action_key_guidance">Press the action key on your keyboard</string>
    <!-- Screen title after action key pressed successfully [CHAR LIMIT=NONE] -->
    <!-- Screen title after action key pressed successfully [CHAR LIMIT=NONE] -->
    <string name="tutorial_action_key_success_title">Congratulations!</string>
    <string name="tutorial_action_key_success_title">Well done!</string>
    <!-- Text shown to the user after they complete action key tutorial [CHAR LIMIT=NONE] -->
    <!-- Text shown to the user after they complete action key tutorial [CHAR LIMIT=NONE] -->
    <string name="tutorial_action_key_success_body">You completed the action key gesture.\n\nAction + / shows all the shortcuts you have available.</string>
    <string name="tutorial_action_key_success_body">You completed the view all apps gesture</string>


    <!-- Content description for keyboard backlight brightness dialog [CHAR LIMIT=NONE] -->
    <!-- Content description for keyboard backlight brightness dialog [CHAR LIMIT=NONE] -->
    <string name="keyboard_backlight_dialog_title">Keyboard backlight</string>
    <string name="keyboard_backlight_dialog_title">Keyboard backlight</string>
+44 −19
Original line number Original line Diff line number Diff line
@@ -20,19 +20,27 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.ArrowBack
import androidx.compose.material3.Button
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.dp
import com.android.systemui.inputdevice.tutorial.ui.composable.DoneButton
import com.android.systemui.inputdevice.tutorial.ui.composable.DoneButton
import com.android.systemui.res.R
import com.android.systemui.res.R
@@ -47,20 +55,17 @@ fun TutorialSelectionScreen(
    Column(
    Column(
        verticalArrangement = Arrangement.Center,
        verticalArrangement = Arrangement.Center,
        modifier =
        modifier =
            Modifier.background(
            Modifier.background(color = MaterialTheme.colorScheme.surfaceContainer).fillMaxSize(),
                    color = MaterialTheme.colorScheme.surfaceContainer,
                )
                .fillMaxSize()
    ) {
    ) {
        TutorialSelectionButtons(
        TutorialSelectionButtons(
            onBackTutorialClicked = onBackTutorialClicked,
            onBackTutorialClicked = onBackTutorialClicked,
            onHomeTutorialClicked = onHomeTutorialClicked,
            onHomeTutorialClicked = onHomeTutorialClicked,
            onRecentAppsTutorialClicked = onRecentAppsTutorialClicked,
            onRecentAppsTutorialClicked = onRecentAppsTutorialClicked,
            modifier = Modifier.padding(60.dp)
            modifier = Modifier.padding(60.dp),
        )
        )
        DoneButton(
        DoneButton(
            onDoneButtonClicked = onDoneButtonClicked,
            onDoneButtonClicked = onDoneButtonClicked,
            modifier = Modifier.padding(horizontal = 60.dp)
            modifier = Modifier.padding(horizontal = 60.dp),
        )
        )
    }
    }
}
}
@@ -70,30 +75,36 @@ private fun TutorialSelectionButtons(
    onBackTutorialClicked: () -> Unit,
    onBackTutorialClicked: () -> Unit,
    onHomeTutorialClicked: () -> Unit,
    onHomeTutorialClicked: () -> Unit,
    onRecentAppsTutorialClicked: () -> Unit,
    onRecentAppsTutorialClicked: () -> Unit,
    modifier: Modifier = Modifier
    modifier: Modifier = Modifier,
) {
) {
    Row(
    Row(
        horizontalArrangement = Arrangement.spacedBy(20.dp),
        horizontalArrangement = Arrangement.spacedBy(20.dp),
        verticalAlignment = Alignment.CenterVertically,
        verticalAlignment = Alignment.CenterVertically,
        modifier = modifier
        modifier = modifier,
    ) {
    ) {
        TutorialButton(
        TutorialButton(
            text = stringResource(R.string.touchpad_tutorial_home_gesture_button),
            text = stringResource(R.string.touchpad_tutorial_home_gesture_button),
            icon = Icons.AutoMirrored.Outlined.ArrowBack,
            iconColor = MaterialTheme.colorScheme.onPrimary,
            onClick = onHomeTutorialClicked,
            onClick = onHomeTutorialClicked,
            color = MaterialTheme.colorScheme.primary,
            backgroundColor = MaterialTheme.colorScheme.primary,
            modifier = Modifier.weight(1f)
            modifier = Modifier.weight(1f),
        )
        )
        TutorialButton(
        TutorialButton(
            text = stringResource(R.string.touchpad_tutorial_back_gesture_button),
            text = stringResource(R.string.touchpad_tutorial_back_gesture_button),
            icon = ImageVector.vectorResource(id = R.drawable.touchpad_tutorial_home_icon),
            iconColor = MaterialTheme.colorScheme.onTertiary,
            onClick = onBackTutorialClicked,
            onClick = onBackTutorialClicked,
            color = MaterialTheme.colorScheme.tertiary,
            backgroundColor = MaterialTheme.colorScheme.tertiary,
            modifier = Modifier.weight(1f)
            modifier = Modifier.weight(1f),
        )
        )
        TutorialButton(
        TutorialButton(
            text = stringResource(R.string.touchpad_tutorial_recent_apps_gesture_button),
            text = stringResource(R.string.touchpad_tutorial_recent_apps_gesture_button),
            icon = ImageVector.vectorResource(id = R.drawable.touchpad_tutorial_recents_icon),
            iconColor = MaterialTheme.colorScheme.onSecondary,
            onClick = onRecentAppsTutorialClicked,
            onClick = onRecentAppsTutorialClicked,
            color = MaterialTheme.colorScheme.secondary,
            backgroundColor = MaterialTheme.colorScheme.secondary,
            modifier = Modifier.weight(1f)
            modifier = Modifier.weight(1f),
        )
        )
    }
    }
}
}
@@ -101,16 +112,30 @@ private fun TutorialSelectionButtons(
@Composable
@Composable
private fun TutorialButton(
private fun TutorialButton(
    text: String,
    text: String,
    icon: ImageVector,
    iconColor: Color,
    onClick: () -> Unit,
    onClick: () -> Unit,
    color: Color,
    backgroundColor: Color,
    modifier: Modifier = Modifier
    modifier: Modifier = Modifier,
) {
) {
    Button(
    Button(
        onClick = onClick,
        onClick = onClick,
        shape = RoundedCornerShape(16.dp),
        shape = RoundedCornerShape(16.dp),
        colors = ButtonDefaults.buttonColors(containerColor = color),
        colors = ButtonDefaults.buttonColors(containerColor = backgroundColor),
        modifier = modifier.aspectRatio(0.66f)
        modifier = modifier.aspectRatio(0.66f),
    ) {
        Column(
            verticalArrangement = Arrangement.Center,
            horizontalAlignment = Alignment.CenterHorizontally,
        ) {
        ) {
            Icon(
                imageVector = icon,
                contentDescription = text,
                modifier = Modifier.width(30.dp).height(30.dp),
                tint = iconColor,
            )
            Spacer(modifier = Modifier.height(16.dp))
            Text(text = text, style = MaterialTheme.typography.headlineLarge)
            Text(text = text, style = MaterialTheme.typography.headlineLarge)
        }
        }
    }
    }
}