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

Commit 4059ff0a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update All set page subtitle to use the same device name used acrss the SUW" into tm-qpr-dev

parents 193f8992 6386d4b5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -189,10 +189,10 @@
    <string name="allset_hint">Swipe up to go Home</string>
    <!-- Hint string at the bottom of "All Set" page for button navigation [CHAR LIMIT=NONE] -->
    <string name="allset_button_hint">Tap the home button to go to your home screen</string>
    <!-- Description of "All Set" page on phones [CHAR LIMIT=NONE] -->
    <string name="allset_description">You\u2019re ready to start using your phone</string>
    <!-- Description of "All Set" page on tablets [CHAR LIMIT=NONE] -->
    <string name="allset_description_tablet">You\u2019re ready to start using your tablet</string>
    <!-- Description of "All Set" page on the user's device [CHAR LIMIT=NONE] -->
    <string name="allset_description_generic">You\u2019re ready to start using your <xliff:g id="device" example="Pixel 6">%1$s</xliff:g></string>
    <!-- A default device name to use in the description of the "All Set" page [CHAR LIMIT=NONE] -->
    <string name="default_device_name">device</string>
    <!-- String linking to navigation settings on "All Set" page [CHAR LIMIT=NONE] -->
    <string name="allset_navigation_settings"><annotation id="link">System navigation settings</annotation></string>

+10 −4
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.View.AccessibilityDelegate;
@@ -79,6 +80,7 @@ public class AllSetActivity extends Activity {
            "#Intent;action=com.android.settings.SEARCH_RESULT_TRAMPOLINE;S.:settings:fragment_args_key=gesture_system_navigation_input_summary;S.:settings:show_fragment=com.android.settings.gestures.SystemNavigationGestureSettings;end";
    private static final String EXTRA_ACCENT_COLOR_DARK_MODE = "suwColorAccentDark";
    private static final String EXTRA_ACCENT_COLOR_LIGHT_MODE = "suwColorAccentLight";
    private static final String EXTRA_DEVICE_NAME = "suwDeviceName";

    private static final float HINT_BOTTOM_FACTOR = 1 - .94f;

@@ -110,7 +112,8 @@ public class AllSetActivity extends Activity {

        int mode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
        boolean isDarkTheme = mode == Configuration.UI_MODE_NIGHT_YES;
        int accentColor = getIntent().getIntExtra(
        Intent intent = getIntent();
        int accentColor = intent.getIntExtra(
                isDarkTheme ? EXTRA_ACCENT_COLOR_DARK_MODE : EXTRA_ACCENT_COLOR_LIGHT_MODE,
                isDarkTheme ? Color.WHITE : Color.BLACK);

@@ -121,10 +124,12 @@ public class AllSetActivity extends Activity {
        mContentView = findViewById(R.id.content_view);
        mSwipeUpShift = getResources().getDimension(R.dimen.allset_swipe_up_shift);

        DeviceProfile dp = InvariantDeviceProfile.INSTANCE.get(this).getDeviceProfile(this);
        TextView subtitle = findViewById(R.id.subtitle);
        subtitle.setText(dp.isTablet
                ? R.string.allset_description_tablet : R.string.allset_description);
        String suwDeviceName = intent.getStringExtra(EXTRA_DEVICE_NAME);
        subtitle.setText(getString(
                R.string.allset_description_generic,
                !TextUtils.isEmpty(suwDeviceName)
                        ? suwDeviceName : getString(R.string.default_device_name)));

        TextView tv = findViewById(R.id.navigation_settings);
        tv.setTextColor(accentColor);
@@ -138,6 +143,7 @@ public class AllSetActivity extends Activity {
        });

        TextView hintTextView = findViewById(R.id.hint);
        DeviceProfile dp = InvariantDeviceProfile.INSTANCE.get(this).getDeviceProfile(this);
        if (!dp.isGestureMode) {
            hintTextView.setText(R.string.allset_button_hint);
        }