mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-04-02 21:01:02 +02:00
fix: reset/delete button getting hidden after multiple updates
This commit is contained in:
parent
570279bb21
commit
8d6b5770ed
@ -53,7 +53,6 @@ class TimerFragment : Fragment() {
|
|||||||
timer_view_pager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
|
timer_view_pager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
updateViews(position)
|
updateViews(position)
|
||||||
indicator_view.setCurrentPosition(0)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -145,8 +144,8 @@ class TimerFragment : Fragment() {
|
|||||||
|
|
||||||
private fun updateViewStates(state: TimerState) {
|
private fun updateViewStates(state: TimerState) {
|
||||||
val resetPossible = state is TimerState.Running || state is TimerState.Paused || state is TimerState.Finished
|
val resetPossible = state is TimerState.Running || state is TimerState.Paused || state is TimerState.Finished
|
||||||
view.timer_reset.beVisibleIf(resetPossible)
|
view.timer_reset.beInvisibleIf(!resetPossible)
|
||||||
view.timer_delete.beVisibleIf(!resetPossible && timerAdapter.itemCount > 1)
|
view.timer_delete.beInvisibleIf(!(!resetPossible && timerAdapter.itemCount > 1))
|
||||||
|
|
||||||
val drawableId = if (state is TimerState.Running) {
|
val drawableId = if (state is TimerState.Running) {
|
||||||
R.drawable.ic_pause_vector
|
R.drawable.ic_pause_vector
|
||||||
|
Loading…
x
Reference in New Issue
Block a user