Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <android.support.v7.widget.RecyclerView
- android:id="@+id/results_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_below="@+id/toolbar_wrapper"
- android:scrollbars="vertical"
- app:itemView="@{listViewModel.itemView}"
- app:items="@{listViewModel.films}"
- app:layoutManager="@{LayoutManagers.linear()}"
- app:onItemSelected="@{listViewModel.onItemSelected}"
- />
- @BindingAdapter("app:onItemSelected")
- public static void OnItemSelected(RecyclerView recyclerView, final OnItemSelected listener) {
- final RecyclerView.OnItemTouchListener onItemTouch = new RecyclerItemClickListener(recyclerView.getContext(), (view, position) -> listener.onItemSelected(position));
- recyclerView.addOnItemTouchListener(onItemTouch);
- }
- //////
- <ImageView
- android:id="@+id/film_picture"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:url="@{detailViewModel.film.largePosterUrl}"
- />
- @BindingAdapter("app:url")
- public static void setImageUrl(ImageView view, String url) {
- Picasso.with(view.getContext())
- .load(url)
- .into(view);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement