fix #1934, scroll to the first non past section at search
This commit is contained in:
parent
0d7f08786d
commit
6d63c6ff73
1 changed files with 6 additions and 0 deletions
|
@ -35,6 +35,7 @@ import com.simplemobiletools.calendar.pro.jobs.CalDAVUpdateListener
|
|||
import com.simplemobiletools.calendar.pro.models.Event
|
||||
import com.simplemobiletools.calendar.pro.models.ListEvent
|
||||
import com.simplemobiletools.calendar.pro.models.ListItem
|
||||
import com.simplemobiletools.calendar.pro.models.ListSectionDay
|
||||
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||
|
@ -1266,6 +1267,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||
}
|
||||
} else if (updateStatus == UPDATE_BOTTOM) {
|
||||
search_results_list.smoothScrollBy(0, resources.getDimension(R.dimen.endless_scroll_move_height).toInt())
|
||||
} else {
|
||||
val firstNonPastSectionIndex = listItems.indexOfFirst { it is ListSectionDay && !it.isPastSection }
|
||||
if (firstNonPastSectionIndex != -1) {
|
||||
search_results_list.scrollToPosition(firstNonPastSectionIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue