staggered-gridview

Android StaggeredGridLayoutManager offset bug

这一生的挚爱 提交于 2019-12-03 07:48:52
When you clear your adapter and call notifyDataSetChanged() - StaggedGridLayoutManager manager still has mCachedStart/End in Span[] instances. So when you add new items to adapter - layout manager draws items with offset , and this is a huge problem . EtsyStaggeredGridView has method resetToTop() which clears all cached stuff and draws everything from scratch. There are some workarounds: Call layoutManager.onDetachedFromWindow(recyclerView, null) after clearing an adapter Set new layout manager which is bad There are some workarounds: Call layoutManager.onDetachedFromWindow(recyclerView, null)

How to reflow items in a RecyclerView with the StaggeredGridLayoutManager

我的梦境 提交于 2019-12-01 09:05:24
I'm playing around with the StaggeredGridLayoutManager and have something close to what I want. I have a horizontal staggered grid with 2 rows, where some items are the height of 1 row, and others span both rows. I want the single row height items to stack up and I thought that could be achieved by setting the gap strategy to GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS, but this does not appear to work. Current: ___ ___ ___ ___ |___| | | |___| | | | | | | |___| |___| What I want: ___ ___ ___ |___| | | | | ___ | | | | |___| |___| |___| The relevant code snippets: Setting up the layout manager for the

Android: How to create a Facebook like images gallery grid?

喜欢而已 提交于 2019-11-30 05:32:38
I'm trying to implement a facebook like, gallery grid, where items have different sizes: I was trying to use different libraries/solutions but for now without success: I tried to use AsymemetricGridView . But the problem with this implementation is that there are empty dead spaces left in the grid after going throw the adapter. I also thought of using the StaggeredGridLayoutManager and a RecycleView , but items, in this case, don't have equal or half sizes to other items as it implemented in the Facebook gallery. Now I thinking of providing different view holders for different cases in the

Windows phone 8.1 Implement virtualization for Custom variable sized Gridview

时光怂恿深爱的人放手 提交于 2019-11-29 18:07:42
I have implemented custom itempanel for gridview to support variable item height using this link posted by JerryNixon.My Custom panel supports 3 different sized template(depending on image dimension I am deciding which template to use).This custom Gridview should have pagination and it should support more than 200 items. Right now i could load only 50 items and it crashes because of out of memory exception event in 1GB device . Its one of the requirement in out project. I know when we implement custom itemspanel it losses default virtualization. I have checked Pin.it app. They have implemented

Android: How to create a Facebook like images gallery grid?

梦想的初衷 提交于 2019-11-29 04:14:04
问题 I'm trying to implement a facebook like, gallery grid, where items have different sizes: I was trying to use different libraries/solutions but for now without success: I tried to use AsymemetricGridView. But the problem with this implementation is that there are empty dead spaces left in the grid after going throw the adapter. I also thought of using the StaggeredGridLayoutManager and a RecycleView , but items, in this case, don't have equal or half sizes to other items as it implemented in

Adjust GridView child height according to the dynamic content in flutter

ⅰ亾dé卋堺 提交于 2019-11-28 21:35:19
How to implement this complex view in the flutter? I am trying to implement a GridView with n columns and the child should be of a certain aspect ratio(say 1.3) but the height of the child should be (wrap content in Android terminology). I am stuck because as fas I understand GridView's childAspectRatio:1.3 (default:1) always lays out the child in same aspect ratio but not dynamic content. Note: Child should expand its height according to the image's height Use case: I am trying to implement a view like below, in which image is wrapped height = wrap content so that in case an image with

Adjust GridView child height according to the dynamic content in flutter

∥☆過路亽.° 提交于 2019-11-27 20:34:45
问题 How to implement this complex view in the flutter? I am trying to implement a GridView with n columns and the child should be of a certain aspect ratio(say 1.3) but the height of the child should be (wrap content in Android terminology). I am stuck because as fas I understand GridView's childAspectRatio:1.3 (default:1) always lays out the child in same aspect ratio but not dynamic content. Note: Child should expand its height according to the image's height Use case: I am trying to implement

Android RecyclerView StaggeredGrid items change position when scrolling top

核能气质少年 提交于 2019-11-27 07:14:42
问题 In my Staggered Grid with 2 columns I use the effect of infinite list to automatically load elements 10 by 10, everything works fine except when I scroll up. The first two elements change their position. It is like the first two items jump from one column to another. As I read, the adapter must save the state of each element. But, I do not know how to do it. This is the main code that I use to display the StaggeredGrid functionality public class SpacesItemDecoration extends RecyclerView

No good example about RecyclerView and StaggeredGridLayoutManager in Android Docs

穿精又带淫゛_ 提交于 2019-11-27 00:19:39
I couldn't find any better example for using RecyclerView with StaggeredGridLayoutManager . Not even in Android Docs . Q1. I need some examples which can give proper explanation about how to use RecyclerView with StaggeredGridLayoutManager . Q2. Can anyone tell me if it is possible to create following layout using RecyclerView with StaggeredGridLayoutManager So far i have found this link which is not at all useful. I also found this link for cardslib but it is too much complex in implementation and has too much dependencies which will increase my app size unnecessarily. g4th For those who are