Skip to content

Commit

Permalink
Fix : fix a bug that current date radio button is not checked and add…
Browse files Browse the repository at this point in the history
… scoll feature at datePickerDialog tukcomCD2024#85
  • Loading branch information
ksh-g001 committed Jun 15, 2024
1 parent 7ce1aa2 commit 1aa9e5c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DatePickerDialog(private val data : DaysSchedule, private val dates : List
text = d
id = View.generateViewId()
if (d == dates[selectedDays])
check(true)
isChecked = true
}
binding.radio.addView(rdbtn)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class CalendarViewModel : ViewModel() {
val selectedDate : LiveData<LocalDate>
get() = _selectedDate

fun init() : Flow<List<Int>> = calendarRepository.init()

fun plusSelectedDate() : Flow<List<Int>> = calendarRepository.plusSelectedDate()

fun minusSelectedDate() : Flow<List<Int>> = calendarRepository.minusSelectedDate()
Expand Down
31 changes: 11 additions & 20 deletions android/HowAboutTrip/app/src/main/res/layout/dialog_datepicker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,20 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<RadioGroup
android:id="@+id/radio"
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
style="@style/DateRadioButton"
android:text="2024.02.23" />

<RadioButton
android:layout_width="wrap_content"
android:layout_height="match_parent">
<RadioGroup
android:id="@+id/radio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/DateRadioButton"
android:text="2024.02.24" />
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

</RadioGroup>
</RadioGroup>
</ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down

0 comments on commit 1aa9e5c

Please sign in to comment.