views:

48

answers:

1

Hello. I've been a couple of days trying to solve this thing but I can'f figure it out. The problem is, simple activity, with simple layout, ScrollView -> LinearLayout -> and a lot of buttons inside the layout (within the scroll content). Everything works just fine but one tricky thing. When I click a button let's say at the top of the scroll content and inmediatelly I scroll down to the bottom of the content and I click other button there, nothing happens until I click a second time and all come to normal again. This can be reproduced anytime and it's code independent (i've tried more than 20 scenarios). I've not much experience in android yet but looks like the scroll listener stops the onclick listener or something like that. Any help with this would be much apreciated. Thank you in advance.

PD. If i programatically do a scrollTo() instead of manual scroll with my fingers everything works just fine and click responds at first touch. It's simply overwhelming me.

A: 

Everything is behaving normally.

When you start scrolling, the ScrollView will claim touch events until you stop touching the screen for a bit. In Android 2.2, you will know when scrolling is deemed complete, because the scrollbar on the right will fade away.

CommonsWare
Ok, I understand what you mean. So I asume there is no option to reduce the time while scrollview is claming touch events once it stops scrolling (at leat visually)...? I know it's not much time, maybe 0,5 seconds but sill anoying. If there was a way it would be great. Anyway thank you so much for your answer.
esenian
@esenian: "So I asume there is no option to reduce the time while scrollview is claming touch events once it stops scrolling (at leat visually)...?" -- not that I am aware of. Bear in mind that a `ScrollView` of a list of `Buttons` is not a technique you will see many production applications use.
CommonsWare
@CommonsWare Sure you're right and again thank you, I thought this was the approach for the new YouTube app from google. It seems to have an horizontalscrollview populated with buttons simulating "scrolling tabs". I've made it work and look pretty much the same but the issue with the click lag was annoying. Now I see that the app itself has also the same laggy behaviour with this so that my approach must be quite close. It's nice in my opinion. I'll try to see the scrollview code to see if I can override what controls this time. Really thank you man.
esenian