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

Week6 #10

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open
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
37 changes: 13 additions & 24 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.serialization)
id("kotlin-kapt")
id("com.google.dagger.hilt.android")
}


val properties = Properties().apply {
load(project.rootProject.file("local.properties").inputStream())
}

android {
namespace = "org.sopt.and"
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = "org.sopt.and"
Expand Down Expand Up @@ -52,7 +49,6 @@ android {
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
Expand All @@ -61,31 +57,24 @@ dependencies {
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.navigation.runtime.ktx)
implementation(libs.lifecycle.viewmodel.compose)
implementation(libs.kotlinx.serialization.json)
implementation(libs.androidx.compose.navigation)
implementation(libs.androidx.runtime.livedata)

// network
implementation(platform(libs.okhttp.bom))
implementation(libs.okhttp)
implementation(libs.okhttp.logging.interceptor)
implementation(libs.retrofit)
implementation(libs.retrofit.kotlin.serialization.converter)

implementation(libs.androidx.datastore.preferences)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.material)
// Network
implementation(platform(libs.okhttp.bom))
implementation(libs.okhttp)
implementation(libs.okhttp.logging.interceptor)
implementation(libs.retrofit)
implementation(libs.retrofit.kotlin.serialization.converter)
implementation(libs.kotlinx.serialization.json)
//hilt
implementation(libs.hilt.android.v2511)
kapt(libs.hilt.compiler.v2511)
implementation(libs.androidx.hilt.navigation.compose)
}

kapt {
correctErrorTypes = true
}
10 changes: 5 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".MyApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -16,15 +16,15 @@
android:usesCleartextTraffic="true"
tools:targetApi="31">

<activity android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.ANDANDROID">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

</manifest>
58 changes: 6 additions & 52 deletions app/src/main/java/org/sopt/and/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,19 @@ package org.sopt.and
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.runtime.Composable
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import org.sopt.and.navigation.SignNavigation
import org.sopt.and.signup.SignUpScreen

import org.sopt.and.signin.SignInScreen

import org.sopt.and.data.service.AppContext
import org.sopt.and.presentation.navigation.Navigation
import org.sopt.and.ui.theme.ANDANDROIDTheme
import org.sopt.and.viewmodel.SignViewModel

import dagger.hilt.android.AndroidEntryPoint
import dagger.hilt.android.HiltAndroidApp

@AndroidEntryPoint
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
AppContext.init(this)

setContent {
ANDANDROIDTheme {
val signViewModel: SignViewModel = viewModel()
MyApp(signViewModel)
Navigation()
}
}
}
}

@Composable
fun MyApp(signViewModel: SignViewModel) {
val navController = rememberNavController()

NavHost(navController, startDestination = SignNavigation.SignUp.route) {
composable(SignNavigation.SignUp.route) {
SignUpScreen(
signViewModel = signViewModel,
// onNavigateBack = { navController.popBackStack() },
onNavigateToSignIn = { navController.navigate("signIn") },
)
}
composable(SignNavigation.SignIn.route) {
SignInScreen(
signViewModel = signViewModel,
onNavigateToMain = {navController.navigate("main"){
popUpTo(navController.graph.findStartDestination().id) { saveState = true }
launchSingleTop = true
}},
onNavigateToSignUp = {navController.navigate("signUp")}

)
}

composable(SignNavigation.Main.route) {
MainScreen(signViewModel = signViewModel)
}
}
}

}
91 changes: 0 additions & 91 deletions app/src/main/java/org/sopt/and/MainScreen.kt

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/java/org/sopt/and/MyApplication.kt

This file was deleted.

60 changes: 0 additions & 60 deletions app/src/main/java/org/sopt/and/api/Api.kt

This file was deleted.

25 changes: 0 additions & 25 deletions app/src/main/java/org/sopt/and/api/Auth.kt

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/main/java/org/sopt/and/api/Hobby.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.sopt.and.data.datasource

import org.sopt.and.data.model.response.MyHobbyResponseDto
import org.sopt.and.data.service.UserService

class MyHobbyDataSource(
private val userService: UserService
) {
suspend fun getMyHobby(): MyHobbyResponseDto = userService.getMyHobby()
}
Loading