android-recyclerview

how to update data in recyclerview item from another item?

主宰稳场 提交于 2020-01-06 06:08:20
问题 I have a problem with RecyclerView , I have RecyclerView which has a radio button and few other views in each row item, What I wanted exactly is, when a RadioButton is checked by user I want to uncheck other RadioButton (if anything is checked earlier). Since it is a Recyclerview I cannot use radiogroup. In the adapter onBindViewHolder I write this listener for each radio button holder.radioButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {

on scrolled to add items in recyclerview always comes to top automatically when i scroll down

北城余情 提交于 2020-01-06 06:06:19
问题 I am implementing endless recycler view . Data is getting fine from server aslo scroll down getting down and show it. But on scroll it automatically comes to top again and again. I implemented number of solutions but doesn't work. here is bit of code. private int postNo = 15; public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (!lastTime) { if (dy > 0) { // check for scroll down visibleItemCount = layoutManager.getChildCount();

on scrolled to add items in recyclerview always comes to top automatically when i scroll down

杀马特。学长 韩版系。学妹 提交于 2020-01-06 06:05:14
问题 I am implementing endless recycler view . Data is getting fine from server aslo scroll down getting down and show it. But on scroll it automatically comes to top again and again. I implemented number of solutions but doesn't work. here is bit of code. private int postNo = 15; public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (!lastTime) { if (dy > 0) { // check for scroll down visibleItemCount = layoutManager.getChildCount();

Imageview in a recyclerview

◇◆丶佛笑我妖孽 提交于 2020-01-06 05:51:21
问题 I have an imageview in row.xml and I set a picture for it in xml layout. But when I use that in adapter (onbindviewholder method) Not show any image . But when I set image resource in onbindviewholder that works and show the image !!! What is wrong in the first method ??? 回答1: use holder.Image.setImageResource(); or you can use Glide or Picasso library to load images. and also return the size of your list. @Override public int getItemCount() { return contacts.size(); } 回答2: public class

Send click event from RecyclerView to parent ListFragment or ListAdapter

倾然丶 夕夏残阳落幕 提交于 2020-01-06 05:43:18
问题 I have a ListFragment with some ListItems. In one ListItem I have some Views and also a RecyclerView with CardViews. In the CardView is a ImageView. I want to use the RecyclerView to have some pictures in it and I want to scroll the pictures. I also want to zoom the pictures with a two finger-gesture. (Would be nice if someone knows a good step by step tutorial therefor). But I also want to click and longclick on the pictures. I need the click and longclick in my ListArrayAdapter or in my

arraylist add to new recyclerview

故事扮演 提交于 2020-01-06 05:25:26
问题 Hi I am trying to add a new item to my chat, I use RXJava2, to make call to my REST API to get the chat data, with this nested json response. But I get an NullPointer when I try to add a new item to the Arraylist (Send new message): 09-08 13:35:14.529 2869-2869/com.jonathan.myapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.jonathan.myapp, PID: 2869 java.lang.NullPointerException: Attempt to invoke virtual method 'void com.jonathan.myapp.models.ChatMessageUser.setUserId(java.lang

Retrive Image from Firebase to show in my Imageview

社会主义新天地 提交于 2020-01-06 05:17:50
问题 I'm looking forward to Display the images stored in Firebase Storage with refrence from Firebase Database. Below is my Firebase Data Structure and my Storage Structure is Below is my code of Recycle adapter, I'm using to retrive images from Firebase public class SubjectBooksAdapter extends RecyclerView.Adapter<SubjectBooksAdapter.MyViewHolder> { ArrayList<Books> bookslist; CardView cv; FirebaseAuth fauth; FirebaseDatabase database; DatabaseReference dbreference; Books b; public

How to use ParseObjects with a RecyclerView?

泪湿孤枕 提交于 2020-01-06 04:56:12
问题 I am attempting to pull data from my parse server and display an image and text within a RecyclerView of CardViews. I have encountered a few issues, some of which may not have been corrected appropriately, so please feel free to correct any novice code you find below outside of my two current issues. Finally my two issues are. The data does not display initially. I have 3 tabs in a ViewPager and I have to swipe over twice in order for it to display. If I'm on tab 1 the data doesn't appear

data doesn't show up on recyclerview - got error No layout manager attached; skipping layout

冷暖自知 提交于 2020-01-06 04:40:06
问题 i tried to retrieving data from Firebase Realtime Database to Recycler-view. i already create Modul class called Ph.java and adapter called PhAdapter.java. but, i am so confused to call the adapter on MainActivity.java. here's my code :) Ph.Class public class Ph { public String date; public String nilai; public String time; public Ph(){ } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getNilai() { return nilai; } public void

AnimationDrawable in RecyclerView item not animating on notifyDataSetChanged

可紊 提交于 2020-01-06 03:10:14
问题 I have a recyclerview whenever i select an item in recyclerview to play music i need to animate my AnimationDrawable equalizer of selected item but it is not animating when i call notifyDataSetChanged to refresh my view to show equalizer on selected item. 来源: https://stackoverflow.com/questions/47574529/animationdrawable-in-recyclerview-item-not-animating-on-notifydatasetchanged