Created
May 4, 2015 12:54
-
-
Save unosk/e96f3578dcb77d0b50a8 to your computer and use it in GitHub Desktop.
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.view.View; | |
public class UiVisibilityHelper { | |
private View[] mViews; | |
public UiVisibilityHelper(View... views) { | |
mViews = views; | |
} | |
public void toggle() { | |
if (mViews[0].getVisibility() == View.GONE) { | |
show(); | |
} else { | |
hide(); | |
} | |
} | |
public void show() { | |
for (View view : mViews) { | |
view.setVisibility(View.VISIBLE); | |
} | |
} | |
public void hide() { | |
for (View view : mViews) { | |
view.setVisibility(View.GONE); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment