Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Updated] Formatted sample code in Readme.md #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ dependencies {

The sample app has all but if you want quick tip,


```
```xml
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -75,13 +74,15 @@ The sample app has all but if you want quick tip,

```

In your activity or fragment,
```
CurvedBottomSheet(view = bottom_sheet,
shape = CurvedBottomSheet.Shape.Concave,
location = CurvedBottomSheet.Location.BOTTOM,
type = CurvedBottomSheet.Type.CURVE)
.init()
In your activity or fragment,

```kotlin
CurvedBottomSheet(
view = bottom_sheet,
shape = CurvedBottomSheet.Shape.Concave,
location = CurvedBottomSheet.Location.BOTTOM,
type = CurvedBottomSheet.Type.CURVE
).init()
```

### Parameters
Expand Down Expand Up @@ -111,13 +112,14 @@ Explanation of app:fillColor | Explanation of app:showControlPoints
This bonus part has already implemented in [WavedActivity](https://github.com/TayfunCesur/CurvedBottomSheet/blob/master/app/src/main/java/com/tayfuncesur/curvedbottomsheetdemo/WavedActivity.kt)

If you pass the [Callback](https://github.com/TayfunCesur/CurvedBottomSheet/blob/master/lib/src/main/java/com/tayfuncesur/curvedbottomsheet/Callback.kt) parameter to CurvedBottomSheet, you gonna have
```
object : Callback {
override fun onSlide(p0: View, p1: Float) {
// Here you can play alpha with p1 value.
contentLayout.alpha = p1
dolphinLayout.alpha = 1 - p1
}

```kotlin
object : Callback {
override fun onSlide(p0: View, p1: Float) {
// Here you can play alpha with p1 value.
contentLayout.alpha = p1
dolphinLayout.alpha = 1 - p1
}
```

### Useful Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ class CurvedLayout @JvmOverloads constructor(
with(mPaint) {
style = Paint.Style.FILL_AND_STROKE
color = fillColor
isAntiAlias = true
}
with(circlePaint) {
style = Paint.Style.FILL_AND_STROKE
color = Color.parseColor("#4caf50")
isAntiAlias = true
}
}

Expand Down