android-recyclerview

How to implement Vertical Recyclerview inside vertical recyclerview android?

左心房为你撑大大i 提交于 2019-12-07 18:17:06
问题 Suppose i have 2 items in a RecyclerView where each item has a innerrecyclerview which have around 100 items in it both are vertical or anything that does not have any affect on the existing problem. I have implemented the method available here on other stackoverflow questions or other android Blogs but were not helpful. I have a question regarding onbindviewholder , the item 1 inner RecyclerView 's onbindviewholder gets called for all the elements i.e. 100 at once and they are not recycling

Auto-scroll Scrollbar While Drag item In Recyclerview

跟風遠走 提交于 2019-12-07 17:32:09
问题 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

Recyclerview adapted from Firestore not appearing on Fragment (with tabs)

爷,独闯天下 提交于 2019-12-07 16:25:27
My Recyclerview (which is loaded from Firestore) works if I load it on the activity. I just added a TabLayout and a ViewPager to my ConstraintLayout: <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="30dp" app:layout_constraintTop_toBottomOf="@id/storeIDLayout" > <android.support.design.widget.TabItem android:id="@+id/tabItem" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TEST 1" /> <android.support.design.widget.TabItem android:id="@+id/tabItem2" android:layout_width="wrap_content

RecyclerView Grid - define number of items per row in

我的梦境 提交于 2019-12-07 16:12:14
问题 I'm typically against posting a question without code, but I have no code to show. I'm finally converting my project from listviews and gridviews to recyclerView. In one class, I use a small gridview to place items pulled from a server. The max number of items per row is 3, but the remainder needs to be on top. So if there's 5 items, top row has 2, bottom has 3. If there's 4 items, top row has 1, bottom has 3. My google-fu is failing me and I'm not able to find any examples with this type of

Create or inflate views programmatically in a RecyclerView OnCreateViewHolder

别来无恙 提交于 2019-12-07 16:12:09
问题 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);

Horizontal RecyclerView inside Vertical RecyclerView

寵の児 提交于 2019-12-07 15:48:46
问题 I'm trying to make something like this. So the idea is that i have vertical recyclerview with channels and on second position of channel I should have a horizontal recyclerview with relives. I'm not sure how I'm supposed to do that, I tried messing with viewholders and guess I should make only one recyclerview in my channel_details layout, and another one as an item in item_channel_details, but I cant get it to work. Here is my code. ChannelDetailsActivity: @Override protected void onCreate

How to cancel dragging of items in RecyclerView when using ItemTouchHelper, as you drag?

假装没事ソ 提交于 2019-12-07 14:57:22
问题 Background I'm trying to have a RecyclerView that has different view types, and yet has the ability for drag&drop, together with single click and long click operations. It's similar to what you have on Phone app, where you can change the order of your favorites items. On the Phone app, when you long touch an item, a context menu appears right away, and if you continue to drag, the context menu is gone. However, in this case, I'm required to do the opposite. Upon long pressing, if the user

scroll event for recyclerview inside scrollview android

允我心安 提交于 2019-12-07 14:32:08
问题 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 filter not working

那年仲夏 提交于 2019-12-07 14:29:34
问题 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

Load Earlier Messages in listview like whats app

狂风中的少年 提交于 2019-12-07 13:13:50
问题 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);