Code example for HorizontalScrollView

Methods: smoothScrollTo

0
            menu.setVisibility(View.VISIBLE);
 
            if (!menuOut) {
                // Scroll to 0 to reveal menu 
                int left = 0;
                scrollView.smoothScrollTo(left, 0);
            } else { 
                // Scroll to menuWidth so menu isn't on screen. 
                int left = menuWidth;
                scrollView.smoothScrollTo(left, 0);
            } 
            menuOut = !menuOut;
        } 
    } 
 
    /** 
     * Helper that remembers the width of the 'slide' button, so that the 'slide' button remains in view, even when the menu is 
     * showing. 
     */ 
    static class SizeCallbackForMenu implements SizeCallback { 
        int btnWidth;