All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.afollestad.materialdialogs.views.MeasureCallbackScrollView Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package com.afollestad.materialdialogs.views;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

/**
 * @author Aidan Follestad (afollestad)
 */
public class MeasureCallbackScrollView extends ScrollView {

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

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

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

    public static interface Callback {
        void onMeasureScroll(ScrollView view);
    }

    private Callback mCallback;

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

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        if (mCallback != null)
            mCallback.onMeasureScroll(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy