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 committed Sep 13, 2024
1 parent e2f113a commit e41f317
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,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(preferenceCategorySync, titleColor);
// setupInternalTwoWaySyncPreference(preferenceCategorySync, titleColor);
}

/**
Expand Down Expand Up @@ -401,7 +402,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);
Expand All @@ -428,7 +428,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;
});
Expand Down Expand Up @@ -648,7 +647,7 @@ private void setupAutoUploadPreference(PreferenceCategory preferenceCategoryMore

private void setupInternalTwoWaySyncPreference(PreferenceCategory preferenceCategorySync, 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 -> {
Expand Down Expand Up @@ -859,6 +858,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 @@ -878,6 +878,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 All @@ -901,7 +917,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);
}

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 @@ -991,6 +991,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 @@ -1197,6 +1197,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
8 changes: 6 additions & 2 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@
android:layout="@layout/custom_preference_layout"
android:summary="@string/prefs_sycned_folders_summary" />

<Preference
<!-- <Preference
android:title="@string/internal_two_way_sync"
android:key="internal_two_way_sync"
android:layout="@layout/custom_preference_layout"
android:summary="@string/prefs_two_way_sync_summary" />
android:summary="@string/prefs_two_way_sync_summary" />-->
</com.owncloud.android.ui.PreferenceCustomCategory>

<com.owncloud.android.ui.PreferenceCustomCategory
Expand Down Expand Up @@ -160,6 +160,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 e41f317

Please sign in to comment.