package de.thedevstack.conversationsplus.utils.ui; import android.support.annotation.IdRes; import android.view.View; /** * Created by steckbrief on 11.01.2017. */ public class ViewUtil { public static T visible(View parentView, @IdRes int textViewId) { return ViewUtil.visible((T) parentView.findViewById(textViewId)); } public static T invisible(View parentView, @IdRes int textViewId) { return ViewUtil.invisible((T) parentView.findViewById(textViewId)); } public static T gone(View parentView, @IdRes int textViewId) { return ViewUtil.gone((T) parentView.findViewById(textViewId)); } public static T gone(T view) { if (null != view) { view.setVisibility(View.GONE); } return view; } public static T visible(T view) { if (null != view) { view.setVisibility(View.VISIBLE); } return view; } public static T invisible(T view) { if (null != view) { view.setVisibility(View.INVISIBLE); } return view; } }