Skip to content

Commit e6986b0

Browse files
authored
Update README.md
1 parent 5dbbc8c commit e6986b0

File tree

1 file changed

+39
-5
lines changed

1 file changed

+39
-5
lines changed

README.md

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
```gradle
1717
// module's build.gradle
1818
dependencies {
19-
implementation "com.holix.android:bottomsheetdialog-compose:1.0.1"
19+
implementation "com.holix.android:bottomsheetdialog-compose:1.0.3"
2020
}
2121
```
2222
## Usage
23+
You can use BottomSheetDialog composable like Dialog composable! It is super simple 😎
2324
```kotlin
2425
@Composable
2526
fun YourComposable() {
@@ -32,10 +33,7 @@ fun YourComposable() {
3233
show = false
3334
},
3435
properties = BottomSheetDialogProperties(
35-
dismissOnBackPress = true,
36-
dismissOnClickOutside = true,
37-
dismissWithAnimation = false,
38-
navigationBarColor = Color.Unspecified
36+
...
3937
)
4038
) {
4139
// content
@@ -47,6 +45,42 @@ fun YourComposable() {
4745
}
4846

4947
```
48+
## BottomSheetDialogProperties
49+
|name|default value|type|
50+
|--|--|--|
51+
|dismissOnBackPress|true|Boolean|
52+
|dismissOnClickOutside|true|Boolean|
53+
|dismissWithAnimation|false|Boolean|
54+
|navigationBarProperties|NavigationBarProperties()|NavigationBarProperties|
55+
|behaviorProperties|BottomSheetBehaviorProperties()|BottomSheetBehaviorProperties|
56+
57+
### NavigationBarProperties
58+
inspired by [accompanist's SystemUiController](https://github.com/google/accompanist/blob/353be641be03ffed5dc2a89efc6fdcb0e6fe65b1/systemuicontroller/src/main/java/com/google/accompanist/systemuicontroller/SystemUiController.kt#L97-L119)
59+
60+
|name|default value|type|
61+
|--|--|--|
62+
|color|Color.Unspecified|Color|
63+
|darkIcons|color.luminance() > 0.5f|Boolean|
64+
|navigationBarContrastEnforced|true|Boolean|
65+
|transformColorForLightContent|{ original -> Color(0f, 0f, 0f, 0.3f).compositeOver(original) }|(Color) -> Color|
66+
67+
### BottomSheetBehaviorProperties
68+
[BottomSheetBehavior official docs](https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior)
69+
70+
|name|default value|type|
71+
|--|--|--|
72+
|state|State.Collapsed|[State](https://github.com/holixfactory/bottomsheetdialog-compose/blob/5dbbc8cb1ef4b9ec27d4181e87d3136dd2915216/bottomsheetdialog-compose/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/BottomSheetDialog.kt#L156)|
73+
|maxWidth|Size.NotSet|[Size](https://github.com/holixfactory/bottomsheetdialog-compose/blob/5dbbc8cb1ef4b9ec27d4181e87d3136dd2915216/bottomsheetdialog-compose/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/BottomSheetDialog.kt#L167)|
74+
|maxHeight|Size.NotSet|[Size](https://github.com/holixfactory/bottomsheetdialog-compose/blob/5dbbc8cb1ef4b9ec27d4181e87d3136dd2915216/bottomsheetdialog-compose/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/BottomSheetDialog.kt#L167)|
75+
|isDraggable|true|Boolean|
76+
|expandedOffset|0|Integer|
77+
|halfExpandedRatio|0.5F|Float|
78+
|isHideable|true|Boolean|
79+
|peekHeight|PeekHeight.Auto|[PeekHeight](https://github.com/holixfactory/bottomsheetdialog-compose/blob/5dbbc8cb1ef4b9ec27d4181e87d3136dd2915216/bottomsheetdialog-compose/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/BottomSheetDialog.kt#L177)|
80+
|isFitToContents|true|Boolean|
81+
|skipCollapsed|false|Boolean|
82+
|isGestureInsetBottomIgnored|false|Boolean|
83+
5084
## Additional Information
5185
- This library depends on [material-components-android(BottomSheetDialog)](https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/bottomsheet/BottomSheetDialog.java).
5286

0 commit comments

Comments
 (0)