Skip to content

Commit d1edfdd

Browse files
committed
Functional interfaces were added
1 parent d1eeea4 commit d1edfdd

File tree

7 files changed

+31
-10
lines changed

7 files changed

+31
-10
lines changed
0 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
exclude group: 'com.android.support', module: 'support-annotations'
2727
})
2828
implementation 'androidx.appcompat:appcompat:1.2.0'
29-
implementation 'com.google.android.material:material:1.2.0'
29+
implementation 'com.google.android.material:material:1.2.1'
3030
implementation project(':dialogsheet')
3131
testImplementation 'junit:junit:4.12'
3232
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

app/src/main/java/com/marcoscg/dialogsheetsample/MainActivity.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ class MainActivity : AppCompatActivity() {
3131
.setMessage(R.string.lorem)
3232
.setSingleLineTitle(true)
3333
.setColoredNavigationBar(true) //.setButtonsColorRes(R.color.colorAccent) // You can use dialogSheetAccent style attribute instead
34-
.setPositiveButton(android.R.string.ok, object: DialogSheet.OnPositiveClickListener {
35-
override fun onClick(v: View?) {
36-
Toast.makeText(this@MainActivity, "Positive button clicked!", Toast.LENGTH_SHORT).show()
37-
}
38-
})
34+
.setPositiveButton(android.R.string.ok) {
35+
Toast.makeText(this@MainActivity, "Positive button clicked!", Toast.LENGTH_SHORT).show()
36+
}
3937
.setNegativeButton(android.R.string.cancel)
4038
.setNeutralButton("Neutral")
4139
//.setNeutralButtonColor(Color.BLACK)

dialogsheet/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ android {
2222

2323
dependencies {
2424
implementation 'androidx.appcompat:appcompat:1.2.0'
25-
implementation 'com.google.android.material:material:1.2.0'
25+
implementation 'com.google.android.material:material:1.2.1'
2626
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2727
}

dialogsheet/src/main/java/com/marcoscg/dialogsheet/DialogSheet.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ class DialogSheet(private val context: Context, private val useNewStyle: Boolean
5656
var inflatedView: View? = null
5757
private set
5858

59-
interface OnPositiveClickListener {
59+
fun interface OnPositiveClickListener {
6060
fun onClick(v: View?)
6161
}
6262

63-
interface OnNegativeClickListener {
63+
fun interface OnNegativeClickListener {
6464
fun onClick(v: View?)
6565
}
6666

67-
interface OnNeutralClickListener {
67+
fun interface OnNeutralClickListener {
6868
fun onClick(v: View?)
6969
}
7070

0 commit comments

Comments
 (0)