android-recyclerview

RecyclerView scrolling makes changes

◇◆丶佛笑我妖孽 提交于 2020-01-17 15:23:34
问题 I have a RecyclerView which has a custom adapter that inflates a rowLayout. Each Row contains a CardView and in it some text and images as buttons. In particular i have a "like" button( ImageView ) that as for now only is supposed to change imageResource on click. I was able to set an onClicklistener in the onBindViewHolder() method and it does indeed register when i click the button, however it not only changes that buttons image but it also changes some of the other like buttons and also

RecyclerView in Android Home Screen Widget

南笙酒味 提交于 2020-01-17 08:08:14
问题 Is there a way to put a recyclerview in an android homescreen widget. If so, how would you set the adapter and layout manager. Thanks 回答1: No, sorry, at the present time, RecyclerView is not one of the supported widgets for an app widget. 来源: https://stackoverflow.com/questions/29051733/recyclerview-in-android-home-screen-widget

fragment- firebaserecycler adapter is not working on fragment

不问归期 提交于 2020-01-17 06:52:23
问题 I have data in realtime database and I am trying to display that data in fragment which has a recycler view. But data is not populated. Even populateView method is not triggred(I tried logging it). It loads well in activity but not in fragment. Can anyone help? public class ExtraFragment extends Fragment { RecyclerView recyclerView; TextView clickLink; DatabaseReference databaseReference; FirebaseRecyclerAdapter<ExtraBeans,MyViewHolder> recyclerAdapter; @Override public View onCreateView

doinbackground() in async task not working properly

馋奶兔 提交于 2020-01-16 19:56:13
问题 I am fetching some data from API and presenting each item as a RecyclerViewPager slide . So, I have made an async task inside onScrollListener to check scroll actions and when the user slides 5 items asynctask fetches the Items of page 2 and in the doInBackGround function the data will be added to the array and array will be added to the recycler view pager . Everything works fine but I need to stop scrolling at 5 slide for a few seconds(Minimum 5 sec) or else the recyclerView won't show the

Error to load item with RecyclerView

本秂侑毒 提交于 2020-01-16 19:42:07
问题 I know that RecyclerView loads the items again every time to save memory and increase performance. However, I found a problem with the images, that is that when I start to scroll quickly the recyclerView the elements start to recharge in the wrong order. I put the video in description of what happens. How can I resolve this error? LINK: https://www.youtube.com/watch?v=iwHUYgWIm5g RecyclerViewAdapter.class package com.example.mattiaferigutti.chatjava; import android.content.Context; import

RecyclerView not correctly displaying Heterogenous Layouts

我是研究僧i 提交于 2020-01-16 19:35:49
问题 I am developing a weather app in which i wanted to use two Views inside RecyclerView which is having CursorAdapter as its member. I want to use one View to display todays weather and other view to display other days weathers. My RecyclerView is working perfectly and i even displaying the two layouts but not correctly i.e layout i want to use for today's weather is used by tomorrow weather and second last day in the list Following is the code for my RecyclerView Adapter :- public class

Android recyclerview - call method / function from second adapter (Kotlin)

你说的曾经没有我的故事 提交于 2020-01-16 18:51:29
问题 I'm using two adapters for the same list but each is differently sorted. This is the adapterONE (I removed almost everything non necessary for this question): override fun onBindViewHolder(holder: ViewHolder, position: Int) { val video = videolist[position] holder.title.text = video.id.toString() holder.title.setOnClickListener { hide(video.id) } } override fun getItemCount() = videolist.size override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val view =

Implement view clicks on multiple ViewHolder types in RecycleView adapter

妖精的绣舞 提交于 2020-01-16 18:10:07
问题 I am implementing multiple ViewHolders as suggested in this answer which uses an abstract bind() . My current Adapter and ViewHolder looks likes: // MyAdapter.java {adapter code} public static abstract class MyViewHolder extends RecyclerView.ViewHolder { public MyViewHolder(View itemView) { super(itemView); } protected abstract void bind(MyModel item); } // ViewHolder1.java public class ViewHolder1 extends MyAdapter.MyViewHolder implements View.OnClickListener { TextView textView; public

BottomSheet: issue with nested scrolling (RecyclerView & NestedScrollView)

流过昼夜 提交于 2020-01-16 16:48:15
问题 I have a rather complex BottomSheetLayout which layout is as follow The root view of my bottom sheet is a custom FrameLayout that allows to round it's corner (both background and children). Nothing else (nothing touch-related) Then, I use the usual ConstraintLayout in order to layout my Bottom sheet. This ConstraintLayout contains, amongst other views, a vertical RecyclerView : <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match

Big space between items in Android RecyclerView

删除回忆录丶 提交于 2020-01-16 16:25:53
问题 I'm using RecyclerView to load data from a list of objects that is populated every time that I hit "Enter" in an EditText. But the problema that I am facing is that the first item I add it shows OK, when I add the second it shows a big gap between the first and the second, and if I keep adding items the gap gets bigger and the list doesn't fit the whole screen. This is my Adapter: public class CategoryAdapter extends RecyclerView.Adapter<CategoryAdapter.MyViewHolder> { private Context