Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if android clicks invalid verification

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the android click invalid verification how to do, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.

Background

There is a problem when writing something to swipe and delete the list. My requirement is to slide to the left and then delete appears, and then click delete to make the slider disappear.

When I click on the first line of the list, left slide, delete appears, click delete, ok, perfect. Then I click on the third, the same left slide appears delete, click delete there is no response.

Then I click on the first one, and I can delete it.

The model is as follows:

Sub-model:

Ps:

The black is the outermost layer, the blue is in the black block, and then the delete area is in the slider area. Sliding controls the movement of the blue area.

If that's all, I don't panic at all. Something appeared, which made me even more confused. Delete's groupview container clicks are valid, that is, clickable in the blue area, and I use it to click and add item, which also gives me a clue.

Two questions arose in my mind:

Why only the first can be clicked, after deleting the first, the second becomes the first, and can be deleted? Why is the delete area unclickable and its groupview clickable?

Solve

For the first question, I tried to check whether it was bound, but of course it was impossible to debug it, because the list is all the same. If you look at the xy coordinates, you will have brain pain.

/ / holder.tvMsgRemindDelete is to get the delete object holder.tvMsgRemindDelete.setText ("Hello")

I will get the delete view and then modify its text.

Of course it's useless. I didn't feel right when I finished it, but I still had a glimmer of hope.

Because if it becomes the first one, then you can click to delete, and you must have bound the event, ha.

For the second question, the parent groupview can be clicked, and I wonder if the parent's groupview blocked the distribution event. (generally speaking, it will not be stopped, but the slide I made is more complicated, so comfort myself.)

Whether to distribute to child elements, involving

1. OnInterceptTouchEvent2. DispatchTouchEvent

These two events, one is distribution, the other is interception.

Then find [ACTION_DOWN,ACTION_UP] to judge that the event is through these two judgments.

And then really found: return inView (x, y)

Ps:

InView is what I use to determine whether the current XBI y axis is in the slider, that is, in the blue block.

Put the delete on the outside, as follows:

Forgot to change and then caused the problem.

Thank you for reading this article carefully. I hope the article "how to verify invalid android clicks" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report