Skip to content Skip to sidebar Skip to footer

Use Etsy's Staggeredgridview In Eclipse

I wanted to use Etsy's StaggeredGridView in a project of mine on Eclipse. Their gitHub page doesn't provide instructions to import/setup their project in Eclipse. If anyone has suc

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):

  1. Download zip file from Github, unzip, and open project folder --> library --> src --> main

  2. Copy all 3 files there: AndroidManifest and the res and src folders

  3. Start new project in Eclipse: File --> New --> Android Application Project

  4. Create project name, select API levels, etc.. click Next

  5. Unclick Create custom icon launcher and Create activity

  6. Click Mark this project as library (if to be used as a library)

  7. Click Finish

  8. Select project title in Package Explorer, then paste those 3 files into there (click "yes to all" to override)

  9. (optional) If importing as a library, right click your main project's name, go to Properties --> Android

  10. At bottom of popup find "Add" button, select your newly imported library, click ok

  11. 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"