Open Young-Seok-Kim opened 3 years ago
int sunday = day.getDate().with(DayOfWeek.SATURDAY).getDayOfMonth(); return sunday == day.getDay();
I find why can't use copyTo() i fixed material calendar version 2.0.1 -> 1.4.3
한국인이시져??? 제가 영어를 못해서 한국말로 할께욯 ㅎㅎㅎ 자바에서는 copyTo() 사ㅓ용하지않고 위방법으로 정상동작되는데 코틀린에서는 잘 모르겠네여.. 아마 같은메소드가 잇지 않을까 생각이 듭니다만,,ㅠㅠ
네! 코틀린으로 위방법대로 했는데 잘 안되더라구요 ㅜㅜ 라이브러리 버전을 내렸더니 정상작동했습니다! 라이브러리가 업데이트 되면서 해당 메소드 지원을 안하는건지 ㅜㅜ 덕분에 잘 고쳤습니다 감사합니다 ㅎㅎ
버전 2.0.1 기준 코틀린 코드는 다음과 같습니다.
여기서 DayOfWeek.SATURDAY
는 import org.threeten.bp.DayOfWeek
를 통해 불러와야합니다.
class SaturdayDecorator: DayViewDecorator { override fun shouldDecorate(day: CalendarDay?): Boolean { val sunday = day?.date?.with(DayOfWeek.SATURDAY)?.dayOfMonth return sunday == day?.day } override fun decorate(view: DayViewFacade?) { view?.addSpan(object: ForegroundColorSpan(Color.BLUE){}) } }
2.0.0 업데이트 부터 copyTo() 사용이 안되네요. 2.0.1 버전을 1.6.1으로 바꿔도 사용 가능 합니다.
I think can't use copyTo() from version 2.0.0. So You have to change the version 2.0.1 to 1.6.1. It helped me.
I tried for someday's color change but i can't use copyTo i leave part of my code please advise me. I did import for materialcalendarvie thank you
import com.prolificinteractive.materialcalendarview.CalendarDay import com.prolificinteractive.materialcalendarview.DayViewDecorator import com.prolificinteractive.materialcalendarview.DayViewFacade
....
this is error message [Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: public fun File.copyTo(target: File, overwrite: Boolean = ..., bufferSize: Int = ...): File defined in kotlin.io public fun InputStream.copyTo(out: OutputStream, bufferSize: Int = ...): Long defined in kotlin.io public fun Reader.copyTo(out: Writer, bufferSize: Int = ...): Long defined in kotlin.io]