Skip to content

Commit

Permalink
πŸ”€ ::(#172) ID κ°•μ œ 둜직 제거
Browse files Browse the repository at this point in the history
πŸ”€ ::(#172) ID κ°•μ œ 둜직 제거
  • Loading branch information
JunJaBoy authored Oct 4, 2023
2 parents dd905b6 + 118c956 commit 32031cf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.xquare.xquare_android"
minSdk 24
targetSdk 33
versionCode 35
versionName "1.6.2"
versionCode 36
versionName "1.6.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.Scaffold
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
Expand Down Expand Up @@ -44,18 +49,23 @@ fun SignInScreen(navController: NavController) {
is SignInViewModel.Event.Success -> {
navController.navigate(AppNavigationItem.Main.route) { popUpTo(0) }
}

is SignInViewModel.Event.BadRequest -> {
makeToast(context, "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€")
}

is SignInViewModel.Event.NotFound -> {
makeToast(context, "아이디와 λΉ„λ°€λ²ˆν˜Έλ₯Ό ν™•μΈν•΄μ£Όμ„Έμš”")
}

is SignInViewModel.Event.Timeout -> {
makeToast(context, "μš”μ²­ μ‹œκ°„μ΄ μ΄ˆκ³Όλ˜μ—ˆμŠ΅λ‹ˆλ‹€")
}

is SignInViewModel.Event.TooManyRequest -> {
makeToast(context, "ν˜„μž¬ μš”μ²­μ΄ λ„ˆλ¬΄ λ§ŽμŠ΅λ‹ˆλ‹€")
}

is SignInViewModel.Event.FetchIdSuccess -> {
userId = it.data
}
Expand All @@ -67,7 +77,10 @@ fun SignInScreen(navController: NavController) {
onSignInClick = { signInViewModel.signIn(it) },
onFindAccountClick = {
//makeToast(context, "Xquare 페이슀뢁 νŽ˜μ΄μ§€λ‘œ 문의 ν•΄μ£Όμ„Έμš”.")
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/profile.php?id=100091948951498"))
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse("https://www.facebook.com/profile.php?id=100091948951498")
)
context.startActivity(intent)
//TODO("아이디/λΉ„λ°€λ²ˆν˜Έ 찾기둜 이동")
},
Expand All @@ -85,7 +98,7 @@ private fun SignIn(
val context = LocalContext.current
var accountId by remember { mutableStateOf("") }
var password by remember { mutableStateOf("") }
if (userId.isNotBlank()) accountId = userId

val isSignInEnabled = accountId.isNotEmpty() && password.isNotEmpty()
Scaffold(
modifier = Modifier
Expand All @@ -109,7 +122,7 @@ private fun SignIn(
Column(Modifier.padding(horizontal = 16.dp)) {
TextField(
text = accountId,
placeholder = "아이디",
placeholder = userId.ifBlank { "아이디" },
onTextChange = { text ->
accountId = text
}
Expand All @@ -126,7 +139,7 @@ private fun SignIn(
}
Spacer(Modifier.size(16.dp))
ColoredLargeButton(text = "둜그인", isEnabled = isSignInEnabled) {
onSignInClick(SignInEntity(accountId, password, getToken(context).toString() ))
onSignInClick(SignInEntity(accountId, password, getToken(context).toString()))
}
Spacer(Modifier.size(16.dp))
Body2(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.xquare.xquare_android.feature.signin

import com.xquare.domain.entity.auth.SignInEntity
import com.xquare.domain.exception.*
import com.xquare.domain.exception.BadRequestException
import com.xquare.domain.exception.NotFoundException
import com.xquare.domain.exception.TimeoutException
import com.xquare.domain.exception.TooManyRequestException
import com.xquare.domain.usecase.auth.FetchIdUseCase
import com.xquare.domain.usecase.auth.SignInUseCase
import com.xquare.xquare_android.base.BaseViewModel
Expand Down Expand Up @@ -30,15 +33,15 @@ class SignInViewModel @Inject constructor(
fun fetchId() = execute(
job = { fetchIdUseCase.execute(Unit) },
onSuccess = { emitEvent(Event.FetchIdSuccess(it)) },
onFailure = { }
onFailure = { }
)

sealed class Event {
object Success : SignInViewModel.Event()
object Success : Event()
object BadRequest : Event()
object NotFound : Event()
object Timeout : Event()
object TooManyRequest : Event()
data class FetchIdSuccess(val data: String) : Event()
}
}
}

0 comments on commit 32031cf

Please sign in to comment.