Example usage for android.widget ScrollView setSmoothScrollingEnabled

List of usage examples for android.widget ScrollView setSmoothScrollingEnabled

Introduction

In this page you can find the example usage for android.widget ScrollView setSmoothScrollingEnabled.

Prototype

public void setSmoothScrollingEnabled(boolean smoothScrollingEnabled) 

Source Link

Document

Set whether arrow scrolling will animate its transition.

Usage

From source file:Main.java

/**
 * E.g. when using previous-next facility you need to make sure the scroll view's position is back at the top of the screen
 *//*www. ja  va2  s  .co m*/
public static void scrollToTop(int scrollViewId, Activity activity) {
    ScrollView sv = (ScrollView) activity.findViewById(scrollViewId);
    sv.fullScroll(View.FOCUS_UP);
    sv.setSmoothScrollingEnabled(true);
}