package Ġcom . github . a stra ube . state flow binding . common . databinding Ċ Ċ import Ġandroid . widget . ProgressBar Ċ import Ġandroid . widget . TextView Ċ import Ġandroidx . core . view . isVisible Ċ import Ġandroidx . databinding . Binding Adapter Ċ import Ġcom . github . a stra ube . state flow binding . data . source . Result Source Ċ import Ġcom . github . a stra ube . state flow binding . data . source . isLoading ĊĊ Ċ @ Binding Adapter (" g one Unless ") Ċ fun ĠTextView . bind G one Unless ( text : ĠString ?) Ġ{ ĊĠĠĠ Ġthis . isVisible Ġ= Ġ! text . isNull Or Blank () Ċ } Ċ Ċ @ Binding Adapter (" isLoading Top ") Ċ fun ĠProgress Bar . bind Loading Top ( enabled : ĠBoolean ) Ġ{ ĊĠĠĠ Ġthis . isVisible Ġ= Ġenabled ĊĠĠĠ Ġthis . isIn determinate Ġ= Ġenabled Ċ } Ċ Ċ @ Binding Adapter (" isLoading Top ") Ċ fun ĠProgress Bar . bind Loading Top State Flow ( ui State : ĠResult Source < *> ?) Ġ{ ĊĠĠĠ Ġthis . bind Loading Top ( ui State ?. isLoading Ġ?: Ġfalse ) Ċ }