add a toggle for setting Sunday as the first day

This commit is contained in:
tibbi 2018-03-12 20:06:05 +01:00
parent d91895f336
commit 68ee5a40c6
2 changed files with 32 additions and 0 deletions

View file

@ -24,6 +24,7 @@ class SettingsActivity : SimpleActivity() {
setupUseEnglish()
setupAvoidWhatsNew()
setupPreventPhoneFromSleeping()
setupSundayFirst()
setupShowSeconds()
setupDisplayOtherTimeZones()
setupAlarmMaxReminder()
@ -75,6 +76,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupSundayFirst() {
settings_sunday_first.isChecked = config.isSundayFirst
settings_sunday_first_holder.setOnClickListener {
settings_sunday_first.toggle()
config.isSundayFirst = settings_sunday_first.isChecked
}
}
private fun setupShowSeconds() {
settings_show_seconds.isChecked = config.showSeconds
settings_show_seconds_holder.setOnClickListener {

View file

@ -102,6 +102,29 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_sunday_first_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_sunday_first"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/sunday_first"/>
</RelativeLayout>
<View
android:id="@+id/clock_tab_divider"
android:layout_width="match_parent"