Skip to content

Commit

Permalink
Merge pull request #101 from FOR-GRAD/21-졸업-요건-ui
Browse files Browse the repository at this point in the history
21 졸업 요건 UI
  • Loading branch information
dkyuuum authored Feb 19, 2024
2 parents 75f9899 + af52990 commit 0cdad6c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ class LoginActivity : AppCompatActivity() {
viewModel.login()
}

viewModel.loginStatus.observe(this, Observer { loginStatus ->
if (!loginStatus) {
viewModel.loginSuccess.observe(this, Observer { loginSuccess ->
if (!loginSuccess) {
val intent = Intent(this@LoginActivity, MainActivity::class.java)
startActivity(intent)
finish() // 로그인 성공시 로그인 액티비티 종료
finish()
} else {
// 로그인 실패시 처리할 로직 추가 가능
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class LoginViewModel : ViewModel() {
fun init() {
id.postValue("")
pw.postValue("")
_loginSuccess.postValue(false)
}

init {
_loginStatus.postValue(false)
}

Expand All @@ -71,7 +75,7 @@ class LoginViewModel : ViewModel() {
)
}
_loginResult.postValue(response.body())
_loginStatus.postValue(false)
_loginSuccess.postValue(false)

Log.d("cookies", "$cookies")
Log.d("Login", "${response.body()}")
Expand All @@ -84,7 +88,9 @@ class LoginViewModel : ViewModel() {
result = null
)
)
_loginSuccess.postValue(true)
_loginStatus.postValue(true)

Log.e("Login", "정보 틀림: $loginResult")
}
}
Expand All @@ -98,7 +104,9 @@ class LoginViewModel : ViewModel() {
result = null
)
)
_loginSuccess.postValue(true)
_loginStatus.postValue(true)

Log.e("Login", "네트워크 오류: $loginResult / $loginStatus")
}
})
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,5 @@
android:text="@string/login_title"
android:textColor="@color/white" />

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_content2"
style="@style/MediumFont.10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/login_content_id_pw"
android:textColor="@color/text_gray" />

</androidx.appcompat.widget.LinearLayoutCompat>
</layout>

0 comments on commit 0cdad6c

Please sign in to comment.