[UI] Enable swipe-to-refresh on home, grades, behaviour fragments
Some checks failed
Schedule/dispatch / Build nightly release (APK) (push) Has been skipped
Schedule/dispatch / Check new changes (push) Failing after 28s

This commit is contained in:
Kuba Szczodrzyński 2024-07-07 23:22:37 +02:00
parent ddefda08f1
commit 8450f6953e
No known key found for this signature in database
GPG Key ID: 43037AC62A600562
4 changed files with 5 additions and 1 deletions

View File

@ -20,6 +20,7 @@ class BehaviourFragment : BaseFragment<FragmentBehaviourBinding, MainActivity>(
inflater = FragmentBehaviourBinding::inflate,
) {
override fun getRefreshScrollingView() = b.noticesView
override fun getMarkAsReadType() = MetadataType.NOTICE
private var displayMode = MODE_YEAR

View File

@ -38,6 +38,7 @@ class GradesListFragment : BaseFragment<GradesListFragmentBinding, MainActivity>
inflater = GradesListFragmentBinding::inflate,
) {
override fun getRefreshScrollingView() = b.list
override fun getMarkAsReadType() = MetadataType.GRADE
override fun getBottomSheetItems() = listOf(
BottomSheetPrimaryItem(true)

View File

@ -78,6 +78,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, MainActivity>(
}
}
override fun getRefreshScrollingView() = b.scrollView
override fun getBottomSheetItems() = listOf(
BottomSheetPrimaryItem(true)
.withTitle(R.string.menu_add_remove_cards)
@ -174,6 +175,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, MainActivity>(
adapter.itemTouchHelper = itemTouchHelper
b.list.layoutManager = LinearLayoutManager(activity)
b.list.adapter = adapter
b.list.isNestedScrollingEnabled = false
b.list.setAccessibilityDelegateCompat(object : RecyclerViewAccessibilityDelegate(b.list) {
override fun getItemDelegate(): AccessibilityDelegateCompat {
return object : ItemDelegate(this) {

View File

@ -11,7 +11,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView