package Ġxyz . god i . popular movies . binding Ċ Ċ import Ġandroidx . databinding . Binding Adapter Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . sky do ves . bas er ec y cl er view adapter . RecyclerView Paginator Ċ import Ġcom . sky do ves . what if . what If NotNull OrEmpty Ċ import Ġxyz . god i . popular movies . adapters . Movie Adapter Ċ import Ġxyz . god i . popular movies . model . Movie Ċ import Ġxyz . god i . popular movies . ui . home . Home ViewModel Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠFar ou k Ġon Ġ 1 2 / 0 6 / 2 0 . Ċ Ġ*/ Ċ @ Binding Adapter (" adapter ") Ċ fun Ġbind Adapter ( view : ĠRecyclerView , Ġadapter : ĠRecyclerView . Adapter <* >) Ġ{ ĊĠĠĠ Ġview . adapter Ġ= Ġadapter Ċ } Ċ Ċ @ Binding Adapter (" pagination Movie List ") Ċ fun Ġpagination Movie List ( view : ĠRecyclerView , ĠviewModel : ĠHome ViewModel ) Ġ{ ĊĠĠĠ ĠRecyclerView Paginator ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġre cyclerView Ġ= Ġview , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠisLoading Ġ= Ġ{ ĠviewModel . isLoading (). get () Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġload More Ġ= Ġ{ ĠviewModel . fetch Movie List ( it ) Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon Last Ġ= Ġ{ Ġfalse Ġ} ĊĠĠĠ Ġ). run Ġ{ ĊĠĠĠĠĠĠĠ Ġthreshold Ġ= Ġ 8 ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ Binding Adapter (" adapter Movie List ") Ċ fun Ġbind Adapter Movie List ( view : ĠRecyclerView , Ġmovie List : ĠList < Movie > ?) Ġ{ ĊĠĠĠ Ġmovie List . what If NotNull OrEmpty Ġ{ ĊĠĠĠĠĠĠĠ Ġ( view . adapter Ġas ? ĠMovie Adapter )?. add Movie List ( it ) ĊĠĠĠ Ġ} Ċ }