Android Open Source - synchroller Range Computer






From Project

Back to project page synchroller.

License

The source code is released under:

MIT License

If you think the Android project synchroller listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ru.egslava.synchroller;
/*w  w w.j  a  va 2  s  .com*/
/**
 * The interface is needed to get known how to calculate the virtual (scrollable) size of component.
 * For example, physical component size on screen is 640x480, but we can scroll much more:
 * 2 or 2 screens up and down. So virtual size is 1280x960.
 *
 * So, according to scrollviews, extent - is a physical size of view and extent - is the virtual.
 * @see http://stackoverflow.com/a/16889455/1444191 for more information
 */
public interface RangeComputer{
    /**
     * Calls every time it needs to update scroll position
     */
    void computeScroll();

    /**
     * @return computed (cached) size of total (virtual) area. All processings should be in #computeScroll()
     */
    int computeHorizontalScrollExtent();

    /**
     * @return computed (cached) size of real usually, getMeasuredWidth(). All processings should be in #computeScroll()
     */
    int computeHorizontalScrollRange();

    /**
     * @return computed (cached) size of total (virtual) area. All processings should be in #computeScroll()
     */
    int computeVerticalScrollExtent();

    /**
     * @return computed (cached) size of real usually, getMeasuredHeight(). All processings should be in #computeScroll()
     */
    int computeVerticalScrollRange();

}




Java Source Code List

ru.egslava.synchroller.ApplicationTest.java
ru.egslava.synchroller.ConcreteViewRangeComputer.java
ru.egslava.synchroller.MaxChildSizeRangeComputer.java
ru.egslava.synchroller.RangeComputer.java
ru.egslava.synchroller.SavedState.java
ru.egslava.synchroller.ScrollListener.java
ru.egslava.synchroller.ScrollableComponent.java
ru.egslava.synchroller.ScrollerTo.java
ru.egslava.synchroller.StaticSizeRange.java
ru.egslava.synchroller.ViewPrivateMethods.java