Skip to content

Commit 2382151

Browse files
committed
Added delete account menu under settings.
NMC-3041 NMC-4681 -- enable logs for debug builds
1 parent 107080e commit 2382151

File tree

8 files changed

+76
-36
lines changed

8 files changed

+76
-36
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Nextcloud - Android Client
3+
~
4+
~ SPDX-FileCopyrightText: 2025 Your Name <your@email.com>
5+
~ SPDX-License-Identifier: AGPL-3.0-or-later
6+
-->
7+
8+
<resources>
9+
<!-- enable logs in debug builds -->
10+
<bool name="logger_enabled">true</bool>
11+
</resources>

app/src/main/java/com/owncloud/android/ui/AppVersionPreference.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AppVersionPreference : Preference {
3737
var temp: String
3838
try {
3939
val pkg = context.packageManager.getPackageInfo(context.packageName, 0)
40-
temp = pkg.versionName
40+
temp = pkg.versionName ?: ""
4141
} catch (e: PackageManager.NameNotFoundException) {
4242
temp = ""
4343
Log_OC.e(TAG, "Error while showing about dialog", e)

app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public void onCreate(Bundle savedInstanceState) {
213213

214214
// About
215215
// Not required in NMC
216-
//setupAboutCategory(appVersion);
216+
// setupAboutCategory(appVersion);
217217

218218
// Data Privacy
219219
setupDataPrivacyCategory(titleColor);
@@ -395,9 +395,10 @@ public void onBackPressed() {
395395

396396
private void setupSyncCategory(int titleColor) {
397397
final PreferenceCategory preferenceCategorySync = (PreferenceCategory) findPreference("sync");
398-
398+
preferenceCategorySync.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_category_sync),
399+
titleColor));
399400
setupAutoUploadPreference(preferenceCategorySync, titleColor);
400-
setupInternalTwoWaySyncPreference(titleColor);
401+
// setupInternalTwoWaySyncPreference(titleColor);
401402
}
402403

403404
/**
@@ -444,7 +445,6 @@ private void setupDataPrivacyCategory(int titleColor) {
444445
getResources().getString(R.string.privacy_policy));
445446
intent.putExtra(ExternalSiteWebView.EXTRA_URL, privacyUrl.toString());
446447
intent.putExtra(ExternalSiteWebView.EXTRA_SHOW_SIDEBAR, false);
447-
intent.putExtra(ExternalSiteWebView.EXTRA_MENU_ITEM_ID, -1);
448448
}
449449

450450
startActivity(intent);
@@ -471,7 +471,6 @@ private void setupDataPrivacyCategory(int titleColor) {
471471
getResources().getString(R.string.prefs_open_source));
472472
intent.putExtra(ExternalSiteWebView.EXTRA_URL, getResources().getString(R.string.sourcecode_url));
473473
intent.putExtra(ExternalSiteWebView.EXTRA_SHOW_SIDEBAR, false);
474-
intent.putExtra(ExternalSiteWebView.EXTRA_MENU_ITEM_ID, -1);
475474
startActivity(intent);
476475
return true;
477476
});
@@ -492,7 +491,7 @@ private void setupMoreCategory(int titleColor) {
492491
preferenceCategoryMore.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_category_more),
493492
titleColor));
494493

495-
setupCalendarPreference(preferenceCategoryMore);
494+
setupCalendarPreference(preferenceCategoryMore);
496495

497496
setupBackupPreference(titleColor);
498497

@@ -690,7 +689,7 @@ private void setupAutoUploadPreference(PreferenceCategory preferenceCategoryMore
690689

691690
private void setupInternalTwoWaySyncPreference(int titleColor) {
692691
Preference twoWaySync = findPreference("internal_two_way_sync");
693-
twoWaySync.setTitle(StringUtils.getColorSpan(getString(R.string.drawer_synced_folders),
692+
twoWaySync.setTitle(StringUtils.getColorSpan(getString(R.string.internal_two_way_sync),
694693
titleColor));
695694

696695
twoWaySync.setOnPreferenceClickListener(preference -> {
@@ -704,7 +703,7 @@ private void setupBackupPreference(int titleColor) {
704703
Preference pContactsBackup = findPreference("backup");
705704
if (pContactsBackup != null) {
706705
boolean showCalendarBackup = getResources().getBoolean(R.bool.show_calendar_backup);
707-
//NMC Customization
706+
// NMC Customization
708707
pContactsBackup.setTitle(StringUtils.getColorSpan(getString(R.string.actionbar_contacts), titleColor));
709708
pContactsBackup.setSummary(showCalendarBackup
710709
? getString(R.string.prefs_daily_backup_summary)
@@ -768,7 +767,7 @@ private void setupDetailsCategory(int titleColor, PreferenceScreen preferenceScr
768767
private void setupShowMediaScanNotifications(PreferenceCategory preferenceCategoryDetails,
769768
boolean fShowMediaScanNotifications, int titleColor) {
770769
SwitchPreference mShowMediaScanNotifications = (SwitchPreference) findPreference(PREFERENCE_SHOW_MEDIA_SCAN_NOTIFICATIONS);
771-
mShowMediaScanNotifications.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_storage_path),
770+
mShowMediaScanNotifications.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_enable_media_scan_notifications),
772771
titleColor));
773772
if (fShowMediaScanNotifications) {
774773
preferenceCategoryDetails.removePreference(mShowMediaScanNotifications);
@@ -866,7 +865,7 @@ private void setupLockPreference(PreferenceCategory preferenceCategoryDetails,
866865
}
867866

868867
private void setupAutoUploadCategory(int titleColor, PreferenceScreen preferenceScreen) {
869-
PreferenceCategory preferenceCategorySyncedFolders =
868+
final PreferenceCategory preferenceCategorySyncedFolders =
870869
(PreferenceCategory) findPreference("synced_folders_category");
871870
preferenceCategorySyncedFolders.setTitle(StringUtils.getColorSpan(getString(R.string.drawer_synced_folders),
872871
titleColor));
@@ -910,6 +909,7 @@ private void setUpServiceCategory(int titleColor) {
910909
preferenceCategoryService.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_category_service),
911910
titleColor));
912911
setupHelpPreference(titleColor);
912+
setupDeleteAccountPreference(titleColor);
913913
setupImprintPreference(titleColor);
914914
}
915915

@@ -929,6 +929,22 @@ private void setupHelpPreference(int titleColor) {
929929
}
930930
}
931931

932+
private void setupDeleteAccountPreference(int titleColor) {
933+
Preference pHelp = findPreference("delete_account");
934+
if (pHelp != null) {
935+
pHelp.setTitle(StringUtils.getColorSpan(getString(R.string.prefs_delete_account),
936+
titleColor));
937+
pHelp.setOnPreferenceClickListener(preference -> {
938+
String helpWeb = getString(R.string.url_delete_account);
939+
if (!helpWeb.isEmpty()) {
940+
openLinkInWebView(helpWeb, R.string.prefs_delete_account);
941+
}
942+
return true;
943+
});
944+
945+
}
946+
}
947+
932948
private void setupImprintPreference(int titleColor) {
933949
Preference pImprint = findPreference("imprint");
934950
if (pImprint != null) {
@@ -952,7 +968,6 @@ private void openLinkInWebView(String url, @StringRes int title) {
952968
getResources().getString(title));
953969
externalWebViewIntent.putExtra(ExternalSiteWebView.EXTRA_URL, url);
954970
externalWebViewIntent.putExtra(ExternalSiteWebView.EXTRA_SHOW_SIDEBAR, false);
955-
externalWebViewIntent.putExtra(ExternalSiteWebView.EXTRA_MENU_ITEM_ID, -1);
956971
startActivity(externalWebViewIntent);
957972
}
958973

app/src/main/res/values-de/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,9 @@
10661066
<string name="uploader_local_files_uploaded">Fehlgeschlagene lokale Dateien erneut hochladen</string>
10671067
<string name="prefs_category_account_info">Kontoinformationen</string>
10681068
<string name="prefs_category_data_privacy">Datenschutz</string>
1069-
<string name="privacy_settings">Datenschutz</string>
1069+
<string name="privacy_settings">Datenschutz-Einstellungen</string>
10701070
<string name="privacy_policy">Datenschutzbestimmungen</string>
1071+
<string name="prefs_delete_account">Konto endgültig löschen</string>
10711072
<string name="prefs_open_source">Verwendete OpenSource Software</string>
10721073
<string name="prefs_category_info">Info</string>
10731074
<string name="prefs_category_service">Bedienung</string>

app/src/main/res/values/setup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
<string name="url_imprint"></string>
100100
<string name="url_app_download">"https://play.google.com/store/apps/details?id=com.nextcloud.client"</string>
101101
<string name="url_server_install">https://nextcloud.com/install</string>
102+
<string name="url_delete_account">https://www.telekom.de/hilfe/vertrag-rechnung/login-daten-passwoerter/telekom-login-loeschen</string>
102103
<!-- using different key as existing url_imprint will be duplicated during the merge process
103104
because url_app_download will be changed in branding -->
104105
<string name="url_imprint_nmc">https://www.telekom.de/impressum</string>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,7 @@
12801280
<string name="prefs_category_data_privacy">Data Privacy</string>
12811281
<string name="privacy_settings">Privacy Settings</string>
12821282
<string name="privacy_policy">Privacy Policy</string>
1283+
<string name="prefs_delete_account">Delete account permanently</string>
12831284
<string name="prefs_open_source">Used OpenSource Software</string>
12841285
<string name="prefs_category_service">Service</string>
12851286
<string name="document_scan_pdf_generation_in_progress">Generating PDF…</string>

app/src/main/res/xml/preferences.xml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
32
~ Nextcloud - Android Client
43
~
54
~ SPDX-FileCopyrightText: 2017-2022 Tobias Kaminsky <tobias@kaminsky.me>
@@ -27,14 +26,11 @@
2726
<com.owncloud.android.ui.PreferenceCustomCategory
2827
android:key="general"
2928
android:title="@string/prefs_category_general">
30-
<ListPreference
31-
android:key="storage_path"
29+
<Preference
30+
android:key="data_storage_location"
3231
android:layout="@layout/custom_preference_layout"
33-
android:title="@string/prefs_storage_path" />
34-
<!-- <ListPreference
35-
android:title="@string/prefs_theme_title"
36-
android:key="darkMode"
37-
android:summary="%s" />-->
32+
android:summary="@string/prefs_data_storage_location_summary"
33+
android:title="@string/prefs_data_storage_location" />
3834
</com.owncloud.android.ui.PreferenceCustomCategory>
3935

4036
<com.owncloud.android.ui.PreferenceCustomCategory
@@ -54,7 +50,7 @@
5450
<com.owncloud.android.ui.PreferenceCustomCategory
5551
android:key="details"
5652
android:title="@string/prefs_category_details">
57-
<ListPreference
53+
<com.owncloud.android.ui.ListPreferenceDialog
5854
android:defaultValue="none"
5955
android:dialogTitle="@string/prefs_lock_title"
6056
android:key="lock"
@@ -66,10 +62,10 @@
6662
android:title="@string/prefs_show_hidden_files" />
6763
<com.owncloud.android.ui.ThemeableSwitchPreference
6864
android:defaultValue="true"
69-
android:title="@string/prefs_show_ecosystem_apps"
7065
android:key="show_ecosystem_apps"
7166
android:layout="@layout/custom_preference_layout"
72-
android:summary="@string/prefs_show_ecosystem_apps_summary"/>
67+
android:summary="@string/prefs_show_ecosystem_apps_summary"
68+
android:title="@string/prefs_show_ecosystem_apps" />
7369
<com.owncloud.android.ui.ThemeableSwitchPreference
7470
android:key="show_media_scan_notifications"
7571
android:layout="@layout/custom_preference_layout"
@@ -78,24 +74,24 @@
7874
</com.owncloud.android.ui.PreferenceCustomCategory>
7975

8076
<com.owncloud.android.ui.PreferenceCustomCategory
81-
android:title="@string/prefs_category_sync"
82-
android:key="sync">
77+
android:key="sync"
78+
android:title="@string/prefs_category_sync">
8379
<Preference
84-
android:title="@string/drawer_synced_folders"
8580
android:key="syncedFolders"
8681
android:layout="@layout/custom_preference_layout"
87-
android:summary="@string/prefs_sycned_folders_summary" />
82+
android:summary="@string/prefs_sycned_folders_summary"
83+
android:title="@string/drawer_synced_folders" />
8884

89-
<Preference
90-
android:title="@string/internal_two_way_sync"
91-
android:key="internal_two_way_sync"
92-
android:layout="@layout/custom_preference_layout"
93-
android:summary="@string/prefs_two_way_sync_summary" />
85+
<!-- <Preference
86+
android:title="@string/internal_two_way_sync"
87+
android:key="internal_two_way_sync"
88+
android:layout="@layout/custom_preference_layout"
89+
android:summary="@string/prefs_two_way_sync_summary" />-->
9490
</com.owncloud.android.ui.PreferenceCustomCategory>
9591

9692
<com.owncloud.android.ui.PreferenceCustomCategory
97-
android:title="@string/prefs_category_more"
98-
android:key="more">
93+
android:key="more"
94+
android:title="@string/prefs_category_more">
9995
<Preference
10096
android:key="backup"
10197
android:layout="@layout/custom_preference_layout"
@@ -160,6 +156,10 @@
160156
android:key="help"
161157
android:layout="@layout/custom_preference_layout"
162158
android:title="@string/prefs_help" />
159+
<Preference
160+
android:key="delete_account"
161+
android:layout="@layout/custom_preference_layout"
162+
android:title="@string/prefs_help" />
163163
<Preference
164164
android:key="imprint"
165165
android:layout="@layout/custom_preference_layout"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Nextcloud - Android Client
3+
~
4+
~ SPDX-FileCopyrightText: 2025 Your Name <your@email.com>
5+
~ SPDX-License-Identifier: AGPL-3.0-or-later
6+
-->
7+
8+
<resources>
9+
<!-- disable logs in debug builds -->
10+
<bool name="logger_enabled">false</bool>
11+
</resources>

0 commit comments

Comments
 (0)