[Homework] Optimize sorting using layout manager

This commit is contained in:
Kacper Ziubryniewicz 2019-09-29 12:54:41 +02:00
parent 8d86f9c7af
commit 07d4616974

View File

@ -47,8 +47,8 @@ class HomeworkListFragment : Fragment() {
} }
val layoutManager = LinearLayoutManager(context) val layoutManager = LinearLayoutManager(context)
layoutManager.reverseLayout = false layoutManager.reverseLayout = true
layoutManager.stackFromEnd = false layoutManager.stackFromEnd = true
b.homeworkView.setHasFixedSize(true) b.homeworkView.setHasFixedSize(true)
b.homeworkView.layoutManager = layoutManager b.homeworkView.layoutManager = layoutManager
@ -64,7 +64,7 @@ class HomeworkListFragment : Fragment() {
if (app.profile == null || !isAdded) return@Observer if (app.profile == null || !isAdded) return@Observer
if (homeworkList != null && homeworkList.size > 0) { if (homeworkList != null && homeworkList.size > 0) {
val adapter = HomeworkAdapter(context, homeworkList.reversed()) val adapter = HomeworkAdapter(context, homeworkList)
b.homeworkView.adapter = adapter b.homeworkView.adapter = adapter
b.homeworkView.visibility = View.VISIBLE b.homeworkView.visibility = View.VISIBLE
b.homeworkNoData.visibility = View.GONE b.homeworkNoData.visibility = View.GONE