Skip to content

Commit 48cb1e5

Browse files
committed
Add README.md
1 parent 40e6bdb commit 48cb1e5

File tree

3 files changed

+144
-1
lines changed

3 files changed

+144
-1
lines changed

README.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
<!-- TODO: fix url -->
2+
[![header](./header.png)](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=cardslider-android-logo)
3+
4+
# CircleMenu for Android
5+
[![Twitter](https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat)](http://twitter.com/Ramotion)
6+
7+
<!-- TODO: fix urls -->
8+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/42eb7b00b93645c0812c045ab26cb3b7)](https://www.codacy.com/app/andreylos/cardslider-android?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Ramotion/cardslider-android&amp;utm_campaign=Badge_Grade)
9+
[![CircleCI](https://circleci.com/gh/Ramotion/cardslider-android/tree/master.svg?style=svg)](https://circleci.com/gh/Ramotion/cardslider-android/tree/master)
10+
11+
## About
12+
This project is maintained by Ramotion, Inc.<br>
13+
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.<br><br>**Looking for developers for your project?**
14+
15+
<!-- TODO: fix url -->
16+
<a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=cardslider-android-contact-us/#Get_in_Touch" > <img src="https://github.com/Ramotion/navigation-stack/raw/master/contact_our_team@2x.png" width="150" height="30"></a>
17+
18+
<!-- TODO: add preview.gif -->
19+
![Animation](./preview.gif)
20+
21+
<!-- TODO: fix url -->
22+
The [Android mockup](https://store.ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=cardslider-android) available [here](https://store.ramotion.com/product/htc-one-a9-mockups?utm_source=gthb&utm_medium=special&utm_campaign=cardslider-android).
23+
24+
## Requirements
25+
26+
- Android 4.4 KitKat (API lvl 19) or greater
27+
- Your favorite IDE
28+
29+
## Installation
30+
31+
<!-- TODO: add url -->
32+
Just download the package from [here]() and add it to your project classpath, or just use the maven repo:
33+
34+
<!-- TODO: add package -->
35+
Gradle:
36+
```groovy
37+
'com.ramotion.?'
38+
```
39+
SBT:
40+
```scala
41+
libraryDependencies += "?"
42+
```
43+
Maven:
44+
```xml
45+
<dependency>
46+
<groupId>com.ramotion.?</groupId>
47+
<artifactId>?</artifactId>
48+
<version>?</version>
49+
</dependency>
50+
```
51+
52+
53+
## Basic usage
54+
55+
Place the `CircleMenuView` in your layout and set the icons and colors of the buttons, as shown below.
56+
```xml
57+
app:button_colors="@array/colors"
58+
app:button_icons="@array/icons"
59+
```
60+
61+
Example of arrays `colors` and `icons` in `res\values\buttons.xml`:
62+
```xml
63+
<?xml version="1.0" encoding="utf-8"?>
64+
<resources>
65+
<array name="icons">
66+
<item>@drawable/ic_home_white_24dp</item>
67+
<item>@drawable/ic_search_white_24dp</item>
68+
<item>@drawable/ic_notifications_white_24dp</item>
69+
<item>@drawable/ic_settings_white_24dp</item>
70+
<item>@drawable/ic_place_white_24dp</item>
71+
</array>
72+
<array name="colors">
73+
<item>@android:color/holo_blue_light</item>
74+
<item>@android:color/holo_green_dark</item>
75+
<item>@android:color/holo_red_light</item>
76+
<item>@android:color/holo_purple</item>
77+
<item>@android:color/holo_orange_light</item>
78+
</array>
79+
</resources>
80+
```
81+
82+
Or use the constructor
83+
`CircleMenuView(@NonNull Context context, @NonNull List<Integer> icons, @NonNull List<Integer> colors)`,
84+
to add `CircleMenuView` and configure the buttons programmatically (in the code).
85+
86+
Next, connect the event handler `CircleMenuView.EventListener` as shown below,
87+
and override the methods you need.
88+
89+
```java
90+
final CircleMenuView menu = (CircleMenuView) findViewById(R.id.circle_menu);
91+
menu.setEventListener(new CircleMenuView.EventListener() {
92+
@Override
93+
public void onMenuOpenAnimationStart(@NonNull CircleMenuView view) {
94+
Log.d("D", "onMenuOpenAnimationStart");
95+
}
96+
97+
@Override
98+
public void onMenuOpenAnimationEnd(@NonNull CircleMenuView view) {
99+
Log.d("D", "onMenuOpenAnimationEnd");
100+
}
101+
102+
@Override
103+
public void onMenuCloseAnimationStart(@NonNull CircleMenuView view) {
104+
Log.d("D", "onMenuCloseAnimationStart");
105+
}
106+
107+
@Override
108+
public void onMenuCloseAnimationEnd(@NonNull CircleMenuView view) {
109+
Log.d("D", "onMenuCloseAnimationEnd");
110+
}
111+
112+
@Override
113+
public void onButtonClickAnimationStart(@NonNull CircleMenuView view, int index) {
114+
Log.d("D", "onButtonClickAnimationStart| index: " + index);
115+
}
116+
117+
@Override
118+
public void onButtonClickAnimationEnd(@NonNull CircleMenuView view, int index) {
119+
Log.d("D", "onButtonClickAnimationEnd| index: " + index);
120+
}
121+
});
122+
```
123+
124+
Here are the attributes you can specify through XML or related setters:
125+
*`button_icons` - Array of buttons icons.
126+
*`button_colors` - Array of buttons colors.
127+
*`icon_menu` - Menu default icon.
128+
*`icon_close` - Menu closed icon.
129+
*`icon_color` - Menu icon color.
130+
*`duration_ring` - Ring effect duration.
131+
*`duration_open` - Menu opening animation duration.
132+
*`duration_close` - Menu closing animation duration.
133+
*`distance` - Distance between center button and buttons
134+
135+
## License
136+
137+
CircleMenu for Android is released under the MIT license.
138+
See [LICENSE](./LICENSE.md) for details.
139+
140+
## Follow us
141+
142+
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/Ramotion/circle-menu-android)
143+
[![Twitter Follow](https://img.shields.io/twitter/follow/ramotion.svg?style=social)](https://twitter.com/ramotion)

circle-menu-simple-example/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
app:layout_constraintHorizontal_bias="0.5"
1717
app:layout_constraintLeft_toLeftOf="parent"
1818
app:layout_constraintRight_toRightOf="parent"
19-
app:layout_constraintTop_toTopOf="parent" />
19+
app:layout_constraintTop_toTopOf="parent"/>
2020

2121
</android.support.constraint.ConstraintLayout>

header.png

19.2 KB
Loading

0 commit comments

Comments
 (0)