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

Commit 7b7604f5 authored by Will Leshner's avatar Will Leshner
Browse files

Improve glanceable hub lockscreen affordance string.

Also, added an action intent to the disabled dialog to take users to
settings where they can enable "Widgets on lock screen" if it is
disabled.

Bug: 378173531
Test: manually
Flag: EXEMPT bugfix
Change-Id: I5b26eb19b40127e55c263a6f25063fe094d084b9
parent 0825a072
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1336,10 +1336,12 @@
    <string name="communal_widgets_disclaimer_text">To open an app using a widget, you\u2019ll need to verify it\u2019s you. Also, keep in mind that anyone can view them, even when your tablet\u2019s locked. Some widgets may not have been intended for your lock screen and may be unsafe to add here.</string>
    <!-- Button for user to verify they understand the information presented. [CHAR LIMIT=50] -->
    <string name="communal_widgets_disclaimer_button">Got it</string>
    <!-- Lockscreen affordance to open glanceable hub. [CHAR LIMIT=20] -->
    <!-- Label for a lock screen affordance to show widgets on the lock screen. [CHAR LIMIT=20] -->
    <string name="glanceable_hub_lockscreen_affordance_label">Widgets</string>
    <!-- Text explaining that the glanceable hub affordance is disabled. [CHAR LIMIT=NONE] -->
    <string name="glanceable_hub_lockscreen_affordance_disabled_text">To add Widgets on the lock screen as a shortcut, make sure it is enabled in settings.</string>
    <!-- Text explaining why the lock screen affordance to show widgets on the lockscreen is disabled and how to enable the affordance in settings. [CHAR LIMIT=NONE] -->
    <string name="glanceable_hub_lockscreen_affordance_disabled_text">To add the \"Widgets\" shortcut, make sure \"Show widgets on lock screen\" is enabled in settings.</string>
    <!-- Label for a button used to open Settings in order to enable showing widgets on the lock screen. [CHAR LIMIT=NONE] -->
    <string name="glanceable_hub_lockscreen_affordance_action_button_label">Settings</string>

    <!-- Related to user switcher --><skip/>

+9 −1
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.systemui.keyguard.data.quickaffordance

import android.content.Context
import android.content.Intent
import android.provider.Settings
import android.util.Log
import com.android.systemui.Flags.glanceableHubShortcutButton
import com.android.systemui.animation.Expandable
@@ -86,7 +88,13 @@ constructor(
        } else if (!communalInteractor.isCommunalEnabled.value) {
            Log.i(TAG, "Button disabled in picker: hub not enabled in settings.")
            KeyguardQuickAffordanceConfig.PickerScreenState.Disabled(
                context.getString(R.string.glanceable_hub_lockscreen_affordance_disabled_text)
                explanation =
                    context.getString(R.string.glanceable_hub_lockscreen_affordance_disabled_text),
                actionText =
                    context.getString(
                        R.string.glanceable_hub_lockscreen_affordance_action_button_label
                    ),
                actionIntent = Intent(Settings.ACTION_LOCKSCREEN_SETTINGS),
            )
        } else {
            KeyguardQuickAffordanceConfig.PickerScreenState.Default()