fixed bug in Planning displayed multiple times (not cleared in-between)
parent
b77d9017a6
commit
f28487b07c
|
|
@ -64,6 +64,7 @@ class Planning {
|
|||
if (result.has("planning"))
|
||||
{
|
||||
val programList = result.getJSONArray("planning")
|
||||
programmes.clear()
|
||||
for (i in 0 until programList.length())
|
||||
{
|
||||
val item = programList[i] as JSONObject
|
||||
|
|
|
|||
|
|
@ -32,13 +32,13 @@ class ProgrammeDayFragment : Fragment() {
|
|||
viewModel.day = arguments?.getString("day") ?: ""
|
||||
|
||||
val root = inflater.inflate(R.layout.fragment_programme_day, container, false)
|
||||
|
||||
Planning.instance.programmes.forEach {
|
||||
if (it.isThisDay(day = weekdays.indexOf(viewModel.day)))
|
||||
programmeOfTheDay.add(it)
|
||||
}
|
||||
viewManager = LinearLayoutManager(context)
|
||||
viewAdapter =
|
||||
ProgrammeAdapter(programmeOfTheDay, viewModel.day)
|
||||
viewAdapter = ProgrammeAdapter(programmeOfTheDay, viewModel.day)
|
||||
recyclerView = root.findViewById<RecyclerView>(R.id.programme_recycler).apply {
|
||||
// use this setting to improve performance if you know that changes
|
||||
// in content do not change the layout size of the RecyclerView
|
||||
|
|
|
|||
Loading…
Reference in New Issue