Android Open Source - Android.MovingToolbar Notify Scroll View






From Project

Back to project page Android.MovingToolbar.

License

The source code is released under:

MIT License

If you think the Android project Android.MovingToolbar 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 com.iamnbty.movingtoolbar;
//from   w w w .jav  a  2  s .  c  om
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

public class NotifyScrollView extends ScrollView {

    private Callback callback;

    public NotifyScrollView(Context context) {
        super(context);
    }

    public NotifyScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NotifyScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public void setCallback(Callback callback) {
        this.callback = callback;
    }

    @Override
    protected void onScrollChanged(int left, int top, int oldLeft, int oldTop) {
        super.onScrollChanged(left, top, oldLeft, oldTop);

        if (callback != null)
            callback.onScrollChanged(left, top, oldLeft, oldTop);
    }

    public interface Callback {

        public void onScrollChanged(int left, int top, int oldLeft, int oldTop);

    }

}




Java Source Code List

com.iamnbty.movingtoolbar.ApplicationTest.java
com.iamnbty.movingtoolbar.MainActivity.java
com.iamnbty.movingtoolbar.NotifyScrollView.java