Way to check if user is scrolling?

I have a scrollview in my layout and I want to be able to check if the user is scrolling. I checked the Scrollview in Android Docs, but I don't see anything like isScrolling() that returns a boolean.

My question is: is there a way to check if the user is attempting to scroll, as opposed to clicking a button? Could there be some other class in the Android core that is monitoring the scroll event?

-------------Problems Reply------------

There could be a better way but here is how you can figure it out.

You get a MotionEvent object inside the onTouchEvent(MotionEvent ev) method. check the action of the motion event as ev.getAction().

If the action is ACTION_MOVE it implies that a scrolling is taking place.

Note: Scrolling is different than a fling. So the same logic cannot be used to determine if the fling is over.

Category:android Views:0 Time:2011-03-12
Tags: android

Related post

  • Winforms .NET DataRepeater - Unbound checkboxes won't maintain checked / unchecked state on scroll 2010-12-10

    I have a WinForms application that retrieves items from a database and displays them in a list: <Delete Button><Edit Button><Checkbox><PartNumber><PartDescription> The Checkbox is unbound and enables users to select as m

  • checkboxes in the List randomly get checked/unchecked when i scroll through. android 2.3 2011-04-19

    I am using my custom adapter. There is a checkbox and a text view in each row. But i have a problem. There are more items in the list than the number which fits on the screen. So when i check any of the checkboxes on the screen and scroll down. The a

  • UITableViewCell is checked randomly when i scroll up and down 2012-01-02

    My code representing my approach works great, however, when i scroll down and up, i got some UItableViewCells checked in all my sections. Can you please help me figure out what wrong with my logic. This is my whole code: The Definition file .h: @inte

  • In a div that has overflow:scroll, how do I check what position the scroll is at? 2011-04-29

    Using JQuery. How do I know if it's scrolled to the middle? Top? Bottom? --------------Solutions------------- You can use the element's scrollLeft, scrollTop, scrollWidth and scrollHeight properties to find out the status of the element's scrolling.

  • checking if a user scrolls to top or bottom 2012-02-29

    I am trying to figure out a way to detect whether a UIScrollView is scrolled to the top or the bottom. I know I will have to do some calculation using the contentOffset.y, but how do I do the calculation? --------------Solutions------------- The scro

  • Android development: Check if WebView is Scrolled to Right Or Left 2012-03-24

    Im using GestureListner to Swipe against Tab(TabHost) But in one tab there is a WebView. And if the WebView is zoomed in and the user fling it switch tab and I don't want that! :) Ive tried if(!web.zoomoOut()) and it works half it checks if cant zoom

  • How to check if Scroll Lock is on or off? 2010-10-22

    How does one check to see if Scroll Lock is enabled on a system or not in Java? --------------Solutions------------- import java.awt.Toolkit; import java.awt.event.KeyEvent; Toolkit toolkit = Toolkit.getDefaultToolkit(); toolkit.getLockingKeyState(Ke

  • Check Scroll Lock, Num Lock & Caps Lock in JavaScript on Page Load 2012-01-30

    Is it possible to check the status of Scroll Lock, Num Lock and Caps Lock on page load of a web page? I've found ways to check after a keypress using JavaScript, but that's not what I'm asking. --------------Solutions------------- No, you can't get s

  • ListView unable to check a checkbox 2009-06-29

    This is a strange problem, I've not added much code as I don't know were to start. I have a listview control in virtual mode, if I filter the listview to show me all people called John, I then see 3 users called John, I then cancel the filter setting

  • Scrolling down both parts of a split-window at the same time in Vim 2009-07-07

    Is it possible to scroll down the left and right parts of a vertically split window in Vim? I have two files I would like to compare roughly. Each line of these files looks almost the same. --------------Solutions------------- See the documentation f

  • prevent window for scrolling after div box scrolling 2009-12-27

    I have a small div box that has a vertical scroll bar and sits within an html page that also has a vertical scroll bar. My problem is when the user reaches the end of the small DIV box scrolling, the ENTIRE html page that contains the div box then be

  • jquery: scroll to an element within an overflowed div 2010-02-27

    i have 20 list items inside of a div that can only show 5 at a time. what is a good way to scroll to item #10, and then item #20. i know the height of all the items. the scrollTo plugin does this, but its source is not super easy to understand withou

  • Toggle element based on viewport & scrolling 2010-03-08

    I'm trying to toggle an element based on the viewport and scrolling. By using $(window).scroll(function().. I can fire an event when the user scrolls but how do I check whether you're scrolled to the top in order to hide the element? --------------So

  • How to fetch data based on scrolling of div - JQuery? 2010-04-20

    I am working on a search page wherein I could potentially get thousands of records (I fetch Client Name only) based on search criteria. I load the data into a results div (height:300px; overflow:scroll). Is it possible to fetch a part of data first (

  • How to scroll the contents to bottom by default in JTextPane? 2010-05-11

    I have JTextPane on my window and i have JTextField. When i press enter enter in JTextField, the text gets added in JTextPane. Everything works fine and scrollbar too appears on its own. But, it doesn't appear properly. It automatically scrolls to th

  • HTML scroll bar width 2010-07-19

    I would like to know if there is any scroll bar property in HTML to change the width of the default scroll bar in HTML. The default size of the scroll bar is 13px. is it possible to increase the the pixel value. Can anyone help... --------------Solut

  • Adding list of check boxes in a single widget in Qt 2010-11-01

    I'm using Qt Creator 2.0.1 (Qt 4.7). I need a widget which can hold multiple check boxes vertically. The check boxes will be added to the widget dynamically upon user interaction with other UI element. The widget will have fixed width and height so i

  • Check box item for UITableView 2010-11-14

    I am trying to check items of a uitableview but I am having two difficulties: 1. I cannot select the first item 2. if I select the 2nd and 3rd item for instance, this will also place a check mark near the 5th and 7th, and 9th and 10th etc etc The fol

  • How to detect/disable inertial scrolling in Mac Safari? 2010-12-02

    Is there a way to disable or detect that wheel events are from the "inertia" setting on a Mac? I'd like to be able to tell the difference between real events and the others...or disable that kind of scrolling for a particular page. --------------Solu

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.148 (s). 11 q(s)