Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

RecyclerView scrolled UP/DOWN listener

mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {

    @Override
    public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
        super.onScrolled(recyclerView, dx, dy);
        if (dy > 0) {
            // Scrolling up
        } else {
            // Scrolling down
        }
    }

    @Override
    public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
        super.onScrollStateChanged(recyclerView, newState);

        if (newState == AbsListView.OnScrollListener.SCROLL_STATE_FLING) {
            // Do something
        } else if (newState == AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
            // Do something
        } else {
            // Do something
        }
    }
});
Comment

PREVIOUS NEXT
Code Example
Java :: java.lang.ArrayIndexOutOfBoundsException: -1 
Java :: public void bookingDetails(View view) { Intent intent = new Intent (PackageContext:this, MainActivity.class); intent.putExtra("name", value "kenny"); startActivity(intent); } 
Java :: Mirror Inverse Program in java 
Java :: are classes in java public by default 
Java :: activity selection java solution 
Java :: switch expression 
Java :: scanner class in java 
Java :: how i can recover the information from arraylist 
Java :: linked list introduction 
Java :: dependency maven mvn assertj asserting testing framework 
Java :: spigot give item 
Java :: print string in reverse order using recursion java 
Java :: how to put array in array list stack overflow 
Java :: Save SQLite returned data to an object list 
Java :: @android:color/system_neutral1_1000 
Java :: if(ResultSet.next()) 
Java :: Which one of the following values can a Java variable NOT have? 
Java :: Append Line Separator In StringBuilder 
Java :: react native appearance.addchangelistener android 
Java :: using condition for each loop 
Java :: how to take input an array in java 
Java :: Java Numbers and Strings 
Java :: Recyclerview scramble after scrolling 
Java :: truncar a 2 decimales java 
Java :: spring jpa group by query method 
Java :: java bufferedreader 
Java :: string split java 
Java :: Calculate weeks from date using java 
Java :: compare two strings java 
Java :: code to get date and time in android 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =