Skip to content

Commit

Permalink
Feature #9: Update MainActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
0se0 committed Dec 6, 2024
1 parent ac8ee8b commit 696e90f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 108 deletions.
55 changes: 0 additions & 55 deletions app/src/main/java/org/sopt/and/data/DataSource.kt

This file was deleted.

51 changes: 0 additions & 51 deletions app/src/main/java/org/sopt/and/data/UserRepository.kt

This file was deleted.

11 changes: 9 additions & 2 deletions app/src/main/java/org/sopt/and/feature/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import org.sopt.and.core.designsystem.theme.color.ChangeStatusBarColor
import org.sopt.and.data.UserRepository
import org.sopt.and.data.datasourceImpl.UserDataLocalSourceImpl
import org.sopt.and.data.repository.UserRepository
import org.sopt.and.domain.repository.UserRepositoryImpl
import org.sopt.and.feature.home.HomeRoute
import org.sopt.and.feature.login.LoginRoute
import org.sopt.and.feature.login.LoginViewModel
Expand All @@ -33,7 +35,12 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
userRepository = UserRepository(userService, applicationContext)
val sharedPreferences = applicationContext.getSharedPreferences("UserPrefs", MODE_PRIVATE)
val userDataSource = UserDataLocalSourceImpl(sharedPreferences)
userRepository = UserRepositoryImpl(
userService = userService,
userDataSource = userDataSource
)

setContent {
val isLoggedIn = remember { mutableStateOf(userRepository.isLoggedIn()) }
Expand Down

0 comments on commit 696e90f

Please sign in to comment.