diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt index 6a9c5bd8..6ae36730 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/SettingsActivity.kt @@ -21,8 +21,12 @@ class SettingsActivity : SimpleActivity() { private var blockedNumbersAtPause = -1 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() { @@ -51,17 +55,13 @@ class SettingsActivity : SimpleActivity() { refreshMessages() } - arrayOf(settings_color_customization_label, settings_general_settings_label, settings_outgoing_messages_label, settings_notifications_label).forEach { - it.setTextColor(getProperPrimaryColor()) - } - arrayOf( - settings_color_customization_holder, - settings_general_settings_holder, - settings_outgoing_messages_holder, - settings_notifications_holder + settings_color_customization_section_label, + settings_general_settings_label, + settings_outgoing_messages_label, + settings_notifications_label ).forEach { - it.background.applyColorFilter(getProperBackgroundColor().getContrastColor()) + it.setTextColor(getProperPrimaryColor()) } } @@ -72,32 +72,20 @@ class SettingsActivity : SimpleActivity() { private fun setupPurchaseThankYou() { settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled()) - - // make sure the corners at ripple fit the stroke rounded corners - if (settings_purchase_thank_you_holder.isGone()) { - settings_use_english_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) - settings_language_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) - } - settings_purchase_thank_you_holder.setOnClickListener { launchPurchaseThankYouIntent() } } private fun setupCustomizeColors() { - settings_customize_colors_label.text = getCustomizeColorsString() - settings_customize_colors_holder.setOnClickListener { + settings_color_customization_label.text = getCustomizeColorsString() + settings_color_customization_holder.setOnClickListener { handleCustomizeColorsClick() } } private fun setupCustomizeNotifications() { settings_customize_notifications_holder.beVisibleIf(isOreoPlus()) - - if (settings_customize_notifications_holder.isGone()) { - settings_lock_screen_visibility_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme) - } - settings_customize_notifications_holder.setOnClickListener { launchCustomizeNotificationsIntent() } @@ -116,11 +104,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_purchase_thank_you_holder.isGone()) { - settings_change_date_time_format_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) - } - settings_language_holder.setOnClickListener { launchChangeAppLanguageIntent() } @@ -272,5 +255,4 @@ class SettingsActivity : SimpleActivity() { else -> R.string.mms_file_size_limit_none } ) - } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 8a3f4e3d..7083d0c3 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -6,28 +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:text="@string/language" /> - - - - - + android:layout_below="@+id/settings_language_label" + tools:text="English" /> - + - + - - - + android:text="@string/change_date_and_time_format" /> - + - + - + android:text="@string/manage_blocked_numbers" /> - + - + - + android:text="@string/font_size" /> - + - + - - + - + android:layout_height="wrap_content"> - + android:text="@string/customize_notifications" /> - + - + - + android:text="@string/lock_screen_visibility" /> - + - + - - + - + android:layout_height="wrap_content"> - + android:text="@string/show_character_counter" /> - + - + - + android:text="@string/use_simple_characters" /> - + - + - + android:text="@string/send_on_enter" /> - + - + - + android:text="@string/enable_delivery_reports" /> - + - + - + android:text="@string/send_long_message_mms" /> - + - + - + android:text="@string/group_message_mms" /> - + - + - + android:text="@string/mms_file_size_limit" /> - + - - - - +