Skip to content

Instantly share code, notes, and snippets.

@douglasjunior
Created September 30, 2015 12:29
Show Gist options
  • Save douglasjunior/9d52feb7e0f3158996ec to your computer and use it in GitHub Desktop.
Save douglasjunior/9d52feb7e0f3158996ec to your computer and use it in GitHub Desktop.
Override to fix enable/disable problem.
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import com.weiwangcn.betterspinner.library.material.MaterialBetterSpinner;
/**
* Created by Douglas Nassif Roma Junior on 30/09/15.
*/
public class CustomMaterialSpinner extends MaterialBetterSpinner {
public CustomMaterialSpinner(Context context) {
super(context);
}
public CustomMaterialSpinner(Context arg0, AttributeSet arg1) {
super(arg0, arg1);
}
public CustomMaterialSpinner(Context arg0, AttributeSet arg1, int arg2) {
super(arg0, arg1, arg2);
}
/**
* Override to fix enable/disable problem.
*
* @param event
* @return
*/
@Override
public boolean onTouchEvent(MotionEvent event) {
if (isEnabled())
return super.onTouchEvent(event);
else return false;
}
}
@douglasjunior
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment