Skip to content

Commit

Permalink
Added delete account menu under settings.
Browse files Browse the repository at this point in the history
NMC-3041
  • Loading branch information
surinder-tsys authored and tobiasKaminsky committed Jul 19, 2024
1 parent 126c51c commit 547d6ba
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ private void setUpServiceCategory(int titleColor) {
preferenceCategoryService.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_category_service),
titleColor));
setupHelpPreference(titleColor);
setupDeleteAccountPreference(titleColor);
setupImprintPreference(titleColor);
}

Expand All @@ -849,6 +850,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) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
<string name="prefs_category_data_privacy">Datenschutz</string>
<string name="privacy_settings">Datenschutz</string>
<string name="privacy_policy">Datenschutzbestimmungen</string>
<string name="prefs_delete_account">Konto endgültig löschen</string>
<string name="prefs_open_source">Verwendete OpenSource Software</string>
<string name="prefs_category_info">Info</string>
<string name="prefs_category_service">Bedienung</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<string name="url_imprint"></string>
<string name="url_app_download">"https://play.google.com/store/apps/details?id=com.nextcloud.client"</string>
<string name="url_server_install">https://nextcloud.com/install</string>
<string name="url_delete_account">https://www.telekom.de/hilfe/vertrag-rechnung/login-daten-passwoerter/telekom-login-loeschen</string>
<!-- using different key as existing url_imprint will be duplicated during the merge process
because url_app_download will be changed in branding -->
<string name="url_imprint_nmc">https://www.telekom.de/impressum</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,7 @@
<string name="prefs_category_data_privacy">Data Privacy</string>
<string name="privacy_settings">Privacy Settings</string>
<string name="privacy_policy">Privacy Policy</string>
<string name="prefs_delete_account">Delete account permanently</string>
<string name="prefs_open_source">Used OpenSource Software</string>
<string name="prefs_category_service">Service</string>
<string name="document_scan_pdf_generation_in_progress">Generating PDF…</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
android:key="help"
android:layout="@layout/custom_preference_layout"
android:title="@string/prefs_help" />
<Preference
android:key="delete_account"
android:layout="@layout/custom_preference_layout"
android:title="@string/prefs_help" />
<Preference
android:key="imprint"
android:layout="@layout/custom_preference_layout"
Expand Down

0 comments on commit 547d6ba

Please sign in to comment.