mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 19:04:38 -06:00
[Homework] Optimize sorting using layout manager
This commit is contained in:
parent
8d86f9c7af
commit
07d4616974
@ -47,8 +47,8 @@ class HomeworkListFragment : Fragment() {
|
||||
}
|
||||
|
||||
val layoutManager = LinearLayoutManager(context)
|
||||
layoutManager.reverseLayout = false
|
||||
layoutManager.stackFromEnd = false
|
||||
layoutManager.reverseLayout = true
|
||||
layoutManager.stackFromEnd = true
|
||||
|
||||
b.homeworkView.setHasFixedSize(true)
|
||||
b.homeworkView.layoutManager = layoutManager
|
||||
@ -64,7 +64,7 @@ class HomeworkListFragment : Fragment() {
|
||||
if (app.profile == null || !isAdded) return@Observer
|
||||
|
||||
if (homeworkList != null && homeworkList.size > 0) {
|
||||
val adapter = HomeworkAdapter(context, homeworkList.reversed())
|
||||
val adapter = HomeworkAdapter(context, homeworkList)
|
||||
b.homeworkView.adapter = adapter
|
||||
b.homeworkView.visibility = View.VISIBLE
|
||||
b.homeworkNoData.visibility = View.GONE
|
||||
|
Loading…
Reference in New Issue
Block a user