Skip to content

Commit 0813bbc

Browse files
authored
Update README.md
1 parent e1c3bbe commit 0813bbc

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

README.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
# How to prepare a new library:
2-
1. Rename module
3-
2. Rename package
4-
3. Find all other instances of "ceribelibname" (Ctrl + F) and rename them
5-
4. Prepare README.md and remove this list
6-
7-
Here add jitpack badge
1+
[![](https://jitpack.io/v/ceribe/compose-overflow-menu.svg)](https://jitpack.io/#ceribe/compose-overflow-menu)
82

93
# Overflow Menu
10-
Here short description and screenshots/gifs
4+
Android library for Jetpack Compose providing an Overflow Menu via fast and easy to use DSL.
5+
6+
<img src="art/Sample1.gif" width="250"/>
117

128
# How to add to project
139
### Step 1. Add the JitPack repository to your build file
@@ -23,12 +19,39 @@ Add it in your root build.gradle at the end of repositories:
2319
### Step 2. Add the dependency
2420
```gradle
2521
dependencies {
26-
Here place dependency provided by jitpack
22+
implementation 'com.github.ceribe:compose-overflow-menu:1.0'
2723
}
2824
```
2925

3026
# How to use
31-
Here add some sample code
27+
```kotlin
28+
OverflowMenu {
29+
shownIconsCount = 2 //How many icons will be shown on top app bar, rest will be hidden under overflow icon
30+
icons {
31+
icon {
32+
imageVector = Icons.Filled.Edit
33+
onClick = { context.toast("First Icon Clicked") }
34+
}
35+
icon {
36+
imageVector = Icons.Filled.Delete
37+
onClick = { context.toast("Second Icon Clicked") }
38+
}
39+
icon {
40+
label = "Third Example"
41+
onClick = { context.toast("Third Icon Clicked") }
42+
}
43+
}
44+
//Default values for icons. If icon does not have some parameter set it will use the one from defaults
45+
defaults {
46+
tint = Color.Red
47+
}
48+
//Parameters for overflow icon
49+
overflowIcon {
50+
tint = Color.Yellow
51+
}
52+
}
53+
```
54+
For more in examples check [here](https://github.com/ceribe/compose-overflow-menu/blob/master/sample/src/main/java/com/ceribe/compose/sample/MainActivity.kt)
3255

3356
# License
3457
```

0 commit comments

Comments
 (0)