android-recyclerview

RecyclerView Adapter is repeating values at wrong places

为君一笑 提交于 2019-12-23 13:00:39
问题 I am displaying 17 CardViews. I am using RecyclerView to achieve the same. Each CardView shows a common data (format). Depending on data received from a JSON file, a card may display some additional rows. . The following image shows 2 CardViews (in focus) displaying the additional data, the rest displaying the common data. It appears correctly. But then when I scroll down to bottom of the View, the last CardView is not suppose to display any row, but it does copy one from one of the 2 we saw

Android RecyclerView Scroll not working after Layout edit

狂风中的少年 提交于 2019-12-23 12:52:42
问题 I am trying to implement a horizontal scrolling RecyclerView inside an another RecyclerView which means parent RecyclerView(vertical scroll) and child RecyclerView(Horizontal scroll) inside parent RecyclerView. I referred couple of questions regarding this requirement and found a better solution from this question How to have a ListView/RecyclerView inside a parent RecyclerView? and implemented successfully. After the child adapter's layout file edit the child RecyclerView's scrolling

RecyclerView Viewholder reusing

两盒软妹~` 提交于 2019-12-23 12:47:44
问题 I am creating a RecyclerView which will expand itself when the user touches it and closes itself when the user touches it again. Below is my code: public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.RecViewHolder> { ArrayList<String> values; ArrayList<Integer> expandedPosition; public static class RecViewHolder extends RecyclerView.ViewHolder { ... private boolean resultsOpened = false; ... RelativeLayout favHeaderLayout; RelativeLayout favResultsLayout; public

RecyclerView.Adapter's onCreateViewHolder and onBindViewHolder methods are not getting called

こ雲淡風輕ζ 提交于 2019-12-23 12:36:44
问题 I'm trying to implement TwoWayView in my project by following the sample project provided in that link. I have implemented everything and my code works without any errors but the actual List is not getting inflated. Upon debugging I found out that the adapter is set correctly and the getItemCount method is also returning positive count but the other two overridden methods onCreateViewHolder and onBindViewHolder are not getting called. I have no clue why it is not working. Please see the

Recycler View Inside Recycler View not Scrolling

浪子不回头ぞ 提交于 2019-12-23 11:55:04
问题 There is a Recycler View inside the other Recycler View.Both needs to scroll vertically. Outer Recycler view is scrolling properly but inner recycler view is not. Here is the code: LinearLayoutManager mLayoutManager = new LinearLayoutManager(ViewActivity.this); outerRecyclerView.setLayoutManager(mLayoutManager); ViewAdapter adapter = new ViewAdapter(ViewActivity.this); outerRecyclerView.setAdapter(adapter); ViewAdapter is as follows: public void onBindViewHolder(ViewAdapter.ViewViewHolder

Setting the background image of a CardView inside RecyclerView causes the program to crash when scrolling

℡╲_俬逩灬. 提交于 2019-12-23 11:14:14
问题 I have a RecyclerView containing a list of CardViews with information that is pulled from a server, some cards have only a background color but some contains a background image. If the cards all have just background colors, the RecyclerView behaves accordingly (I am able to set the margins and corner radius as well). However, if any one card contains a background image, a crash will happen when I try to scroll up/down the list (although the background image will load without the previously

Android: Recycler view item fast clicking it crash the application

纵然是瞬间 提交于 2019-12-23 10:43:15
问题 I have search a lot what I did is created a list of items simple number and having check box Which is checked and unchecked, So when I tap fast fast on list it crash and generate ArrayIndexOutOfBound Exception So I don't know what is I am doing wrong here is my code adapter class class SingleListItemHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private TextView mItemDate, mFontSizeCategory; private ImageView isChecked, isTrack, isUnChecked; private int fontSize = 13

Problems with dynamic views inside recycler view

核能气质少年 提交于 2019-12-23 10:28:57
问题 I'm using recycler view to show list of items which contains grid layout of images. The grid layout is added dynamically to the list item inside "onBindViewHolder" method on recycler view adapter. Now problem is that the grid layout views are recreated on every scroll. I don't want those views to be recreated on scroll. How to deal with it?? Here is the code snippet @Override public void onBindViewHolder(final PersonViewHolder personViewHolder, final int i) { GridLayout feedGrid = new

RecyclerView + MediaPlayer + Toggle Button + String Uri

放肆的年华 提交于 2019-12-23 10:15:16
问题 Background: I'm working on an Fitness app. Everything is working good till now but problem came when I was working with audio files MediaPlayer in android. I have checked resources and found ListView but couldn't find anything on RecyclerView + MediaPlayer. I want to know how to make it work while working with RecyclerView + Toggle Button + String Uri (Offline - Raw folder) Problem: Right now it is playing the first .mp3 file on every click event (for Eng: R.raw.sample_one_eng is played and

Image flickering while scrolling in RecyclerView

我只是一个虾纸丫 提交于 2019-12-23 10:09:08
问题 I'm trying to display a list of songs found on the device requesting data directly from the MediaStore. I'm using a RecyclerView and an adapter that uses a CursorAdapter to get data from MediaStore. When adapter's onBindViewHolder is called, the request is passed to the bindView function of the CursorAdapter the all visual elements are set. public class ListRecyclerAdapter3 extends RecyclerView.Adapter<ListRecyclerAdapter3.SongViewHolder> { // PATCH: Because RecyclerView.Adapter in its