android-recyclerview

Highlight filtered text in recyclerView

丶灬走出姿态 提交于 2020-05-17 05:48:05
问题 This is my adapter class: public class adapter_cgpa extends RecyclerView.Adapter<adapter_cgpa.Viewholder> implements Filterable { ArrayList<POJO> cgpaArrayList; ArrayList<POJO> cgpaArrayListcopy; String filterPattern = ""; public adapter_cgpa(ArrayList<POJO> cgpaArrayList) { this.cgpaArrayList = cgpaArrayList; cgpaArrayListcopy = new ArrayList<>(cgpaArrayList); } @NonNull @Override public adapter_cgpa.Viewholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View listitem =

How to update a single item in a PagedListAdapter

时间秒杀一切 提交于 2020-05-15 10:11:06
问题 I've implemented the new PagedListAdapter with an ItemKeyedDataSource. My list contains feed items with a like button. A click on the like button should refresh the item. To refresh my list item on a like button click, i update the state in my Firestore back-end, and call invalidate on my ItemKeyedDataSource. But this will refresh my whole list while jumping back to the top of my list. I wasn't sure if this is normal behaviour, so i went debugging and checking maiby my DiffUtil.ItemCallback

How to update a single item in a PagedListAdapter

与世无争的帅哥 提交于 2020-05-15 10:11:03
问题 I've implemented the new PagedListAdapter with an ItemKeyedDataSource. My list contains feed items with a like button. A click on the like button should refresh the item. To refresh my list item on a like button click, i update the state in my Firestore back-end, and call invalidate on my ItemKeyedDataSource. But this will refresh my whole list while jumping back to the top of my list. I wasn't sure if this is normal behaviour, so i went debugging and checking maiby my DiffUtil.ItemCallback

How to update a single item in a PagedListAdapter

亡梦爱人 提交于 2020-05-15 10:10:08
问题 I've implemented the new PagedListAdapter with an ItemKeyedDataSource. My list contains feed items with a like button. A click on the like button should refresh the item. To refresh my list item on a like button click, i update the state in my Firestore back-end, and call invalidate on my ItemKeyedDataSource. But this will refresh my whole list while jumping back to the top of my list. I wasn't sure if this is normal behaviour, so i went debugging and checking maiby my DiffUtil.ItemCallback

Radio button checked by itself when scrolling

我与影子孤独终老i 提交于 2020-05-15 09:26:38
问题 I made a RecyclerView that shows 32 question and 4 answers as RadioButton s. When I click a single radio button, it works, and I show a toast when it is checked. But when I scroll the RecyclerView`, it shows toasts like I checked a radio button. How do I fix it? My adapter: public class sikapadapter extends RecyclerView.Adapter<sikapadapter.ViewHolder> { private int[] integer; String option[]; private OnRadioChangeListener onRadioChangeListener; public sikapadapter(String[] option,

How can I replace ButterKnife with ViewBinding on RecyclerView Adapter

吃可爱长大的小学妹 提交于 2020-05-14 12:12:06
问题 I would like to use the new View Binding instead of ButterKnife in my RecyclerView Adapter class ? This is my class : import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.cardview.widget.CardView; import androidx.recyclerview.widget.RecyclerView; import com.gallosalocin.mareu.R; import com.gallosalocin.mareu.model.Meeting; import java

How can I replace ButterKnife with ViewBinding on RecyclerView Adapter

北城余情 提交于 2020-05-14 12:12:01
问题 I would like to use the new View Binding instead of ButterKnife in my RecyclerView Adapter class ? This is my class : import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.cardview.widget.CardView; import androidx.recyclerview.widget.RecyclerView; import com.gallosalocin.mareu.R; import com.gallosalocin.mareu.model.Meeting; import java

Motion Layout with swipe gesture + SwipeRefreshLayout + RecyclerView bug wrong behavior scrolling up

别等时光非礼了梦想. 提交于 2020-05-14 10:08:09
问题 I'm using MotionLayout to build UI with 2 parts - top one with some view and bottom one with SwipeRefresh and RecyclerView inside. Also I have a single gesture for MotionLayout - SwipeRefresh moves up above top view on swipe up. The problem is when I scroll RecyclerView to the bottom (top view "collapses") and then to the top - MotionLayout starts to reverse my transition at once ("expand") - when RecyclerView is not fully scrolled to the top instead of scrolling RecyclerView first. While my

Motion Layout with swipe gesture + SwipeRefreshLayout + RecyclerView bug wrong behavior scrolling up

纵然是瞬间 提交于 2020-05-14 10:06:53
问题 I'm using MotionLayout to build UI with 2 parts - top one with some view and bottom one with SwipeRefresh and RecyclerView inside. Also I have a single gesture for MotionLayout - SwipeRefresh moves up above top view on swipe up. The problem is when I scroll RecyclerView to the bottom (top view "collapses") and then to the top - MotionLayout starts to reverse my transition at once ("expand") - when RecyclerView is not fully scrolled to the top instead of scrolling RecyclerView first. While my

How to check if first item of RecyclerView is visible on the screen

不想你离开。 提交于 2020-05-13 11:53:26
问题 Is it possible to check if the first or second item of the RecyclerView is visible on the screen of the user? For example when the user scrolls down: if (first item not visible to user) { // do something } else if ( first item is visible){ // do something } What I currently do is I add a listener to my recycler so that when the user scrolls down, it will do something and scroll up. recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled