Use Etsy's Staggeredgridview In Eclipse
Solution 1:
An easy way is to download the ZIP file, extract the entire file to a temp directory, navigate to the \AndroidStaggeredGrid-master\library\src\main\java
directory, and copy the com
folder into your project's src\
directory. Then go to the \AndroidStaggeredGrid-master\library\src\main\res\values
directory and copy the attrs.xml
file to your project's \res\values\
folder (or merge his file with yours if you already have one).
You don't need Gradle to do this. The source just becomes part of your project.
Another way is to do this, is to try and create a JAR file from it, but I haven't tried this yet with an Android project.
Solution 2:
I have successfully imported the Etsy Staggered GridView into Eclipse. Here are the steps (which work for any Android Studio project you need to get into Eclipse):
Download zip file from Github, unzip, and open project folder --> library --> src --> main
Copy all 3 files there: AndroidManifest and the res and src folders
Start new project in Eclipse: File --> New --> Android Application Project
Create project name, select API levels, etc.. click Next
Unclick Create custom icon launcher and Create activity
Click Mark this project as library (if to be used as a library)
Click Finish
Select project title in Package Explorer, then paste those 3 files into there (click "yes to all" to override)
(optional) If importing as a library, right click your main project's name, go to Properties --> Android
At bottom of popup find "Add" button, select your newly imported library, click ok
Done!
Solution 3:
@ Qian
U must copy the attrs.xml or its content to your projects attrs.xml. make sure to copy the whole thing like this;
<declare-styleablename="StaggeredGridView"><attrname="column_count"format="integer" /><attrname="column_count_portrait"format="integer" /><attrname="column_count_landscape"format="integer" /><attrname="item_margin"format="dimension" /><attrname="grid_paddingLeft"format="dimension" /><attrname="grid_paddingRight"format="dimension" /><attrname="grid_paddingTop"format="dimension" /><attrname="grid_paddingBottom"format="dimension" /></declare-styleable>
to your own attires.xml
then in the error file import your own com.example.example in the R.
Post a Comment for "Use Etsy's Staggeredgridview In Eclipse"