diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0672a53..8ba8ff3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -66,13 +66,8 @@ android:value=".MainActivity" /> - - + android:name=".DbManagementActivity" + android:label="@string/db_management_activity_label" /> dbInfoTask; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_debug); + setContentView(R.layout.activity_db_management); onDbInfoButtonClick(null); } @@ -55,7 +55,7 @@ public class DebugActivity extends AppCompatActivity { @Subscribe(threadMode = ThreadMode.MAIN_ORDERED) public void onSecondaryDbUpdateFinished(SecondaryDbUpdateFinished event) { - setResult(getString(R.string.debug_update_result, + setResult(getString(R.string.db_management_update_result, YacbHolder.getCommunityDatabase().getEffectiveDbVersion())); } diff --git a/app/src/main/java/dummydomain/yetanothercallblocker/MainActivity.java b/app/src/main/java/dummydomain/yetanothercallblocker/MainActivity.java index 8db3635..e06902c 100644 --- a/app/src/main/java/dummydomain/yetanothercallblocker/MainActivity.java +++ b/app/src/main/java/dummydomain/yetanothercallblocker/MainActivity.java @@ -205,10 +205,6 @@ public class MainActivity extends AppCompatActivity { startActivity(new Intent(this, SettingsActivity.class)); } - public void onOpenDebugActivity(MenuItem item) { - startActivity(new Intent(this, DebugActivity.class)); - } - private void onCallLogItemClicked(CallLogItem item) { InfoDialogHelper.showDialog(this, item.numberInfo, null); } diff --git a/app/src/main/java/dummydomain/yetanothercallblocker/SettingsActivity.java b/app/src/main/java/dummydomain/yetanothercallblocker/SettingsActivity.java index a072840..e38134f 100644 --- a/app/src/main/java/dummydomain/yetanothercallblocker/SettingsActivity.java +++ b/app/src/main/java/dummydomain/yetanothercallblocker/SettingsActivity.java @@ -102,6 +102,7 @@ public class SettingsActivity extends AppCompatActivity private static final String PREF_AUTO_UPDATE_ENABLED = "autoUpdateEnabled"; private static final String PREF_CATEGORY_NOTIFICATIONS = "categoryNotifications"; private static final String PREF_SCREEN_ADVANCED = "screenAdvanced"; + private static final String PREF_DB_MANAGEMENT = "dbManagement"; private static final String PREF_COUNTRY_CODES_INFO = "countryCodesInfo"; private static final String PREF_EXPORT_LOGCAT = "exportLogcat"; @@ -213,6 +214,12 @@ public class SettingsActivity extends AppCompatActivity private void initAdvancedScreen(String rootKey) { if (!PREF_SCREEN_ADVANCED.equals(rootKey)) return; + requireNonNull((Preference) findPreference(PREF_DB_MANAGEMENT)) + .setOnPreferenceClickListener(preference -> { + startActivity(new Intent(getActivity(), DbManagementActivity.class)); + return true; + }); + String countryCodesExplanationSummary = getString(R.string.country_codes_info_summary) + ". " + getString(R.string.country_codes_info_summary_addition, App.getSettings().getCachedAutoDetectedCountryCode()); diff --git a/app/src/main/res/layout/activity_debug.xml b/app/src/main/res/layout/activity_db_management.xml similarity index 84% rename from app/src/main/res/layout/activity_debug.xml rename to app/src/main/res/layout/activity_db_management.xml index 49efc00..e1a3ad0 100644 --- a/app/src/main/res/layout/activity_debug.xml +++ b/app/src/main/res/layout/activity_db_management.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".DebugActivity"> + tools:context=".DbManagementActivity"> + android:text="@string/db_management_db_info" />