Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersantos authored Aug 29, 2016
1 parent db6f56a commit a920a00
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ And add the library to your module **build.gradle**:

```Javascript
dependencies {
compile 'com.github.javiersantos:BottomDialogs:1.1'
compile 'com.github.javiersantos:BottomDialogs:1.2'
}
```

Expand Down Expand Up @@ -75,7 +75,7 @@ new BottomDialog.Builder(this)
```

### Adding buttons and callbacks
Buttons are showed at the end of the bottom dialog. You can add your own text and actions/callbacks.
Buttons are showed at the end of the bottom dialog. You can add your own text, colors and actions/callbacks.

```Java
new BottomDialog.Builder(this)
Expand All @@ -87,7 +87,12 @@ new BottomDialog.Builder(this)
public void onClick(BottomDialog dialog) {
Log.d("BottomDialogs", "Do something!");
}
}).show();
})
.setPositiveBackgroundColorResource(R.color.colorPrimary)
//.setPositiveBackgroundColor(ContextCompat.getColor(this, R.color.colorPrimary)
.setPositiveTextColorResource(android.R.color.white)
//.setPositiveTextColor(ContextCompat.getColor(this, android.R.color.colorPrimary)
.show();
```

```Java
Expand All @@ -100,11 +105,16 @@ new BottomDialog.Builder(this)
public void onClick(BottomDialog dialog) {
Log.d("BottomDialogs", "Do something!");
}
}).show();
})
.setNegativeTextColorResource(R.color.colorAccent)
//.setNegativeTextColor(ContextCompat.getColor(this, R.color.colorAccent)
.show();
```

If no `onPositive()` or `onNegative()` callbacks are provided, then the bottom dialog will be dismissed when tapping de button.

If `autoDismiss()` is turned `false`, then you must manually dismiss the dialog in these callbacks. Auto dismiss is `true` by default.

### Dismissing when touching outside
The `setCancelable()` method lets you disable dismissing the bottom dialog when you tap outside the dialog window.

Expand Down

0 comments on commit a920a00

Please # to comment.