Skip to content

Commit

Permalink
Merge pull request #265 from Project-Unifest/develop
Browse files Browse the repository at this point in the history
release v1.1.0
  • Loading branch information
easyhooon authored Sep 29, 2024
2 parents 3d2599a + b5b2ad6 commit 6332041
Show file tree
Hide file tree
Showing 289 changed files with 8,752 additions and 3,098 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ secrets.properties
/app/release/*

/app/google-services.json

.kotlin/
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# unifest-android
[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.23-blue.svg)](https://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/Kotlin-2.0.0-blue.svg)](https://kotlinlang.org)
[![Gradle](https://img.shields.io/badge/gradle-8.7-green.svg)](https://gradle.org/)
[![Android Studio](https://img.shields.io/badge/Android%20Studio-2023.2.1%20%28Iguana%29-green)](https://developer.android.com/studio)
[![minSdkVersion](https://img.shields.io/badge/minSdkVersion-26-red)](https://developer.android.com/distribute/best-practices/develop/target-sdk)
Expand All @@ -23,6 +23,7 @@
## Features

## Article
- [[Android] Type-Safe Compose Navigation 적용 - 중첩(Nested) 네비게이션 구조](https://velog.io/@mraz3068/Android-Type-Safe-Compose-Navigation-Applying-in-Nested-Navigation)
- [[Android] Github Action 를 이용하여 CD 를 적용 하는 방법](https://velog.io/@mraz3068/Apply-Android-Github-Action-CD)
- [[Android] Jetpack Compose 가로 세로 길이가 같은 반응형 다이얼로그 만들기](https://velog.io/@mraz3068/Creating-Responsive-Dialog-with-Equal-Width-and-Height-in-Jetpack-Compose)
- [[Android] Jetpack Compose 에서 Snackbar Duration 을 Custom 하는 방법](https://velog.io/@mraz3068/Android-Compose-Snackbar-Duration-Custom)
Expand All @@ -35,7 +36,7 @@

- IDE : Android Studio Iguana
- JDK : Java 17을 실행할 수 있는 JDK
- Kotlin Language : 1.9.23
- Kotlin Language : 2.0.0

### Language

Expand Down
10 changes: 9 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,25 @@ dependencies {
implementations(
projects.core.common,
projects.core.data,
projects.core.database,
projects.core.datastore,
projects.core.designsystem,
projects.core.model,
projects.core.navigation,
projects.core.network,
projects.core.datastore,
projects.core.ui,

projects.feature.booth,
projects.feature.festival,
projects.feature.home,
projects.feature.intro,
projects.feature.likedBooth,
projects.feature.main,
projects.feature.map,
projects.feature.menu,
projects.feature.navigator,
projects.feature.splash,
projects.feature.stamp,
projects.feature.waiting,

libs.androidx.activity.compose,
Expand Down
94 changes: 94 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,97 @@
#-renamesourcefileattribute SourceFile

-keep class com.unifest.android.feature.map.model.** { *; }

-dontwarn com.unifest.android.core.common.ErrorHandlerActions
-dontwarn com.unifest.android.core.common.HandleExceptionKt
-dontwarn com.unifest.android.core.common.ObserveEventKt
-dontwarn com.unifest.android.core.common.PermissionDialogButtonType
-dontwarn com.unifest.android.core.common.UiText$DirectString
-dontwarn com.unifest.android.core.common.UiText
-dontwarn com.unifest.android.core.common.extension.ContextKt
-dontwarn com.unifest.android.core.common.utils.DateUtilsKt
-dontwarn com.unifest.android.core.common.utils.DpToPxKt
-dontwarn com.unifest.android.core.data.datasource.RemoteConfigDataSource
-dontwarn com.unifest.android.core.data.datasource.RemoteConfigDataSourceImpl
-dontwarn com.unifest.android.core.data.di.FirebaseModule_ProvideMessagingFactory
-dontwarn com.unifest.android.core.data.di.FirebaseModule_ProvideRemoteConfigFactory
-dontwarn com.unifest.android.core.data.repository.BoothRepository
-dontwarn com.unifest.android.core.data.repository.BoothRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.FestivalRepository
-dontwarn com.unifest.android.core.data.repository.FestivalRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.LikedBoothRepository
-dontwarn com.unifest.android.core.data.repository.LikedBoothRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.LikedFestivalRepository
-dontwarn com.unifest.android.core.data.repository.LikedFestivalRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.MessagingRepository
-dontwarn com.unifest.android.core.data.repository.MessagingRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.OnboardingRepository
-dontwarn com.unifest.android.core.data.repository.OnboardingRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.RemoteConfigRepository
-dontwarn com.unifest.android.core.data.repository.RemoteConfigRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.WaitingRepository
-dontwarn com.unifest.android.core.data.repository.WaitingRepositoryImpl
-dontwarn com.unifest.android.core.database.LikedBoothDao
-dontwarn com.unifest.android.core.database.LikedFestivalDao
-dontwarn com.unifest.android.core.database.di.DaoModule_ProvideLikedBoothDaoFactory
-dontwarn com.unifest.android.core.database.di.DaoModule_ProvideLikedFestivalDaoFactory
-dontwarn com.unifest.android.core.database.di.DatabaseModule_ProvideLikedBoothDatabaseFactory
-dontwarn com.unifest.android.core.database.di.DatabaseModule_ProvideLikedFestivalDatabaseFactory
-dontwarn com.unifest.android.core.datastore.OnboardingDataSource
-dontwarn com.unifest.android.core.datastore.OnboardingDataSourceImpl
-dontwarn com.unifest.android.core.datastore.RecentLikedFestivalDataSource
-dontwarn com.unifest.android.core.datastore.RecentLikedFestivalDataSourceImpl
-dontwarn com.unifest.android.core.datastore.TokenDataSource
-dontwarn com.unifest.android.core.datastore.TokenDataSourceImpl
-dontwarn com.unifest.android.core.datastore.di.DataStoreModule_ProvideOnboardingDataStore$datastore_releaseFactory
-dontwarn com.unifest.android.core.datastore.di.DataStoreModule_ProvideRecentFestivalDataStore$datastore_releaseFactory
-dontwarn com.unifest.android.core.designsystem.component.ButtonKt
-dontwarn com.unifest.android.core.designsystem.component.DialogKt
-dontwarn com.unifest.android.core.designsystem.component.LoadingWheelKt
-dontwarn com.unifest.android.core.designsystem.component.NetworkImageKt
-dontwarn com.unifest.android.core.designsystem.component.ScaffoldKt
-dontwarn com.unifest.android.core.designsystem.component.SearchTextFieldKt
-dontwarn com.unifest.android.core.designsystem.component.SnackBarKt
-dontwarn com.unifest.android.core.designsystem.theme.ColorKt
-dontwarn com.unifest.android.core.designsystem.theme.FontKt
-dontwarn com.unifest.android.core.designsystem.theme.ThemeKt
-dontwarn com.unifest.android.core.navigation.MainTabRoute$Home
-dontwarn com.unifest.android.core.navigation.MainTabRoute$Map
-dontwarn com.unifest.android.core.navigation.MainTabRoute$Menu
-dontwarn com.unifest.android.core.navigation.MainTabRoute$Stamp
-dontwarn com.unifest.android.core.navigation.MainTabRoute$Waiting
-dontwarn com.unifest.android.core.navigation.MainTabRoute
-dontwarn com.unifest.android.core.navigation.Route
-dontwarn com.unifest.android.core.network.di.ApiModule_ProvideUnifestService$network_releaseFactory
-dontwarn com.unifest.android.core.network.di.NetworkModule_ProvideHttpLoggingInterceptor$network_releaseFactory
-dontwarn com.unifest.android.core.network.di.NetworkModule_ProvideUnifestApiRetrofit$network_releaseFactory
-dontwarn com.unifest.android.core.network.di.NetworkModule_ProvideUnifestOkHttpClient$network_releaseFactory
-dontwarn com.unifest.android.core.network.service.UnifestService
-dontwarn com.unifest.android.core.ui.component.CameraPermissionTextProvider
-dontwarn com.unifest.android.core.ui.component.LikedFestivalGridKt
-dontwarn com.unifest.android.core.ui.component.PermissionDialogKt
-dontwarn com.unifest.android.core.ui.component.PermissionTextProvider
-dontwarn com.unifest.android.feature.booth.navigation.BoothNavigationKt
-dontwarn com.unifest.android.feature.booth.viewmodel.BoothViewModel
-dontwarn com.unifest.android.feature.booth.viewmodel.BoothViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.festival.viewmodel.FestivalViewModel
-dontwarn com.unifest.android.feature.festival.viewmodel.FestivalViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.home.navigation.HomeNavigationKt
-dontwarn com.unifest.android.feature.home.viewmodel.HomeViewModel
-dontwarn com.unifest.android.feature.home.viewmodel.HomeViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.liked_booth.navigation.LikedBoothNavigationKt
-dontwarn com.unifest.android.feature.liked_booth.viewmodel.LikedBoothViewModel
-dontwarn com.unifest.android.feature.liked_booth.viewmodel.LikedBoothViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.map.navigation.MapNavigationKt
-dontwarn com.unifest.android.feature.map.viewmodel.MapViewModel
-dontwarn com.unifest.android.feature.map.viewmodel.MapViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.menu.navigation.MenuNavigationKt
-dontwarn com.unifest.android.feature.menu.viewmodel.MenuViewModel
-dontwarn com.unifest.android.feature.menu.viewmodel.MenuViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.navigator.IntroNavigator
-dontwarn com.unifest.android.feature.navigator.MainNavigator
-dontwarn com.unifest.android.feature.navigator.Navigator$DefaultImpls
-dontwarn com.unifest.android.feature.navigator.Navigator
-dontwarn com.unifest.android.feature.waiting.navigation.WaitingNavigationKt
-dontwarn com.unifest.android.feature.waiting.viewmodel.WaitingViewModel
-dontwarn com.unifest.android.feature.waiting.viewmodel.WaitingViewModel_HiltModules$KeyModule
18 changes: 18 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<application
android:name=".UnifestApplication"
Expand Down Expand Up @@ -33,12 +39,24 @@
android:name="com.unifest.android.initializer.FirebaseCrashlyticsInitializer"
android:value="androidx.startup" />

<meta-data
android:name="com.unifest.android.initializer.FirebaseMessagingInitializer"
android:value="androidx.startup" />

</provider>

<meta-data
android:name="com.naver.maps.map.CLIENT_ID"
android:value="${NAVER_MAP_CLIENT_ID}" />

<service
android:name=".service.UnifestFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.unifest.android.initializer

import android.content.Context
import androidx.startup.Initializer
import com.google.firebase.messaging.FirebaseMessaging
import timber.log.Timber

class FirebaseMessagingInitializer : Initializer<Unit> {
override fun create(context: Context) {
FirebaseMessaging.getInstance().subscribeToTopic("2")
.addOnCompleteListener { task ->
if (task.isSuccessful) {
Timber.d("Subscribed to topic successfully")
} else {
Timber.e("Failed to subscribe to topic")
}
}
}

override fun dependencies(): List<Class<out Initializer<*>>> {
return emptyList()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.unifest.android.service

import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.os.Build
import androidx.core.app.NotificationCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.unifest.android.core.designsystem.R as designR
import com.unifest.android.feature.main.MainActivity
import timber.log.Timber

class UnifestFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
super.onMessageReceived(remoteMessage)
if (remoteMessage.notification != null) {
sendNotification(remoteMessage)
}
}

private fun sendNotification(remoteMessage: RemoteMessage) {
val requestCode = System.currentTimeMillis().toInt()

val intent = Intent(this, MainActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).also {
if (remoteMessage.data["boothId"] != null) {
if (remoteMessage.data["waitingId"] != null) {
Timber.tag("UnifestFirebaseMessagingService").d("waitingId: ${remoteMessage.data["waitingId"]}")
putExtra("navigate_to_waiting", true)
putExtra("waitingId", remoteMessage.data["waitingId"])
} else {
Timber.tag("UnifestFirebaseMessagingService").d("boothId: ${remoteMessage.data["boothId"]}")
putExtra("navigate_to_booth", true)
putExtra("boothId", remoteMessage.data["boothId"])
}
}
}
}

val pendingIntentFlags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
} else {
PendingIntent.FLAG_UPDATE_CURRENT
}
val pendingIntent = PendingIntent.getActivity(this, requestCode, intent, pendingIntentFlags)

val channelId = CHANNEL_ID

val notificationBuilder = NotificationCompat.Builder(this, channelId)
.setSmallIcon(designR.mipmap.ic_launcher)
.setContentTitle(remoteMessage.notification?.title.toString())
.setContentText(remoteMessage.notification?.body.toString())
.setAutoCancel(true)
.setContentIntent(pendingIntent)

val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager

val channel = NotificationChannel(channelId, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH)
notificationManager.createNotificationChannel(channel)

notificationManager.notify(requestCode, notificationBuilder.build())
}

override fun onNewToken(token: String) {
Timber.d("Refreshed token: $token")
}

companion object {
private const val CHANNEL_ID = "unifest"
private const val CHANNEL_NAME = "unifest_notification"
}
}
6 changes: 4 additions & 2 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ repositories {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

kotlin {
Expand All @@ -46,6 +47,7 @@ dependencies {
compileOnly(libs.gradle.android)
compileOnly(libs.gradle.kotlin)
compileOnly(libs.gradle.androidx.room)
compileOnly(libs.compose.compiler.extension)

compileOnly(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.gradle.kotlin.dsl.configure

internal class AndroidApplicationComposeConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.AndroidApplication)
applyPlugins(Plugins.ANDROID_APPLICATION, Plugins.COMPOSE_COMPILER)

extensions.configure<ApplicationExtension> {
configureCompose(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.gradle.kotlin.dsl.configure

internal class AndroidApplicationConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.AndroidApplication, Plugins.KotlinAndroid)
applyPlugins(Plugins.ANDROID_APPLICATION, Plugins.KOTLIN_ANDROID)

extensions.configure<ApplicationExtension> {
configureAndroid(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ internal class AndroidFeatureConventionPlugin : BuildLogicConventionPlugin(
implementation(project(path = ":core:designsystem"))
implementation(project(path = ":core:model"))
implementation(project(path = ":core:ui"))
implementation(project(path = ":core:navigation"))

implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.hilt.navigation.compose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import org.gradle.kotlin.dsl.dependencies

internal class AndroidFirebaseConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.GoogleServices, Plugins.FirebaseCrashlytics)
applyPlugins(Plugins.GOOGLE_SERVICES, Plugins.FIREBASE_CRASHLYTICS)

dependencies {
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.config)
implementation(libs.firebase.messaging)
}
},
)
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/AndroidHiltConventionPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.gradle.kotlin.dsl.dependencies

internal class AndroidHiltConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.hilt, Plugins.Ksp)
applyPlugins(Plugins.HILT, Plugins.KSP)

dependencies {
implementation(libs.hilt.android)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.gradle.kotlin.dsl.configure

internal class AndroidLibraryComposeConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.AndroidLibrary)
applyPlugins(Plugins.ANDROID_LIBRARY, Plugins.COMPOSE_COMPILER)

extensions.configure<LibraryExtension> {
configureCompose(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.unifest.android.libs
import org.gradle.kotlin.dsl.configure

internal class AndroidLibraryConventionPlugin : BuildLogicConventionPlugin({
applyPlugins(Plugins.AndroidLibrary, Plugins.KotlinAndroid)
applyPlugins(Plugins.ANDROID_LIBRARY, Plugins.KOTLIN_ANDROID)

extensions.configure<LibraryExtension> {
configureAndroid(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.gradle.kotlin.dsl.dependencies

internal class AndroidRetrofitConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.KotlinxSerialization)
applyPlugins(Plugins.KOTLINX_SERIALIZATION)

dependencies {
implementation(libs.retrofit)
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/AndroidRoomConventionPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.gradle.kotlin.dsl.dependencies

class AndroidRoomConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.AndroidxRoom, Plugins.KotlinxSerialization, Plugins.Ksp)
applyPlugins(Plugins.ANDROIDX_ROOM, Plugins.KOTLINX_SERIALIZATION, Plugins.KSP)

extensions.configure<RoomExtension> {
// The schemas directory contains a schema file for each version of the Room database.
Expand Down
Loading

0 comments on commit 6332041

Please sign in to comment.