Android分页3跳转和占位符示例

发布于 2025-01-17 00:06:16 字数 212 浏览 0 评论 0原文

我一直在搜索很多,但找不到示例如何从已加载页面中的一个位置跳转到另一个尚未加载页面中的另一个位置以及如何实现占位符。

我知道 PagingConfig 中的“jumpThreshold”和“enablePlaceholders”参数,但是文档不清楚,所有提供的示例都非常标准,没有一个实际涵盖该场景。

我想知道是否有人在同一条船上以及你是如何解决的。不确定这是否可以帮助@dlam?

I’ve been searching a lot but couldn’t find an example how to jump from a position in a loaded page to another position in another page which hasn’t been loaded and how to implement placeholders.

I am aware of ‘jumpThreshold’ and ‘enablePlaceholders’ params in PagingConfig however the doc isn’t clear, all the provided examples are pretty standard and none actually covers the scenario.

I was wondering if anyone on the same boat and how did you work it out. Not sure if this is something you can help @dlam?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

治碍 2025-01-24 00:06:16

'enablePlacedholder' 应为 'true',默认情况下存在,然后您可以指定 'jumpThreshold' 值。例如:我正在使用以下配置从数据库加载 1L 行:

PagingConfig(
            pageSize = 400,
            prefetchDistance = 160,
            maxSize = (400 + 160) * 5,
            jumpThreshold = 4000,
            initialLoadSize = 800
        )

看一下这个示例:
https://blog.ah.technology/paging-3s-占位符和跳转功能-805344191df

'enablePlacedholder' should be 'true', which is there by default and then you can give 'jumpThreshold' value. for eg: I am loading 1L rows from DB with following config:

PagingConfig(
            pageSize = 400,
            prefetchDistance = 160,
            maxSize = (400 + 160) * 5,
            jumpThreshold = 4000,
            initialLoadSize = 800
        )

Take a look at this example:
https://blog.ah.technology/paging-3s-placeholders-and-jumping-features-805344191df

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文