mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-28 17:37:38 +01:00
use the adjusted primary color at filter checkboxes to improve b&w theme
This commit is contained in:
parent
14b94d1eb0
commit
62294150bb
@ -8,6 +8,7 @@ import com.simplemobiletools.calendar.R
|
|||||||
import com.simplemobiletools.calendar.activities.SimpleActivity
|
import com.simplemobiletools.calendar.activities.SimpleActivity
|
||||||
import com.simplemobiletools.calendar.extensions.config
|
import com.simplemobiletools.calendar.extensions.config
|
||||||
import com.simplemobiletools.calendar.models.EventType
|
import com.simplemobiletools.calendar.models.EventType
|
||||||
|
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
|
||||||
import com.simplemobiletools.commons.extensions.setBackgroundWithStroke
|
import com.simplemobiletools.commons.extensions.setBackgroundWithStroke
|
||||||
import com.simplemobiletools.commons.interfaces.MyAdapterListener
|
import com.simplemobiletools.commons.interfaces.MyAdapterListener
|
||||||
import kotlinx.android.synthetic.main.filter_event_type_view.view.*
|
import kotlinx.android.synthetic.main.filter_event_type_view.view.*
|
||||||
@ -70,7 +71,7 @@ class FilterEventTypeAdapter(val activity: SimpleActivity, val eventTypes: List<
|
|||||||
class ViewHolder(view: View, val adapterListener: MyAdapterListener, val activity: SimpleActivity) : RecyclerView.ViewHolder(view) {
|
class ViewHolder(view: View, val adapterListener: MyAdapterListener, val activity: SimpleActivity) : RecyclerView.ViewHolder(view) {
|
||||||
fun bindView(eventType: EventType): View {
|
fun bindView(eventType: EventType): View {
|
||||||
itemView.apply {
|
itemView.apply {
|
||||||
filter_event_type_checkbox.setColors(activity.config.textColor, activity.config.primaryColor, activity.config.backgroundColor)
|
filter_event_type_checkbox.setColors(activity.config.textColor, activity.getAdjustedPrimaryColor(), activity.config.backgroundColor)
|
||||||
filter_event_type_checkbox.text = eventType.getDisplayTitle()
|
filter_event_type_checkbox.text = eventType.getDisplayTitle()
|
||||||
filter_event_type_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor)
|
filter_event_type_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor)
|
||||||
filter_event_type_holder.setOnClickListener { viewClicked(!filter_event_type_checkbox.isChecked) }
|
filter_event_type_holder.setOnClickListener { viewClicked(!filter_event_type_checkbox.isChecked) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user