问题标签 [epoxy]

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.

0 投票
1 回答
69 浏览

android - Android双向数据绑定,ObservableDouble改变时不触发任何东西

我会很感激你的帮助。我想在送餐应用程序(uber eats,deliveroo)中建立一个自定义复选框组。当用户选择/取消选择一项时,它应该自动调整价格。此屏幕是使用每个项目的自定义复选框、自定义复选框组、双向数据绑定和环氧树脂构建的。选择/取消选择项目时,调用了正确的绑定适配器,但它永远不会更新视图模型。

在此处输入图像描述

这是自定义复选框。

这是自定义复选框组:

这是绑定适配器

使用复选框的项目复选框,它是环氧树脂项目。

这是视图模型:

这是自定义视图模型

此代码来自片段,并且没有被触发:

这段代码也来自片段,也没有被触发

绑定适配器似乎工作正常,当我在其中放置断点时它可以工作,但由于某种原因,totalPrice从片段中观察变化永远不会工作。

感谢您的帮助

0 投票
1 回答
1338 浏览

android - 如何为 Jetpack Compose 中的列表实现“对齐中心”功能?

在带有 Horizo​​ntal LinearLayout 的 EpoxyRecyclerView 中,有一个 Snap to center 功能,它的工作原理类似于,如果我以良好的速度滚动列表,它会继续滚动,直到它放慢速度并在中心放置一个项目。如果我慢慢滚动并抬起手指,那么下一个项目会跨越/移动到屏幕中心。你必须明白一件事,这不是寻呼机。寻呼机仅自动捕捉下一个项目。但我不能像自由滚动一样滚动......

您可以将此 gif 视为示例

在此处输入图像描述

所以,我在 Jetpack Compose 中寻找这样的捕捉功能。这可能吗?如果是,如何实现这一目标?

0 投票
3 回答
454 浏览

android - 环氧树脂一旦构建就更新模型中的环氧树脂属性会导致崩溃

应用已崩溃,正在执行 CustomActivityOnCrash 的 UncaughtExceptionHandler

控制器类

// 模型类

在 DialogFragment oncreate 中,我设置了epoxyRecyclerView。

并调用控制器上的设置器并请求模型构建

但是,问题是我想用一些新数据更改模型中显示的数据。因此,当用户点击一个国家/地区时,我想再次设置设置器。

0 投票
1 回答
103 浏览

android - Is the automatic comparison in the Epoxy library based on DiffUtil?

I came across the Epoxy library while looking for information about RecyclerView.

Epoxy is a library that makes RecyclerView easier to use.

I haven't applied it to my app yet, but I think it will be easier if I apply it.

Because the RecyclerView I use is based on two view types, and both items are dynamically added/removed frequently (DiffUitl is also used).

However, while reading the description of the Epoxy library in Git,

I came across the following:

Additionally, Epoxy adds support for saving view state and automatic diffing of item changes.

I'm curious as to what automatic diffing you're talking about here works based on. Is it DiffUtil internally or simply notifyDatasetChanged()?

If it uses DiffUtil then I'm going to use Epoxy or I'll consider it.

0 投票
1 回答
396 浏览

android - How to fix java.lang.AbstractMethodError in android?

I switched from a recyclerview to using an epoxy list controler to display the results of a web response in my application. My response is handled in the right way and is transfered in my model class. Unfortunately after I received the response I got an error. The error looks like this:

I tried to find a solution but can´t find someone with the same error as me. I updated everything in my gradle files but I keep getting the same error. I´m not familiar with such a problem and can´t find a helpful solution on my own!

I would be thankful for any help!

0 投票
1 回答
80 浏览

android - 在代码中,lambda的类型不匹配,它是如何工作的?

我正在使用Epoxy libraryon Android

我很好奇的是为什么当类型不匹配时parameteroflambda expression不会出错。

listener是以 alambda expression作为参数的Int typea。

listener(addDetailClicked)工作正常。

不应该listener(Int)吗?或listener({ i -> addDetailClicked(i) })

实际上,即使我编写了代码,我也不知道它为什么会起作用。

这怎么可能?

模型

控制器

分段

0 投票
1 回答
31 浏览

android - BottomSheetDialog 内 VideoView 的 MediaController 隐藏在 BottomSheetDialog 后面

我有一个项目,我以编程方式将自定义地图标记添加到地图活动。当用户单击标记时,BottomSheetDialog 会从屏幕底部出现,其中包含有关自定义地图标记的信息。关键信息之一是将播放的视频。问题是 VideoView 的 MediaController 没有悬停在视频上方,而是在 BottomSheetDialog 后面。它位于屏幕上的正确位置,但位于 BottomSheetDialog 和 VideoView 的后面。我正在使用 EpoxyRecyclerView 将 VideoView、MediaController 和各种 TextView 添加到 BottomSheetDialog。

创建 BottomSheetDialog 的函数:

将 VideoView 和 MediaController 添加到 BottomSheetDialog 的 Epoxy 函数:

VideoView 的布局文件:

EpoxyRecycler 布局文件:

0 投票
1 回答
70 浏览

android - RecyclerView的数据随机变化的问题

(图 1 和图 2)

在此处输入图像描述 在此处输入图像描述


(图3)

在此处输入图像描述


我目前正在使用Epoxy library而不是RecyclerView. 不过,既然Epoxy是建立在 的基础之上的RecyclerView,我们就叫它吧RecyclerView

问题 1。(图 1 和图 2)

当我在 中输入一个值后返回另一个屏幕时EditTextRecyclerView item输入的数据会随机移动。

问题 2。(图3)

添加足够items的可滚动后,我还将值输入到EditText. 如果我向下滚动并返回,数据将移动到随机位置。

请告诉我是什么原因以及正确的解决方案是什么。

0 投票
0 回答
41 浏览

android-recyclerview - 环氧树脂轮播如何以编程方式移动到下一个项目

我需要显示轮播项目,并在轮播项目之外有按钮可以转到上一个项目和下一个项目。鉴于轮播项目是回收站视图的元素,我应该使用以下方法移动到下一个和上一个位置,但它似乎不起作用

我不确定是否有任何其他回调来设置位置,就好像用户正在滚动到下一个项目一样。非常感谢任何帮助

0 投票
1 回答
25 浏览

kotlin - 如何使用 Airbnb 的 Epoxy 模型实现拖放功能?

我想编写这个 todo() 部分以使用 Airbnb 的 Epoxy Library 执行拖放,我有这个方法 onModelMoved() 我无法思考要编码什么或方法需要帮助!

下面是我在 HomeEpoxyController 中的数据类,如果它可以帮助你的话