【发布时间】:2021-02-22 11:35:14
【问题描述】:
我想在 Paging3 中使用 Multi Type,但 PagingDataAdapter 只支持一种通用范式。怎么做?也许有一些演示?
我想将它与 Room 一起使用。
和 RecylerView 一样,有两种 item。一种是文本内容,另一种是图像。
所以我想知道怎么做?
【问题讨论】:
标签: android kotlin android-jetpack android-paging
我想在 Paging3 中使用 Multi Type,但 PagingDataAdapter 只支持一种通用范式。怎么做?也许有一些演示?
我想将它与 Room 一起使用。
和 RecylerView 一样,有两种 item。一种是文本内容,另一种是图像。
所以我想知道怎么做?
【问题讨论】:
标签: android kotlin android-jetpack android-paging
通常你会有某种基类在两种视图类型之间共享。
这里有一个很好的示例,展示了从单一视图类型到模式的渐进式迁移,第二个视图类型从.insertSeparators 注入。
https://developer.android.com/topic/libraries/architecture/paging/v3-transform#convert-ui-model
【讨论】: