From 9f550efeb099ea58f9b89935dd6a56dcadcb57ab Mon Sep 17 00:00:00 2001 From: A117870935 Date: Fri, 19 Apr 2024 13:04:23 +0530 Subject: [PATCH] Added delete account menu under settings. NMC-3041 --- .../android/ui/activity/SettingsActivity.java | 37 ++++++++++----- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values/setup.xml | 1 + app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/preferences.xml | 46 +++++++++---------- 5 files changed, 52 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java index 670c44e8cf4a..43248e3b755e 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java @@ -199,7 +199,7 @@ public void onCreate(Bundle savedInstanceState) { // About // Not required in NMC - //setupAboutCategory(appVersion); + // setupAboutCategory(appVersion); // Data Privacy setupDataPrivacyCategory(titleColor); @@ -364,9 +364,10 @@ public void onBackPressed() { private void setupSyncCategory(int titleColor) { final PreferenceCategory preferenceCategorySync = (PreferenceCategory) findPreference("sync"); - + preferenceCategorySync.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_category_sync), + titleColor)); setupAutoUploadPreference(preferenceCategorySync, titleColor); - setupInternalTwoWaySyncPreference(titleColor); + // setupInternalTwoWaySyncPreference(titleColor); } /** @@ -413,7 +414,6 @@ private void setupDataPrivacyCategory(int titleColor) { getResources().getString(R.string.privacy_policy)); intent.putExtra(ExternalSiteWebView.EXTRA_URL, privacyUrl.toString()); intent.putExtra(ExternalSiteWebView.EXTRA_SHOW_SIDEBAR, false); - intent.putExtra(ExternalSiteWebView.EXTRA_MENU_ITEM_ID, -1); } startActivity(intent); @@ -440,7 +440,6 @@ private void setupDataPrivacyCategory(int titleColor) { getResources().getString(R.string.prefs_open_source)); intent.putExtra(ExternalSiteWebView.EXTRA_URL, getResources().getString(R.string.sourcecode_url)); intent.putExtra(ExternalSiteWebView.EXTRA_SHOW_SIDEBAR, false); - intent.putExtra(ExternalSiteWebView.EXTRA_MENU_ITEM_ID, -1); startActivity(intent); return true; }); @@ -461,7 +460,7 @@ private void setupMoreCategory(int titleColor) { preferenceCategoryMore.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_category_more), titleColor)); - setupCalendarPreference(preferenceCategoryMore); + setupCalendarPreference(preferenceCategoryMore); setupBackupPreference(titleColor); @@ -659,7 +658,7 @@ private void setupAutoUploadPreference(PreferenceCategory preferenceCategoryMore private void setupInternalTwoWaySyncPreference(int titleColor) { Preference twoWaySync = findPreference("internal_two_way_sync"); - twoWaySync.setTitle(StringUtils.getColorSpan(getString(R.string.drawer_synced_folders), + twoWaySync.setTitle(StringUtils.getColorSpan(getString(R.string.internal_two_way_sync), titleColor)); twoWaySync.setOnPreferenceClickListener(preference -> { @@ -673,7 +672,7 @@ private void setupBackupPreference(int titleColor) { Preference pContactsBackup = findPreference("backup"); if (pContactsBackup != null) { boolean showCalendarBackup = getResources().getBoolean(R.bool.show_calendar_backup); - //NMC Customization + // NMC Customization pContactsBackup.setTitle(StringUtils.getColorSpan(getString(R.string.actionbar_contacts), titleColor)); pContactsBackup.setSummary(showCalendarBackup ? getString(R.string.prefs_daily_backup_summary) @@ -737,7 +736,7 @@ private void setupDetailsCategory(int titleColor, PreferenceScreen preferenceScr private void setupShowMediaScanNotifications(PreferenceCategory preferenceCategoryDetails, boolean fShowMediaScanNotifications, int titleColor) { SwitchPreference mShowMediaScanNotifications = (SwitchPreference) findPreference(PREFERENCE_SHOW_MEDIA_SCAN_NOTIFICATIONS); - mShowMediaScanNotifications.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_storage_path), + mShowMediaScanNotifications.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_enable_media_scan_notifications), titleColor)); if (fShowMediaScanNotifications) { preferenceCategoryDetails.removePreference(mShowMediaScanNotifications); @@ -835,7 +834,7 @@ private void setupLockPreference(PreferenceCategory preferenceCategoryDetails, } private void setupAutoUploadCategory(int titleColor, PreferenceScreen preferenceScreen) { - PreferenceCategory preferenceCategorySyncedFolders = + final PreferenceCategory preferenceCategorySyncedFolders = (PreferenceCategory) findPreference("synced_folders_category"); preferenceCategorySyncedFolders.setTitle(StringUtils.getColorSpan(getString(R.string.drawer_synced_folders), titleColor)); @@ -879,6 +878,7 @@ private void setUpServiceCategory(int titleColor) { preferenceCategoryService.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_category_service), titleColor)); setupHelpPreference(titleColor); + setupDeleteAccountPreference(titleColor); setupImprintPreference(titleColor); } @@ -898,6 +898,22 @@ private void setupHelpPreference(int titleColor) { } } + private void setupDeleteAccountPreference(int titleColor) { + Preference pHelp = findPreference("delete_account"); + if (pHelp != null) { + pHelp.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_delete_account), + titleColor)); + pHelp.setOnPreferenceClickListener(preference -> { + String helpWeb = getString(R.string.url_delete_account); + if (!helpWeb.isEmpty()) { + openLinkInWebView(helpWeb, R.string.prefs_delete_account); + } + return true; + }); + + } + } + private void setupImprintPreference(int titleColor) { Preference pImprint = findPreference("imprint"); if (pImprint != null) { @@ -921,7 +937,6 @@ private void openLinkInWebView(String url, @StringRes int title) { getResources().getString(title)); externalWebViewIntent.putExtra(ExternalSiteWebView.EXTRA_URL, url); externalWebViewIntent.putExtra(ExternalSiteWebView.EXTRA_SHOW_SIDEBAR, false); - externalWebViewIntent.putExtra(ExternalSiteWebView.EXTRA_MENU_ITEM_ID, -1); startActivity(externalWebViewIntent); } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 713c23565092..de01d4450c45 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -1016,6 +1016,7 @@ Datenschutz Datenschutz Datenschutzbestimmungen + Konto endgültig löschen Verwendete OpenSource Software Info Bedienung diff --git a/app/src/main/res/values/setup.xml b/app/src/main/res/values/setup.xml index 1ee060d200ad..c7738236807c 100644 --- a/app/src/main/res/values/setup.xml +++ b/app/src/main/res/values/setup.xml @@ -99,6 +99,7 @@ "https://play.google.com/store/apps/details?id=com.nextcloud.client" https://nextcloud.com/install + https://www.telekom.de/hilfe/vertrag-rechnung/login-daten-passwoerter/telekom-login-loeschen https://www.telekom.de/impressum diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2e310da098c2..da58ff7f26d6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1220,6 +1220,7 @@ Data Privacy Privacy Settings Privacy Policy + Delete account permanently Used OpenSource Software Service Generating PDF… diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index b36934671ee5..2544e448a08b 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -1,5 +1,4 @@ - - + android:summary="@string/prefs_data_storage_location_summary" + android:title="@string/prefs_data_storage_location" /> - + android:summary="@string/prefs_show_ecosystem_apps_summary" + android:title="@string/prefs_show_ecosystem_apps" /> + android:key="sync" + android:title="@string/prefs_category_sync"> + android:summary="@string/prefs_sycned_folders_summary" + android:title="@string/drawer_synced_folders" /> - + + android:key="more" + android:title="@string/prefs_category_more"> +