Databinding variable inheritance with included layout

后端 未结 3 2395
一个人的身影
一个人的身影 2021-02-20 00:40

I am learning data binding and mvvm. I have an issue where I would like a BaseViewModel.kt to include some UI related variables such as an isLoading fl

3条回答
  •  鱼传尺愫
    2021-02-20 01:30

    You can use binding with include like

    loading_view.xml

    
    
    
        
    
            
    
            
    
            
        
    
        
            
            
        
    
    

    Using

    
    

    you can also pass the hard value like

    app:visibility="@{false}"
    app:text="@{@string/loading_text}"
    

提交回复
热议问题