etsy / androidstaggeredgrid Goto Github PK
View Code? Open in Web Editor NEWAn Android staggered grid view which supports multiple columns with rows of varying sizes.
Home Page: https://github.com/etsy/AndroidStaggeredGrid
An Android staggered grid view which supports multiple columns with rows of varying sizes.
Home Page: https://github.com/etsy/AndroidStaggeredGrid
Is anyone else using this in 4.0+?
I have my item_margin set to 7dp, but there is no margin between the items.
15041 dalvikvm W method Lcom/etsy/android/grid/ExtendableListView;.fillGap incorrectly overrides package-private method with same name in Landroid/widget/AbsListView;
15041 dalvikvm W method Lcom/etsy/android/grid/ExtendableListView;.getFooterViewsCount incorrectly overrides package-private method with same name in Landroid/widget/AbsListView;
15041 dalvikvm W method Lcom/etsy/android/grid/ExtendableListView;.getHeaderViewsCount incorrectly overrides package-private method with same name in Landroid/widget/AbsListView;
15041 dalvikvm W method Lcom/etsy/android/grid/ExtendableListView;.invokeOnItemScrollListener incorrectly overrides package-private method with same name in Landroid/widget/AbsListView;
15041 dalvikvm W method Lcom/etsy/android/grid/ExtendableListView;.rememberSyncState incorrectly overrides package-private method with same name in Landroid/widget/AdapterView;
15041 dalvikvm W method Lcom/etsy/android/grid/ExtendableListView;.reportScrollStateChange incorrectly overrides package-private method with same name in Landroid/widget/AbsListView;
I am just using the library normally. No steps to reproduce except for using this library. There is no code of mine mentioned.
When you have a grid with two items and the first one is taller than the screen height + the second item height and you scroll the grid hiding the second item, you cannot see it again if you scroll up.
In layout file I have the attribute
app:grid_paddingTop="200dp"
But it is ignored
The attributes:
app:grid_paddingLeft="200dp"
and
app:grid_paddingRight="200dp"
are applied properly.
Hi, I found that when we use two finger to touch the item(even when the fingers aren't up) in the staggeredGridView, the onitemClick will be triggered. Could you guys suffer the same problem?
Thanks
There are two column count attributes - portrait and landscape. Are they needed?
I would expect only columnCount
, and if I needed a different number for landscape, I'd include another layout in my layout-land directory which would have a different value for columnCount
(if that was the only difference in my layout for landscape, I could use @integer/columnCount
, so I'd have two resource files for integers instead).
It suggests that the view checks for device orientation; should that be the view's responsibility?
when i call view.setSelction(2) the gridview can not work
I would like to see support for multi-column items. I wanted to open this topic up to discussion because I understand it would be a large change.
For my particular use-case I mostly want to implement some full-width rows in between the staggered columns (think section headers). You can sort of get this effect by claiming the header rows are of type ITEM_VIEW_TYPE_HEADER_OR_FOOTER but of course that's a hack right now and comes with a host of problems.
The general solution would be supporting multi-column items. Alternatively, a more specific solution (for me) would be to support a section header of sorts (full rows), implement similarly to header/footer rows but the code adjusts for them being in the middle.
I'd be willing to work on it myself and enter it through a pull request, but I wanted to gather thoughts first. Does this go outside the scope of the library, or is it something worth adding? And if it's worth adding, do you have any tips for how to get started?
Occurs on master commit b81c1c6
Video can be found here: http://dai.ly/x1dj5iy
Test App to reproduce is at https://github.com/venkat230278/AndroidStaggeredGridViewOverscrollBug.git
Place app at same level as "library", "sample", import into Android studio and build.
Test App has a StaggeredGridView with 2 columns. Its adapter supplies 3 text views. Eventually, the three text views are laid out by the GridView as below.
A B
C
All text views (A, B, C) are of equal height H. H is greater than screen height. In above layout, A and B are clipped by the screen.
Slowly start scrolling towards and beyond C. Note that it is possible to scroll beyond C. Scroll in reverse towards A. Notice that B has disappeared. Notice after a while that A too disappears.
This issue is also encountered if the user flings on A or B towards C.
It appears that the grid view considers empty columns in scroll math. We tried to put in a quick hack fix for this issue for our product.
Patch can be found here: https://github.com/venkat230278/AndroidStaggeredGridViewOverscrollBug/blob/master/patch/sg.patch
Apply patch as follows:
[Some dir]/AndroidStaggeredGrid/library/src/main$ patch -p1 < sg.patch
Things to note about the above patch:
Staggered gridview is nice i have built the same sample for eclipse if you want i can mail you
contact me at [email protected]
Changing the visibility of the footer doesn't effect the space needed by the footer. If I set the visibility to GONE I expect no space to be used by the footer.
From the Android API View: http://developer.android.com/reference/android/view/View.html#GONE
The position
argument to performItemClick
is offset by mFirstPosition
, but the argument passed to adapter.getItemId()
is not offset.
I think the line should be:
performItemClick(view, motionPosition + mFirstPosition, adapter.getItemId(motionPosition + mFirstPosition));
Everything works as expected when scrolling down but when I scroll up there is a lot of re-layouting done for elements that had previously been loaded.
I tried using just a classic DynamicHeightImageView :
<com.etsy.android.grid.util.DynamicHeightImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/deviation_list_item_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true" />
Then I tried to load images into it using Picasso and UIL. Both had the same problem.
The re-layouting comes across as jank since it seems that views are measured again and everything.
Is there any way to remember the height of every element so it does not have to be re-layouted?
I set a OnScrollListener on StaggeredGrid, but the listener never get called. So i dive into source code and find that newState always equal to mTouchMode.
void reportScrollStateChange(int newState) {
Log.d("staggeredGrid", "newState = " + newState + " mTouchMode = " + mTouchMode);
if (newState != mTouchMode) {
mTouchMode = newState;
if (mOnScrollListener != null) {
mOnScrollListener.onScrollStateChanged(this, newState);
}
}
}
Now that the SGV supports an OnItemClickListener
it should have support for drawing the selector. The following two properties have no effect on the SGV:
android:listSelector
android:drawSelectorOnTop
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.
java.lang.NullPointerException
at com.etsy.android.grid.ExtendableListView.getLastVisiblePosition(ExtendableListView.java:1830)
at android.widget.AdapterView.onInitializeAccessibilityEvent(AdapterView.java:957)
at android.widget.AbsListView.onInitializeAccessibilityEvent(AbsListView.java:1488)
at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:4936)
at android.view.View.sendAccessibilityEventUnchecked(View.java:4923)
at android.view.View$SendViewStateChangedAccessibilityEvent.run(View.java:19486)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
I'm getting an error just doing setContentView.
Here is my list layout:
<com.etsy.android.grid.StaggeredGridView
android:id="@+id/product_grid"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:column_count_landscape="3"
app:column_count_portrait="2"
app:grid_paddingBottom="@dimen/padding_medium"
app:grid_paddingLeft="@dimen/padding_medium"
app:grid_paddingRight="@dimen/padding_medium"
app:grid_paddingTop="@dimen/padding_medium"
app:item_margin="@dimen/padding_medium"/>
Here the staktrace:
java.lang.NullPointerException: Attempt to invoke interface method 'int android.widget.ListAdapter.getCount()' on a null object reference
at com.etsy.android.grid.ExtendableListView.getLastVisiblePosition(ExtendableListView.java:1828)
at android.widget.AdapterView.onInitializeAccessibilityEvent(AdapterView.java:957)
at android.widget.AbsListView.onInitializeAccessibilityEvent(AbsListView.java:1443)
at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:4946)
at android.view.View.sendAccessibilityEventUnchecked(View.java:4933)
at android.view.View$SendViewStateChangedAccessibilityEvent.run(View.java:19472)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5019)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
Thanks!!
It would be nice to see it in maven central in aar format.
Hello!
Here my first post on github!
Manifest:
<activity
android:name="com.ambrosettilive.app.CardViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:theme="@style/AppBaseTheme" >
</activity>
Layout:
<com.etsy.android.grid.StaggeredGridView
android:id="@+id/staggeredGridView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:item_margin="8dp"
app:column_count="@integer/column_number" />
<!-- 4 column landscape and 3 on portrait-->
Before rotating:
After rotating:
Ask me whatever yout want.
Thank you,
Daniele
I registered an setOnItemClickListener to the StaggeredGridView which works as expected besides one exception:
If I scroll up as far as possible (i. e. scroll up just after initialization) and lift the finger, an onItemClick event is triggered for the item of my current finger position. It looks like there is a missinterpretation of the scroll gesture by the GridView.
In the code that is not yet implemented. I guess just planned to copy over the necessary stuff from AbsListView and modify it correctly. I know this is quite some task to make sure it works correctly.
Or what are the plans for this? Anybody already working on this? Getting only OnItemClickListener working is pretty easy, but getting long click and selectors working takes more time.
I have read the source, in ExtendableListView#reportScrollStateChange method, we check whether newState is equal mTouchMode. However, before invoke reportScrollStateChange, I found that the mTouchMode almost always been set to new state. so reportScrollStateChange can not work. can someone fix it? I have read AbsListView, actually it will set mTouchMode to TOUCH_MODE_REST before report.
PLEASE HELP !!!! I am not familiar with Android Studio .Plzz someone help me with the steps to run this successfully on Eclipse .I tried importing it to AS also but its throwing so many notification which are so confusing .
Trying to execute your sample app, When I click on "Staggered Grid View" button I get this error:
01-23 12:10:22.546: E/AndroidRuntime(26874): FATAL EXCEPTION: main
01-23 12:10:22.546: E/AndroidRuntime(26874): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.etsy.android.sample/com.etsy.android.sample.StaggeredGridActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class com.etsy.android.grid.StaggeredGridView
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.os.Handler.dispatchMessage(Handler.java:99)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.os.Looper.loop(Looper.java:130)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.app.ActivityThread.main(ActivityThread.java:3687)
01-23 12:10:22.546: E/AndroidRuntime(26874): at java.lang.reflect.Method.invokeNative(Native Method)
01-23 12:10:22.546: E/AndroidRuntime(26874): at java.lang.reflect.Method.invoke(Method.java:507)
01-23 12:10:22.546: E/AndroidRuntime(26874): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
01-23 12:10:22.546: E/AndroidRuntime(26874): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
01-23 12:10:22.546: E/AndroidRuntime(26874): at dalvik.system.NativeStart.main(Native Method)
01-23 12:10:22.546: E/AndroidRuntime(26874): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.etsy.android.grid.StaggeredGridView
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
01-23 12:10:22.546: E/AndroidRuntime(26874): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:216)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.app.Activity.setContentView(Activity.java:1660)
01-23 12:10:22.546: E/AndroidRuntime(26874): at com.etsy.android.sample.StaggeredGridActivity.onCreate(StaggeredGridActivity.java:31)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
01-23 12:10:22.546: E/AndroidRuntime(26874): ... 11 more
01-23 12:10:22.546: E/AndroidRuntime(26874): Caused by: java.lang.reflect.InvocationTargetException
01-23 12:10:22.546: E/AndroidRuntime(26874): at java.lang.reflect.Constructor.constructNative(Native Method)
01-23 12:10:22.546: E/AndroidRuntime(26874): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
01-23 12:10:22.546: E/AndroidRuntime(26874): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
01-23 12:10:22.546: E/AndroidRuntime(26874): ... 21 more
01-23 12:10:22.546: E/AndroidRuntime(26874): Caused by: java.lang.NoClassDefFoundError: com.etsy.android.grid.R$styleable
01-23 12:10:22.546: E/AndroidRuntime(26874): at com.etsy.android.grid.StaggeredGridView.(StaggeredGridView.java:153)
01-23 12:10:22.546: E/AndroidRuntime(26874): at com.etsy.android.grid.StaggeredGridView.(StaggeredGridView.java:145)
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).
Like gridview, if we set emptyview into an adapterview, before we set adapter, the adapter view should show the empty view, until we set the adapter into it.
But AndroidStaggeredGrid doesn't work like this.
I want to use this library in my project but before any implementation I want to know that is it possible to add full-width layouts as a separator between grids through this library or not?
Thanks in advance...
When not setting app:column_count_portrait / landscape in xml.
02-07 17:47:16.355: E/AndroidRuntime(2224): java.lang.ClassCastException: xxx.CustomAdapter cannot be cast to com.etsy.android.grid.HeaderViewListAdapter
02-07 17:47:16.355: E/AndroidRuntime(2224): at com.etsy.android.grid.ExtendableListView.removeFooterView(ExtendableListView.java:450)
I'm using footer views. By trying to remove one of the footer views I get a ClassCastException. Do I have to implement the HeaderListViewAdapter instead of the ArrayAdapter? I thought I could use any common list adapter.
Calling notifyDataSetChanged() refresh the list properly and mantain the position everywhere but not when first items are partially displayed.
It would be great to add maven support for the library and push it to maven central
I have a custom component that extends from a RelativeLayout. The component is relatively simple -- an ImageView with an optional TextView. The TextView's visibility is changed after an AsyncTask is run. Thus, the StaggeredGridView renders the initial view correctly, but ignores (does not honor) the visibility change) after the AsyncTask runs.
I'm using identical code with a ListView and the StaggeredGridView and the ListView runs correctly, but the StaggeredGridView does not. Is this expected behavior or a bug?
It looks like when the tops are copied into the bottom,
there is a mismatch in size between
the array src (mColumnTops
) and the array dest (mColumnBottoms
).
02-11 14:10:48.628 3518 6271 E AndroidRuntime: Caused by: java.lang.ArrayIndexOutOfBoundsException: src.length=3 srcPos=0 dst.length=0 dstPos=0 length=3
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at java.lang.System.arraycopy(Native Method)
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at com.etsy.android.grid.StaggeredGridView.preLayoutChildren(StaggeredGridView.java:341)
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at com.etsy.android.grid.StaggeredGridView.layoutChildren(StaggeredGridView.java:326)
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at com.etsy.android.grid.ExtendableListView.onLayout(ExtendableListView.java:507)
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at com.etsy.android.grid.ExtendableListView.updateEmptyStatus(ExtendableListView.java:2040)
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at com.etsy.android.grid.ExtendableListView.access$1000(ExtendableListView.java:59)
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at com.etsy.android.grid.ExtendableListView$AdapterDataSetObserver.onChanged(ExtendableListView.java:2078)
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
02-11 14:10:48.628 3518 6271 E AndroidRuntime: at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
Any chance of getting a variation on setNumColumns?
I allow my users to change the formatting of the standard grid on the fly, setting the columns and list item style. In the current implementation this is hard coded as a layout value, any chance that is welcomed? I can do the work if it's something that is desired.
E.G. setNumColumns(int columnsPortrait, int columnsLandscape); is what would seem most consistent.
Thoughts?
Maybe i am doing wrong, but onItemClick, onScroll method not working in the Fragment class.
Anyone has this issue?
The standard android way to handle this is to only have one attribute named column_count
and let the user of the library specify a integer resource which is changed by android's resource system when the app changes from portrait to landscape. Before making a pull request to change this i would like to ask if there is any special thought behind this?
I've noticed that in the categories section of the Etsy android app you have images that span multiple colums (like the screenshot below).
Can this be achieved using the StaggeredGrid library? I noticed that the categories section has a scrollbar where as the StaggeredGrid does not, so my hunch is that you are using a different library. Could you share? I'd like to accomplish something similar.
It's quite clearly stated item selector drawables are not supported. Having used the Etsy app I notice that when an item is touched a selector is drawn. How is this implemented? I really need some visual feedback to my grid items when a tap occurs.
Apologies for this not being an issue (I cannot mark as question for some reason).
Thanks!
As @vubinaz mentioned this was introduced in #19
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?
It would appear that extremely high fling velocities cause the list to stop altogether.
In the sample, perform three extremely fast, additive upwards flings from the top of the list. If done correctly, the list should be completely stopped partway through the third fling.
Another way to see this behavior is to constantly fling upward as fast as you can and you'll notice that the list pauses every few flings.
I am trying to add modern implementation of the pull-to-refresh interaction with chrisbanes's library ( https://github.com/chrisbanes/ActionBar-PullToRefresh ) when using androidStaggeredGrid in my viewpager but I have not any success results. I think, AndroidStaggeredGrid's touch events aren't applicable for pulltorefresh.
Can anyone tell me how to add pulltorefresh feature to the my androidStaggeredGrid?
Thanks.
Hi there,
At first, I want to appreciate about this library. It is really great, Thanks :)
By the way, I've tried to add header and footer, but the problem caused.
I follow the example project included in library.
But it causes crash when I use addHeaderView()
and addFooterView()
.
The exception caused by layoutChildren()
method in ExtendableListView
class.
In the layoutChildren()
method, it checks the number of item and adapter like this : else if(mItemCount != mAdapter.getCount())
, and it causes IllegalStateException
.
When I put the 6 items for array adapter and putting the header, the mItemCount
becomes 6 but mAdapter.getCount()
becomes 7. Also, If I put the footer also, then mAdapter.getCount()
becomes 8. I think mItemCount
should contain the footer and header value, but it doesn't. I changed every XML and code are almost same with example in library, but still have a problem
Did I something wrong? or is there any other rule or advice for using header & footer?
Thanks in advance.
Issue in version 1.0.4 (after #53 fix)
Issue occurs if you turn the device and start scrolling
java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
at com.etsy.android.grid.StaggeredGridView.getChildBottom(StaggeredGridView.java:630)
at com.etsy.android.grid.ExtendableListView.fillGap(ExtendableListView.java:1261)
at com.etsy.android.grid.ExtendableListView.moveTheChildren(ExtendableListView.java:1229)
at com.etsy.android.grid.ExtendableListView.scrollIfNeeded(ExtendableListView.java:1055)
at com.etsy.android.grid.ExtendableListView.onTouchMove(ExtendableListView.java:876)
at com.etsy.android.grid.ExtendableListView.onTouchEvent(ExtendableListView.java:696)
at android.view.View.dispatchTouchEvent(View.java:7350)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2412)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2147)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2139)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1476)
at android.app.Activity.dispatchTouchEvent(Activity.java:2487)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2087)
at android.view.View.dispatchPointerEvent(View.java:7535)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3415)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3347)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4456)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4434)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4538)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4506)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4557)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:523)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
I have paddingTop="?android:attr/actionBarSize"
and clipToPadding="false"
set on the view. Upon app launch, the content is scrolled by the action bar size rather than being at 0.
It seems, that calling setAdapter on StaggeredGridView requires API11, not 10, which makes me really sad :(
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.