fixed bug in Planning displayed multiple times (not cleared in-between)

remotes/origin/devel
yattoz 2020-04-14 00:31:18 +02:00
parent b77d9017a6
commit f28487b07c
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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