adapter

Ads in recyclerview

╄→гoц情女王★ 提交于 2020-08-26 13:42:19
问题 I have an app that stores some data in room database. At first, my adapter was like that: public class ViewCourseAdapter extends ListAdapter<Course, ViewCourseAdapter.ViewCourseHolder> { private int previousPosition = 0; public ViewCourseAdapter() { super(DIFF_CALLBACK); } private static final DiffUtil.ItemCallback<Course> DIFF_CALLBACK = new DiffUtil.ItemCallback<Course>() { @Override public boolean areItemsTheSame(@NonNull Course oldItem, @NonNull Course newItem) { return oldItem.getId() ==

Dynamically Tint drawable in adapter change color for all

試著忘記壹切 提交于 2020-08-11 03:06:05
问题 I get an array of strings from my server using a volley connection. Every single string contain a different color in hex. I use this color to set Tint of a drawable in adapter. Here my code in adapter: @Override public void onBindViewHolder(@NonNull final ViewHolder holder, final int position) { // Get item from position MyObject object = array_data.get(position); ... ... Drawable unwrappedDrawable = AppCompatResources.getDrawable(context, R.drawable.ic_beenhere_black_24dp); Drawable

Dynamically Tint drawable in adapter change color for all

浪子不回头ぞ 提交于 2020-08-11 03:05:20
问题 I get an array of strings from my server using a volley connection. Every single string contain a different color in hex. I use this color to set Tint of a drawable in adapter. Here my code in adapter: @Override public void onBindViewHolder(@NonNull final ViewHolder holder, final int position) { // Get item from position MyObject object = array_data.get(position); ... ... Drawable unwrappedDrawable = AppCompatResources.getDrawable(context, R.drawable.ic_beenhere_black_24dp); Drawable