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