Skip to content
This repository was archived by the owner on Mar 27, 2022. It is now read-only.

Commit 3fd6031

Browse files
authored
Update README.md
1 parent 2f9bf9d commit 3fd6031

1 file changed

Lines changed: 77 additions & 1 deletion

File tree

README.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,77 @@
1-
# FitGridView
1+
# FitGridView,
2+
3+
![poster](https://cloud.githubusercontent.com/assets/20969019/21449819/b230b9a4-c8f9-11e6-8620-7a2297f96d71.png)
4+
5+
##Preview
6+
![preview](https://cloud.githubusercontent.com/assets/20969019/21449604/9b90ceac-c8f7-11e6-9c32-3c94b24f8e15.gif)
7+
8+
9+
## Installation
10+
11+
#### Gradle
12+
13+
Add it to your build.gradle with:
14+
```gradle
15+
allprojects {
16+
repositories {
17+
maven { url "https://jitpack.io" }
18+
}
19+
}
20+
```
21+
and:
22+
23+
```gradle
24+
dependencies {
25+
compile 'com.github.ceryle:FitGridView:v1.0'
26+
}
27+
```
28+
29+
## Customization
30+
31+
### Some Attributes
32+
33+
#### Segmented Button
34+
| Option Name | Format | Description |
35+
| ---------------- | ---------------------- | ----------------------------- |
36+
| app:row | `integer` | number of rows |
37+
| app:column | `integer` | number of colums |
38+
39+
40+
41+
#### Examples
42+
43+
##### In Xml Layout
44+
```xml
45+
<co.ceryle.fitgridview.FitGridView
46+
android:id="@+id/gridView"
47+
android:layout_width="match_parent"
48+
android:layout_height="match_parent"
49+
android:listSelector="@android:color/transparent"
50+
app:column="3"
51+
app:row="4"/>
52+
```
53+
54+
##### In Java
55+
```java
56+
@Override
57+
protected void onCreate(Bundle savedInstanceState) {
58+
super.onCreate(savedInstanceState);
59+
setContentView(R.layout.activity_main);
60+
61+
gridView = (FitGridView) findViewById(R.id.gridView);
62+
gridView.setFitGridAdapter(new Adapter(this));
63+
64+
// you can change grid view size any time. don't forget calling update method.
65+
changeSize(4, 4);
66+
}
67+
68+
private void changeSize(int r, int c) {
69+
gridView.setRow(r);
70+
gridView.setColumn(c);
71+
gridView.update();
72+
}
73+
```
74+
75+
## License
76+
77+
This project is licensed under the Apache License Version 2.0 - see the [LICENSE.md](LICENSE.md) file for details

0 commit comments

Comments
 (0)