gridlayoutmanager

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

Recycler View With Gridlayout Manager

孤街浪徒 提交于 2019-12-06 03:42:55
问题 I'm using RecyclerView with GridLayout manager to make seat booking layout like travels. My problem is how to auto detect spancount when my column is random? I know spanCount = recyclerViewWidth / singleItemWidth; , but the problem is singleItemWidth is different, as the seat width is different. This is the desired layout that I want: ... but I'm currently getting something like this: This is the code I'm using to arrange the seat layout: gridLayoutManager=new GridLayoutManager(this,totalRows

RecyclerView with GridLayoutManager and first element with different viewHolder

自作多情 提交于 2019-12-04 21:55:53
问题 I need to create a recyclerView with a GridLayoutManager on two lines, and the first element to be bigger than the rest. The result should look like this: I managed to achieve this, but in an unconventional way. In my recyclerView adapter I use a different viewHolder for the first element, a bigger one. That would have been a great solution, but the second element would have gone below the first element. So I made a trick of giving recyclerView a fixed height same as the first element, that

Spacing Issue while creating bus layout in recycler view Gridlayout manager

纵然是瞬间 提交于 2019-12-04 16:29:39
问题 I'm using recycler view with GirdLayout Manager for creating bus layout my problem is with spacing I'm populating data according to row column This is how I'm getting layout This is how i want my layout to be: i want the item at row 3 and column 2 beside sleeper seat at row 2 column 0 like shown in pic how can i remove that space, item should accommodate according to its upper item. customGridAdapter = new CustomGridViewAdapter(getActivity(), busSeatModel, false, fareCategory, BusSeatLayout

GridLayoutManager with custom divider

一世执手 提交于 2019-12-04 12:19:14
问题 I am trying to add custom divider in RecyclerView with GridLayoutManager but not getting success, i have searched a lot and looked into below mention answer but it didn't help me link 1 link 2 link 3 I want to put black line in between each items of RecyclerView , something like below. I have got horizontal line in between each row, but not able to find how to get those lines in between columns also. chintan soni's answer worked perfectly, but it is creating problem in one scenario only, when

How to set the height of an item row in GridLayoutManager

六月ゝ 毕业季﹏ 提交于 2019-12-04 07:53:37
问题 My Recycler Item which inflate in onCreateViewHolder <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical" android:padding="16dp"> <ImageView android:id="@+id/gridListImageView" android:layout_width="96dp" android:layout_height="96dp" android:src="@drawable/a" /> <TextView android:id="@+id/gridListView_title"

Recycler View With Gridlayout Manager

心不动则不痛 提交于 2019-12-04 07:44:00
I'm using RecyclerView with GridLayout manager to make seat booking layout like travels. My problem is how to auto detect spancount when my column is random? I know spanCount = recyclerViewWidth / singleItemWidth; , but the problem is singleItemWidth is different, as the seat width is different. This is the desired layout that I want: ... but I'm currently getting something like this: This is the code I'm using to arrange the seat layout: gridLayoutManager=new GridLayoutManager(this,totalRows, LinearLayoutManager.VERTICAL, false); gridLayoutManager.setSpanSizeLookup(new GridLayoutManager

Spacing Issue while creating bus layout in recycler view Gridlayout manager

扶醉桌前 提交于 2019-12-03 11:26:20
I'm using recycler view with GirdLayout Manager for creating bus layout my problem is with spacing I'm populating data according to row column This is how I'm getting layout This is how i want my layout to be: i want the item at row 3 and column 2 beside sleeper seat at row 2 column 0 like shown in pic how can i remove that space, item should accommodate according to its upper item. customGridAdapter = new CustomGridViewAdapter(getActivity(), busSeatModel, false, fareCategory, BusSeatLayout.this); RtlGridLayoutManager gridLayoutManager = new RtlGridLayoutManager(getActivity(), busSeatModel

Android add spacing below last element in recyclerview with gridlayoutmanager

99封情书 提交于 2019-12-03 02:42:33
问题 I am trying to add spacing below the last element row in RecyclerView with GridLayoutManager . I used custom ItemDecoration for this purpose with bottom padding when its last element as follows: public class SpaceItemDecoration extends RecyclerView.ItemDecoration { private int space; private int bottomSpace = 0; public SpaceItemDecoration(int space, int bottomSpace) { this.space = space; this.bottomSpace = bottomSpace; } public SpaceItemDecoration(int space) { this.space = space; this

RecyclerView GridLayoutManager with full width header

天大地大妈咪最大 提交于 2019-12-02 19:00:55
I'm using a very helpful example here to show a RecyclerView and a GridLayoutManager to show a grid with a header. It looks pretty good, but my graphic designer wants the header item to take up the full width of the RecyclerView. Right now there is padding. When I set up the GridLayoutManager I add in padding (which I still want for the other grid items): [it's using Xamarin C#] var numColumns = myListView.MeasuredWidth / tileSizeMax; myGridView.SetPadding(tilePadding, tilePadding, tilePadding, tilePadding); layoutManager = new GridLayoutManager(Activity, numColumns); myListView