Skip to content

Commit

Permalink
[FIX/#144] 컨플릭 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
crownjoe committed Jan 17, 2024
2 parents 5538248 + cfa6c99 commit 7775000
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.going.presentation.entertrip.preferencetag

import androidx.recyclerview.widget.RecyclerView
import com.going.domain.entity.PreferenceData
import com.going.presentation.R
import com.going.presentation.databinding.ItemPreferenceTagBinding

class PreferenceTagViewHolder(
Expand All @@ -17,20 +16,36 @@ class PreferenceTagViewHolder(
tvPreferenceTag1.text = item.leftPrefer
tvPreferenceTag3.text = item.rightPrefer

rgPreferenceTag.setOnCheckedChangeListener { _, checkedId ->
val selectedButtonIdList = listOf(
R.id.rb_preference_1,
R.id.rb_preference_2,
R.id.rb_preference_3,
R.id.rb_preference_4,
R.id.rb_preference_5
)
val selectedButtonList = listOf(
rbPreference1,
rbPreference2,
rbPreference3,
rbPreference4,
rbPreference5
)

val checkedIndex = selectedButtonIdList.indexOf(checkedId)
if (checkedIndex != -1) {
listener.onPreferenceSelected(item, checkedIndex)
val selectedViewList = listOf(
viewPreferenceRadio1,
viewPreferenceRadio2,
viewPreferenceRadio3,
viewPreferenceRadio4,
viewPreferenceRadio5
)

selectedButtonList.forEachIndexed { index, radioButton ->
radioButton.setOnClickListener {
if (radioButton.isChecked) {
listener.onPreferenceSelected(item, index)
}
}
}

selectedViewList.forEachIndexed { index, view ->
view.setOnClickListener {
selectedButtonList[index].isChecked = true
listener.onPreferenceSelected(item, index)
}
}
}
}
}
}
110 changes: 58 additions & 52 deletions presentation/src/main/res/layout/activity_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_profile_tag"
app:layout_constraintVertical_bias="0.0">
app:layout_constraintTop_toBottomOf="@id/layout_profile_tag">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
Expand All @@ -84,9 +82,8 @@
<TextView
android:id="@+id/tv_profile_name"
style="@style/TextAppearance.Doorip.Head2"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="12dp"
android:gravity="center"
android:textColor="@color/red_500"
Expand All @@ -98,9 +95,8 @@
<TextView
android:id="@+id/tv_profile_one_line"
style="@style/TextAppearance.Doorip.Detail1.Regular"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="4dp"
android:gravity="center"
android:textColor="@color/gray_500"
Expand All @@ -114,7 +110,7 @@
android:layout_width="wrap_content"
android:layout_height="8dp"
android:layout_marginTop="24dp"
android:background="@color/gray_50"
android:background="@color/gray_100"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_profile_one_line" />
Expand All @@ -125,7 +121,6 @@
style="@style/TextAppearance.Doorip.Body1.Bold"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="28dp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -137,70 +132,81 @@
style="@style/TextAppearance.Doorip.Detail1.Regular"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="4dp"
android:gravity="center"
android:textColor="@color/gray_300"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_profile_type" />

<androidx.constraintlayout.helper.widget.Flow
<LinearLayout
android:id="@+id/ll_tags"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
app:constraint_referenced_ids="tv_profile_tag1,tv_profile_tag2,tv_profile_tag3"
app:flow_horizontalGap="8dp"
app:flow_horizontalStyle="packed"
app:flow_wrapMode="chain"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_profile_sub_type" />
app:layout_constraintTop_toBottomOf="@id/tv_profile_sub_type">

<TextView
android:id="@+id/tv_profile_tag1"
style="@style/TextAppearance.Doorip.Detail1.Regular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="2dp"
android:textColor="@color/red_300"
app:layout_constraintHorizontal_weight="1" />
<TextView
android:id="@+id/tv_profile_tag1"
style="@style/TextAppearance.Doorip.Detail1.Regular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="3dp"
android:text="#tag1"
android:textColor="@color/red_300"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_tendency_test_result_sub_type" />

<TextView
android:id="@+id/tv_profile_tag2"
style="@style/TextAppearance.Doorip.Detail1.Regular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="2dp"
android:textColor="@color/red_300"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintHorizontal_weight="1" />
<androidx.legacy.widget.Space
android:layout_width="8dp"
android:layout_height="0dp" />

<TextView
android:id="@+id/tv_profile_tag3"
style="@style/TextAppearance.Doorip.Detail1.Regular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="2dp"
android:textColor="@color/red_300"
app:layout_constraintHorizontal_chainStyle="packed" />
<TextView
android:id="@+id/tv_profile_tag2"
style="@style/TextAppearance.Doorip.Detail1.Regular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="3dp"
android:text="#tag2"
android:textColor="@color/red_300"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_tendency_test_result_sub_type" />

<androidx.legacy.widget.Space
android:layout_width="8dp"
android:layout_height="0dp" />

<TextView
android:id="@+id/tv_profile_tag3"
style="@style/TextAppearance.Doorip.Detail1.Regular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="3dp"
android:text="#tag3"
android:textColor="@color/red_300"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_tendency_test_result_sub_type" />
</LinearLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_box_description_first"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:background="@drawable/shape_rect_6_gray100_line"
android:background="@drawable/shape_rect_6_gray200_line"
android:minHeight="142dp"
android:paddingHorizontal="14dp"
android:paddingVertical="16dp"
Expand Down Expand Up @@ -292,7 +298,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="8dp"
android:background="@drawable/shape_rect_6_gray100_line"
android:background="@drawable/shape_rect_6_gray200_line"
android:minHeight="142dp"
android:paddingHorizontal="14dp"
android:paddingVertical="16dp"
Expand Down Expand Up @@ -380,7 +386,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="8dp"
android:background="@drawable/shape_rect_6_gray100_line"
android:background="@drawable/shape_rect_6_gray200_line"
android:minHeight="142dp"
android:paddingHorizontal="14dp"
android:paddingVertical="16dp"
Expand Down Expand Up @@ -475,8 +481,8 @@
<androidx.legacy.widget.Space
android:layout_width="0dp"
android:layout_height="17dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_profile_restart" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
Expand Down
6 changes: 3 additions & 3 deletions presentation/src/main/res/layout/activity_tendency_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="2dp"
android:paddingVertical="3dp"
android:textColor="@color/red_300"
app:layout_constraintHorizontal_weight="1" />

Expand All @@ -150,7 +150,7 @@
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="2dp"
android:paddingVertical="3dp"
android:textColor="@color/red_300"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintHorizontal_weight="1" />
Expand All @@ -162,7 +162,7 @@
android:layout_height="wrap_content"
android:background="@drawable/shape_rect_10_red300_line"
android:paddingHorizontal="8dp"
android:paddingVertical="2dp"
android:paddingVertical="3dp"
android:textColor="@color/red_300"
app:layout_constraintHorizontal_chainStyle="packed" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
android:id="@+id/tab_dashboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_000"
android:background="@drawable/layer_list_todo_unselected_indicator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_dashboard_toolbar"
app:tabIndicatorColor="@color/gray_500"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="14dp">
android:paddingBottom="6dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_dashboard"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="14dp">
android:paddingBottom="6dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_dashboard"
Expand Down
Loading

0 comments on commit 7775000

Please sign in to comment.