Update SettingsActivity.kt
This commit is contained in:
parent
3a70d1ab40
commit
cd3a574aa1
|
@ -345,12 +345,15 @@ class SettingsActivity : SimpleActivity() {
|
|||
private fun setupHighlightWeekends() {
|
||||
settings_highlight_weekends.isChecked = config.highlightWeekends
|
||||
settings_highlight_weekends_color_holder.beVisibleIf(config.highlightWeekends)
|
||||
setupHighlightWeekendColorBackground()
|
||||
settings_highlight_weekends_holder.setOnClickListener {
|
||||
settings_highlight_weekends.toggle()
|
||||
config.highlightWeekends = settings_highlight_weekends.isChecked
|
||||
settings_highlight_weekends_color_holder.beVisibleIf(config.highlightWeekends)
|
||||
setupHighlightWeekendColorBackground()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupHighlightWeekendsColor() {
|
||||
settings_highlight_weekends_color.setFillWithStroke(config.highlightWeekendsColor, config.backgroundColor)
|
||||
settings_highlight_weekends_color_holder.setOnClickListener {
|
||||
|
@ -363,6 +366,14 @@ class SettingsActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun setupHighlightWeekendColorBackground() {
|
||||
if (settings_highlight_weekends_color_holder.isVisible()) {
|
||||
settings_highlight_weekends_holder.background = resources.getDrawable(R.drawable.ripple_background, theme)
|
||||
} else {
|
||||
settings_highlight_weekends_holder.background = resources.getDrawable(R.drawable.ripple_bottom_corners, theme)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupDeleteAllEvents() {
|
||||
settings_delete_all_events_holder.setOnClickListener {
|
||||
ConfirmationDialog(this, messageId = R.string.delete_all_events_confirmation) {
|
||||
|
|
Loading…
Reference in New Issue