Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }
Ejemplo n.º 3
0
 public static <V extends View> V hideView(final V view) {
   if (GONE != view.getVisibility()) {
     view.setVisibility(GONE);
   }
   return view;
 }
Ejemplo n.º 4
0
 public static <V extends View> V showView(final V view) {
   if (VISIBLE != view.getVisibility()) {
     view.setVisibility(VISIBLE);
   }
   return view;
 }