Skip to content

Commit

Permalink
Merge pull request #1385 from ChinaVolvocars/master
Browse files Browse the repository at this point in the history
Update BaseViewHolder.java
  • Loading branch information
CymChad authored Aug 8, 2017
2 parents d976640 + aa4a3d0 commit 1282582
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,25 @@ public BaseViewHolder setAlpha(@IdRes int viewId, float value) {
* @param visible True for VISIBLE, false for GONE.
* @return The BaseViewHolder for chaining.
*/
public BaseViewHolder setVisible(@IdRes int viewId, boolean visible) {
public BaseViewHolder setGone(@IdRes int viewId, boolean visible) {
View view = getView(viewId);
view.setVisibility(visible ? View.VISIBLE : View.GONE);
return this;
}

/**
* Set a view visibility to VISIBLE (true) or INVISIBLE (false).
*
* @param viewId The view id.
* @param visible True for VISIBLE, false for INVISIBLE.
* @return The BaseViewHolder for chaining.
*/
public BaseViewHolder setVisible(@IdRes int viewId, boolean visible) {
View view = getView(viewId);
view.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
return this;
}

/**
* Add links into a TextView.
*
Expand Down

0 comments on commit 1282582

Please sign in to comment.