Skip to content

색상 설정 관련 이슈 #3

Description

@sonms
//gradle :app
 //calendar
    implementation ("com.github.uuranus:schedule-calendar-compose:1.0.3")

//gradle ;project
plugins {
    id("com.android.application") version "8.2.0" apply false
    id("org.jetbrains.kotlin.android") version "1.9.0" apply false
    id("org.jetbrains.kotlin.jvm") version "1.9.23"
    id("com.google.devtools.ksp") version "1.9.23-1.0.20"
    id("com.android.library") version "8.2.0" apply false
}
buildscript {
    //ext.hilt_version = "2.52"
    dependencies {
        classpath("com.google.dagger:hilt-android-gradle-plugin:2.52")
    }
}

//setting
pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_PROJECT) //FAIL_ON_PROJECT_REPOS
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}
//source code
ScheduleCalendar(
                        modifier = Modifier.fillMaxSize(), // 내부에서 명시적으로 채움
                        initialDate = ScheduleDate.create(YearMonth.now().year, YearMonth.now().monthValue, 1),
                        schedules = calendarList,
                        /*mapOf(
                            ScheduleDate.create(2024, 11, 1) to ScheduleInfo(
                                isCheckNeeded = false,
                                schedules = listOf(
                                    ScheduleData(
                                        title = "schedule1",
                                        color = blueP3,
                                        detail = "Schedule Info 1",
                                    )
                                )
                            ),
                        ),*/
                        isMondayFirst = false,
                        calendarColors = ScheduleCalendarDefaults.colors(
                            lightColors = ScheduleCalendarDefaults.defaultLightColors().copy(
                                dayOfWeeks = blueP4,
                                saturdayColor = blueExLight,
                                sundayColor = redInLight,
                                dateScheduleTextColor = Color.Red,
                                dateColor = blueP4,
                                todayIndicatorColor = blueP4,
                            ),
                            darkColors = ScheduleCalendarDefaults.defaultDarkColors().copy(
                                dayOfWeeks = blueP4,
                                saturdayColor = blueExLight,
                                sundayColor = redInLight,
                                todayIndicatorColor = blueP4,
                                dateScheduleTextColor = Color.White,
                                dateColor = blueP4
                            ),
                        ),
                        onDayClick = {
                            val formattedMonth = String.format("%02d", it.month)
                            val formattedDate = String.format("%02d", it.date)
                            selectDate = "${it.year}-${formattedMonth}-${formattedDate}"

                            coroutineScope.launch {
                                listState.scrollToItem(1) // stickyHeader는 두 번째 항목 (index 1)
                            }
                        },
                        onPageChanged = {
                            LoadingState.show()
                            val formattedMonth = String.format("%02d", it.month)
                            pageChangeDate = "${it.year}-${formattedMonth}"
                        }
                    )

다크모드와 라이트모드의 색상을 변경하려 할 시 기본으로 설정된 색상 값도 적용이 안되고 black, white의 색상값이 적용이 되지 않는 것 같습니다. 또한 라이트모드와 다크모드의

@StabilityInferred
public final data class ScheduleCalendarColors(
    val monthHeaderColor: Color,
    val horizontalDividerColor: Color,
    val dayOfWeeks: Color,
    val saturdayColor: Color,
    val sundayColor: Color,
    val dateColor: Color,
    val dateScheduleTextColor: Color,
    val todayIndicatorColor: Color,
    val todayIndicatorTextColor: Color,
    val dateAlarmColor: Color
)

예를 들어 dayOfWeeks 등 라이트모드와 다크모드의 색상이 같아야지만 색상 변경이 적용되는 문제가 있는 것 같습니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions