Skip to content

Commit

Permalink
Merge pull request #594 from Team-WSS/bugfix/591
Browse files Browse the repository at this point in the history
bugfix: 약관동의 다이얼로그 관련 이슈 수정
  • Loading branch information
yeonjeen authored Feb 21, 2025
2 parents 19ed06d + 5d2a6f2 commit cba3c14
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class HomeViewModel
private val _isNotificationPermissionFirstLaunched: MutableLiveData<Boolean> = MutableLiveData()
val isNotificationPermissionFirstLaunched: LiveData<Boolean> get() = _isNotificationPermissionFirstLaunched

private val _termsAgreementState = MutableStateFlow<TermsAgreementEntity?>(null)
val termsAgreementState: StateFlow<TermsAgreementEntity?> = _termsAgreementState.asStateFlow()
private val termsAgreementState = MutableStateFlow<TermsAgreementEntity?>(null)

private val _showTermsAgreementDialog = MutableStateFlow(false)
val showTermsAgreementDialog: StateFlow<Boolean> = _showTermsAgreementDialog.asStateFlow()
Expand Down Expand Up @@ -247,7 +246,7 @@ class HomeViewModel
runCatching { userRepository.fetchTermsAgreements() }
.onSuccess { terms ->

_termsAgreementState.value = terms
termsAgreementState.value = terms
_showTermsAgreementDialog.value = !(terms.serviceAgreed && terms.privacyAgreed)
}
}
Expand Down
39 changes: 26 additions & 13 deletions app/src/main/res/layout/dialog_terms_agreement.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -75,7 +76,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_terms_agreement_All">

<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_terms_agreement_service"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -93,18 +94,22 @@
android:paddingVertical="8dp"
android:text="@string/string_terms_agreement_service"
android:textAppearance="@style/body2"
android:textColor="@color/gray_200_AEADB3" />
android:textColor="@color/gray_200_AEADB3"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>

<ImageView
android:id="@+id/iv_terms_agreement_service"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:src="@drawable/ic_terms_agreement_unselected" />
</LinearLayout>
android:src="@drawable/ic_terms_agreement_unselected"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_terms_agreement_privacy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -122,18 +127,22 @@
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:textAppearance="@style/body2"
android:textColor="@color/gray_200_AEADB3"/>
android:textColor="@color/gray_200_AEADB3"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>

<ImageView
android:id="@+id/iv_terms_agreement_privacy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:src="@drawable/ic_terms_agreement_unselected" />
</LinearLayout>
android:src="@drawable/ic_terms_agreement_unselected"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_terms_agreement_marketing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -151,16 +160,20 @@
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:textAppearance="@style/body2"
android:textColor="@color/gray_200_AEADB3"/>
android:textColor="@color/gray_200_AEADB3"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>

<ImageView
android:id="@+id/iv_terms_agreement_marketing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:src="@drawable/ic_terms_agreement_unselected" />
</LinearLayout>
android:src="@drawable/ic_terms_agreement_unselected"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

<androidx.appcompat.widget.AppCompatButton
Expand Down

0 comments on commit cba3c14

Please sign in to comment.