mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
Update SettingsActivity.kt
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user