Skip to content

Commit

Permalink
Merge pull request #106 from FOR-GRAD/21-졸업-요건-ui
Browse files Browse the repository at this point in the history
21 졸업 요건 UI
  • Loading branch information
dkyuuum authored Feb 20, 2024
2 parents 2e6e61d + ca67406 commit 430b14b
Show file tree
Hide file tree
Showing 11 changed files with 440 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class LoginActivity : AppCompatActivity() {
imm.hideSoftInputFromWindow(binding.etPassword.windowToken, 0)

// 로그인 버튼 클릭
binding.btnLogin.performClick()
// binding.btnLogin.performClick()
return@setOnEditorActionListener true
}
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LoginViewModel : ViewModel() {
val loginStatus: LiveData<Boolean>
get() = _loginStatus

// 추가: 로그인 성공 여부 LiveData
// 로그인 성공 여부 LiveData
private val _loginSuccess: MutableLiveData<Boolean> = MutableLiveData()
val loginSuccess: LiveData<Boolean>
get() = _loginSuccess
Expand All @@ -53,6 +53,7 @@ class LoginViewModel : ViewModel() {
}

init {
// _loginStatus.value = false
_loginStatus.postValue(false)
}

Expand All @@ -77,8 +78,9 @@ class LoginViewModel : ViewModel() {
_loginResult.postValue(response.body())
_loginSuccess.postValue(false)

Log.d("cookies", "$cookies")
Log.d("Login", "${response.body()}")
// Log.d("cookies", "$cookies")
// Log.d("Login", "${_loginResult.value}")
// Log.d("Login success", "${response.body()}")
} else {
_loginResult.postValue(
LoginResponse(
Expand All @@ -91,7 +93,7 @@ class LoginViewModel : ViewModel() {
_loginSuccess.postValue(true)
_loginStatus.postValue(true)

Log.e("Login", "정보 틀림: $loginResult")
// Log.e("Login", "정보 틀림: ${_loginResult.value}")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ class SettingFragment : Fragment() {
navigate(R.id.action_fragment_setting_to_fragment_setting_notification)
}

binding.tvServiceTerms.setOnClickListener {
navigate(R.id.action_fragment_setting_to_fragment_setting_service_term)
}

binding.tvGuideTerms2.setOnClickListener {
navigate(R.id.action_fragment_setting_to_fragment_setting_policy_privacy)
}

binding.tvEtcLogout.setOnClickListener {
var dialogBuilder =
AlertDialog.Builder(requireContext(), R.style.CustomAlertDialogTheme)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package umc.com.mobile.project.ui.setting

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import umc.com.mobile.project.databinding.FragmentSettingPolicyPrivacyBinding
import umc.com.mobile.project.ui.common.NavigationUtil.popBackStack

class SettingPolicyPrivacyFragment : Fragment() {
private var _binding: FragmentSettingPolicyPrivacyBinding? = null
private val binding get() = _binding!!

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = FragmentSettingPolicyPrivacyBinding.inflate(inflater, container, false)

binding.btnBack.setOnClickListener {
popBackStack()
}
return binding.root
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package umc.com.mobile.project.ui.setting

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import umc.com.mobile.project.databinding.FragmentSettingBinding
import umc.com.mobile.project.databinding.FragmentSettingServiceTermsBinding
import umc.com.mobile.project.ui.common.NavigationUtil.popBackStack

class SettingServiceTermsFragment : Fragment() {
private var _binding: FragmentSettingServiceTermsBinding? = null
private val binding get() = _binding!!

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = FragmentSettingServiceTermsBinding.inflate(inflater, container, false)

binding.btnBack.setOnClickListener {
popBackStack()
}
return binding.root
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
6 changes: 3 additions & 3 deletions app/src/main/res/layout/fragment_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
app:layout_constraintTop_toBottomOf="@+id/tv_guide_title" />

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_guide_terms"
android:id="@+id/tv_service_terms"
style="@style/MediumFont.14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -204,8 +204,8 @@
android:text="개인정보 처리방침"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/tv_guide_terms"
app:layout_constraintTop_toBottomOf="@+id/tv_guide_terms" />
app:layout_constraintStart_toStartOf="@+id/tv_service_terms"
app:layout_constraintTop_toBottomOf="@+id/tv_service_terms" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_setting_notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:layout_marginTop="75dp"
android:layout_marginTop="33dp"
android:layout_marginEnd="17dp"
android:background="@drawable/bg_stroke_gray_radius_16_5"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
64 changes: 64 additions & 0 deletions app/src/main/res/layout/fragment_setting_policy_privacy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<androidx.core.widget.NestedScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title"
style="@style/SemiBoldFont.16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="52dp"
android:text="개인정보처리방침"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/btn_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="17dp"
android:src="@drawable/ic_close_11"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_title" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:layout_marginTop="33dp"
android:layout_marginEnd="17dp"
android:background="@drawable/bg_stroke_gray_radius_16_5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_title">

<androidx.appcompat.widget.AppCompatTextView
style="@style/MediumFont.12"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="17dp"
android:layout_marginEnd="17dp"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="@string/setting_term_2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</layout>
64 changes: 64 additions & 0 deletions app/src/main/res/layout/fragment_setting_service_terms.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<androidx.core.widget.NestedScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title"
style="@style/SemiBoldFont.16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="52dp"
android:text="서비스 이용약관"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/btn_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="17dp"
android:src="@drawable/ic_close_11"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_title" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:layout_marginTop="33dp"
android:layout_marginEnd="17dp"
android:background="@drawable/bg_stroke_gray_radius_16_5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_title">

<androidx.appcompat.widget.AppCompatTextView
style="@style/MediumFont.10"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="17dp"
android:layout_marginEnd="17dp"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="@string/setting_term"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</layout>
17 changes: 16 additions & 1 deletion app/src/main/res/navigation/mobile_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,23 @@
<action
android:id="@+id/action_fragment_setting_to_fragment_setting_notification"
app:destination="@id/fragment_setting_notification" />
<action
android:id="@+id/action_fragment_setting_to_fragment_setting_policy_privacy"
app:destination="@id/fragment_setting_policy_privacy" />
<action
android:id="@+id/action_fragment_setting_to_fragment_setting_service_term"
app:destination="@id/fragment_setting_service_term" />
</fragment>

<fragment
android:id="@+id/fragment_setting_service_term"
android:name="umc.com.mobile.project.ui.setting.SettingServiceTermsFragment"
android:label="서비스 이용약관"
tools:layout="@layout/fragment_setting_service_terms" />
<fragment
android:id="@+id/fragment_setting_policy_privacy"
android:name="umc.com.mobile.project.ui.setting.SettingPolicyPrivacyFragment"
android:label="개인정보처리방침"
tools:layout="@layout/fragment_setting_policy_privacy" />
<fragment
android:id="@+id/fragment_setting_notification"
android:name="umc.com.mobile.project.ui.setting.SettingNotificationFragment"
Expand Down
Loading

0 comments on commit 430b14b

Please sign in to comment.