use proper primary color at B&W theme on alarm switches

This commit is contained in:
tibbi 2018-03-04 20:38:25 +01:00
parent d9d84b0c2f
commit a7fe9d35da
1 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import com.simplemobiletools.clock.activities.SimpleActivity
import com.simplemobiletools.clock.extensions.formatAlarmTime
import com.simplemobiletools.clock.models.Alarm
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
import com.simplemobiletools.commons.extensions.getSelectedDaysString
import com.simplemobiletools.commons.views.MyRecyclerView
import kotlinx.android.synthetic.main.item_alarm.view.*
@ -15,6 +16,7 @@ import java.util.*
class AlarmsAdapter(activity: SimpleActivity, var alarms: ArrayList<Alarm>, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) :
MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
private val adjustedPrimaryColor = activity.getAdjustedPrimaryColor()
override fun getActionMenuId() = R.menu.cab_alarms
@ -76,7 +78,7 @@ class AlarmsAdapter(activity: SimpleActivity, var alarms: ArrayList<Alarm>, recy
alarm_days.setTextColor(textColor)
alarm_switch.isChecked = alarm.isEnabled
alarm_switch.setColors(textColor, primaryColor, backgroundColor)
alarm_switch.setColors(textColor, adjustedPrimaryColor, backgroundColor)
}
}
}