问题标签 [fastadapter]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - 即使数据保持不变,从 LiveData 加载后 FastAdapter 也会闪烁
对于这个问题,我在 Github 准备了一个简单且有效的示例:
我的示例应用程序使用 okhttp 下载了一个包含游戏中前 30 名玩家的 JSON 数组,并将它们存储到 SQLite Room 中。在片段中,我观察了相应的LiveData<List<TopEntity>>
对象并更新了 FastAdapter 实例:
我的问题是:每次下载数据时,回收站视图都会闪烁一次。
尽管前 30 名并不经常变化,即数据保持不变。
当我查看 Penz 先生出色的FastAdapter库中的示例应用程序时,我看不到那里有任何闪烁。
更新:
我有一个提示,闪烁显然是由调用方法引起mItemAdapter.clear();
的onChanged
,我应该改用 DiffUtil 类。
所以我添加了一个新类:
然后我试图在onChanged
方法中使用它而不是仅仅调用mItemAdapter.clear()
但是 RecyclerView 保持为空,即使tops
有元素:
我的问题的简短摘要:
我的真实应用程序使用FastAdapter
有几个原因,我正在寻找一种方法将其与DiffUtil “结合” ,以消除通过 HTTPS 下载数据并在 Room 中更新数据时的一次性闪烁。
android - FastAdapter 和 ConstraintLayout 的滚动问题:跳过 211 帧
对于我的问题,我在 Github 上准备了一个非常简单的 AndroidX 测试应用程序:
我在MainActivity中使用了非常好的 FastAdapter 库:
对于项目布局,我使用带有 8 个 TextView 和 4 个 ImageView 的 ConstraintLayout:
在手机上调试应用程序(我使用 Moto G2 和 Moto G4 Play)并滚动只有 10 个项目的列表时,我不断收到警告:
在我的真实应用程序中,我有其他布局的片段不会产生此类错误,所以我不认为旧手机是原因。我也不会滚动得特别快或太慢。
android - FastAdapter 项目内视图的单击侦听器
我正在尝试为 CardView 中的按钮实现单击侦听器。当我按下此按钮时,该项目将被删除。但我找不到实现它的方法。FastAdapter 文档位于 Kotlin 中,因此没有 Java 示例。
通常这是在 onBindView 中完成的,但对于 FastAdapter,方法是不同的。这是我的模型(RequestBuyer)
模型.java
这是我的片段活动(RequestActivityBuyer)
活动.java
我试图遵循这个例子,但它没有工作,因为图书馆从那时起逐渐改变。链接:FastAdapter ViewHolder 监听器
android - Android FastAdapter ClickEventHook isn't working properly
I am seeking forgiveness for this simple problem. I am using FastAdapter for the first time and I am new to Kotlin. Let me share the problem. I have a layout for the recyclerview item holder, an adapter which extends AbstractItem class.
Actually I couldn't format the code correctly here on Stack overflow. So I created the code at GitHub Gist. Here is the link.
In the layout_add_item.xml
file, I have two buttons, one's id is addStudent
and another one's id is addTeacher
.
So, my problem is, these two button's onClickListener is not triggered until I click on the root layout once on every onCreate method is called. If I click on the LinearLayout once, then these two button's onClickEvent get fired normally.
I don't know what's wrong here :-(
Any help would be appreciated. Thanks in advance.
android - 扩展嵌套项 FastAdapter
我找不到使用 FastAdapter 库扩展嵌套项目的方法。
示例:
类别 1
-- 子类别 1 // 类别的子项
++ SubSubCategory 1 // 子类别的子
项 ++ SubSubCategory 2
-- 子类别 2
++ SubSubCategory 3
++ SubSubCategory 4
类别 2
-- 子类别 1
-- 子类别 2
I'我想扩展“SubSubCategory 2”。当我通过单击(显然)手动执行此操作时,它可以工作。但在某些情况下,我想以编程方式打开它。如果我想打开 Subcategory - ,我知道该怎么做getExpandableExtension().expand(globalPosition)
。但是如何使用 SubSubCategory 做到这一点?我不知道有什么办法可以得到他们的位置。更改 isExpanded 标志也无济于事。我知道我要打开的项目的标识符。
android - FastAdapter 组合标题和项目
我使用 mikepenz 的库 fastadapter https://github.com/mikepenz/FastAdapter
需要结合不同的观点
项目类别
显示标题类
用于生成项目
我不知道如何组装适配器,以便它可以有两种不同类型的视图。
一个简单的例子?因为存储库中的内容太复杂而无法理解
android - Is there any way to add Native Ad to the adapter with fast adapter?
I am developing an app that will show AdMob Native Ad in Recycler View. I know how can I code the Recycler View adapter for it without any 3rd party libraries. But I am using fast adapter library and I don't know how can I show the ad in fast adapter.
The adapter class:
There is fragment:
Is there any way to add Native Ad to the adapter with fast adapter?