From d1edfdd0bca7a6d2058d2c7c6539157af18025ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Calvo=20Garc=C3=ADa?= Date: Thu, 17 Sep 2020 19:02:54 +0200 Subject: [PATCH] Functional interfaces were added --- .idea/caches/build_file_checksums.ser | Bin 591 -> 591 bytes .idea/codeStyles/Project.xml | 18 ++++++++++++++++++ .idea/jarRepositories.xml | 5 +++++ app/build.gradle | 2 +- .../dialogsheetsample/MainActivity.kt | 8 +++----- dialogsheet/build.gradle | 2 +- .../com/marcoscg/dialogsheet/DialogSheet.kt | 6 +++--- 7 files changed, 31 insertions(+), 10 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 8f0ea94d294123dde9d6b896f6bcd13dacdd1925..ba6743276f4bae93ca3ff52144e1af1586b0f5da 100644 GIT binary patch delta 56 zcmV-80LTB&1kVJJm;{{cy}yy1cM!H_&Gzn+74&fYPhgmKo^X>R0hbVEMD-n{OyX8( OQ5b9~`}lN|$^nHtVH_I( delta 56 zcmV-80LTB&1kVJJm;?jyQmc`icMy#GRzQlfa&{dsj}J0*26&Sr0hbU|c?@vRYI4m2 O{`IybFO5r+$^nI)E*GEx diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 681f41a..0d15693 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,5 +1,23 @@ + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 6811f8c..323975d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,7 +26,7 @@ dependencies { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.2.0' + implementation 'com.google.android.material:material:1.2.1' implementation project(':dialogsheet') testImplementation 'junit:junit:4.12' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" diff --git a/app/src/main/java/com/marcoscg/dialogsheetsample/MainActivity.kt b/app/src/main/java/com/marcoscg/dialogsheetsample/MainActivity.kt index 6b672e1..8c64cde 100644 --- a/app/src/main/java/com/marcoscg/dialogsheetsample/MainActivity.kt +++ b/app/src/main/java/com/marcoscg/dialogsheetsample/MainActivity.kt @@ -31,11 +31,9 @@ class MainActivity : AppCompatActivity() { .setMessage(R.string.lorem) .setSingleLineTitle(true) .setColoredNavigationBar(true) //.setButtonsColorRes(R.color.colorAccent) // You can use dialogSheetAccent style attribute instead - .setPositiveButton(android.R.string.ok, object: DialogSheet.OnPositiveClickListener { - override fun onClick(v: View?) { - Toast.makeText(this@MainActivity, "Positive button clicked!", Toast.LENGTH_SHORT).show() - } - }) + .setPositiveButton(android.R.string.ok) { + Toast.makeText(this@MainActivity, "Positive button clicked!", Toast.LENGTH_SHORT).show() + } .setNegativeButton(android.R.string.cancel) .setNeutralButton("Neutral") //.setNeutralButtonColor(Color.BLACK) diff --git a/dialogsheet/build.gradle b/dialogsheet/build.gradle index 34ef062..eb77575 100644 --- a/dialogsheet/build.gradle +++ b/dialogsheet/build.gradle @@ -22,6 +22,6 @@ android { dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.2.0' + implementation 'com.google.android.material:material:1.2.1' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/dialogsheet/src/main/java/com/marcoscg/dialogsheet/DialogSheet.kt b/dialogsheet/src/main/java/com/marcoscg/dialogsheet/DialogSheet.kt index 4dffe4f..b057c21 100644 --- a/dialogsheet/src/main/java/com/marcoscg/dialogsheet/DialogSheet.kt +++ b/dialogsheet/src/main/java/com/marcoscg/dialogsheet/DialogSheet.kt @@ -56,15 +56,15 @@ class DialogSheet(private val context: Context, private val useNewStyle: Boolean var inflatedView: View? = null private set - interface OnPositiveClickListener { + fun interface OnPositiveClickListener { fun onClick(v: View?) } - interface OnNegativeClickListener { + fun interface OnNegativeClickListener { fun onClick(v: View?) } - interface OnNeutralClickListener { + fun interface OnNeutralClickListener { fun onClick(v: View?) }