Code example for ImageButton

Methods: setVisibility

0
 
    public void setType(Type type) {
        if (type == Type.PRIVATE) {
            likeButton.setVisibility(View.GONE);
        } else if (type == Type.PUBLIC) {
            likeButton.setVisibility(View.VISIBLE);
        } 
    } 
 
    public void setLikeListener(OnClickListener listener) {
        likeButton.setOnClickListener(listener);
    } 
}