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

Commit 919521cd authored by Ale Nijamkin's avatar Ale Nijamkin Committed by Android (Google) Code Review
Browse files

Merge "[tp] Some UX polish for strings and text." into udc-dev

parents 8e2eab4f 0f3be444
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -62,8 +62,10 @@
        android:id="@id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:textColor="@color/text_color_primary"
        android:singleLine="true"
        android:maxLines="2"
        android:hyphenationFrequency="normal"
        android:ellipsize="end"
        android:text="Placeholder for stable size calculation, please do not remove."
        tools:ignore="HardcodedText" />
+2 −9
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
    <string name="clock_picker_entry_content_description">Change a custom clock</string>

    <!-- Title of a section of the customization picker where the user can configure Clock face. [CHAR LIMIT=19] -->
    <string name="clock_settings_title">Clock Settings</string>
    <string name="clock_settings_title">Clock color &amp; size</string>

    <!-- Title of a section of the customization picker where the user can configure clock color and size. [CHAR LIMIT=20] -->
    <string name="clock_color_and_size_title">Clock color &amp; size</string>
@@ -360,14 +360,7 @@
    enabled. The dialog contains a list of instructions that the user needs to take in order to
    enable the option before it can be selected again. [CHAR LIMIT=NONE].
    -->
    <string name="keyguard_affordance_enablement_dialog_headline">Shortcut unavailable</string>

    <!--
    Supporting text for a popup dialog shown when the user attempts to select an option that is not
    currently enabled. The dialog contains a list of instructions that the user needs to take in
    order to enable the option before it can be selected again. [CHAR LIMIT=NONE].
    -->
    <string name="keyguard_affordance_enablement_dialog_title">To select `<xliff:g id="appName" example="Wallet">%1$s</xliff:g>` check the following</string>
    <string name="keyguard_affordance_enablement_dialog_headline">Can\'t add shortcut</string>

    <!--
    Template for an action that opens a specific app. [CHAR LIMIT=16]
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ class KeyguardQuickAffordancePickerRepository(
            name = name,
            iconResourceId = iconResourceId,
            isEnabled = isEnabled,
            enablementInstructions = enablementInstructions ?: emptyList(),
            enablementExplanation = enablementExplanation ?: "",
            enablementActionText = enablementActionText,
            enablementActionIntent = enablementActionIntent,
            configureIntent = configureIntent,
+2 −2
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ data class KeyguardQuickAffordancePickerAffordanceModel(
    @DrawableRes val iconResourceId: Int,
    /** Whether this quick affordance is enabled. */
    val isEnabled: Boolean,
    /** If not enabled, the list of user-visible steps to re-enable it. */
    val enablementInstructions: List<String>,
    /** If not enabled, the user-visible message explaining why. */
    val enablementExplanation: String,
    /**
     * If not enabled, an optional label for a button that takes the user to a destination where
     * they can re-enable it.
+31 −32
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ private constructor(
                                    showEnablementDialog(
                                        icon = affordanceIcon,
                                        name = affordance.name,
                                        instructions = affordance.enablementInstructions,
                                        explanation = affordance.enablementExplanation,
                                        actionText = affordance.enablementActionText,
                                        actionIntent = affordance.enablementActionIntent,
                                    )
@@ -346,7 +346,7 @@ private constructor(
    private fun showEnablementDialog(
        icon: Drawable,
        name: String,
        instructions: List<String>,
        explanation: String,
        actionText: String?,
        actionIntent: Intent?,
    ) {
@@ -358,39 +358,38 @@ private constructor(
                        contentDescription = null,
                    ),
                headline = Text.Resource(R.string.keyguard_affordance_enablement_dialog_headline),
                supportingText =
                    Text.Loaded(
                        applicationContext.getString(
                            R.string.keyguard_affordance_enablement_dialog_title,
                            name
                        )
                    ),
                message =
                    Text.Loaded(
                        buildString {
                            instructions.forEachIndexed { index, instruction ->
                                if (index > 0) {
                                    append('\n')
                                }

                                append(instruction)
                            }
                        }
                    ),
                message = Text.Loaded(explanation),
                buttons =
                    listOf(
                    buildList {
                        add(
                            ButtonViewModel(
                            text = actionText?.let { Text.Loaded(actionText) }
                                    ?: Text.Resource(
                                text =
                                    Text.Resource(
                                        if (actionText != null) {
                                            // This is not the only button on the dialog.
                                            R.string.cancel
                                        } else {
                                            // This is the only button on the dialog.
                                            R.string
                                            .keyguard_affordance_enablement_dialog_dismiss_button,
                                                .keyguard_affordance_enablement_dialog_dismiss_button
                                        }
                                    ),
                                style = ButtonStyle.Secondary,
                            ),
                        )

                        if (actionText != null) {
                            add(
                                ButtonViewModel(
                                    text = Text.Loaded(actionText),
                                    style = ButtonStyle.Primary,
                                    onClicked = {
                                        actionIntent?.let { intent -> requestActivityStart(intent) }
                                    }
                                ),
                    ),
                            )
                        }
                    },
            )
    }

Loading