mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 04:46:44 -06:00
[UI] Enable swipe-to-refresh on home, grades, behaviour fragments
This commit is contained in:
parent
ddefda08f1
commit
8450f6953e
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user