-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from Team-B1ND/feature/162-onboarding-ios-view
[Onboarding] Create iOS View
- Loading branch information
Showing
31 changed files
with
523 additions
and
522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
build-logic/src/main/kotlin/com/b1nd/dodam/primitive/MultiplatformApplicationPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.b1nd.dodam.primitive | ||
|
||
import com.b1nd.dodam.dsl.kotlin | ||
import com.b1nd.dodam.dsl.library | ||
import com.b1nd.dodam.dsl.libs | ||
import com.b1nd.dodam.dsl.setupMultiplatform | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class MultiplatformApplicationPlugin: Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.application") | ||
apply("org.jetbrains.kotlin.multiplatform") | ||
} | ||
setupMultiplatform() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
dodam-teacher-android/src/androidMain/kotlin/com/b1nd/dodam/teacher/Platform.android.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
86 changes: 17 additions & 69 deletions
86
dodam-teacher-android/src/commonMain/kotlin/com/b1nd/dodam/teacher/DodamTeacherApp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,26 @@ | ||
package com.b1nd.dodam.teacher | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.material.Button | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.material.TextField | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.collectAsState | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.lifecycle.viewmodel.compose.viewModel | ||
import org.koin.compose.viewmodel.koinViewModel | ||
import org.koin.core.annotation.KoinExperimentalAPI | ||
import androidx.navigation.compose.NavHost | ||
import androidx.navigation.compose.rememberNavController | ||
import com.b1nd.dodam.designsystem.DodamTheme | ||
import com.b1nd.dodam.onboarding.navigation.ONBOARDING_ROUTE | ||
import com.b1nd.dodam.onboarding.navigation.onboardingScreen | ||
|
||
@OptIn(KoinExperimentalAPI::class) | ||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun DodamTeacherApp(viewModel: TestViewModel = koinViewModel()) { | ||
val state by viewModel.state.collectAsState() | ||
|
||
var idText by remember { mutableStateOf("") } | ||
var pwText by remember { mutableStateOf("") } | ||
var tokenText by remember { mutableStateOf("") } | ||
|
||
MaterialTheme { | ||
Column { | ||
Text(state.toString()) | ||
|
||
TextField( | ||
value = idText, | ||
onValueChange = { | ||
idText = it | ||
}, | ||
) | ||
TextField( | ||
value = pwText, | ||
onValueChange = { | ||
pwText = it | ||
}, | ||
) | ||
TextField( | ||
value = tokenText, | ||
onValueChange = { | ||
tokenText = it | ||
}, | ||
) | ||
DodamTestButton( | ||
text = "삭제", | ||
onClick = { | ||
viewModel.deleteUser() | ||
}, | ||
) | ||
|
||
DodamTestButton( | ||
text = "저장", | ||
onClick = { | ||
viewModel.saveUser( | ||
id = idText, | ||
pw = pwText, | ||
token = tokenText, | ||
) | ||
}, | ||
fun DodamTeacherApp() { | ||
val navHostController = rememberNavController() | ||
DodamTheme { | ||
NavHost( | ||
navController = navHostController, | ||
startDestination = ONBOARDING_ROUTE, | ||
) { | ||
onboardingScreen( | ||
onRegisterClick = {}, | ||
onLoginClick = {}, | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
private fun DodamTestButton(text: String, onClick: () -> Unit) { | ||
Button( | ||
onClick = onClick, | ||
content = { | ||
Text(text) | ||
}, | ||
) | ||
} |
9 changes: 0 additions & 9 deletions
9
dodam-teacher-android/src/commonMain/kotlin/com/b1nd/dodam/teacher/Greeting.kt
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
dodam-teacher-android/src/commonMain/kotlin/com/b1nd/dodam/teacher/Koin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,14 @@ | ||
package com.b1nd.dodam.teacher | ||
|
||
import com.b1nd.dodam.datastore.di.dataStoreModule | ||
import org.koin.compose.viewmodel.dsl.viewModel | ||
import org.koin.core.KoinApplication | ||
import org.koin.core.context.startKoin | ||
import org.koin.dsl.module | ||
|
||
fun initKoin(block: KoinApplication.() -> Unit = {}) { | ||
startKoin { | ||
modules( | ||
dataStoreModule, | ||
testViewModelModule, | ||
) | ||
block() | ||
} | ||
} | ||
|
||
val testViewModelModule = module { | ||
viewModel { | ||
TestViewModel() | ||
} | ||
} |
Oops, something went wrong.