Code example for HorizontalScrollView

Methods: smoothScrollTo, getScrollY

0
        runningScoresTable.post(scroll);
    } 
 
    private final Runnable scroll = new Runnable() {
        @Override public void run() { 
            runningScoresScroller.smoothScrollTo(runningScoresTable.getWidth(), 
                    runningScoresScroller.getScrollY()); 
 
        } 
    }; 
 
    /** 
     * Returns a string ending with {@code s} of at least {@link #MIN_LENGTH} 
     * characters. 
     */ 
    private String pad(String s) {
        String spaces = "          ";
        int toAdd = MIN_LENGTH - s.length();
        return toAdd <= 0 ? s : (spaces.substring(0, toAdd) + s);
    }