Created
September 30, 2015 12:29
-
-
Save douglasjunior/9d52feb7e0f3158996ec to your computer and use it in GitHub Desktop.
Override to fix enable/disable problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lesilva/BetterSpinner#27