@@ -28,7 +28,7 @@ Download the sample apk [here](https://github.com/marcoscgdev/DialogSheet/releas
2828
2929Add this to your root * build.gradle* file:
3030
31- ```
31+ ``` groovy
3232allprojects {
3333 repositories {
3434 ...
@@ -39,15 +39,15 @@ allprojects {
3939
4040Now add the dependency to your app build.gradle file:
4141
42- ```
42+ ``` groovy
4343implementation 'com.github.marcoscgdev:DialogSheet:2.1.2'
4444```
4545
4646### Creating the dialog
4747
4848Here is a complete snippet of it usage:
4949
50- ``` java
50+ ``` kotlin
5151val dialogSheet = DialogSheet (this )
5252 .setTitle(R .string.app_name)
5353 .setMessage(R .string.lorem)
@@ -72,7 +72,7 @@ val dialogSheet = DialogSheet(this)
7272
7373Simply use the new _ DialogSheet2_ class:
7474
75- ``` java
75+ ``` kotlin
7676val dialogSheet = DialogSheet2 (this )
7777 .. .
7878 .. .
@@ -81,7 +81,7 @@ val dialogSheet = DialogSheet2(this)
8181
8282Or add a new boolean-type argument to the dialog constructor:
8383
84- ``` java
84+ ``` kotlin
8585val dialogSheet = DialogSheet2 (this , true )
8686 .. .
8787 .. .
@@ -92,11 +92,11 @@ val dialogSheet = DialogSheet2(this, true)
9292
9393You 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