Skip to content

Commit

Permalink
Merge pull request #3 from Deishelon/development
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
Deishelon authored Jan 21, 2019
2 parents f7f125a + 1193060 commit b4b3334
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ allprojects {
#### Step 2. Add the dependency
```gradle
dependencies {
implementation 'com.github.Deishelon:RoundedBottomSheet:1.0.0'
implementation 'com.github.Deishelon:RoundedBottomSheet:1.0.1'
}
```

## Usage
## Usage - DialogFragment

Simply extend `RoundedBottomSheetDialogFragment`, inflate your layout and show it

### Usage - Example
#### Example

```kotlin
import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment
Expand All @@ -40,11 +40,19 @@ class MyRoundedBottomSheet: RoundedBottomSheetDialogFragment(){
}
```

To show your bottom sheet:
## Usage - Dialog

Simply extend or create an instance of `RoundedBottomSheetDialog` , inflate your layout and show it

#### Example

```kotlin
val myRoundedBottomSheet = MyRoundedBottomSheet()
myRoundedBottomSheet.show(supportFragmentManager, myRoundedBottomSheet.tag)
import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialog

val mBottomSheetDialog = RoundedBottomSheetDialog(context!!)
val sheetView = layoutInflater.inflate(R.layout.dialog_2_my_rounded_bottom_sheet, null)
mBottomSheetDialog.setContentView(sheetView)
mBottomSheetDialog.show()
```

## Customization
Expand All @@ -64,3 +72,5 @@ To change default values, just override the recourse you wish, like so:
| @color/roundedBottomSheetPrimaryNavigationBarColor | Navigation bar colour | #FFFFFFFF |
| @dimen/roundedBottomSheetCornerRadius | Bottom sheet corner radius | 16dp |
| @dimen/roundedBottomSheetCornerRadiusTopPadding | Top padding | 8dp |
| @dimen/roundedBottomSheetCornerRadiusLeftPadding | Left padding | 8dp |
| @dimen/roundedBottomSheetCornerRadiusRightPadding | Right padding | 8dp |
6 changes: 3 additions & 3 deletions roundedbottomsheet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group = 'com.github.Deishelon'
version = '1.0.0'
version = '1.0.1'

android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
versionCode 2
versionName version
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.deishelon.roundedbottomsheet

import android.content.Context
import android.support.design.widget.BottomSheetDialog

open class RoundedBottomSheetDialog(context: Context) : BottomSheetDialog(context, R.style.BottomSheetDialogTheme)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<corners
android:topLeftRadius="@dimen/roundedBottomSheetCornerRadius"
android:topRightRadius="@dimen/roundedBottomSheetCornerRadius" />
<padding android:top="@dimen/roundedBottomSheetCornerRadiusTopPadding" />
<padding
android:top="@dimen/roundedBottomSheetCornerRadiusTopPadding"
android:left="@dimen/roundedBottomSheetCornerRadiusLeftPadding"
android:right="@dimen/roundedBottomSheetCornerRadiusRightPadding" />
<solid android:color="@color/roundedBottomSheetPrimaryBackground" />
</shape>
2 changes: 2 additions & 0 deletions roundedbottomsheet/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
<resources>
<dimen name="roundedBottomSheetCornerRadius">16dp</dimen>
<dimen name="roundedBottomSheetCornerRadiusTopPadding">8dp</dimen>
<dimen name="roundedBottomSheetCornerRadiusLeftPadding">8dp</dimen>
<dimen name="roundedBottomSheetCornerRadiusRightPadding">8dp</dimen>
</resources>

0 comments on commit b4b3334

Please sign in to comment.