android01-CalendaRun
android01-CalendaRun copied to clipboard
π μλ λ λ¬λ €λ¬λ ₯μ΄μΌ! λμ μΌμ μνμ λμμ€ μ€μΌμ€λ¬λλ€! π§ββοΈ
CKS Calendar
CKS Calendar λΌμ΄λΈλ¬λ¦¬
- μ€μΉλ²
-
μ¬μ©λ²
- μ 곡 ν¨μ
- 리μ€λ
- 컀μ€ν
- κ΄λ ¨ λ§ν¬
- κΈ°μ¬
λ¬λ €λ¬λ ₯ μ±
- μ€μΉ
- Preview
- μ©μ΄ μ 리
- κΈ°μ μ€ν
CalendarSet
λ¬λ ₯μ ν νμ΄μ§λ‘, ν νλ©΄μ 보μ¬μ€ κΈ°κ°
MonthCalendarView
κ°λ‘ μ€μμ΄νλ‘ λ¬λ ₯μ 보μ¬μ€λλ€.
YearCalendarView
μΈλ‘ μ€ν¬λ‘€λ‘ λ¬λ ₯μ 보μ¬μ€λλ€.

μ€μΉλ²
Step 1. JitPack repositoryλ₯Ό prject build.gradleμ μΆκ°ν©λλ€.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. dependencyλ₯Ό μΆκ°ν©λλ€.
dependencies {
implementation 'com.github.boostcampwm-2021:android01-CalendaRun:${version}'
}
μ¬μ©λ²
μ 곡 ν¨μ
fun setOnDateClickListener(onDateClickListener: OnDayClickListener)
fun setOnDaySecondClickListener(onDateSecondClickListener: OnDaySecondClickListener)
fun setSchedule(schedule: CalendarScheduleObject)
fun setSchedules(schedules: List<CalendarScheduleObject>)
fun setTheme(designObject: CalendarDesignObject)
fun resetTheme()
fun getDaySchedules(day: LocalDateTime): List<CalendarScheduleObject>
fun setCalendarSetList(calendarSetList: List<CalendarSet>)
fun setupDefaultCalendarSet()
리μ€λ
YearCalendarViewλλMonthCalendarViewλ₯Ό λ μ΄μμ λλ λ·° κ³μΈ΅μ μΆκ°ν©λλ€.- νμνλ€λ©΄
OnDayClickListenerλλonDaySecondClickListenerλ₯Ό μΆκ°ν μ μμ΅λλ€.
onDayClickListnerλ λ μ§λ₯Ό μ νν λ μ€νλ©λλ€.onDaySecondClickListnerλ ν΄λ¦λ λ μ§λ₯Ό μ νν λ μ€νλ©λλ€.
Example:
<com.drunkenboys.ckscalendar.yearcalendar.YearCalendarView
android:id="@+id/calendar_year"
app:onDayClick="@{(date, position) -> dayClickEvent(date)}"
app:onDaySecondClick="@{(date, position) -> daySecondClickEvent(date)}" />
<com.drunkenboys.ckscalendar.monthcalendar.MonthCalendarView
android:id="@+id/calendar_month"
app:onDayClick="@{(date, position) -> dayClickEvent(date)}"
app:onDaySecondClick="@{(date, position) -> daySecondClickEvent(date)}" />
μΌμ μΆκ°
data class CalendarScheduleObject(
val id: Int,
val color: Int,
val text: String,
val startDate: LocalDateTime,
val endDate: LocalDateTime,
val isHoliday: Boolean = false
)
val scheduleList = listOf(
CalendarScheduleObject(
0,
ScheduleColorType.ORANGE.color,
"Schedule01",
LocalDateTime.now(),
LocalDateTime.now()
),
CalendarScheduleObject(
1,
ScheduleColorType.BLUE.color,
"Schedule02",
LocalDateTime.now(),
LocalDateTime.now()
),
CalendarScheduleObject(
2,
ScheduleColorType.GRAY.color,
"Schedule03",
LocalDateTime.now(),
LocalDateTime.now()
),
)
binding.calendarMonth.setSchedules(scheduleList)
binding.calendarYear.setSchedules(scheduleList)
μ μ© μ¬μ§

컀μ€ν ν λ§
XMLμμλ μλμ μμ±λ€μ, νλ‘κ·Έλλ°μ μμ μΌλ‘λ CalendarDesignObjectλ₯Ό ν΅ν΄ λ¬λ ₯μ 컀μ€ν
μμλ₯Ό μ§μν©λλ€
XML
| Attribute | Type | description |
|---|---|---|
| weekDayTextColor | Color | νμΌ μμ |
| holidayTextColor | Color | 곡ν΄μΌ μμ |
| saturdayTextColor | Color | ν μμΌ μμ |
| sundayTextColor | Color | μΌμμΌ μμ |
| selectedFrameColor | Color | λ μ§ μ ν ν λ리 μμ Stroke μμμ λ³κ²½ |
| backgroundColor | Color | λ¬λ ₯ λ°°κ²½ μμ |
| selectedFrameDrawable | Shape Drawable | λ μ§ μ ν ν λ리 |
| visibleScheduleCount | Integer | 보μ¬μ§ μΌμ κ°μ(5κ° μ΄ν) |
CalendarDesignObject
data class CalendarDesignObject(
@ColorInt var weekDayTextColor: Int = Color.BLACK,
@ColorInt var holidayTextColor: Int = ScheduleColorType.RED.color,
@ColorInt var saturdayTextColor: Int = ScheduleColorType.BLUE.color,
@ColorInt var sundayTextColor: Int = ScheduleColorType.RED.color,
@ColorInt var selectedFrameColor: Int = ScheduleColorType.GRAY.color,
@ColorInt var backgroundColor: Int = Color.WHITE,
@DrawableRes var selectedFrameDrawable: Int = R.drawable.bg_month_date_selected,
var textSize: Float = 10f,
var textAlign: Int = Gravity.CENTER,
val weekSimpleStringSet: List<String> = listOf("μΌ", "μ", "ν", "μ", "λͺ©", "κΈ", "ν "),
val weekFullStringSet: List<String> = listOf("μΌμμΌ", "μμμΌ", "νμμΌ", "μμμΌ", "λͺ©μμΌ", "κΈμμΌ", "ν μμΌ"),
var visibleScheduleCount: Int = 3
)
κ΄λ ¨ λ§ν¬
λͺ¨λ λ¬Έμλ μν€μ μ μ₯λμ΄ μμ΅λλ€.
κΈ°μ¬
- Fork Project
- μ΄μ λ±λ‘
- Feature Branch μμ± (
git checkout -b feature/#IssueNumber) - Commit (
git commit -m 'Issue-#{Number} feat: AmazingFeature') - Push Branch (
git push origin feature/#IssueNumber) - Pull Request μμ²
λ¬λ €λ¬λ ₯
λ¬λ €λ¬λ ₯μ λΆμ€νΈμΊ ν μΉβ’λͺ¨λ°μΌ 6κΈ° Andrunken νμ΄ κ°λ° λ° μλΉμ€νκ³ μλ λ¬λ ₯ μ ν리μΌμ΄μ μ λλ€.
λ¬λ €λ¬λ ₯μ μ¬μ©μκ° μνλ λλ‘ λ¬λ ₯μ ꡬμ±νκ³ μΌμ μ κ΄λ¦¬ν μ μμ΅λλ€.
λ¬λ ₯ κ΄λ¦¬
μ¬μ©μλ μ λ¬λ ₯μ μΆκ°ν μ μκ³ , λ¬λ ₯λ€μ κ΄λ¦¬ν μ μμΌλ©°, μμ , μμ λ κ°λ₯ν©λλ€.
컀μ€ν λ¬λ ₯
μ¬μ©μλ λ¬λ ₯μ ν νμ΄μ§λ₯Ό μ λ¨μ(30μΌ)κ° μλ μμμ κΈ°κ°μ μ€μ ν μ μμ΅λλ€. λν μ€μμ΄νλ₯Ό ν΅ν΄ λ¬λ ₯μ μΌλΆ κΈ°κ°μ λ°λ‘ νμΈν μ μμ΅λλ€.
μΌμ κ΄λ¦¬
λ¬λ ₯μ μΌμ μ μΆκ°νμ¬ κ΄λ¦¬ν μ μμ΅λλ€. μΌμ μ μκ°, λ©λͺ¨λ₯Ό κΈ°λ‘ν μ μκ³ , μλ¦Όμ μ€μ νμ¬ μ νλ μκ°μ μλ¦Όμ λ°μ μ μμ΅λλ€. λν λ¬λ ₯μ νμλ μΌμ μ μμ μ νν μ μμ΅λλ€.
μΌμ κ²μ
μΌμ μ μλ¦Όμ μ€μ νμ¬ μ νλ μκ°μ μλ¦Όμ λ°μ μ μμ΅λλ€.
ν νλ©΄ μμ ―
ν νλ©΄μ μμ ―μ μΆκ°νμ¬ μ€λ μΌμ μ νμΈν μ μμ΅λλ€.
ν λ§ λ³κ²½
λ€ν¬ λͺ¨λλ₯Ό μ§μν©λλ€. λ¬λ ₯μ λμμΈ(λ¬λ ₯, κΈμ μ λ±)μ λ³κ²½ν μ μμ΅λλ€.
곡ν΄μΌ μ§μ
λ¬λ ₯μ 곡ν΄μΌμ μΌμ μ²λΌ νμν΄μ 보μ¬μ€λλ€.
μ€μΉ
Preview
μ©μ΄ μ 리
λ¬λ ₯
μ¬μ©μμ μ΅μ’ μΌμ λλ λͺ©ν (μλ₯, νλ‘μ νΈ λ±)
μ¬λΌμ΄μ€
λ¬λ ₯μ ν νμ΄μ§λ‘ ν νλ©΄μ 보μ¬μ€ κΈ°κ°
μΌμ λ¨κΈ°κ°μ μ΄λ£° λͺ©ν
κΈ°μ μ€ν
- Android Jetpack
- Lifecycle
- Databinding
- Navigation
- Room
- Hilt
- Coroutine / Flow
- MVVM
- Retrofit2