From 1eac851aa5560bea065930f2fa97a5e4ced0efc4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 31 Dec 2022 10:29:56 +0100 Subject: [PATCH] updating the settings ui --- .../pro/activities/SettingsActivity.kt | 33 +- app/src/main/res/layout/activity_settings.xml | 488 ++++++++---------- .../main/res/layout/item_file_dir_list.xml | 3 +- 3 files changed, 224 insertions(+), 300 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SettingsActivity.kt index 37f82c4a..59c2d577 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SettingsActivity.kt @@ -18,9 +18,13 @@ import java.util.* import kotlin.system.exitProcess class SettingsActivity : SimpleActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + isMaterialActivity = true super.onCreate(savedInstanceState) setContentView(R.layout.activity_settings) + updateMaterialActivityViews(settings_coordinator, settings_holder, true) + setupMaterialScrollListener(settings_nested_scrollview, settings_toolbar) } override fun onResume() { @@ -46,7 +50,7 @@ class SettingsActivity : SimpleActivity() { updateTextColors(settings_nested_scrollview) arrayOf( - settings_color_customization_label, + settings_color_customization_section_label, settings_general_settings_label, settings_visibility_label, settings_scrolling_label, @@ -55,21 +59,10 @@ class SettingsActivity : SimpleActivity() { ).forEach { it.setTextColor(getProperPrimaryColor()) } - - arrayOf( - settings_color_customization_holder, - settings_general_settings_holder, - settings_visibility_holder, - settings_scrolling_holder, - settings_file_operations_holder, - settings_security_holder - ).forEach { - it.background.applyColorFilter(getProperBackgroundColor().getContrastColor()) - } } private fun setupCustomizeColors() { - settings_customize_colors_holder.setOnClickListener { + settings_color_customization_holder.setOnClickListener { startCustomizationActivity() } } @@ -87,11 +80,6 @@ class SettingsActivity : SimpleActivity() { private fun setupLanguage() { settings_language.text = Locale.getDefault().displayLanguage settings_language_holder.beVisibleIf(isTiramisuPlus()) - - if (settings_use_english_holder.isGone() && settings_language_holder.isGone()) { - settings_manage_favorites_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) - } - settings_language_holder.setOnClickListener { launchChangeAppLanguageIntent() } @@ -251,15 +239,6 @@ class SettingsActivity : SimpleActivity() { private fun setupEnableRootAccess() { settings_enable_root_access_holder.beVisibleIf(config.isRootAvailable) settings_enable_root_access.isChecked = config.enableRootAccess - - settings_file_deletion_password_protection_holder.background = resources.getDrawable( - if (settings_enable_root_access_holder.isGone()) { - R.drawable.ripple_bottom_corners - } else { - R.drawable.ripple_background - }, theme - ) - settings_enable_root_access_holder.setOnClickListener { if (!config.enableRootAccess) { RootHelpers(this).askRootIfNeeded { diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index bbc99694..106ff052 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -6,29 +6,21 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - + android:layout_height="?attr/actionBarSize" + android:background="@color/color_primary" + app:title="@string/settings" + app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" /> + android:scrollbars="none"> - + android:layout_height="wrap_content"> - + android:text="@string/customize_colors" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + - - + - + android:layout_height="wrap_content"> - + android:text="@string/use_english_language" /> - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_below="@+id/settings_font_size_label" + tools:text="@string/medium" /> - + - + - - - + android:text="@string/press_back_twice" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + android:layout_height="wrap_content"> - + android:text="@string/show_hidden_items" /> - + - - + - + android:layout_height="wrap_content"> - + android:text="@string/enable_pull_to_refresh" /> - + - - + - + android:layout_height="wrap_content"> - + android:text="@string/keep_last_modified" /> - + - + - + android:text="@string/skip_delete_confirmation" /> - + - - + - + android:layout_height="wrap_content"> - + android:text="@string/password_protect_hidden_items" /> - + - + - + android:text="@string/password_protect_whole_app" /> - + - + - + android:text="@string/password_protect_file_deletion" /> - + - + - + android:text="@string/enable_root_access" /> - - - - + diff --git a/app/src/main/res/layout/item_file_dir_list.xml b/app/src/main/res/layout/item_file_dir_list.xml index 14ca4eee..f4e37c29 100644 --- a/app/src/main/res/layout/item_file_dir_list.xml +++ b/app/src/main/res/layout/item_file_dir_list.xml @@ -15,7 +15,8 @@ android:id="@+id/item_holder" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingEnd="@dimen/activity_margin"> + android:paddingStart="@dimen/small_margin" + android:paddingEnd="@dimen/bigger_margin">