From 83e8ab36f7f134883cf434257d43b40b29026923 Mon Sep 17 00:00:00 2001 From: germainkevinbusiness <67168053+kevingermainbusiness@users.noreply.github.com> Date: Wed, 5 Jan 2022 00:08:30 -0500 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=9A=80=20Added=20support=20for=20Java?= =?UTF-8?q?=208=20=E2=9C=A8=20Added=20support=20for=20Android=20SDK=2031?= =?UTF-8?q?=20=F0=9F=98=84=20Updated=20dependencies=20to=20the=20latest=20?= =?UTF-8?q?stable=20versions=20=F0=9F=91=8C=20Tested=20the=20whole=20proje?= =?UTF-8?q?ct=20in=20portrait=20&=20landscape=20mode=20on=20an=20Android?= =?UTF-8?q?=20Studio=20Emulator=20&=20it=20works=20just=20fine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MaterialDialogLibrary/build.gradle | 28 +++++++++++++----------- app/build.gradle | 21 +++++++++++------- app/src/main/AndroidManifest.xml | 4 +++- build.gradle | 5 +---- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 33 insertions(+), 27 deletions(-) diff --git a/MaterialDialogLibrary/build.gradle b/MaterialDialogLibrary/build.gradle index c644a33..c3012a0 100644 --- a/MaterialDialogLibrary/build.gradle +++ b/MaterialDialogLibrary/build.gradle @@ -1,14 +1,12 @@ apply plugin: 'com.android.library' +apply plugin: 'com.vanniktech.maven.publish' android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { minSdkVersion 19 - targetSdkVersion 30 - versionCode 2 - versionName VERSION_NAME - + targetSdkVersion 31 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -20,23 +18,27 @@ android { } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'androidx.annotation:annotation:1.2.0' + implementation 'androidx.appcompat:appcompat:1.4.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.2' + implementation 'androidx.annotation:annotation:1.3.0' // Material Design Library - implementation 'com.google.android.material:material:1.3.0' + implementation 'com.google.android.material:material:1.4.0' // Lottie Animation Library implementation 'com.airbnb.android:lottie:3.7.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.2.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:runner:1.4.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } -apply plugin: 'com.vanniktech.maven.publish' \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 8631e5e..0b686a2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { applicationId "com.shreyaspatil.MaterialDialogExample" minSdkVersion 19 - targetSdkVersion 30 + targetSdkVersion 31 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -16,24 +16,29 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation 'androidx.appcompat:appcompat:1.4.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.2' // Material Dialog Library implementation 'dev.shreyaspatil.MaterialDialog:MaterialDialog:2.2.2' // Material Design Library - implementation 'com.google.android.material:material:1.3.0' + implementation 'com.google.android.material:material:1.4.0' // Lottie Animation Library implementation 'com.airbnb.android:lottie:3.7.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.2.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:runner:1.4.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' // implementation project(path: ':MaterialDialogLibrary') } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5258684..5e22634 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,7 +11,9 @@ android:supportsRtl="true" android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"> - + diff --git a/build.gradle b/build.gradle index 0457f26..5d38b0b 100644 --- a/build.gradle +++ b/build.gradle @@ -3,12 +3,10 @@ buildscript { repositories { google() - jcenter() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' - + classpath 'com.android.tools.build:gradle:7.0.4' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2' } } @@ -16,7 +14,6 @@ buildscript { allprojects { repositories { google() - jcenter() mavenCentral() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e29b41..87c1df5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip \ No newline at end of file From 4ec4ff44409645424a1b5e269b96e6c52719a63f Mon Sep 17 00:00:00 2001 From: Shreyas Date: Sat, 8 Jan 2022 10:47:49 +0530 Subject: [PATCH 2/8] Bump gradle plugin version --- gradle/wrapper/gradle-wrapper.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 87c1df5..a66dd2d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Feb 12 18:52:11 IST 2021 +#Sat Jan 08 10:47:24 IST 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip \ No newline at end of file +zipStoreBase=GRADLE_USER_HOME From 97a90a222f4117a308051b513df2b7cb08afddd6 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Sat, 8 Jan 2022 10:50:48 +0530 Subject: [PATCH 3/8] Bump library version to 2.2.3 --- README.md | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 017efa3..378b7bd 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ repositories { dependencies { // Material Dialog Library - implementation 'dev.shreyaspatil.MaterialDialog:MaterialDialog:2.2.2' + implementation 'dev.shreyaspatil.MaterialDialog:MaterialDialog:2.2.3' // Material Design Library implementation 'com.google.android.material:material:1.0.0' diff --git a/gradle.properties b/gradle.properties index a9cb68b..ba49c34 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ android.enableJetifier=true # Maven Publish Details GROUP=dev.shreyaspatil.MaterialDialog POM_ARTIFACT_ID=MaterialDialog -VERSION_NAME=2.2.2 +VERSION_NAME=2.2.3 POM_NAME=MaterialDialog-Android POM_DESCRIPTION=Android Library to implement animated, beautiful, stylish Material Dialog in android apps easily. POM_INCEPTION_YEAR=2021 From b246e7d34d31276d4e2e95ccbab3686a8326953e Mon Sep 17 00:00:00 2001 From: Shreyas Date: Sat, 8 Jan 2022 10:52:39 +0530 Subject: [PATCH 4/8] Bump lottie version to 4.2.2 --- MaterialDialogLibrary/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MaterialDialogLibrary/build.gradle b/MaterialDialogLibrary/build.gradle index c3012a0..f828b23 100644 --- a/MaterialDialogLibrary/build.gradle +++ b/MaterialDialogLibrary/build.gradle @@ -35,7 +35,7 @@ dependencies { implementation 'com.google.android.material:material:1.4.0' // Lottie Animation Library - implementation 'com.airbnb.android:lottie:3.7.0' + implementation 'com.airbnb.android:lottie:4.2.2' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:runner:1.4.0' From e0a0db553528985848b95641aa8985a8d90d4189 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Sat, 8 Jan 2022 11:06:10 +0530 Subject: [PATCH 5/8] Migrate to usage of Lambda fun in Abstract dialog --- .../MaterialDialog/AbstractDialog.java | 41 +++++-------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/AbstractDialog.java b/MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/AbstractDialog.java index 9293c44..9ab90fd 100644 --- a/MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/AbstractDialog.java +++ b/MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/AbstractDialog.java @@ -1,5 +1,6 @@ package dev.shreyaspatil.MaterialDialog; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.Dialog; import android.content.res.ColorStateList; @@ -74,6 +75,7 @@ protected AbstractDialog(@NonNull Activity mActivity, this.mAnimationFile = mAnimationFile; } + @SuppressLint("WrongConstant") protected View createView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container) { // Inflate and set the layout for the dialog // Pass null as the parent view because its going in the dialog layout @@ -113,12 +115,9 @@ protected View createView(@NonNull LayoutInflater inflater, @Nullable ViewGroup mPositiveButtonView.setIcon(ContextCompat.getDrawable(mActivity, mPositiveButton.getIcon())); } - mPositiveButtonView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - mPositiveButton.getOnClickListener().onClick(AbstractDialog.this, BUTTON_POSITIVE); - } - }); + mPositiveButtonView.setOnClickListener(view -> + mPositiveButton.getOnClickListener().onClick(AbstractDialog.this, BUTTON_POSITIVE) + ); } else { mPositiveButtonView.setVisibility(View.INVISIBLE); } @@ -131,12 +130,9 @@ public void onClick(View view) { mNegativeButtonView.setIcon(ContextCompat.getDrawable(mActivity, mNegativeButton.getIcon())); } - mNegativeButtonView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - mNegativeButton.getOnClickListener().onClick(AbstractDialog.this, BUTTON_NEGATIVE); - } - }); + mNegativeButtonView.setOnClickListener(view -> + mNegativeButton.getOnClickListener().onClick(AbstractDialog.this, BUTTON_NEGATIVE) + ); } else { mNegativeButtonView.setVisibility(View.INVISIBLE); } @@ -270,12 +266,7 @@ public void dismiss() { public void setOnShowListener(@NonNull final OnShowListener onShowListener) { this.mOnShowListener = onShowListener; - mDialog.setOnShowListener(new android.content.DialogInterface.OnShowListener() { - @Override - public void onShow(android.content.DialogInterface dialogInterface) { - showCallback(); - } - }); + mDialog.setOnShowListener(dialogInterface -> showCallback()); } /** @@ -284,12 +275,7 @@ public void onShow(android.content.DialogInterface dialogInterface) { public void setOnCancelListener(@NonNull final OnCancelListener onCancelListener) { this.mOnCancelListener = onCancelListener; - mDialog.setOnCancelListener(new android.content.DialogInterface.OnCancelListener() { - @Override - public void onCancel(android.content.DialogInterface dialogInterface) { - cancelCallback(); - } - }); + mDialog.setOnCancelListener(dialogInterface -> cancelCallback()); } /** @@ -298,12 +284,7 @@ public void onCancel(android.content.DialogInterface dialogInterface) { public void setOnDismissListener(@NonNull final OnDismissListener onDismissListener) { this.mOnDismissListener = onDismissListener; - mDialog.setOnDismissListener(new android.content.DialogInterface.OnDismissListener() { - @Override - public void onDismiss(android.content.DialogInterface dialogInterface) { - dismissCallback(); - } - }); + mDialog.setOnDismissListener(dialogInterface -> dismissCallback()); } /** From 192c1701942a79cf0a27dca9ec89bd86a60272cf Mon Sep 17 00:00:00 2001 From: Shreyas Date: Sat, 8 Jan 2022 11:07:24 +0530 Subject: [PATCH 6/8] Migrate to usage of Lambda fun in BottomSheetMaterialDialog.java --- .../MaterialDialog/BottomSheetMaterialDialog.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/BottomSheetMaterialDialog.java b/MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/BottomSheetMaterialDialog.java index 8904642..e70081a 100644 --- a/MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/BottomSheetMaterialDialog.java +++ b/MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/BottomSheetMaterialDialog.java @@ -2,7 +2,6 @@ import android.app.Activity; import android.content.Context; -import android.content.DialogInterface; import android.graphics.Outline; import android.os.Build; import android.view.LayoutInflater; @@ -65,16 +64,13 @@ public void getOutline(View view, Outline outline) { } // Expand Bottom Sheet after showing. - mDialog.setOnShowListener(new DialogInterface.OnShowListener() { - @Override - public void onShow(DialogInterface dialog) { - BottomSheetDialog d = (BottomSheetDialog) dialog; + mDialog.setOnShowListener(dialog -> { + BottomSheetDialog d = (BottomSheetDialog) dialog; - FrameLayout bottomSheet = d.findViewById(com.google.android.material.R.id.design_bottom_sheet); + FrameLayout bottomSheet = d.findViewById(com.google.android.material.R.id.design_bottom_sheet); - if (bottomSheet != null) { - BottomSheetBehavior.from(bottomSheet).setState(BottomSheetBehavior.STATE_EXPANDED); - } + if (bottomSheet != null) { + BottomSheetBehavior.from(bottomSheet).setState(BottomSheetBehavior.STATE_EXPANDED); } }); } From 89ffeee19e0e7d7dba1918e931ce8346215bb667 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Sat, 8 Jan 2022 11:13:19 +0530 Subject: [PATCH 7/8] Bump maven-publish plugin version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5d38b0b..21498aa 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:7.0.4' - classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2' + classpath 'com.vanniktech:gradle-maven-publish-plugin:0.18.0' } } From 48967dc7d0781079fef34062591af26964a23cc4 Mon Sep 17 00:00:00 2001 From: Shreyas Date: Sat, 8 Jan 2022 11:13:32 +0530 Subject: [PATCH 8/8] Update library version in sample app --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0b686a2..fe46415 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,13 +29,13 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.2' // Material Dialog Library - implementation 'dev.shreyaspatil.MaterialDialog:MaterialDialog:2.2.2' + implementation 'dev.shreyaspatil.MaterialDialog:MaterialDialog:2.2.3' // Material Design Library implementation 'com.google.android.material:material:1.4.0' // Lottie Animation Library - implementation 'com.airbnb.android:lottie:3.7.0' + implementation 'com.airbnb.android:lottie:4.2.2' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:runner:1.4.0'