android-recyclerview

Auto-scroll Scrollbar While Drag item In Recyclerview

余生长醉 提交于 2019-12-05 23:56:53
I have an issue with Auto-scroll in scroll view. In my case, there are two Recyclerview. First Recyclerview, horizontally scrollable and second vertically. First RecyclerView only for drag and Second RecyclerView only for a drop. Both recyclerviews are inside ScrollView so, I disabled vertical scroll in second Recyclerview. I added DragListener on Second Recyclerview's item. Every item have drag listener so based on that I add/replace item while drop item. So My main issue with scroll, so scroll not working properly while i drag item. currently i used below code for scroll while drag. case

java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true when scrolling down

放肆的年华 提交于 2019-12-05 22:54:08
FATAL EXCEPTION: main Process: com.zipato.android.client.v2, PID: 24966 java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true at android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:5736) at android.support.v7.widget.RecyclerView$Recycler.recycleView(RecyclerView.java:5680) at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:289) at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:336) at android.support.v7.widget.GapWorker

NativeAdsExpress forces RecyclerView to Scroll to have the NativeAd fully visible when first loaded

岁酱吖の 提交于 2019-12-05 22:31:03
问题 I have a weird "problem" or may be it's a "feature" and I just don't know, whenever a NativeAdExpress is loaded in my RecyclerView if only part of the NativeAd is visible, it forces the RecyclerView to scroll until the Native ad becomes fully visible, this behavior causes the list to keep jumping as I scroll. My Layout is mainly: Activity > AppBar with Tabs and ViewPager > each Page in the Pager contains PullToRefresh and inside it there's a RecyclerView, The RecyclerView has 2 types of items

Create or inflate views programmatically in a RecyclerView OnCreateViewHolder

雨燕双飞 提交于 2019-12-05 21:49:47
Basically I wanted to create a layout or inflate a layout programatically with a RecyclerView , but was unable to do so. As I know how to do with xml by inflating it, but out of curiosity I wanted to do it programatically. My adapter code is as follows: public class ACShare extends RecyclerView.Adapter<ACShare.VHShare>{ private List<Integer> listDrawalbe; public ACShare(Context context) { TypedArray drawables = context.getResources().obtainTypedArray(R.array.s_array_contact_us_share); listDrawalbe=new ArrayList<>(); for (int i = 0; i < drawables.length(); ++i) listDrawalbe.add( drawables

Load Earlier Messages in listview like whats app

十年热恋 提交于 2019-12-05 21:06:01
When i Click load earlier messages the earlier messages get loaded from database but list view scrolls to the top which is not be done , the message should only loaded at the top of list view without its scroll. Here is my code for main Activity protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.private_group_chat); Intent i = getIntent(); btnLoadMore = new Button(this);

ListAdapter not refreshing RecyclerView if I submit the same list with different item order

时光毁灭记忆、已成空白 提交于 2019-12-05 20:59:49
I am using a RecyclerView with ListAdapter (which uses AsyncListDiffer to calculate and animate changes when list is replaced). The problem is that if I submit() some list, then re-order that list, and submit() again, nothing happens. How do I force ListAdapter to evaluate this new list, even though it is "the same" (but order has changed)? New findings: I checked source code of submitList() and in the beggining there is a check: public void submitList(@Nullable final List<T> newList) { final int runGeneration = ++this.mMaxScheduledGeneration; if (newList != this.mList) { I think this is the

RecyclerView SCROLL_STATE_IDLE is being called late

耗尽温柔 提交于 2019-12-05 20:47:57
On RecyclerView addOnScrollListener the property SCROLL_STATE_IDLE takes time to get called at end of the item size and when scrolled up to the top of the RecyclerView. But it works fine in middle of the scrolling. The root view of the layout is CoordinatorLayout. Having the same issue, the only workaround I've found is to send a stopScroll() whenever the RecyclerView gets a SCROLL_STATE_SETTLING , though not the ideal solution. Probably would be better to detect if it has reached the top or bottom edge, taking into account the scrolling direction, and then call stopScroll(): @Override public

RecyclerView filter not working

丶灬走出姿态 提交于 2019-12-05 20:21:48
I have used this solution to filter my RecyclerView . Using the solution I was able to get the result while typing. But when I clear the search widget I don't get the full list instead I get the empty RecyclerView . This is how my result looks like. https://imgur.com/nwyetEd This is my Adapter public class ContactsAdapter extends RecyclerView.Adapter<ContactViewHolder> { private LayoutInflater inflater; private ContactViewHolder viewHolder; private ArrayList<Contact> contactsList = new ArrayList<>(); private VolleySingleton volleySingleton; private ImageLoader imageLoader; boolean

Pager-like behavior in RecyclerView

主宰稳场 提交于 2019-12-05 20:16:22
问题 I am trying to implement a ViewPager-like behavior for a horizontal RecyclerView . The data from the adapter should inflate and bind as normal, but the navigation through the Recycler should be handled differently. When the user swipes (or attempts to scroll), I move the Recycler one item in that direction, sticking it to the left side. I already have all the item transition logic. I am using a custom LayoutManager , which overrides onSmoothScrollToPosition() with a custom

scroll event for recyclerview inside scrollview android

故事扮演 提交于 2019-12-05 19:39:07
I have 2 horizontal and 1 vertical (Grid layout) in a single Scrollview. <ScrollView> <Horizontal RecyclerView/> <Horizontal RecyclerView/> <Vertical RecyclerView/> </ScrollView> Above is the schematic of my view. I have to load data on once the vertical recyclerviews last item is visible, but i'm unable to get the scroll event for my vertical view. Here is my scrollviewlistener. recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); totalItemCount =