/** * Set visibility of given view to be invisible or visible * * <p>This method has no effect if the view visibility is currently gone * * @param view * @param invisible * @return view */ public static <V extends View> V setInvisible(final V view, final boolean invisible) { if (view != null) if (invisible) { if (INVISIBLE != view.getVisibility()) view.setVisibility(INVISIBLE); } else { if (VISIBLE != view.getVisibility()) view.setVisibility(VISIBLE); } return view; }
/** * Set visibility of given view to be gone or visible * * <p>This method has no effect if the view visibility is currently invisible * * @param view * @param gone * @return view */ public static <V extends View> V setGone(final V view, final boolean gone) { if (view != null) if (gone) { if (GONE != view.getVisibility()) view.setVisibility(GONE); } else { if (VISIBLE != view.getVisibility()) view.setVisibility(VISIBLE); } return view; }
public static <V extends View> V hideView(final V view) { if (GONE != view.getVisibility()) { view.setVisibility(GONE); } return view; }
public static <V extends View> V showView(final V view) { if (VISIBLE != view.getVisibility()) { view.setVisibility(VISIBLE); } return view; }