diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsPreference.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsPreference.kt index 254d34978d..e985ba6d4f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsPreference.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsPreference.kt @@ -9,20 +9,15 @@ import androidx.preference.PreferenceViewHolder class BlockedContactsPreference @JvmOverloads constructor( context: Context, - attributeSet: AttributeSet? = null) : PreferenceCategory(context, attributeSet), View.OnClickListener { - - override fun onClick(v: View?) { - if (v is BlockedContactsLayout) { - val intent = Intent(context, BlockedContactsActivity::class.java) - context.startActivity(intent) - } - } + attributeSet: AttributeSet? = null +) : PreferenceCategory(context, attributeSet) { override fun onBindViewHolder(holder: PreferenceViewHolder) { super.onBindViewHolder(holder) - val itemView = holder.itemView - itemView.setOnClickListener(this) + holder.itemView.setOnClickListener { + val intent = Intent(context, BlockedContactsActivity::class.java) + context.startActivity(intent) + } } - -} \ No newline at end of file +} diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/appearance/AppearanceSettingsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/appearance/AppearanceSettingsActivity.kt index bfeea554ee..823728c359 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/appearance/AppearanceSettingsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/appearance/AppearanceSettingsActivity.kt @@ -78,8 +78,6 @@ class AppearanceSettingsActivity: PassphraseRequiredActionBarActivity(), View.On viewModel.setNewAccent(R.style.PrimaryGreen) } } - } else if (v == binding.systemSettingsSwitch) { - viewModel.setNewFollowSystemSettings((v as SwitchCompat).isChecked) } } @@ -115,12 +113,8 @@ class AppearanceSettingsActivity: PassphraseRequiredActionBarActivity(), View.On super.onCreate(savedInstanceState, ready) binding = ActivityAppearanceSettingsBinding.inflate(layoutInflater) setContentView(binding.root) - savedInstanceState?.let { bundle -> - val scrollStateParcel = bundle.getSparseParcelableArray(SCROLL_PARCEL) - if (scrollStateParcel != null) { - binding.scrollView.restoreHierarchyState(scrollStateParcel) - } - } + savedInstanceState?.getSparseParcelableArray(SCROLL_PARCEL) + ?.let(binding.scrollView::restoreHierarchyState) supportActionBar!!.title = getString(R.string.activity_settings_message_appearance_button_title) with (binding) { // accent toggles @@ -132,7 +126,8 @@ class AppearanceSettingsActivity: PassphraseRequiredActionBarActivity(), View.On it.setOnClickListener(this@AppearanceSettingsActivity) } // system settings toggle - systemSettingsSwitch.setOnClickListener(this@AppearanceSettingsActivity) + systemSettingsSwitch.setOnCheckedChangeListener { _, isChecked -> viewModel.setNewFollowSystemSettings(isChecked) } + systemSettingsSwitchHolder.setOnClickListener { systemSettingsSwitch.toggle() } } lifecycleScope.launchWhenResumed { @@ -148,6 +143,5 @@ class AppearanceSettingsActivity: PassphraseRequiredActionBarActivity(), View.On } } } - } -} \ No newline at end of file +} diff --git a/app/src/main/res/color/prominent_button_color.xml b/app/src/main/res/color/prominent_button_color.xml new file mode 100644 index 0000000000..8f2e692fda --- /dev/null +++ b/app/src/main/res/color/prominent_button_color.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/borderless_button_medium_background.xml b/app/src/main/res/drawable/borderless_button_medium_background.xml new file mode 100644 index 0000000000..6c72f9e72b --- /dev/null +++ b/app/src/main/res/drawable/borderless_button_medium_background.xml @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/destructive_dialog_text_button_background.xml b/app/src/main/res/drawable/destructive_dialog_text_button_background.xml index 1eff84a69b..f3e13c8000 100644 --- a/app/src/main/res/drawable/destructive_dialog_text_button_background.xml +++ b/app/src/main/res/drawable/destructive_dialog_text_button_background.xml @@ -1,11 +1,10 @@ - - - - - - - - \ No newline at end of file + + + + + + + + diff --git a/app/src/main/res/drawable/filled_button_medium_background.xml b/app/src/main/res/drawable/filled_button_medium_background.xml new file mode 100644 index 0000000000..10eb6de679 --- /dev/null +++ b/app/src/main/res/drawable/filled_button_medium_background.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/app/src/main/res/drawable/preference_bottom.xml b/app/src/main/res/drawable/preference_bottom.xml index d751c7841b..b6c5f506fd 100644 --- a/app/src/main/res/drawable/preference_bottom.xml +++ b/app/src/main/res/drawable/preference_bottom.xml @@ -1,5 +1,6 @@ - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/drawable/preference_middle.xml b/app/src/main/res/drawable/preference_middle.xml index 0f7229cb7f..bf27aacc72 100644 --- a/app/src/main/res/drawable/preference_middle.xml +++ b/app/src/main/res/drawable/preference_middle.xml @@ -1,5 +1,6 @@ - + @@ -14,4 +15,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/drawable/preference_single.xml b/app/src/main/res/drawable/preference_single.xml index da856fcd18..7caf24a084 100644 --- a/app/src/main/res/drawable/preference_single.xml +++ b/app/src/main/res/drawable/preference_single.xml @@ -1,5 +1,6 @@ - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/drawable/preference_top.xml b/app/src/main/res/drawable/preference_top.xml index a997713e23..8f56ddc870 100644 --- a/app/src/main/res/drawable/preference_top.xml +++ b/app/src/main/res/drawable/preference_top.xml @@ -1,5 +1,6 @@ - + - \ No newline at end of file + diff --git a/app/src/main/res/drawable/prominent_filled_button_medium_background.xml b/app/src/main/res/drawable/prominent_filled_button_medium_background.xml index a06a0d11e5..698a67c0a9 100644 --- a/app/src/main/res/drawable/prominent_filled_button_medium_background.xml +++ b/app/src/main/res/drawable/prominent_filled_button_medium_background.xml @@ -1,11 +1,10 @@ - - - - - - - - \ No newline at end of file + + + + + + + + diff --git a/app/src/main/res/drawable/radial_select.xml b/app/src/main/res/drawable/radial_select.xml index a56519ed6e..e09c778d0c 100644 --- a/app/src/main/res/drawable/radial_select.xml +++ b/app/src/main/res/drawable/radial_select.xml @@ -1,12 +1,21 @@ - - + + + + + + + + + + + + + + + - + - - - - - \ No newline at end of file + diff --git a/app/src/main/res/drawable/unimportant_dialog_text_button_background.xml b/app/src/main/res/drawable/unimportant_dialog_text_button_background.xml index 1eff84a69b..f3e13c8000 100644 --- a/app/src/main/res/drawable/unimportant_dialog_text_button_background.xml +++ b/app/src/main/res/drawable/unimportant_dialog_text_button_background.xml @@ -1,11 +1,10 @@ - - - - - - - - \ No newline at end of file + + + + + + + + diff --git a/app/src/main/res/drawable/unimportant_outline_button_medium_background.xml b/app/src/main/res/drawable/unimportant_outline_button_medium_background.xml index 6e0de35a5b..d12f7408d9 100644 --- a/app/src/main/res/drawable/unimportant_outline_button_medium_background.xml +++ b/app/src/main/res/drawable/unimportant_outline_button_medium_background.xml @@ -1,11 +1,13 @@ - - - - - - - - \ No newline at end of file + + + + + + + + + diff --git a/app/src/main/res/layout-sw400dp/activity_landing.xml b/app/src/main/res/layout-sw400dp/activity_landing.xml index 1e89cd967d..5e5a36704a 100644 --- a/app/src/main/res/layout-sw400dp/activity_landing.xml +++ b/app/src/main/res/layout-sw400dp/activity_landing.xml @@ -52,6 +52,7 @@ android:text="@string/activity_landing_restore_button_title" />