Skip to content

Commit

Permalink
Merge pull request #60 from PatilShreyas/version-2.2.3-dev
Browse files Browse the repository at this point in the history
Release v2.2.3
  • Loading branch information
PatilShreyas committed Jan 8, 2022
2 parents edce289 + 48967dc commit e3338c6
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 74 deletions.
30 changes: 16 additions & 14 deletions MaterialDialogLibrary/build.gradle
Original file line number Diff line number Diff line change
@@ -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"

}
Expand All @@ -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'
implementation 'com.airbnb.android:lottie:4.2.2'

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'
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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());
}

/**
Expand All @@ -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());
}

/**
Expand All @@ -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());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
25 changes: 15 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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'
implementation 'dev.shreyaspatil.MaterialDialog:MaterialDialog:2.2.3'

// 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'
implementation 'com.airbnb.android:lottie:4.2.2'

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')
}
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
7 changes: 2 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'

classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.18.0'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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-6.6.1-all.zip
zipStoreBase=GRADLE_USER_HOME

0 comments on commit e3338c6

Please sign in to comment.