Overview
now the development tools are basically used androidstudio. The open source framework is also available online. For example, do waterfall UI Staggeredgridview, as well as navigation page Pagerslidingtabstrip and so on.
So the computer performance is not good, still using eclipse how to use these open source framework?
Steps
Preparatory work
Download the corresponding frame as Staggeredgridview in Https://github.com/maurycyw/StaggeredGridView.
Unzip the end. The required resources are the following: three Java files under Staggeredgridview-master\src\com\origamilabs\library\views;
Staggeredgridview-master\res\values's Attrs.xml
Steps:
1. Open the Androidmanifest.xml under Staggeredgridview and copy the android:allowbackup= "true" to the corresponding location in your project.
2. If your project res/values without attrs.xml, then paste this in Staggeredgridview directly in your folder. If you already exist there
This file, then copy the code into your attrs.xml. Be aware of the custom property name here, and so on the reference is used here (it is possible and online information Staggeredgridview attribute name is not the same, do not directly copy the code, the wrong do not know)
<declare-styleablename= "Staggeredgridview"> <attrname= "Drawselectorontop"format= "Boolean" /> <attrname= "NumColumns"format= "integer" /> <attrname= "Itemmargin"format= "Dimension" /> </declare-styleable>
3. Copy the Java file to your project (note that the three files are copied to the package with the same package name as your androidmanifest.xml, so you will not be prompted to find the resource when you define the view configuration XML)
The next three files, such as Scrollercompat.java, will prompt an error. Just change the package name to your project. Staggeredgridview.java also has an import COM.ORIGAMILABS.LIBRARY.R; error, just remove this right.
4. Finally, you can use it in the layout file. You should also bring the package name when you add it. You can directly right-click on the blue selected file and then tap copy qualified name. The full name is copied.
Like mine is.
< com. Mihai.text.StaggeredGridView android:id= "@+id/stagger_view" Android:layout_ Width= "Match_parent" android:layout_height= "Match_parent" App : itemmargin= "8DP" app:numcolumns= "2" > </ com. Mihai.text.StaggeredGridView>
Postscript
To start with Android, don't be fooled by the word frame, just copy all of its relevant code to our project, including configuration files, custom attributes, etc. Of course there will be errors, common is the package name and XXX. R file is wrong, just import your own on it. There is a Android.support.v4.jar package error, prompt import XXX error. It may be the wrong version because the V4 support package is also available in different versions with the latest.
How to use Staggeredgridview in eclipse