FAQ Database Discussion Community


Infinite scrolling using custom animations in Recycler View not working Android

android,animation,recyclerview,android-recyclerview,recycler-adapter
I have use Wasabeef for Item animation in Recycler view and it works fine. I also want to add infinite scrolling for recycler, for this I am doing like this public abstract class InfiniteScroller extends RecyclerView.OnScrollListener { private int previousTotal = 0; // The total number of items in the...

RecyclerView Adapter and ViewHolder update dynamically

android,jsoup,recyclerview,android-viewholder,recycler-adapter
I am trying to make an app that will be loading news from the network and will be updating dynamically. I am using a RecyclerView and CardView to display the content. I use Jsoup to parse sites. I don't think that my code is needed because my question is more...

Android: how can I insert a RecyclerView inside CardView?

android,recyclerview,android-cardview,android-viewholder,recycler-adapter
The activity I am talking about must show a RecyclerView populated by CardViews as items. My goal is to show in every CardView a RecyclerView in its turn. Here my Activity's basic xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ConjActivity" > <android.support.v7.widget.RecyclerView android:id="@+id/conjCardList"...

Display ad every n items in RecyclerAdapter

android,android-listview,recycler-adapter
I want to display an ad every n items on my RecyclerAdapter. I'm expecting this |----- Item 0 -----| |------- AD -------| |----- Item 1 -----| |----- Item 2 -----| |----- Item 3 -----| |----- Item 4 -----| |----- Item 5 -----| |------ ... -------| |----- Item 15 ----| |-------...

removing RecyclerView items

android,recyclerview,listitem,recycler-adapter
I have a RecyclerView which is adding items each certain period. When adding objects, if list items are more than (lets say) 500, then the first items will be removed and the new items will be added. If the RecyclerView cannot scroll down any more !recyclerView.canScrollVertically(1); then, after adding new...

Android Recyclerview GridLayoutManager column spacing

android,gridview,recyclerview,recycler-adapter,gridlayoutmanager
How do you set the column spacing with a recyclerview using a GridLayoutManager? setting the Margin/Padding inside my layout has no effect.

Background color or Images shuffling on scrolling in recyclerview?

java,android,recyclerview,recycler-adapter
I am wondering that my images and color of layouts shuffling when i scrolls downwards or upwards, I created cardview using recyclerview. and set an image(changes color on click like to know if its user's favourite item) and setbackgroundcolor(randomly chossen) to the parent layout to make cardview attractive. but when...

Item added to the Recycler view every time orientation of the device is changed

android,recyclerview,screen-rotation,android-recyclerview,recycler-adapter
I have a shopping list app that has a bug, when the orientation of the device is changed (Portret to Landscape or the opposite) new item is added. For example, if I have one shopping item like this: and after I change the orientation of the device it is duplicated:...

Error inflating class RecyclerView

android,android-5.0-lollipop,material-design,recyclerview,recycler-adapter
So my code simply makes a list of CardViews using RecyclerView. Upon running my code i kept getting a weird error claiming there was an error in my xml. After tinkering for a while i found out that in my layout file if i change <RecyclerView> to <android.support.v7.widget.RecyclerView> everything would...

Recycler view not showing after parsing json data

android,json,recyclerview,recycler-adapter
I was using static data to populate the recycler view to test. Now after using dynamic data by parsing json the recycler view is not showing up. I have used console to check whether the JSON is getting parsed correctly and it shows correct results. Here is my activity code....

Adding a footer view in RECYCLER VIEW?

android,android-adapter,recyclerview,android-recyclerview,recycler-adapter
i want to add a footer layout at the base of the recycler view.Below is my adapter view which inflates header layout as well as other items as well.Help appreciated! public class SplitMembersAdapter extends RecyclerViewAdapter<SplitMember, SplitMemberViewHolder> { private final ArrayList<SplitMember> mSplitMembersList; private final ImageLoader mImageLoader; private static final int TYPE_HEADER...

How to resolve 'getData()' method in recyclerview using android studio

java,android,android-studio,material-design,recycler-adapter
i have followed Slidenerd's tutorial on youtube on how to create a material design navigation drawer using android studio. However on running the app i get this cannot resolve method getData() and on the console Error:(56, 46) error: cannot find symbol method getData() error onadapter=new AdapterClass(getActivity().getData()); There's probably somewhere i...

Use same Recycler Adapter for inflating different activities

android,android-layout,recycler-adapter
I have the following adapter public class CardAdapter extends RecyclerView.Adapter<CardAdapter.ViewHolder>{ List<String> list; int id; Context context; @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view= LayoutInflater.from(parent.getContext()).inflate(id,parent,false); return new ViewHolder(view); } @Override public void onBindViewHolder(final ViewHolder holder, final int position) { holder.textView.setText(list.get(position)); holder.textView.setOnClickListener(new...

SeachView + RecyclerView

android,searchview,recycler-adapter,android-recyclerview
I search a lot for my question and didnt find good explain how to serch through RecyclerView , I have List<BaseOfCards> (BaseOfCards is my getter&setter class) My RecyclerViewAdapter : public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.MyViewHolder> { private LayoutInflater inflater; private List<BaseOfCards> items; //private int itemLayout; //String cardvalue; private Activity mActivity; public...

RecyclerView Issue with Child Items Visibilities

android,android-5.0-lollipop,recyclerview,recycler-adapter,android-recyclerview
Hey guys I am creating chatting app something like whatsapp but facing issue with Childs Visibilties in RecyclerView here it contains my message and message from server I've defined the two items for my message and server message in single layout and I'm Setting Visibility Based on the Boolean ;...

RecyclerView adapter is showing blank cardview

android,android-support-library,recyclerview,android-cardview,recycler-adapter
I have a nasty issue on sub api21 devices. I am using a RecyclerView.Adapter adapter to inflate android.support.v7.widget.CardView. The idea is that the cards will only add information that is present to the cards. If no information is present the card wont show at all. So I create these cards...

Get clicked item and its position in RecyclerView

android,recyclerview,recycler-adapter
I am replacing my ListView with RecyclerView, list showing ok, but I would like to know how to get clicked item and its position, similar to the method OnItemClickListener.onItemClick(AdapterView parent, View v, int position, long id) we use in ListView. Thanks for ideas!...

Click through a RecyclerView list item

android,android-layout,android-listview,recyclerview,recycler-adapter
I have a RecyclerView with a LinearLayoutManager and an Adapter: @Override public int getItemViewType(int position) { return position == 0? R.layout.header : R.layout.item; } Here's header.xml: <View xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/header" android:layout_width="match_parent" android:layout_height="@dimen/header_height" /> What I want to achieve is to have a hole in the RecyclerView where I can click through...

Update text within card view list?

android,android-fragments,recyclerview,android-cardview,recycler-adapter
So I have a recyclerview list of card views.I am trying to update the text time text in each view when the user clicks the card, and then reset it back when time has past. I set up an internal method in recyclerviewadapter but when I call updateTimes (calling from...

“Facing the same issue” Recycler View in Navigation Drawer

android,android-fragments,navigation-drawer,recyclerview,recycler-adapter
May be duplicate, Navigation Drawer RecyclerView Items Click to an Activity Facing the same issue. Please help to solve this issue. I have a navigation drawer having recycler view in it. I have set onClickListener in adapter. Now I am trying to open a fragment after clicking on any drawer...

Android button on card view, get position of card view on click

android,android-listview,android-cardview,recycler-adapter
I've got a card-view that each card has a button on it. I'm trying to get the position of the card that holds the button when the users clicks the button. I have an adapter that extends from RecyclerView.Adapter and implements the following method... public void onBindViewHolder(MovieImageViewHolder movieImageViewHolder, int i)...

Getting null pointer with recycler adapter

nullpointerexception,fragment,recyclerview,android-recyclerview,recycler-adapter
my app is crashing due to a null pointer with the recyclerview adapter in the fragment code. I'm using this adapter to generate a card view list but cannot find out what exactly is causing this null pointer. The log has it happening when setting the adapter r.setAdapter(rA) in the...