在recyclerview中触发onitemactivatedListener。

发布于 2025-01-23 09:45:38 字数 785 浏览 4 评论 0原文

onitemactivatedListener.OniteMactivated 说此方法是

当项目“激活”时调用。例如,当不存在选择并用手指点击项目时,将项目激活,或用指向设备(如鼠标)单击项目。

但是,当不存在选择并用她(/his)手指敲击物品时,该物品不会被激活。众所周知,当没有选择时,您必须长时间按一个以激活它的项目,并且只能通过Tap激活后续项目。 (通过激活,在这里,我的意思是项目选择。对不起,对不起 因此,我想弄清楚他们的术语。)

因此,我想澄清当该项目刚刚被长时间敲击或激活时是否调用此方法。

The documentation for OnItemActivatedListener.onItemActivated says that this method is

Called when an item is "activated". An item is activated, for example, when no selection exists and the user taps an item with her finger, or double clicks an item with a pointing device like a Mouse.

But, when no selection exists and user taps an item with her(/his) finger, the item does not get activated. As I know, when there is no selection, you have to long press an item for activating it, and only the subsequent items can be activated just by tap. (By activation, here, I mean item-selection. Sorry that Android messed up with their terminology.)

So, I wanted to clarify if this method is called when the item is just-tapped or activated by long-press.

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

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

发布评论

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

评论(1

聊慰 2025-01-30 09:45:38

长压行不通,但是在挖掘物品时会触发它。
除非明确添加,否则它甚至不会将项目添加到选择中。

Long-press doesn't work, but it gets triggered when an item is being tapped.
And it doesn't even add the item to the selection, unless explicitly adding it.

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