diff --git a/app/src/main/java/com/dongchyeon/calendar/MainActivity.kt b/app/src/main/java/com/dongchyeon/calendar/MainActivity.kt index 08859ac..6ae9e4d 100644 --- a/app/src/main/java/com/dongchyeon/calendar/MainActivity.kt +++ b/app/src/main/java/com/dongchyeon/calendar/MainActivity.kt @@ -5,10 +5,17 @@ import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Scaffold import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp import com.dongchyeon.calendar.ui.Calendar import com.dongchyeon.calendar.ui.theme.DongChyeonCalendarTheme import java.time.LocalDate @@ -19,15 +26,34 @@ class MainActivity : ComponentActivity() { enableEdgeToEdge() setContent { DongChyeonCalendarTheme { - var selectedDate by remember { mutableStateOf(LocalDate.now()) } + Scaffold( + containerColor = Color.White + ) { + Column(modifier = Modifier.padding(it)) { + var selectedDate by remember { mutableStateOf(LocalDate.now()) } - Column { - Calendar( - selectedDate = selectedDate - ) { - selectedDate = it + val events = listOf( + CalendarEvent( + date = LocalDate.now().plusDays(1), + imgUrl = "https://picsum.photos/200/300", + imgShape = CircleShape + ), + CalendarEvent( + date = LocalDate.now().plusDays(2), + imgUrl = "https://picsum.photos/200/300", + imgShape = RoundedCornerShape(8.dp) + ), + ) + + Calendar( + selectedDate = selectedDate, + events = events, + ) { + selectedDate = it + } } } + } } } diff --git a/calendar/build.gradle.kts b/calendar/build.gradle.kts index 086ef6e..7d595e8 100644 --- a/calendar/build.gradle.kts +++ b/calendar/build.gradle.kts @@ -1,7 +1,9 @@ +import com.vanniktech.maven.publish.SonatypeHost + plugins { alias(libs.plugins.android.library) alias(libs.plugins.jetbrains.kotlin.android) - `maven-publish` + alias(libs.plugins.maven.publish) } android { @@ -63,19 +65,39 @@ dependencies { debugImplementation(libs.androidx.ui.test.manifest) } -afterEvaluate { - publishing { - publications { - register("release") { - groupId = "com.github.DongChyeon" - artifactId = "PhotoCalendar" - version = "1.0.0" +mavenPublishing { + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) + + signAllPublications() + + coordinates("io.github.dongchyeon", "photo-calendar", "1.0.0") - pom { - name.set("PhotoCalendar") - description.set("This project features a customizable Jetpack Compose calendar that allows you to add background images to specific days.") - } + pom { + name.set("PhotoCalendar") + description.set("This project features a customizable Jetpack Compose calendar that allows you to add background images to specific days.") // 라이브러리 설명 + url.set("https://github.com/DongChyeon/PhotoCalendar.git") + inceptionYear.set("2024") + + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt") } } + + developers { + developer { + id.set("DongChyeon") + name.set("DongChyeon") + url.set("https://github.com/DongChyeon") + } + } + + scm { + url.set("https://github.com/DongChyeon/PhotoCalendar.git") + connection.set("scm:git:git://github.com/DongChyeon/PhotoCalendar.git") + developerConnection.set("scm:git:ssh://git@github.com:DongChyeon/PhotoCalendar.git") + } } } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 69eb6c3..8cc77b5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,6 +12,7 @@ composeBom = "2024.04.01" appcompat = "1.7.0" material = "1.12.0" desugar = "2.0.3" +mavenPublish = "0.29.0" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -40,3 +41,4 @@ desugar-jdk-libs = { group = "com.android.tools", name = "desugar_jdk_libs", ver android-application = { id = "com.android.application", version.ref = "agp" } jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } android-library = { id = "com.android.library", version.ref = "agp" } +maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" } diff --git a/jitpack.yml b/jitpack.yml deleted file mode 100644 index 1e41e00..0000000 --- a/jitpack.yml +++ /dev/null @@ -1,2 +0,0 @@ -jdk: - - openjdk17 \ No newline at end of file