package Ġcom . iam k am r ul . library . extension Ċ Ċ import Ġandroidx . core . content . Context Compat Ċ import Ġandroidx . core . view . isVisible Ċ import Ġcom . iam k am r ul . library . R Ċ import Ġcom . iam k am r ul . library . constant . ViewState Config Ċ import Ġcom . iam k am r ul . library . databinding . ViewState Constraint Layout Binding Ċ Ċ fun ĠView State Constraint Layout Binding . show Simple Data Empty View ( ĊĠĠĠ Ġempty Image : Int Ġ= ĠR . drawable . ic _ no _ result , ĊĠĠĠ Ġmessage : String , ĊĠĠĠ Ġrefresh Button Visibility : Boolean , ĊĠĠĠ Ġbutton Text : String , ĊĠĠĠ Ġbutton Drawable : Int , ĊĠĠĠ Ġbutton TextColor : Int , ĊĠĠĠ Ġrefresh Callback : ()-> Unit Ċ ){ ĊĠĠĠ Ġ// Ġhide Ġall Ġerror Ġlayout ĊĠĠĠ Ġdata Empty Config () ĊĊĠĠĠ Ġ// Ġshow Ġno Ġresult Ġsimple Ġlayout ĊĠĠĠ Ġinc Simple Data Empty Layout . simple Data Empty Layout . isVisible Ġ= Ġtrue ĊĠĠĠ Ġ// Ġhide Ġno Ġresult Ġlo tt ie Ġlayout ĊĠĠĠ Ġinc Lot tie Data Empty Layout . lott ie Data Empty Layout . isVisible Ġ= Ġfalse ĊĠĠĠ Ġ// Ġset Ġrefresh Ġbutton Ġvisibility ĊĠĠĠ Ġinc Simple Data Empty Layout . data Empty Refresh Btn . isVisible Ġ= Ġrefresh Button Visibility ĊĊĠĠĠ Ġinc Simple Data Empty Layout . data Empty Iv . setImage Resource ( empty Image ) ĊĠĠĠ Ġinc Simple Data Empty Layout . data Empty Message Tv . text Ġ= Ġmessage ĊĠĠĠ Ġinc Simple Data Empty Layout . data Empty Refresh Btn . setBackground Resource ( button Drawable ) ĊĠĠĠ Ġinc Simple Data Empty Layout . data Empty Refresh Btn . text Ġ= Ġbutton Text ĊĠĠĠ Ġinc Simple Data Empty Layout . data Empty Refresh Btn . setTextColor ( Context Compat . getColor ( this . root . context , button TextColor )) ĊĠĠĠ Ġinc Simple Data Empty Layout . data Empty Refresh Btn . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠ Ġrefresh Callback . invoke () ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠView State Constraint Layout Binding . show Lot tie Data Empty View ( ĊĠĠĠ Ġlo tt ie Res : Int , ĊĠĠĠ Ġmessage : String , ĊĠĠĠ Ġrefresh Button Visibility : Boolean , ĊĠĠĠ Ġbutton Text : String , ĊĠĠĠ Ġbutton Drawable : Int , ĊĠĠĠ Ġbutton TextColor : Int , ĊĠĠĠ Ġrefresh Callback : ()-> Unit Ċ ){ ĊĊĠĠĠ Ġ// Ġhide Ġall Ġerror Ġlayout ĊĠĠĠ Ġdata Empty Config () ĊĊĠĠĠ Ġ// Ġshow Ġno Ġresult Ġlo tt ie Ġlayout ĊĠĠĠ Ġinc Lot tie Data Empty Layout . lott ie Data Empty Layout . isVisible Ġ= Ġtrue ĊĠĠĠ Ġ// Ġhide Ġno Ġresult Ġsimple Ġlayout ĊĠĠĠ Ġinc Simple Data Empty Layout . simple Data Empty Layout . isVisible Ġ= Ġfalse ĊĠĠĠ Ġ// Ġset Ġrefresh Ġbutton Ġvisibility ĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Refresh Btn . isVisible Ġ= Ġrefresh Button Visibility ĊĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Iv . set Animation ( lott ie Res ) ĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Iv . play Animation () ĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Message Tv . text Ġ= Ġmessage ĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Refresh Btn . setBackground Resource ( button Drawable ) ĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Refresh Btn . text Ġ= Ġbutton Text ĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Refresh Btn . setTextColor ( Context Compat . getColor ( this . root . context , button TextColor )) ĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Refresh Btn . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( ViewState Config . refresh Button View S ate Manage Flag ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġhide Data Empty Layout () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġrefresh Callback . invoke () ĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġfun ĠView State Constraint Layout Binding . data Empty Config (){ ĊĠĠĠ Ġhide Progress Layout () ĊĠĠĠ Ġhide Network Error Layout () Ċ } ĊĊ Ċ fun ĠView State Constraint Layout Binding . hide Data Empty Layout (){ ĊĠĠĠ Ġinc Simple Data Empty Layout . simple Data Empty Layout . isVisible Ġ= Ġfalse ĊĠĠĠ Ġinc Lot tie Data Empty Layout . lott ie Data Empty Layout . isVisible Ġ= Ġfalse ĊĠĠĠ Ġinc Lot tie Data Empty Layout . data Empty Iv . cancel Animation () Ċ }