android-recyclerview

Android - Recycler view set item not swipeable

淺唱寂寞╮ 提交于 2019-12-08 05:31:47
问题 I am using a RecyclerView and ItemTouchHelper.SimpleCallback => onSwiped method. Some of the items at the recycler view are in progress and i want to disable swipe on them. How can i do it? 回答1: You can override getSwipeDirs() in your ItemTouchHelper.SimpleCallback . Return 0 when you don't want an item to be swipe-able. The second parameter to this method is the ViewHolder for the item being swiped- you can add a simple flag to your ViewHolder to indicate whether or not it is swipe-able. For

I want to scroll multiple recyclerview at a time how to achieve that

亡梦爱人 提交于 2019-12-08 05:13:51
问题 I want to scroll multiple RecyclerView at a time how to achieve that Exp- I have 3 RecyclerView in horizontal and when i scroll 1st RecyclerView then second and third shoul also scroll how to do that ? 回答1: The answer is very simple, you have to get scroll feedback from one recycleview and pass it to other recycleviews. But very carefully. you need to keep referance of which recyclerview starts giving scroll feedback, so that it won't enter into continious loop. so create a global variable

Android: get the exact position on the screen that the user was at in a recyclerview

不想你离开。 提交于 2019-12-08 04:53:31
问题 I'm going to reference the following question, because this person asked the same thing a month ago but nobody has answered him yet: How to scroll the user at the exact position, which is somewhere between two views.? When the user scrolls somewhere inside a recyclerview list and minimizes the app, then restores it from the bg - or goes into another activity/fragment and returns back to the recyclerview - I want the list to scroll to the exact same location the user was at. When I say the

How to have a GridLayoutManager with header, without changing its adapter?

别说谁变了你拦得住时间么 提交于 2019-12-08 04:52:45
问题 Background I have an app that shows a list of items in a grid-like way, yet not exactly... The problem Some of the items have a different height, so the ones near them should gain the same height as they have. This one works on GridLayoutManager. Some items (actually only the first one in my case) need to span the entire row (which is why I used StaggeredGridLayoutManager ). Using the normal GridLayoutManager, the first requirement worked fine: each row could have a different height. But

Go back to previous Activity with some `put extra` onClick of a recyclerView Item

痴心易碎 提交于 2019-12-08 04:50:27
问题 I want to pass an data previous activity on click of Item in Recycler view and show it on a Edit Text. This is the code i have used to pass data from listview to the previous activity I want to do the same thing with Recyclerview //Calling Second Activity public static final int REQUEST_CODE = 100; Intent dateintent = new Intent(MainActivity.this, SecondActivity.class); startActivityForResult(dateintent, REQUEST_CODE); //onClick of listview pass the data back to previous activity listView

Material Design parent-child navigational transition recyclerview entry to detail fragment

和自甴很熟 提交于 2019-12-08 04:46:36
问题 Background I am trying to implement the "parent-to-child" navigational transition specifically when you click a Recyclerview entry and the details appear in a fullscreen fragment. Something like this: Question How do I go about doing this with so many animation APIs available? (TransitionManager.beginDelayedTransition, SharedTransition, setExitTransition, etc) What I have tried InboxRecyclerView - This matches my requirements EXCEPT that it seems to only work when the detail view is in the

Android collapsing toolbar with RecyclerView

孤街醉人 提交于 2019-12-08 04:34:36
问题 I am attempting to use the collapsing toolbar in conjunction with a RecyclerView , most examples of collapsing toolbar that I can find are usually with a static scrollview and the few I have found with a RecyclerView don't work, has anyone been able to make this work? I will include my xml code below: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/tools"

Implementing multi selection in Android RecyclerView

谁说我不能喝 提交于 2019-12-08 03:56:53
问题 I need some help with Multi/Single selection. Found what I was looking for here, because of its simplicity. I'm using a GridLayoutManager I have over 90 items in my adapter, a CardView with a TextView and an ImageView , while using the procedure described in the post. When I select one, or more than one item, as I scroll down, other items "seems" to be selected because the background replicates, but they are not selected. Tried placing the setOnClickListener , in onBindViewHolder and also in

RecyclerView scrolling top when loading new data

妖精的绣舞 提交于 2019-12-08 03:56:25
问题 I have a problem with RecyclerView. I implemented OnScrollListener to it and when user reach end of list it should load a new data depending on index (index 1 loading first 8 index 2 loading second 8 etc) But problem is as soon as adapter start loading new data it scroll me to top :( This is my code from function where I'm calling server: public void showlist() { progressBar = new ProgressDialog(getActivity()); progressBar.setMessage("Please wait ..."); progressBar.show(); NetworkSDK

Starting Second tab fragment of first activity from second activity

邮差的信 提交于 2019-12-08 03:49:47
问题 I am new to android and I am stuck at particular section of the app which I am working on. The problem is - I want to navigate to the second tab of HomePageActivity when I perform onClickListener event on createEvent button in my SecondActivity . I tried using solution from various threads here and on other sites too but I was still not able to get my code running. I also have RecyclerView on HomePageActivity which is to be populated based on the click event. Here is the code snippet from