Как создать отдельную фабрику источников данных для хранения нескольких источников данных для отображения нескольких представлений в Recylerview с использованием библиотеки подкачки страниц?
У меня есть ответ json в следующем формате: я хочу отобразить отдельный объект arraylist в том же представлении переработчика, что и отдельные типы представлений. В настоящее время я создал источник данных для новостной ленты, но так как ее размер равен 1, я могу отображать только первое значение индекса объектов массива. пожалуйста, игнорируйте несколько опечаток в формате JSON.
{
"newsfeeds": [
{
"common": [
{
"proposal_viewed": {
"to_user_name": "",
"to_user_image": "",
"to_user_url": "#",
"is_active_touser": false,
"counter": "0",
"site_url": "http://192.168.100.100/angel/public/",
"proposal_id": "224253",
"current_user_id": "406773",
"user_id": "339592",
"owner": "53812',
}
},
{
"document_viewed": {
"proposal_name": "Sample test2 Local",
"to_user_name": "",
"to_user_image": "",
"to_user_url": "#",
"is_active_touser": false,
"counter": "0",
"site_url": "http://192.168.100.100/angel/public/",
"proposal_id": "224254",
"current_user_id": "406773",
"user_id": "339592",
"owner": "538128",
"to_user_id": null,
"site_id": "UKAIN",
"feeds_id": "9007",
"action": "document_viewed",
"type": "common",
"created_at": "1547028831",
}
},
{
"proposal_viewed": {
"is_active_proposal": true,
"user_name": "Ian R",
"user_image_url": "http://dev.angel.com/assets/users,
"to_user_name": "",
"to_user_image": "",
"to_user_url": "#",
"is_active_touser": false,
"counter": "0",
"site_url": "http://192.168.100.100/angel/public/",
"proposal_id": "224254",
"current_user_id": "406773",
"user_id": "339592",
"owner": "538128",
"to_user_id": null,
"site_id": "UKAIN",
"feeds_id": "9006",
"action": "proposal_viewed",
}
}
],
"amazing": [
{
"offer_made": {
"proposal_name": "",
"proposal_url": "",
"proposal_logo": "",
"proposal_description": "",
"counter": "0",
"site_url": "http://192.168.100.100/angel/public/",
"proposal_id": "201320",
"visibility": "0",
"body": "",
"template_id": "9",
"created_at": "1549257187",
"lang": "en",
"page": "1,
"body_text": "",
"days_ago": "3 weeks ago"
}
}
],
"ok": [
{
"investor_profile_update": {
"proposal_name": "",
"proposal_url": "",
"proposal_logo": "",
"proposal_description": "",
"is_active_proposal": false,
"body": "",
"template_id": "21",
"created_at": "1545200111",
"lang": "en",
"page": "1",
},
"shown_interest": {
"is_active_proposal": true,
"proposal_description": "sdafdasfda",
"is_active_proposal": true,
"user_name": "Ian R",
"user_id": "339592",
"owner": "538074",
"to_user_id": null,
"type": "ok",
"visibility": "0",
},
"investor_profile_update": {
"proposal_name": "",
"proposal_url": "",
"proposal_logo": "",
"proposal_description": "",
"is_active_proposal": false,
"to_user_name": "",
"to_user_image": "",
"to_user_url": "#",
"is_active_touser": false,
"counter": "0",
"site_url": "http://192.168.100.100/angel/public/",
"proposal_id": null,
"current_user_id": "406773",
"user_id": "406773",
"owner": "406773",
"to_user_id": null,
"site_id": "UKAIN",
"feeds_id": "8973",
"action": "investor_profile_update",
"type": "ok",
"visibility": "0",
"feeddetails_data": "",
"body_text": "",
"days_ago": "3 months ago"
}
}
],
"good": [
{
"added_video": {
"proposal_name": "Proposal Submitted confirmation",
"user_id": "406773",
"owner": "406773",
"to_user_id": null,
"site_id": "UKAIN",
"feeds_id": "9026",
"action": "added_video",
"type": "good",
"page": "1",
"body_text": "",
"days_ago": "5 days ago"
}
}
]
}