An Android staggered grid view which supports multiple columns with rows of varying sizes.

Overview

AndroidStaggeredGrid

##Notice - Deprecated - 09-2015

This library has been deprecated. We will no longer be shipping any updates or approving community pull requests for this project.

While the code will remain for anyone who wishes to use it, we suggest you prefer using Google's own RecyclerView with their StaggeredGridLayoutManager. We are doing the same internally at Etsy.

Thanks to everyone who used the library and submitted code or issues to improve it.

##About

An Android staggered grid view which supports multiple columns with rows of varying sizes.

The StaggeredGridView was developed due to requirements for the Etsy app not met by any existing Android libraries. Namely a stable implementation with the ability to have a different number of columns in landscape & portrait, to sync grid position across orientation changes and support for headers & footers.

Staggered Grid Sample Image

##Features

  • Configurable column count for portrait and landscape orientations.
  • Sync'd row position across orientation changes.
  • Configurable item margin.
  • Support for headers & footers.
  • Internal padding that does not affect the header & footer.
  • Extends AbsListView - "mostly"
  • Supports AbsListView.OnScrollListener

##Setup

The library was built for and tested on Android version 2.3.3(SDK 10) and above. It could be modified to support older versions if required.

The simplest way to use AndroidStaggeredGrid is to add the library as a gradle aar dependency to your build. See the CHANGELOG.md for the latest version number.

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.etsy.android.grid:library:x.x.x' // see changelog
}

Alternatively import the /library project into your Android Studio project and add it as a dependency in your build.gradle.

The library is currently configured to be built via Gradle only. It has the following dependencies:

  • Android Gradle plugin v0.9.2 - com.android.tools.build:gradle:0.9.2
  • Android Support Library v19.1 - com.android.support:support-v4:19.1.+

Still use Eclipse/building with Ant? You can still use AndroidStaggeredGrid, it's just a few extra steps (left up to the reader).

##Usage

Please see the /sample app for a more detailed code example of how to use the library.

  1. Add the StaggeredGridView to the layout you want to show.
        <com.etsy.android.grid.StaggeredGridView
            xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/grid_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:item_margin="8dp"
            app:column_count="@integer/column_count" />
  2. Configure attributes.
  • item_margin - The margin around each grid item (default 0dp).
  • column_count - The number of columns displayed. Will override column_count_portrait and column_count_landscape if present (default 0)
  • column_count_portrait - The number of columns displayed when the grid is in portrait (default 2).
  • column_count_landscape - The number of columns displayed when the grid is in landscape (default 3).
  • grid_paddingLeft - Padding to the left of the grid. Does not apply to headers and footers (default 0).
  • grid_paddingRight - Padding to the right of the grid. Does not apply to headers and footers (default 0).
  • grid_paddingTop - Padding to the top of the grid. Does not apply to headers and footers (default 0).
  • grid_paddingBottom - Padding to the bottom of the grid. Does not apply to headers and footers (default 0).
  1. Setup an adapter just like you would with a GridView/ListView.
    ListAdapter adapter = ...;
    
    StaggeredGridView gridView = (StaggeredGridView) findViewById(R.id.grid_view);
    
    gridView.setAdapter(adapter);

NOTE: As column widths change on orientation change, the grid view expects that all children maintain their own width to height ratio. To assist with this the project includes the DynamicHeightImageView as an example of a view that measures its height based on its width.

##TODO

The StaggeredGridView does not support the following:

  • Item selector drawables
  • Item long press event
  • Scroll bars
  • Row dividers
  • Edge effect
  • Fading edge
  • Overscroll

##License

Copyright (c) 2013 Etsy

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Support for long click and pressed state

    Support for long click and pressed state

    Based on code from AbsListView, added support for long press so that an onItemLongClickListener will be called for a long press on cards, and added the pressed state for cards when they are clicked or long-clicked.

    opened by DougSimonton 11
  • Staggered Grid only displaying first two items from the adapter in above 17+ device.

    Staggered Grid only displaying first two items from the adapter in above 17+ device.

    The grid items were stretching earlier which was solved by using the dynamic image height but, then the grid stopped populating views after first two items.

    question 
    opened by Kenmraju 8
  • Set selection doesn't work for the first time when data gets loaded

    Set selection doesn't work for the first time when data gets loaded

    When i use set selection for the first time when data gets loaded in grid it doesn't work but when i scroll the list then it works..I don't know how? Can anyone help me here?

    opened by abhirb1 7
  • Add support for setColumnCount(int, int) - Issue #26

    Add support for setColumnCount(int, int) - Issue #26

    Pull request for issue #26 Adds support for changing the grid column count dynamically. Note that in the sample project you have to clear the array of height ratios to properly re-layout the items.

    opened by jenzz 7
  • IndexOutOfBounds-Exception

    IndexOutOfBounds-Exception

    Hi,

    I encountered an error while scrolling through the Listview with Genymotion "Galaxy S4" with Android 4.3.

    The error is: E/MessageQueue-JNI(5118): Exception in MessageQueue callback: handleReceiveCallback E/MessageQueue-JNI(5118): java.lang.IndexOutOfBoundsException: Invalid index 105, size is 1 E/MessageQueue-JNI(5118): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) E/MessageQueue-JNI(5118): at java.util.ArrayList.get(ArrayList.java:308) E/MessageQueue-JNI(5118): at com.etsy.android.grid.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:169) E/MessageQueue-JNI(5118): at com.etsy.android.grid.ExtendableListView.onTouchDown(ExtendableListView.java:818) E/MessageQueue-JNI(5118): at com.etsy.android.grid.ExtendableListView.onTouchEvent(ExtendableListView.java:686) E/MessageQueue-JNI(5118): at android.view.View.dispatchTouchEvent(View.java:7384) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2205) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1940) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) E/MessageQueue-JNI(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) E/MessageQueue-JNI(5118): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1966) E/MessageQueue-JNI(5118): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1418) E/MessageQueue-JNI(5118): at android.app.Activity.dispatchTouchEvent(Activity.java:2424) E/MessageQueue-JNI(5118): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1914) E/MessageQueue-JNI(5118): at android.view.View.dispatchPointerEvent(View.java:7564) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3883) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3778) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5419) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5399) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5370) E/MessageQueue-JNI(5118): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5493) E/MessageQueue-JNI(5118): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182) E/MessageQueue-JNI(5118): at android.os.MessageQueue.nativePollOnce(Native Method) E/MessageQueue-JNI(5118): at android.os.MessageQueue.next(MessageQueue.java:132) E/MessageQueue-JNI(5118): at android.os.Looper.loop(Looper.java:124) E/MessageQueue-JNI(5118): at android.app.ActivityThread.main(ActivityThread.java:5103) E/MessageQueue-JNI(5118): at java.lang.reflect.Method.invokeNative(Native Method) E/MessageQueue-JNI(5118): at java.lang.reflect.Method.invoke(Method.java:525) E/MessageQueue-JNI(5118): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) E/MessageQueue-JNI(5118): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/MessageQueue-JNI(5118): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(5118): FATAL EXCEPTION: main E/AndroidRuntime(5118): java.lang.IndexOutOfBoundsException: Invalid index 105, size is 1 E/AndroidRuntime(5118): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) E/AndroidRuntime(5118): at java.util.ArrayList.get(ArrayList.java:308) E/AndroidRuntime(5118): at com.etsy.android.grid.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:169) E/AndroidRuntime(5118): at com.etsy.android.grid.ExtendableListView.onTouchDown(ExtendableListView.java:818) E/AndroidRuntime(5118): at com.etsy.android.grid.ExtendableListView.onTouchEvent(ExtendableListView.java:686) E/AndroidRuntime(5118): at android.view.View.dispatchTouchEvent(View.java:7384) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2205) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1940) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211) E/AndroidRuntime(5118): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1912) E/AndroidRuntime(5118): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1966) E/AndroidRuntime(5118): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1418) E/AndroidRuntime(5118): at android.app.Activity.dispatchTouchEvent(Activity.java:2424) E/AndroidRuntime(5118): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1914) E/AndroidRuntime(5118): at android.view.View.dispatchPointerEvent(View.java:7564) E/AndroidRuntime(5118): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3883) E/AndroidRuntime(5118): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3778) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398) E/AndroidRuntime(5118): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406) E/AndroidRuntime(5118): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406) E/AndroidRuntime(5118): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379) E/AndroidRuntime(5118): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5419) E/AndroidRuntime(5118): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5399) E/AndroidRuntime(5118): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5370) E/AndroidRuntime(5118): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5493) E/AndroidRuntime(5118): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182) E/AndroidRuntime(5118): at android.os.MessageQueue.nativePollOnce(Native Method) E/AndroidRuntime(5118): at android.os.MessageQueue.next(MessageQueue.java:132) E/AndroidRuntime(5118): at android.os.Looper.loop(Looper.java:124) E/AndroidRuntime(5118): at android.app.ActivityThread.main(ActivityThread.java:5103) E/AndroidRuntime(5118): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(5118): at java.lang.reflect.Method.invoke(Method.java:525) E/AndroidRuntime(5118): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) E/AndroidRuntime(5118): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime(5118): at dalvik.system.NativeStart.main(Native Method)

    Maybe you can reproduce the error and solve the problem?

    opened by tsemann 6
  • The content of the adapter has changed but ExtendableListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread

    The content of the adapter has changed but ExtendableListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread

    How can ı fix it guys ?

         java.lang.IllegalStateException: The content of the adapter has changed but ExtendableListView    did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ExtendableListView(2131558871, class com.etsy.android.grid.StaggeredGridView) with Adapter(class com.etsy.android.grid.HeaderViewListAdapter)]
       at com.etsy.android.grid.ExtendableListView.layoutChildren(ExtendableListView.java:559)
       at com.etsy.android.grid.StaggeredGridView.layoutChildren(StaggeredGridView.java:358)
       at com.etsy.android.grid.ExtendableListView.onLayout(ExtendableListView.java:513)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1160)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.support.v7.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:493)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1888)
       at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1742)
       at android.widget.LinearLayout.onLayout(LinearLayout.java:1651)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.onLayout(CustomViewAbove.java:476)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1160)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.widget.FrameLayout.layoutChildren(FrameLayout.java:515)
       at android.widget.FrameLayout.onLayout(FrameLayout.java:450)
       at android.view.View.layout(View.java:15125)
       at android.view.ViewGroup.layout(ViewGroup.java:4862)
       at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2323)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2029)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1192)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6231)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:788)
       at android.view.Choreographer.doCallbacks(Choreographer.java:591)
       at android.view.Choreographer.doFrame(Choreographer.java:560)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:774)
       at android.os.Handler.handleCallback(Handler.java:808)
       at android.os.Handler.dispatchMessage(Handler.java:103)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:5292)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
       at dalvik.system.NativeStart.main(NativeStart.java)
    
    opened by slm 5
  • First item in column is vertically stretched on API 17+

    First item in column is vertically stretched on API 17+

    The following works on Genymotion api 16 devices, but fails on api 17 and 18 counterparts. Also fails on Nexus 5 (api 19) and HTC One (18).

    activity layout:

    <com.etsy.android.grid.StaggeredGridView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/gridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:item_margin="5dp"
        app:column_count_portrait="3"
        app:column_count_landscape="4" />
    

    item layout (extends ImageView but no modifications to layout):

    <uk.co.ataulm.mijur.app.gallery.GalleryItemView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:scaleType="centerInside"
        android:src="@drawable/ic_launcher"/>
    

    By fail, I mean that on API 17 and above I get the screen on the left, on 16, I get the one on the right:

    This may be a usage bug, so I have posted the relevant portions of my code. FWIW, the Etsy app works fine on my Nexus 5 (4.4.2).

    opened by ataulm 5
  • column positioned in wrong place

    column positioned in wrong place

    after fast scrolling up and down many times, i got this: screenshot_2014-12-08-11-27-49

    screenshot_2014-12-08-11-19-54

    the right position should be 319,320,321,322,323 ...

    the error start form here: screenshot_2014-12-08-11-31-15

    from "position#280".

    1ab093e5-dc46-4713-a35b-43d9024e1591

    note: "position#280" means data index 280, in StaggeredGrid, its position is 281 because of the header.

    the column for position 281 is wrong (should be 1).

    is there anyone has this issue??

    opened by willisdai 4
  • How to set gird item height before loading image?

    How to set gird item height before loading image?

    I have image's width and height, how to set grid item(ImageView)'s width and height before loading image from server like Etsy? Maybe set them in Adapter's getView method?

    opened by RobotAmiee 4
  • BadParcelableException being thrown frequently

    BadParcelableException being thrown frequently

    Hi

    I am using a FragmentStatePagerAdapter, each page holds a StaggeredGridView. When I am paging through the ViewPager I sometimes get the following Exception:

    android.os.BadParcelableException: ClassNotFoundException when unmarshalling: etsy.android.grid.StaggeredGridView$GridListSavedState at android.os.Parcel.readParcelableCreator(Parcel.java:2114) at android.os.Parcel.readParcelable(Parcel.java:2064) at android.os.Parcel.readValue(Parcel.java:1980) at android.os.Parcel.readSparseArrayInternal(Parcel.java:2293) at android.os.Parcel.readSparseArray(Parcel.java:1702) at android.os.Parcel.readValue(Parcel.java:2037) at android.os.Parcel.readMapInternal(Parcel.java:2264) at android.os.Bundle.unparcel(Bundle.java:223) at android.os.Bundle.getSparseParcelableArray(Bundle.java:1237)

    This seems to happen randomly for ~10% of my users. Any ideas what's causing this?

    opened by phyora 4
  • NPE onSizeChanged

    NPE onSizeChanged

    Got this exception from Google Play Developers Console:

    java.lang.NullPointerException
        at com.etsy.android.grid.StaggeredGridView.onColumnSync(StaggeredGridView.java:890)
        at com.etsy.android.grid.StaggeredGridView.onSizeChanged(StaggeredGridView.java:846)
    

    Trying to reproduce locally, but not yet succeeded... Can I help with anything else?

    opened by tumb1er 4
  • Implementing a Mosaic View which is scrollable in all direction, like CRED app

    Implementing a Mosaic View which is scrollable in all direction, like CRED app

    Hi I want to implement a staggered grid view. and this grid can be a 16 * 16 square matrix of grid. and initially, it will be showing the 6*3 matrix. I can scroll in any direction to see more if the grid items. this is implemented in the CRED android application. the screenshot of that view is as below - image

    Can I implement that with AndroidStaggeredGrid?

    opened by sagarnayak 1
  • If this is deprecated are you not supporting below API 22 at etsy ?

    If this is deprecated are you not supporting below API 22 at etsy ?

    The documentation says it's deprecated and you are using Google's own RecyclerView with their StaggeredGridLayoutManager internally at Etsy too, but StaggeredGridLayoutManager is only supported for API 22 and above.

    opened by ishandutta2007 0
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
Releases(1.0.6)
  • 1.0.5(May 24, 2014)

    • Fixed OnScrollListener issue after updating contents #100
    • Fixed LayoutParams casting issue when recycling state #102
    • Fixed the onClick item id #86
    • Fixed bug that the default case on Touch event #67
    • Fixed for "NPE onSizeChanged" #41 PR #91
    • Added guard against issue #45
    • Fixed setAdapter bug #86 #85
    • Using newest build tools and libraries - #78 #96
    Source code(tar.gz)
    Source code(zip)
  • 1.0.4(Feb 22, 2014)

    • Added column_count attribute #32
    • Added setColumnCount() methods to support dynamically changing columns #26
    • Added empty view support to ExtendableListView #33
    • Fixed grid_paddingTop and paddingTop being ignored #20
    • Fixed ArrayIndexOutOfBoundsException fix #52
    • Fixed Unintentional onClick event on scroll down #42
    • Fixed onScrollStateChanged never get called #18
    • Fixed notifyDataSetChanged sync bug when mFirstPosition = 0 #22
    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Jan 7, 2014)

  • 1.0.2(Jan 2, 2014)

  • 1.0.1(Dec 31, 2013)

    • Added - initial support for OnItemClickListener #14
    • Fix - measurement of root with wrap content height #16
    • Fix - high velocity fling bug #11
    Source code(tar.gz)
    Source code(zip)
Android library defining adapter classes of RecyclerView to manage multiple view types

RecyclerView-MultipleViewTypeAdapter RecyclerView adapter classes for managing multiple view types Release Note [Release Note] (https://github.com/yqr

Yoshihito Ikeda 414 Nov 21, 2022
Android ListView that mimics a GridView with asymmetric items. Supports items with row span and column span

AsymmetricGridView An Android custom ListView that implements multiple columns and variable sized elements. Please note that this is currently in a pr

Felipe Lima 1.8k Jan 7, 2023
An Android Animation library which easily add itemanimator to RecyclerView items.

RecyclerView Animators RecyclerView Animators is an Android library that allows developers to easily create RecyclerView with animations. Please feel

Daichi Furiya 11.2k Jan 5, 2023
An adapter which could be used to achieve a parallax effect on RecyclerView.

android-parallax-recycleview Integration Step 1. Add the JitPack repository to your build file repositories { maven { url "https://jitpack

Pedro Oliveira 1.6k Nov 17, 2022
RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)

Advanced RecyclerView This RecyclerView extension library provides Google's Inbox app like swiping, Play Music app like drag-and-drop sorting and expa

Haruki Hasegawa 5.2k Dec 23, 2022
A GridView which can addHeaderView and addFooterView

Please follow me on GitHub, I need your support Github: https://github.com/liaohuqiu twitter: https://twitter.com/liaohuqiu 中文版文档 GridView with Header

Huqiu Liao 1.3k Nov 30, 2022
Kotlin way of building RecyclerView Adapter 🧩. You do not have to write RecyclerView Adapters again and again and suffer from handling of different view types. Kiel will help you.

Kiel Kiel is a RecyclerView.Adapter with a minimalistic and convenient Kotlin DSL which provides utility on top of Android's normal RecyclerView.Adapt

ibrahim yilmaz 370 Jan 2, 2023
Android library to display a ListView whose cells are not rigid but flabby and react to ListView scroll.

FlabbyListView This library is not maintained anymore and there will be no further releases Android library to display a ListView which cells are not

JPARDOGO 762 Nov 23, 2022
. Android library that integrate sticky section headers in your RecyclerView

recyclerview-stickyheaders Recyclerview-stickyheaders is an Android library that makes it easy to integrate section headers in your RecyclerView. Thes

null 968 Nov 10, 2022
An Android custom ListView and ScrollView with pull to zoom-in.

PullZoomView An Android custom ListView and ScrollView with pull to zoom-in. Features Set ZoomView enable Add HeaderView Custom ZoomView Parallax or N

Frank-Zhu 2.3k Dec 26, 2022
An android library for section headers that stick to the top

StickyListHeaders StickyListHeaders is an Android library that makes it easy to integrate section headers in your ListView. These section headers stic

Emil Sjölander 5.5k Jan 2, 2023
Android library to achieve in an easy way, the behaviour of the home page in the Expedia app, with a pair of auto-scroll circular parallax ListViews.

ListBuddies This library is not maintained anymore and there will be no further releases Android library of a pair of auto-scroll circular parallax Li

JPARDOGO 970 Dec 29, 2022
Android library to observe scroll events on scrollable views.

Android-ObservableScrollView Android library to observe scroll events on scrollable views. It's easy to interact with the Toolbar introduced in Androi

Soichiro Kashima 9.6k Dec 29, 2022
Drag and drop GridView for Android

DynamicGrid Drag and drop GridView for Android. Depricated It's much better to use solutions based on recycler view. For example https://github.com/h6

Alex Askerov 920 Dec 2, 2022
Android library providing simple way to control divider items (ItemDecoration) of RecyclerView

RecyclerView-FlexibleDivider Android library providing simple way to control divider items of RecyclerView Release Note [Release Note] (https://github

Yoshihito Ikeda 2.4k Dec 18, 2022
AndroidTreeView. TreeView implementation for android

AndroidTreeView Recent changes 2D scrolling mode added, keep in mind this comes with few limitations: you won't be able not place views on right side

Bogdan Melnychuk 2.9k Jan 4, 2023
ItemDecoration for RecyclerView using LinearLayoutManager for Android

RecyclerItemDecoration RecyclerItemDecoration allows you to draw divider between items in recyclerview with multiple ViewType without considering item

magiepooh 328 Dec 27, 2022
Dividers is a simple Android library to create easy separators for your RecyclerViews

Dividers Dividers is an Android library to easily create separators for your RecyclerViews. It supports a wide range of dividers from simple ones, tha

Karumi 490 Dec 28, 2022
[UNMAINTAINED] Sticky Headers decorator for Android's RecyclerView

This project is no longer being maintained sticky-headers-recyclerview This decorator allows you to easily create section headers for RecyclerViews us

timehop 3.7k Dec 31, 2022