Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

모듈간 순환 참조 이슈 해결 #127

Merged
merged 5 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies {
platform(libs.firebase.bom),
libs.android.material,
libs.androidx.splash,
libs.androidx.startup,
libs.androidx.activity,
libs.androidx.appcompat,
libs.androidx.constraintlayout,
Expand All @@ -39,12 +40,14 @@ dependencies {
libs.timber,
projects.data,
projects.domain,
projects.main,
projects.login,
projects.onboard,
projects.main,
projects.registerCafe,
projects.designResource,
projects.common,
projects.updateCafe,
projects.navigator,
)
}

Expand Down
18 changes: 13 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@
android:roundIcon="@mipmap/ic_launcher_round"
tools:ignore="MissingApplicationIcon">

<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">

<meta-data
android:name="us.wedemy.eggeum.android.initialize.TimberInitializer"
android:value="androidx.startup" />

</provider>

<activity
android:name=".ui.IntroActivity"
android:name=".IntroActivity"
android:exported="true"
android:theme="@style/Theme.Eggeum.Splash">

Expand All @@ -32,10 +44,6 @@

</activity>

<activity
android:name=".ui.LoginActivity"
android:theme="@style/Theme.Eggeum" />

</application>

</manifest>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

package us.wedemy.eggeum.android.ui
/*
* Designed and developed by Wedemy 2023.
*
* Licensed under the MIT.
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

package us.wedemy.eggeum.android

import android.animation.ObjectAnimator
import android.graphics.Color
Expand All @@ -18,14 +25,17 @@ import androidx.activity.viewModels
import androidx.core.animation.doOnEnd
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import us.wedemy.eggeum.android.common.extension.changeActivityWithAnimation
import us.wedemy.eggeum.android.common.extension.repeatOnStarted
import us.wedemy.eggeum.android.common.extension.startActivityWithAnimation
import us.wedemy.eggeum.android.common.ui.BaseActivity
import us.wedemy.eggeum.android.databinding.ActivityIntroBinding
import us.wedemy.eggeum.android.login.LoginActivity
import us.wedemy.eggeum.android.main.ui.MainActivity
import us.wedemy.eggeum.android.viewmodel.IntroViewModel
import us.wedemy.eggeum.android.navigator.LoginNavigator
import us.wedemy.eggeum.android.navigator.MainNavigator

@AndroidEntryPoint
class IntroActivity : BaseActivity() {
Expand All @@ -36,6 +46,12 @@ class IntroActivity : BaseActivity() {

private val viewModel by viewModels<IntroViewModel>()

@Inject
lateinit var loginNavigator: LoginNavigator

@Inject
lateinit var mainNavigator: MainNavigator

override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
super.onCreate(savedInstanceState)
Expand Down Expand Up @@ -72,13 +88,13 @@ class IntroActivity : BaseActivity() {
launch {
viewModel.navigateToLoginEvent.collect {
delay(200L)
changeActivityWithAnimation<LoginActivity>()
startActivityWithAnimation<LoginActivity>()
}
}
launch {
viewModel.navigateToMainEvent.collect {
delay(200L)
changeActivityWithAnimation<MainActivity>()
startActivityWithAnimation<MainActivity>()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

package us.wedemy.eggeum.android.viewmodel
package us.wedemy.eggeum.android

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand Down
10 changes: 1 addition & 9 deletions app/src/main/kotlin/us/wedemy/eggeum/android/app.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ package us.wedemy.eggeum.android

import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber

@HiltAndroidApp
class App : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
}
}
class App : Application()
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package us.wedemy.eggeum.android.initialize

import android.content.Context
import androidx.startup.Initializer
import timber.log.Timber
import us.wedemy.eggeum.android.BuildConfig

class TimberInitializer : Initializer<Unit> {

override fun create(context: Context) {
if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
}

override fun dependencies(): List<Class<out Initializer<*>>> {
return emptyList()
}
}
4 changes: 0 additions & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@

<resources>
<string name="app_name">이끔</string>
<string name="app_name_english">eggeum</string>

<string name="app_slogan">나에게 맞는 카페 찾기, 이끔</string>
<string name="google_login">Google 계정으로 로그인</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import android.app.Activity
import android.content.Intent
import android.os.Build

inline fun <reified T : Activity> Activity.changeActivityWithAnimation(
inline fun <reified T : Activity> Activity.startActivityWithAnimation(
intentBuilder: Intent.() -> Intent = { this },
finishActivity: Boolean = true,
withFinish: Boolean = true,
) {
startActivity(Intent(this, T::class.java).intentBuilder())
if (Build.VERSION.SDK_INT >= 34) {
Expand All @@ -26,5 +26,5 @@ inline fun <reified T : Activity> Activity.changeActivityWithAnimation(
@Suppress("DEPRECATION")
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
}
if (finishActivity) finish()
if (withFinish) finish()
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ public interface LoginRepository {
/** RefreshToken 조회*/
public suspend fun getRefreshToken(): String

/** 로그인 토큰 초기화*/
/** 로그인 토큰 제거*/
public suspend fun deleteAuthToken()
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class GetRefreshTokenUseCase @Inject constructor(
}

@Singleton
public class DeleteAuthTokenUseCase @Inject constructor(
public class LogoutUseCase @Inject constructor(
private val repository: LoginRepository,
) {
public suspend fun execute() {
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ android-hilt = "2.48"
android-play-services-location = "21.0.1"

androidx-splash = "1.0.1"
androidx-startup = "1.1.1"
androidx-core = "1.12.0"
androidx-appcompat = "1.6.1"
androidx-activity = "1.8.0-rc01"
Expand Down Expand Up @@ -91,6 +92,7 @@ android-hilt-runtime = { module = "com.google.dagger:hilt-android", version.ref
android-play-services-location = { module = "com.google.android.gms:play-services-location", version.ref = "android-play-services-location" }

androidx-splash = { module = "androidx.core:core-splashscreen", version.ref = "androidx-splash" }
androidx-startup = { module = "androidx.startup:startup-runtime", version.ref = "androidx-startup" }
androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" }
Expand Down
48 changes: 48 additions & 0 deletions login/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Designed and developed by Wedemy 2023.
*
* Licensed under the MIT.
* Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
*/

@file:Suppress("UnstableApiUsage", "INLINE_FROM_HIGHER_PLATFORM")

plugins {
eggeum("android-library")
eggeum("android-hilt")
id(libs.plugins.google.gms.get().pluginId)
alias(libs.plugins.google.secrets)
}

android {
namespace = "us.wedemy.eggeum.android.login"

buildFeatures {
viewBinding = true
buildConfig = true
}
}

dependencies {
implementations(
platform(libs.firebase.bom),
libs.android.material,
libs.androidx.activity,
libs.androidx.appcompat,
libs.androidx.constraintlayout,
libs.bundles.androidx.lifecycle,
libs.firebase.auth,
libs.google.gms.play.services.auth,
libs.insetter,
libs.timber,
projects.data,
projects.domain,
projects.designResource,
projects.common,
projects.navigator,
)
}

secrets {
defaultPropertiesFileName = "secrets.properties"
}
47 changes: 47 additions & 0 deletions login/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"project_info": {
"project_number": "44067650485",
"project_id": "eggeum-9e931",
"storage_bucket": "eggeum-9e931.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:44067650485:android:6db76e089f26635492f7fc",
"android_client_info": {
"package_name": "us.wedemy.eggeum.android.login"
}
},
"oauth_client": [
{
"client_id": "44067650485-rb29i3i8b57m4jo9dgt814tjrjqvtj38.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "us.wedemy.eggeum.android.login",
"certificate_hash": "f815bf3587470a6d12ccc191569e579132a87a68"
}
},
{
"client_id": "44067650485-m983uf8ib57mfso5gshvnvo6hd7h3ok2.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCL24sGfqpSPm5llowgHpbG9JExkmmfYtE"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "44067650485-en2vd28ie333dlaba4gb8amecuookbic.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
19 changes: 19 additions & 0 deletions login/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Designed and developed by Wedemy 2023.
~
~ Licensed under the MIT.
~ Please see full license: https://github.com/Wedemy/eggeum-android/blob/main/LICENSE
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity
android:name=".LoginActivity"
android:exported="true"
android:theme="@style/Theme.Eggeum.Login" />

</application>

</manifest>
Loading