Java Code Examples for android.view.View.getDrawableState()

The following are Jave code examples for showing how to use getDrawableState() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: GitHub   File: ConnectbotMatchers.java   Source Code and License Vote up 5 votes
private static boolean hasDrawableState(View view, final int expectedState) {
	if (!(view instanceof ImageView)) {
		return false;
	}

	int[] states = view.getDrawableState();
	for (int state : states) {
		if (state == expectedState) {
			return true;
		}
	}
	return false;
}