Skip to content

Commit dd7dcfb

Browse files
authored
Update README.md
1 parent e1bedbc commit dd7dcfb

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Download the sample apk [here](https://github.com/marcoscgdev/DialogSheet/releas
2828

2929
Add this to your root *build.gradle* file:
3030

31-
```
31+
```groovy
3232
allprojects {
3333
repositories {
3434
...
@@ -39,15 +39,15 @@ allprojects {
3939

4040
Now add the dependency to your app build.gradle file:
4141

42-
```
42+
```groovy
4343
implementation 'com.github.marcoscgdev:DialogSheet:2.1.2'
4444
```
4545

4646
### Creating the dialog
4747

4848
Here is a complete snippet of it usage:
4949

50-
```java
50+
```kotlin
5151
val dialogSheet = DialogSheet(this)
5252
.setTitle(R.string.app_name)
5353
.setMessage(R.string.lorem)
@@ -72,7 +72,7 @@ val dialogSheet = DialogSheet(this)
7272

7373
Simply use the new _DialogSheet2_ class:
7474

75-
```java
75+
```kotlin
7676
val dialogSheet = DialogSheet2(this)
7777
...
7878
...
@@ -81,7 +81,7 @@ val dialogSheet = DialogSheet2(this)
8181

8282
Or add a new boolean-type argument to the dialog constructor:
8383

84-
```java
84+
```kotlin
8585
val dialogSheet = DialogSheet2(this, true)
8686
...
8787
...
@@ -92,11 +92,11 @@ val dialogSheet = DialogSheet2(this, true)
9292

9393
You can do it programmatically
9494

95-
```java
95+
```kotlin
9696
.setButtonsColorRes(R.color.colorPrimary)
9797
```
9898

99-
```java
99+
```kotlin
100100
.setPositiveButtonColorRes(R.color.colorPrimary)
101101
.setNegativeButtonColorRes(R.color.colorNegative)
102102
.setNeutralButtonColorRes(R.color.colorNeutral)
@@ -120,19 +120,19 @@ Simply override this dimen with your desired size
120120

121121
- Via inflated view:
122122

123-
```java
124-
View view = View.inflate(context, R.layout.custom_dialog_view, null);
125-
dialogSheet.setView(view);
123+
```kotlin
124+
val view = View.inflate(context, R.layout.custom_dialog_view, null)
125+
dialogSheet.setView(view)
126126
```
127127

128128
- Via layout resource:
129129

130-
```java
131-
dialogSheet.setView(R.layout.custom_dialog_view);
130+
```kotlin
131+
dialogSheet.setView(R.layout.custom_dialog_view)
132132

133133
// Access dialog custom inflated view
134-
View inflatedView = dialogSheet.getInflatedView();
135-
Button button = (Button) inflatedView.findViewById(R.id.customButton);
134+
val inflatedView = dialogSheet.getInflatedView()
135+
val button = inflatedView.findViewById(R.id.customButton)
136136
...
137137
```
138138

0 commit comments

Comments
 (0)