forked from github/wulkanowy-mirror
Prevent changing the current day by accident when excusing absences (#1599)
This commit is contained in:
@ -12,6 +12,7 @@ import android.view.View.INVISIBLE
|
||||
import android.view.View.VISIBLE
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.view.ActionMode
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.android.material.datepicker.CalendarConstraints
|
||||
import com.google.android.material.datepicker.MaterialDatePicker
|
||||
@ -216,13 +217,7 @@ class AttendanceFragment : BaseFragment<FragmentAttendanceBinding>(R.layout.frag
|
||||
}
|
||||
|
||||
override fun showExcuseButton(show: Boolean) {
|
||||
with(binding.attendanceExcuseButton) {
|
||||
if (show) {
|
||||
show()
|
||||
} else {
|
||||
hide()
|
||||
}
|
||||
}
|
||||
binding.attendanceExcuseButton.isVisible = show
|
||||
}
|
||||
|
||||
override fun showAttendanceDialog(lesson: Attendance) {
|
||||
@ -293,12 +288,16 @@ class AttendanceFragment : BaseFragment<FragmentAttendanceBinding>(R.layout.frag
|
||||
}
|
||||
|
||||
override fun showExcuseCheckboxes(show: Boolean) {
|
||||
attendanceAdapter.apply {
|
||||
with(attendanceAdapter) {
|
||||
excuseActionMode = show
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
override fun showDayNavigation(show: Boolean) {
|
||||
binding.attendanceNavContainer.isVisible = show
|
||||
}
|
||||
|
||||
override fun finishActionMode() {
|
||||
actionMode?.finish()
|
||||
}
|
||||
|
@ -174,6 +174,8 @@ class AttendancePresenter @Inject constructor(
|
||||
view?.apply {
|
||||
showExcuseCheckboxes(true)
|
||||
showExcuseButton(false)
|
||||
enableSwipe(false)
|
||||
showDayNavigation(false)
|
||||
}
|
||||
attendanceToExcuseList.clear()
|
||||
return true
|
||||
@ -183,6 +185,8 @@ class AttendancePresenter @Inject constructor(
|
||||
view?.apply {
|
||||
showExcuseCheckboxes(false)
|
||||
showExcuseButton(true)
|
||||
enableSwipe(true)
|
||||
showDayNavigation(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,8 @@ interface AttendanceView : BaseView {
|
||||
|
||||
fun showExcuseCheckboxes(show: Boolean)
|
||||
|
||||
fun showDayNavigation(show: Boolean)
|
||||
|
||||
fun finishActionMode()
|
||||
|
||||
fun popView()
|
||||
|
Reference in New Issue
Block a user