All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.nacular.doodle.theme.basic.date.BasicDaysOfTheWeekPanelBehavior.kt Maven / Gradle / Ivy

The newest version!
package io.nacular.doodle.theme.basic.date

import io.nacular.doodle.controls.ItemVisualizer
import io.nacular.doodle.controls.date.DaysOfTheWeekPanel
import io.nacular.doodle.controls.date.DaysOfTheWeekPanelBehavior
import io.nacular.doodle.drawing.Canvas
import io.nacular.doodle.drawing.Paint
import kotlinx.datetime.DayOfWeek

/**
 * Created by Nicholas Eddy on 2/21/22.
 */
public class BasicDaysOfTheWeekPanelBehavior(private val background: Paint, private val defaultVisualizer: ItemVisualizer?): DaysOfTheWeekPanelBehavior {
    override fun itemVisualizer(of: DaysOfTheWeekPanel): ItemVisualizer? = of.itemVisualizer ?: defaultVisualizer

    override fun render(view: DaysOfTheWeekPanel, canvas: Canvas) {
        canvas.rect(view.bounds.atOrigin, fill = background)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy