package Ġcom . so three . sl iding up panel . demo Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . Toast Ċ import Ġandroidx . databinding . Observable Boolean Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . Transform ations Ċ import Ġandroidx . lifecycle . ViewModel Ċ Ċ class ĠMain ViewModel Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġval Ġplayer State Ġ= ĠObservable Boolean () ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġplayer State . set ( false ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Play Button Clicked ( view : ĠView ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġplayer State . set (! player State . get ()) ĊĠĠĠ Ġ} Ċ }