staggeredgridlayout

GridLayoutManager Customization

梦想与她 提交于 2021-02-10 05:49:30
问题 i want to know if there is way that i can customize gridlayoutmanager in android to have horizontal layout like this sketch: i tried some layout manager that i found in Github but non of them that help me to implement this kind of layout manager. something like this: public class CustomLayoutManager extends StaggeredGridLayoutManager { public CustomLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } public

How to find cell width from StaggeredGridLayoutManager?

℡╲_俬逩灬. 提交于 2019-12-21 17:17:12
问题 I have a StaggeredGrid in a RecyclerView and I am trying to dynamically set the image height in the onBindViewHolder . I thought the StaggeredGrid was supposed to handle all this automatically, so I set android:layout_width="match_parent and android:scaleType="fitStart on the ImageView , but there is lots of gaps around the image. Since the StaggeredGrid isn't living up to it, I'm trying to help it a bit by defining the image height dynamically in the onBindViewHolder . I have the width and

Variable number of columns in GridLayoutManager

痞子三分冷 提交于 2019-12-12 07:47:17
问题 I wanted to display variable number of columns in a row of GridLayoutManager while using RecyclerView. The number of columns to be displayed depends on the size of the column's TextView. I don't know the column width as the text is being dynamically put in it. Can anyone help? StaggeredGridLayoutManager is not solving my purpose as it customizes the height but takes fixed number of columns. 回答1: Take a look at the setSpanSizeLookup method of the GridLayoutManager . It lets you specify the

Why does my StaggeredGrid RecyclerView layout every item, not only visible ones?

寵の児 提交于 2019-12-12 05:06:51
问题 I have a Staggered grid containing 370 items, with images. I want to make sure the items are recycled quickly to be careful with memory, but a ViewHolder is created and then bound for every single item in my adapter and pays no attention to whether children are visible I've tried the following StaggeredGridLayoutManager lm = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL); rv.setLayoutManager(lm); rv.setItemViewCacheSize(20); //Has no effect RecyclerView

Is there a way to make layout like Android StaggeredGridView using react-native in iOS

本小妞迷上赌 提交于 2019-12-12 03:48:11
问题 Android StaggeredGridLayout allows you to layout cards in columns with different height, like how Pinterest does. Is this possible using React-native on iOS? 回答1: This is definitely possible. Have a look at https://github.com/xudafeng/autoresponsive_react_native_sample 来源: https://stackoverflow.com/questions/38004529/is-there-a-way-to-make-layout-like-android-staggeredgridview-using-react-native

How to add headerview to recyclerview with staggeredGridLayoutManager

百般思念 提交于 2019-12-11 13:11:13
问题 I want add a headerview like listview into recyclerview with staggeredGridLayoutManager. I have search all library and only found this one RecyclerHeaderView but this library have limitation for LinearLayoutManager or GridLayoutManager. Is possible to add headerview for staggeredGridLayout? 回答1: you can use setFullSpan in the layout manager to create a row that looks like a header public final void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { StaggeredGridLayoutManager

RecyclerView with wrap content items

心已入冬 提交于 2019-12-10 17:34:44
问题 I need to implement next UI element: Unknown size list of strings (That came from a server call) Any item should be wrap content. If an item is not fits to row, he will be in the next row. All list/grid is centered I thought of using RecyclerView with StaggeredGridLayoutManager But I don't know if it the right way, any ideas? 回答1: I don't sure that method would be helpful for you, but instead of using RecyclerView with StaggeredGridLayoutManager you can use third-party FlowLayout : First

using staggered gridlayout manager in recycler view sorting of items in particulate order is possible

社会主义新天地 提交于 2019-12-08 08:08:12
问题 I have recyclerview which is displaying lot of items in card views those views are dynamic height like following pic. I achieved it but i have an other problem if i apply any order like increase like that iam getting this one. If we look in 5th and 6th cards are not following order.it is disturbing UI. i know it is happening because of Staggered. Is there any way without disturbing staggered we can achieve ordering also. 来源: https://stackoverflow.com/questions/42241048/using-staggered

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

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