Detect scrolling of ScrollView + TextView

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Detect scrolling of ScrollView + TextView

Postby munashii » Tue Dec 29, 2009 8:01 pm

I'm fairly new at Android development. Been a long-time lurker and I finally got some time to get started. I've been looking around all over the place (including these forums) to find an answer to this problem I'm having. I currently have a TextView inside a ScrollView. This part is working just fine.

What I need is a way to call a function after the ScrollView is done scrolling (if for example, say the user swipes up and goes all the way to the bottom of the TextView) in order to do some processing. I can't seem to find any appropriate listeners or events for this purpose.

I'm debating on just using a Handler as a timer (more efficient, probably every 200ms or something) and once the getY() from the ScrollView stops changing, I know it has stopped scrolling, then I can check the position. This will work but it seems like a very roundabout and somewhat inefficient way of doing things.

Any input is appreciated. Thanks! :)
munashii
Freshman
Freshman
 
Posts: 2
Joined: Tue Dec 29, 2009 7:53 pm

Top

Re: Detect scrolling of ScrollView + TextView

Postby sabs » Wed Dec 30, 2009 8:13 am

munashii wrote:I'm fairly new at Android development. Been a long-time lurker and I finally got some time to get started. I've been looking around all over the place (including these forums) to find an answer to this problem I'm having. I currently have a TextView inside a ScrollView. This part is working just fine.

What I need is a way to call a function after the ScrollView is done scrolling (if for example, say the user swipes up and goes all the way to the bottom of the TextView) in order to do some processing. I can't seem to find any appropriate listeners or events for this purpose.

I'm debating on just using a Handler as a timer (more efficient, probably every 200ms or something) and once the getY() from the ScrollView stops changing, I know it has stopped scrolling, then I can check the position. This will work but it seems like a very roundabout and somewhat inefficient way of doing things.

Any input is appreciated. Thanks! :)


Hii
can you please post the sample code of your project so that i can help you better.
sabs
Developer
Developer
 
Posts: 32
Joined: Fri Dec 04, 2009 2:55 pm

Postby munashii » Wed Dec 30, 2009 3:34 pm

I just got to work so I don't have my code on me sadly. :(

Basically it's just a TextView with a lot of text in it inside a ScrollView. The idea is to be able to do something when the user hits the end of it. I got it to work with timers but I'm hoping there's a better way.
munashii
Freshman
Freshman
 
Posts: 2
Joined: Tue Dec 29, 2009 7:53 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests