Guest User

Untitled

a guest
Jun 25th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. @BindingAdapter("mutableVisibility")
  2. fun setMutableVisibility(view: View, visibility: MutableLiveData<Int>?) {
  3. val parentActivity: AppCompatActivity? = view.getParentActivity()
  4. if(parentActivity != null && visibility != null) {
  5. visibility.observe(parentActivity, Observer { value -> view.visibility = value?:View.VISIBLE})
  6. }
  7. }
Add Comment
Please, Sign In to add comment