Skip to content

Commit 9d7744b

Browse files
authored
Merge pull request #90 from LanPet-dev/develop
Develop
2 parents b4dccaa + 7fb04a2 commit 9d7744b

85 files changed

Lines changed: 816 additions & 297 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/deploymentTargetSelector.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
kotlin version: 2.0.21
2+
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
3+
1. Kotlin compile daemon is ready
4+

README.md

Lines changed: 19 additions & 3 deletions

app/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ android {
2828
}
2929

3030
dependencies {
31+
// implementation(libs.androidx.core.splashscreen)
3132
implementation(libs.androidx.browser)
3233
implementation(libs.androidx.appcompat)
3334
implementation(libs.material)
@@ -51,13 +52,14 @@ dependencies {
5152
implementation(projects.feature.free)
5253
implementation(projects.feature.myprofile)
5354
implementation(projects.feature.wiki)
55+
implementation(projects.feature.splash)
5456
implementation(projects.feature.myposts)
5557
implementation(projects.feature.settings)
5658
implementation(projects.core.designsystem)
5759
implementation(projects.domain.model)
60+
implementation(projects.domain.repository)
5861

5962
implementation(libs.hilt.android)
60-
implementation(project(":domain:repository"))
6163
ksp(libs.hilt.android.compiler)
6264

6365
implementation(libs.androidx.core.ktx)

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
66
<uses-permission android:name="android.permission.CAMERA" />
77

8-
<uses-feature android:name="android.hardware.camera" android:required="false" />
8+
<uses-feature
9+
android:name="android.hardware.camera"
10+
android:required="false" />
911

1012
<application
1113
android:name=".LanPetApplication"

app/src/main/java/com/lanpet/app/MainActivity.kt

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@ import androidx.activity.ComponentActivity
55
import androidx.activity.compose.setContent
66
import androidx.activity.enableEdgeToEdge
77
import androidx.compose.runtime.CompositionLocalProvider
8+
import androidx.navigation.compose.rememberNavController
89
import com.lanpet.core.auth.AuthManager
910
import com.lanpet.core.auth.LocalAuthManager
1011
import com.lanpet.core.designsystem.theme.LanPetAppTheme
1112
import com.lanpet.core.manager.CoilManager
1213
import com.lanpet.core.manager.LocalCoilManager
1314
import com.lanpet.core.navigation.AppNavigation
14-
import com.lanpet.domain.model.SocialAuthToken
15-
import com.lanpet.domain.repository.AuthRepository
16-
import com.lanpet.domain.repository.LandingRepository
17-
import com.lanpet.feature.auth.navigation.Login
18-
import com.lanpet.feature.landing.navigation.Landing
1915
import dagger.hilt.android.AndroidEntryPoint
20-
import kotlinx.coroutines.runBlocking
2116
import timber.log.Timber
2217
import javax.inject.Inject
2318

@@ -29,55 +24,30 @@ class MainActivity : ComponentActivity() {
2924
@Inject
3025
lateinit var coilManager: CoilManager
3126

32-
@Inject
33-
lateinit var landingRepository: LandingRepository
34-
35-
@Inject
36-
lateinit var authRepository: AuthRepository
37-
3827
override fun onCreate(savedInstanceState: Bundle?) {
28+
Timber.e("MainActivity onCreate")
29+
// 사용자가 설정한 SplashScreen 스타일을 기본으로 사용
30+
// val splashScreen = installSplashScreen()
31+
3932
super.onCreate(savedInstanceState)
4033

4134
enableEdgeToEdge()
4235
setContent {
43-
// Start destination
44-
val startDestination =
45-
runBlocking {
46-
return@runBlocking if (landingRepository.getShouldShowLanding()) {
47-
Landing
48-
} else {
49-
Login
50-
}
51-
}
52-
53-
// Auto login
54-
runBlocking {
55-
val token = authRepository.getAuthTokenFromDataStore()
56-
57-
Timber.i("token: $token")
58-
59-
if (token != null) {
60-
authManager.handleAuthentication(
61-
SocialAuthToken(
62-
socialAuthType = token.socialAuthType,
63-
accessToken = token.accessToken,
64-
refreshToken = token.refreshToken,
65-
expiresIn = token.expiresIn,
66-
expireDateTime = token.expireDateTime,
67-
),
68-
)
69-
}
70-
}
71-
36+
val navController = rememberNavController()
7237
CompositionLocalProvider(LocalAuthManager provides authManager) {
7338
CompositionLocalProvider(LocalCoilManager provides coilManager) {
7439
LanPetAppTheme {
7540
AppNavigation(
76-
startDestination = startDestination,
41+
navController = navController,
7742
)
7843
}
7944
}
8045
}
8146
}
8247
}
48+
49+
override fun onDestroy() {
50+
Timber.e("MainActivity onDestroy")
51+
super.onDestroy()
52+
}
8353
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_logo_background"/>
4+
<foreground android:drawable="@drawable/ic_logo"/>
5+
</adaptive-icon>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_logo_background"/>
4+
<foreground android:drawable="@drawable/ic_logo"/>
5+
</adaptive-icon>

0 commit comments

Comments
 (0)