From 3ca81566d1f68d8ba7a0da9bc538577338076905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timi=20Rautam=C3=A4ki?= Date: Sat, 15 Jan 2022 16:42:42 +0000 Subject: [PATCH] SUW: use Gliflayout descriptions Set description via getGlifLayout().setDescriptionText instead of writing it in layout to display it properly in two columns when in landscape. No visual change in portrait. Change-Id: I7465a7fbc5819d429bb886a5582fb1f1d4db9a47 --- res/layout-land/sim_missing_page.xml | 10 +------ res/layout/intro_restore_activity.xml | 26 +++--------------- res/layout/setup_datetime_page.xml | 8 +----- res/layout/setup_lineage_settings.xml | 15 ----------- res/layout/setup_lockscreen.xml | 27 +++---------------- res/layout/sim_missing_page.xml | 9 +------ res/layout/update_recovery_page.xml | 14 +--------- res/values/strings.xml | 2 ++ .../setupwizard/DateTimeActivity.java | 3 ++- .../setupwizard/LineageSettingsActivity.java | 8 +++--- .../setupwizard/ScreenLockActivity.java | 3 ++- .../setupwizard/SimMissingActivity.java | 3 ++- .../setupwizard/UpdateRecoveryActivity.java | 5 +++- .../backup/RestoreIntroActivity.java | 5 ++-- 14 files changed, 28 insertions(+), 110 deletions(-) diff --git a/res/layout-land/sim_missing_page.xml b/res/layout-land/sim_missing_page.xml index d2577b04..9551d00b 100644 --- a/res/layout-land/sim_missing_page.xml +++ b/res/layout-land/sim_missing_page.xml @@ -1,7 +1,7 @@ - - - - Select backup screen lock type @@ -103,4 +104,5 @@ Updates Lineage Recovery on first boot subsequent to every update. Recovery will be updated as soon as you finish the setup. If you wish to keep it intact, disable this feature. Update Lineage Recovery alongside the OS + %1$s\n%2$s diff --git a/src/org/lineageos/setupwizard/DateTimeActivity.java b/src/org/lineageos/setupwizard/DateTimeActivity.java index d5293654..361df9c7 100644 --- a/src/org/lineageos/setupwizard/DateTimeActivity.java +++ b/src/org/lineageos/setupwizard/DateTimeActivity.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 The CyanogenMod Project - * Copyright (C) 2017-2018,2020 The LineageOS Project + * 2017-2018,2020,2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,6 +78,7 @@ public class DateTimeActivity extends BaseSetupWizardActivity implements protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setNextText(R.string.next); + getGlifLayout().setDescriptionText(getString(R.string.date_time_summary)); final Spinner spinner = (Spinner) findViewById(R.id.timezone_list); final SimpleAdapter adapter = constructTimezoneAdapter(this); diff --git a/src/org/lineageos/setupwizard/LineageSettingsActivity.java b/src/org/lineageos/setupwizard/LineageSettingsActivity.java index 130b3c60..c40b56d4 100644 --- a/src/org/lineageos/setupwizard/LineageSettingsActivity.java +++ b/src/org/lineageos/setupwizard/LineageSettingsActivity.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 The CyanogenMod Project - * Copyright (C) 2017-2020 The LineageOS Project + * 2017-2020,2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,9 +76,9 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity { String os_name = getString(R.string.os_name); String privacyPolicy = getString(R.string.services_pp_explanation, os_name); String policySummary = getString(R.string.services_find_privacy_policy, PRIVACY_POLICY_URI); - - ((TextView) findViewById(R.id.privacy_policy)).setText(privacyPolicy); - ((TextView) findViewById(R.id.find_privacy_policy)).setText(policySummary); + String servicesFullDescription = getString(R.string.services_full_description, + privacyPolicy, policySummary); + getGlifLayout().setDescriptionText(servicesFullDescription); View metricsRow = findViewById(R.id.metrics); metricsRow.setOnClickListener(mMetricsClickListener); diff --git a/src/org/lineageos/setupwizard/ScreenLockActivity.java b/src/org/lineageos/setupwizard/ScreenLockActivity.java index 74b10623..206ebd44 100644 --- a/src/org/lineageos/setupwizard/ScreenLockActivity.java +++ b/src/org/lineageos/setupwizard/ScreenLockActivity.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 The CyanogenMod Project - * Copyright (C) 2017-2021 The LineageOS Project + * 2017-2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ public class ScreenLockActivity extends SubBaseActivity { finish(); return; } + getGlifLayout().setDescriptionText(getString(R.string.lockscreen_setup_summary)); setNextAllowed(true); } diff --git a/src/org/lineageos/setupwizard/SimMissingActivity.java b/src/org/lineageos/setupwizard/SimMissingActivity.java index b6d32cc9..3092b57d 100644 --- a/src/org/lineageos/setupwizard/SimMissingActivity.java +++ b/src/org/lineageos/setupwizard/SimMissingActivity.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 The CyanogenMod Project - * Copyright (C) 2017-2021 The LineageOS Project + * 2017-2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ public class SimMissingActivity extends BaseSetupWizardActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + getGlifLayout().setDescriptionText(getString(R.string.sim_missing_summary)); mPhoneMonitor = PhoneMonitor.getInstance(); if (!mPhoneMonitor.simMissing()) { finishAction(RESULT_OK); diff --git a/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java b/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java index 2290b479..22968047 100644 --- a/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java +++ b/src/org/lineageos/setupwizard/UpdateRecoveryActivity.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 The LineageOS Project + * Copyright (C) 2020-2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,9 @@ public class UpdateRecoveryActivity extends BaseSetupWizardActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mSetupWizardApp = (SetupWizardApp) getApplication(); + getGlifLayout().setDescriptionText(getString(R.string.update_recovery_full_description, + getString(R.string.update_recovery_description), + getString(R.string.update_recovery_warning))); if (!SetupWizardUtils.hasRecoveryUpdater(this)) { Log.v(TAG, "No recovery updater, skipping UpdateRecoveryActivity"); diff --git a/src/org/lineageos/setupwizard/backup/RestoreIntroActivity.java b/src/org/lineageos/setupwizard/backup/RestoreIntroActivity.java index 351811ca..dd154dc5 100644 --- a/src/org/lineageos/setupwizard/backup/RestoreIntroActivity.java +++ b/src/org/lineageos/setupwizard/backup/RestoreIntroActivity.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2019-2020 The Calyx Institute - * Copyright (C) 2020-2021 The LineageOS Project + * 2020-2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,8 +37,7 @@ public class RestoreIntroActivity extends SubBaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - final TextView restoreSubtitle = (TextView) findViewById(R.id.intro_restore_subtitle); - restoreSubtitle.setText(getString(R.string.intro_restore_subtitle, + getGlifLayout().setDescriptionText(getString(R.string.intro_restore_subtitle, getString(R.string.os_name))); }