Back to project page RoboBinding-gallery.
The source code is released under:
Apache License
If you think the Android project RoboBinding-gallery listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.robobinding.gallery.model.view; /* w ww. j ava 2 s . co m*/ import android.view.View; /** * * @since 1.0 * @version $Revision: 1.0 $ * @author Cheng Wei */ public class IntegerVisibility { private int[] values; private int currentIndex; public IntegerVisibility() { values = new int[]{View.VISIBLE, View.INVISIBLE, View.GONE}; currentIndex = 2; } public int getValue() { return values[currentIndex]; } public void nextState() { currentIndex = nextIndex(); } private int nextIndex() { int nextIndex = currentIndex + 1; if(nextIndex >= values.length) { nextIndex = 0; } return nextIndex; } public String describe(String visibleDescription, String invisibleDescription, String goneDescription) { if(currentIndex == 0) { return visibleDescription; }else if(currentIndex == 1) { return invisibleDescription; }else { return goneDescription; } } }