android-recyclerview

java.lang.IllegalArgumentException: value may not be null

时光怂恿深爱的人放手 提交于 2019-12-24 16:33:23
问题 I'm getting this error when trying to pull data from Parse.com (backend database). The error is saying that the put function in the Businesses class is not null. I'm not sure what that means, because isn't it suppose to not be null? I want to display the name of businesses so the name would have to be there in order to do this right? Or is it saying that the value can't be null in others words? FATAL EXCEPTION: main Process: zafir.com.app, PID: 13295 java.lang.IllegalArgumentException: value

How to use ExpandableRecyclerView library with multiple (child) viewTypes?

我只是一个虾纸丫 提交于 2019-12-24 16:19:08
问题 I need an Activity with an expandable RecyclerView like the one in this picture: So I am using this third party library project . That part works. The problem arose when I did what I am describing in the next two paragraphs: My next requirement is that I want different child-rows for different parent-rows. I am reproducing (if that's the right word) this example to create multiple child-viewholders. Description of Example: The idea is basically to have the different Child-viewholders

FastAdapter flickers after loading from LiveData even though the data stays same

…衆ロ難τιáo~ 提交于 2019-12-24 16:17:59
问题 For the question I have prepared a simple and working example at Github: My example app downloads a JSON array containing top 30 players in a game using okhttp and stores them into SQLite Room. In the fragment I observe the corresponding LiveData<List<TopEntity>> object and update the FastAdapter instance: public class TopFragment extends Fragment { private final ItemAdapter<TopItem> mItemAdapter = new ItemAdapter<>(); private final FastAdapter<TopItem> mFastAdapter = FastAdapter.with

Android how to stop media player when new sound start in Recycleview

吃可爱长大的小学妹 提交于 2019-12-24 16:17:06
问题 I try to find solution but could not find it. My problem is that i have lots of items in recycleview. Each item has image and when i click that image it start sound for that image. Problem is when i start new sound previous sound do not stop, its keep playing until sound finish. After i click 15, 20 sounds app get crashed and i receive this error message: E/MediaPlayer: error (1, -19) Somehow i need to implement release and stop of the previous sound when i click on the new one. I try to find

Partial and full swipe for Recyclerview using TouchHelperCallback

拜拜、爱过 提交于 2019-12-24 16:10:07
问题 I am trying to achieve partial and full swipe for Recyclerview using the api TouchHelperCallback,came acrosscouple of libraries like https://github.com/daimajia/AndroidSwipeLayout and https://github.com/hudomju/android-swipe-to-dismiss-undo but how can achieve this using the api ? I was able to achieve full swipe with the below code,can anyone please give a suggestion on how to approach this problem. Thanks Code base: ExtendItemTouchHelperCallback: import android.graphics.Canvas; import

Item animation stopping in recyclerview when scrolled off the view android

南笙酒味 提交于 2019-12-24 16:00:00
问题 I have a Recyclerview, im animating a view inside individual list item, but when I scroll the recyclerview the animation is stopping. Its because recyclerview removes the items form its view so when we scroll back it fetches it back! But now i want that animation to keep going as I would stop it only when i get data from server! All I want is the animation that I start in the individual items inside the recylerview shouldn't stop even if the recyclerview is scrolled and the view is out of

RecyclerView item background alternating color out of order

若如初见. 提交于 2019-12-24 13:32:07
问题 I want change my RecyclerView item background with alternating color. Here is the method in Adapter. public class NewsAdapter extends RecyclerView.Adapter<NewsAdapter.ViewHolder> { private List<NewsModel> mNewsList; class ViewHolder extends RecyclerView.ViewHolder { TextView newsNameText; TextView newsDataText; View listView; public ViewHolder(View newsView) { super(newsView); newsNameText = (TextView) newsView.findViewById(R.id.news_Name); newsDataText = (TextView) newsView.findViewById(R.id

isRecyclable decremented below 0: unmatched pair of setIsRecyable() calls

限于喜欢 提交于 2019-12-24 13:16:49
问题 I have created a RecyclerView with a very similar design to the one mentioned here and even used the excellent self-supplied solution in my implementation. Basically I have a RecyclerView that expands upon click to show an extra layout component for that entry. That worked fine however once the view was expanded it sometimes got recycled and when scrolling to new views they would sometimes appear on screen in an expanded state which isn't what I was after. To resolve this I followed the

FindViewHolderForPosition return null when card's not in vision

和自甴很熟 提交于 2019-12-24 13:01:12
问题 I'm using RecyclerView with CardView to display a list of Cards. Every card has 2 linearLayout (1 for the header, and 1 for the expand, the second one became visible only when the card is pressed). When I modify the priority of a card, the card is moved in a new position of the list (I change it's position in the "array" of item, and then call adapter.notifyItemMoved(oldPosition,newPosition) ) and it works, I also called RecyclerView.scrollToPosition(newPosition) to show the new position in

onItemClick not working for Card View

爷,独闯天下 提交于 2019-12-24 12:48:21
问题 It uses retrofit 2.0 to fetch the data from the webservice and bind it to the card view. When I click on the card view having image and textviews, on click is not triggering, rather a strange behaviour is at the very corner edges of the card view onclick is triggering. Item_row.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width=