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/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/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/layout/activity_appearance_settings.xml b/app/src/main/res/layout/activity_appearance_settings.xml index fbafa632d5..ce33af82f1 100644 --- a/app/src/main/res/layout/activity_appearance_settings.xml +++ b/app/src/main/res/layout/activity_appearance_settings.xml @@ -11,6 +11,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> + - - - - - - - - - - - - - - - - - - - - + android:layout_height="wrap_content"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_marginVertical="@dimen/small_spacing" + android:layout_marginHorizontal="@dimen/small_spacing"> - - + - - + android:addStatesFromChildren="true" + android:gravity="center"> + + + + \ No newline at end of file