如何使用recyclerview对数据进行分组?

时间:2019-05-29 18:10:11

标签: java android json

我正在android studio中工作,我正在从JSON文件中读取数据。我需要在应用程序中显示特定日期的流。例如,假设星期一有3个数据流,我需要星期一作为标题,下面有这3个数据流。每个流的描述都存储在JSON数组中。

JSON的示例我有:[{“ category”:“州教育委员会”,“ contentHeight”:“ 405”,“ contentUrl”:“ https://d11v388ukuvwpo.cloudfront.net/livedirect/smil:nde.smil/playlist.m3u8”,“ contentWidth”:“ 720”, “ desc”:“ 2019年6月NDE董事会会议”,“ imgName”:“ education_icon.png”,“ mediaId”:“ 50007834”,“ ocFileUri”:null,“ streamEnd”:“ 2019-06-07 20:30: 00“,” streamStart“:” 2019-06-07 14:00:00“,” title“:” 2019年6月NDE委员会会议“},{” category“:”州教育委员会“,” contentHeight“:” 405“,” contentUrl“:” https://d11v388ukuvwpo.cloudfront.net/livedirect/smil:nde.smil/playlist.m3u8“,” contentWidth“:” 720“,” desc“:” 2019年6月NDE工作会议“,” imgName“:” education_icon.png“,” mediaId“:” 50007833“,” ocFileUri“:null,” streamEnd“:” 2019-06-07 01:30:00“,” streamStart“:” 2019-06-06 19:00:00“,” title“:” 2019年6月NDE工作会议“}]

enter image description here

在这种情况下,所有流都在回收器视图中显示而不进行分组。

这就是我想要的 enter image description here

enter image description here

0 个答案:

没有答案