Skip to content

Commit 005fe20

Browse files
authored
Merge pull request #40 from PatilShreyas/migrate/maven-central
Migrate from JCenter to MavenCentral
2 parents f18c946 + fe0a44f commit 005fe20

File tree

22 files changed

+127
-212
lines changed

22 files changed

+127
-212
lines changed

MaterialDialogLibrary/build.gradle

+9-129
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.github.dcendents.android-maven'
3-
apply plugin: "com.jfrog.bintray"
4-
5-
version = "2.1"
62

73
android {
8-
compileSdkVersion 29
4+
compileSdkVersion 30
95

106
defaultConfig {
117
minSdkVersion 19
12-
targetSdkVersion 29
13-
versionCode 1
14-
versionName version
8+
targetSdkVersion 30
9+
versionCode 2
10+
versionName VERSION_NAME
1511

1612
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1713

@@ -28,135 +24,19 @@ android {
2824

2925
dependencies {
3026
implementation fileTree(dir: 'libs', include: ['*.jar'])
31-
implementation 'androidx.appcompat:appcompat:1.1.0'
32-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
27+
implementation 'androidx.appcompat:appcompat:1.2.0'
28+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
3329
implementation 'androidx.annotation:annotation:1.1.0'
3430

3531
// Material Design Library
36-
implementation 'com.google.android.material:material:1.0.0'
32+
implementation 'com.google.android.material:material:1.3.0'
3733

3834
// Lottie Animation Library
39-
implementation 'com.airbnb.android:lottie:3.3.0'
35+
implementation 'com.airbnb.android:lottie:3.6.0'
4036

4137
testImplementation 'junit:junit:4.12'
4238
androidTestImplementation 'androidx.test:runner:1.2.0'
4339
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
4440
}
45-
ext {
46-
bintrayRepo = 'maven'
47-
bintrayName = 'MaterialDialog'
48-
49-
publishedGroupId = 'com.shreyaspatil'
50-
libraryName = 'MaterialDialog'
51-
artifact = 'MaterialDialog'
52-
libraryDescription = 'Android Library to implement animated, beautiful, stylish Material Dialog in android apps easily.'
53-
54-
55-
// Your github repo link
56-
siteUrl = 'https://github.com/patilshreyas/MaterialDialog-Android'
57-
gitUrl = 'https://github.com/patilshreyas/MaterialDialog-Android.git'
58-
githubRepository= 'patilshreyas/MaterialDialog'
59-
60-
libraryVersion = version
61-
62-
developerId = 'patilshreyas'
63-
developerName = 'Shreyas Patil'
64-
developerEmail = 'shreyaspatilg@gmail.com'
65-
66-
licenseName = 'The Apache Software License, Version 2.0'
67-
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
68-
allLicenses = ["Apache-2.0"]
69-
}
70-
71-
group = publishedGroupId
72-
def siteUrl = 'https://github.com/PatilShreyas/MaterialDialog-Android' // Homepage URL of the library
73-
def gitUrl = 'https://github.com/PatilShreyas/MaterialDialog-Android.git' // Git repository URL // Maven Group ID for the artifact
74-
75-
install {
76-
repositories.mavenInstaller {
77-
// This generates POM.xml with proper parameters
78-
pom {
79-
project {
80-
packaging 'aar'
81-
82-
// Add your description here
83-
groupId 'com.shreyaspatil'
84-
artifactId = 'MaterialDialog'
85-
name 'MaterialDialog'
86-
description = 'Android Library to implement animated, beautiful, stylish Material Dialog in android apps easily.'
87-
url siteUrl
88-
89-
// Set your license
90-
licenses {
91-
license {
92-
name 'The Apache Software License, Version 2.0'
93-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
94-
}
95-
}
96-
developers {
97-
developer {
98-
id 'PatilShreyas' // TODO
99-
name 'Shreyas Patil' // TODO
100-
email 'shreyaspatilg@gmail.com' // TODO
101-
}
102-
}
103-
scm {
104-
connection gitUrl
105-
developerConnection gitUrl
106-
url siteUrl
107-
}
108-
}
109-
}
110-
}
111-
}
112-
113-
task sourcesJar(type: Jar) {
114-
from android.sourceSets.main.java.srcDirs
115-
classifier = 'sources'
116-
}
117-
118-
task javadoc(type: Javadoc) {
119-
source = android.sourceSets.main.java.srcDirs
120-
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
121-
options.addStringOption('Xdoclint:none', '-quiet')
122-
options.addStringOption('encoding', 'UTF-8')
123-
options.addStringOption('charSet', 'UTF-8')
124-
}
125-
126-
task javadocJar(type: Jar, dependsOn: javadoc) {
127-
classifier = 'javadoc'
128-
from javadoc.destinationDir
129-
}
130-
artifacts {
131-
archives javadocJar
132-
archives sourcesJar
133-
}
134-
135-
Properties properties = new Properties()
136-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
13741

138-
// https://github.com/bintray/gradle-bintray-plugin
139-
bintray {
140-
user = properties.getProperty("bintray.user")
141-
key = properties.getProperty("bintray.apikey")
142-
143-
configurations = ['archives']
144-
pkg {
145-
repo = "maven"
146-
// it is the name that appears in bintray when logged
147-
name = "com.shreyaspatil:MaterialDialog" // TODO
148-
websiteUrl = siteUrl
149-
vcsUrl = gitUrl
150-
licenses = ["Apache-2.0"]
151-
publish = true
152-
version {
153-
gpg {
154-
sign = true //Determines whether to GPG sign the files. The default is false
155-
passphrase = properties.getProperty("bintray.gpg.password") //Optional. The passphrase for GPG signing'
156-
}
157-
}
158-
}
159-
}
160-
apply plugin: 'com.android.library'
161-
apply plugin: 'com.github.dcendents.android-maven'
162-
apply plugin: 'com.jfrog.bintray'
42+
apply plugin: 'com.vanniktech.maven.publish'
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.shreyaspatil.MaterialDialog;
1+
package dev.shreyaspatil.MaterialDialog;
22

33
import android.content.Context;
44

Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.shreyaspatil.MaterialDialog" />
1+
<manifest package="dev.shreyaspatil.MaterialDialog" />

MaterialDialogLibrary/src/main/java/com/shreyaspatil/MaterialDialog/AbstractDialog.java renamed to MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/AbstractDialog.java

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.shreyaspatil.MaterialDialog;
1+
package dev.shreyaspatil.MaterialDialog;
22

33
import android.app.Activity;
44
import android.app.Dialog;
@@ -18,12 +18,14 @@
1818

1919
import com.airbnb.lottie.LottieAnimationView;
2020
import com.google.android.material.button.MaterialButton;
21-
import com.shreyaspatil.MaterialDialog.interfaces.DialogInterface;
22-
import com.shreyaspatil.MaterialDialog.interfaces.OnCancelListener;
23-
import com.shreyaspatil.MaterialDialog.interfaces.OnDismissListener;
24-
import com.shreyaspatil.MaterialDialog.interfaces.OnShowListener;
25-
import com.shreyaspatil.MaterialDialog.model.DialogButton;
2621

22+
import dev.shreyaspatil.MaterialDialog.interfaces.DialogInterface;
23+
import dev.shreyaspatil.MaterialDialog.interfaces.OnCancelListener;
24+
import dev.shreyaspatil.MaterialDialog.interfaces.OnDismissListener;
25+
import dev.shreyaspatil.MaterialDialog.interfaces.OnShowListener;
26+
import dev.shreyaspatil.MaterialDialog.model.DialogButton;
27+
28+
@SuppressWarnings("unused")
2729
public class AbstractDialog implements DialogInterface {
2830

2931
//Constants
@@ -99,7 +101,7 @@ protected View createView(@NonNull LayoutInflater inflater, @Nullable ViewGroup
99101
mPositiveButtonView.setVisibility(View.VISIBLE);
100102
mPositiveButtonView.setText(mPositiveButton.getTitle());
101103
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mPositiveButton.getIcon() != NO_ICON) {
102-
mPositiveButtonView.setIcon(mActivity.getDrawable(mPositiveButton.getIcon()));
104+
mPositiveButtonView.setIcon(ContextCompat.getDrawable(mActivity, mPositiveButton.getIcon()));
103105
}
104106

105107
mPositiveButtonView.setOnClickListener(new View.OnClickListener() {
@@ -117,7 +119,7 @@ public void onClick(View view) {
117119
mNegativeButtonView.setVisibility(View.VISIBLE);
118120
mNegativeButtonView.setText(mNegativeButton.getTitle());
119121
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mNegativeButton.getIcon() != NO_ICON) {
120-
mNegativeButtonView.setIcon(mActivity.getDrawable(mNegativeButton.getIcon()));
122+
mNegativeButtonView.setIcon(ContextCompat.getDrawable(mActivity, mNegativeButton.getIcon()));
121123
}
122124

123125
mNegativeButtonView.setOnClickListener(new View.OnClickListener() {

MaterialDialogLibrary/src/main/java/com/shreyaspatil/MaterialDialog/BottomSheetMaterialDialog.java renamed to MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/BottomSheetMaterialDialog.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.shreyaspatil.MaterialDialog;
1+
package dev.shreyaspatil.MaterialDialog;
22

33
import android.app.Activity;
44
import android.content.Context;
@@ -16,13 +16,15 @@
1616
import androidx.annotation.RawRes;
1717

1818
import com.google.android.material.bottomsheet.BottomSheetBehavior;
19-
import com.shreyaspatil.MaterialDialog.model.DialogButton;
19+
20+
import dev.shreyaspatil.MaterialDialog.model.DialogButton;
2021

2122
/**
2223
* Creates BottomSheet Material Dialog with 2 buttons.
2324
* <p>
2425
* Use {@link BottomSheetMaterialDialog.Builder} to create a new instance.
2526
*/
27+
@SuppressWarnings("unused")
2628
public class BottomSheetMaterialDialog extends AbstractDialog {
2729

2830
protected BottomSheetMaterialDialog(@NonNull final Activity mActivity,
@@ -84,7 +86,7 @@ protected View createView(@NonNull LayoutInflater inflater, @Nullable ViewGroup
8486
* Builder for {@link BottomSheetMaterialDialog}.
8587
*/
8688
public static class Builder {
87-
private Activity activity;
89+
private final Activity activity;
8890
private String title;
8991
private String message;
9092
private boolean isCancelable;
@@ -161,7 +163,7 @@ public Builder setPositiveButton(@NonNull String name, int icon, @NonNull OnClic
161163
*
162164
* @param name sets the name/label of button.
163165
* @param onClickListener interface for callback event on click of button.
164-
* @see this, for chaining.
166+
* @return this, for chaining.
165167
*/
166168
@NonNull
167169
public Builder setNegativeButton(@NonNull String name, @NonNull OnClickListener onClickListener) {
@@ -215,8 +217,7 @@ public BottomSheetMaterialDialog build() {
215217
}
216218
}
217219

218-
class BottomSheetDialog extends com.google.android.material.bottomsheet.BottomSheetDialog {
219-
220+
static class BottomSheetDialog extends com.google.android.material.bottomsheet.BottomSheetDialog {
220221
BottomSheetDialog(@NonNull Context context) {
221222
super(context, R.style.BottomSheetDialogTheme);
222223
}

MaterialDialogLibrary/src/main/java/com/shreyaspatil/MaterialDialog/MaterialDialog.java renamed to MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/MaterialDialog.java

+30-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.shreyaspatil.MaterialDialog;
1+
package dev.shreyaspatil.MaterialDialog;
22

33
import android.app.Activity;
44
import android.view.LayoutInflater;
@@ -8,16 +8,16 @@
88
import androidx.annotation.RawRes;
99
import androidx.appcompat.app.AlertDialog;
1010

11-
import com.shreyaspatil.MaterialDialog.model.DialogButton;
11+
import dev.shreyaspatil.MaterialDialog.model.DialogButton;
1212

1313
/**
1414
* Creates a Material Dialog with 2 buttons.
1515
* <p>
1616
* Use {@link Builder} to create a new instance.
1717
*/
18+
@SuppressWarnings("unused")
1819
public class MaterialDialog extends AbstractDialog {
1920

20-
2121
protected MaterialDialog(@NonNull final Activity mActivity,
2222
@NonNull String title,
2323
@NonNull String message,
@@ -48,7 +48,7 @@ protected MaterialDialog(@NonNull final Activity mActivity,
4848
* Builder for {@link MaterialDialog}.
4949
*/
5050
public static class Builder {
51-
private Activity activity;
51+
private final Activity activity;
5252
private String title;
5353
private String message;
5454
private boolean isCancelable;
@@ -94,19 +94,23 @@ public Builder setCancelable(boolean isCancelable) {
9494
return this;
9595
}
9696

97-
/** Sets the Positive Button to Material Dialog without icon
98-
* @param name sets the name/label of button.
97+
/**
98+
* Sets the Positive Button to Material Dialog without icon
99+
*
100+
* @param name sets the name/label of button.
99101
* @param onClickListener interface for callback event on click of button.
100-
* @see this, for chaining.
102+
* @return this, for chaining.
101103
*/
102104
@NonNull
103105
public Builder setPositiveButton(@NonNull String name, @NonNull OnClickListener onClickListener) {
104106
return setPositiveButton(name, NO_ICON, onClickListener);
105107
}
106108

107-
/** Sets the Positive Button to Material Dialog with icon
108-
* @param name sets the name/label of button.
109-
* @param icon sets the resource icon for button.
109+
/**
110+
* Sets the Positive Button to Material Dialog with icon
111+
*
112+
* @param name sets the name/label of button.
113+
* @param icon sets the resource icon for button.
110114
* @param onClickListener interface for callback event on click of button.
111115
* @return this, for chaining.
112116
*/
@@ -116,19 +120,23 @@ public Builder setPositiveButton(@NonNull String name, int icon, @NonNull OnClic
116120
return this;
117121
}
118122

119-
/** Sets the Negative Button to Material Dialog without icon.
120-
* @param name sets the name/label of button.
123+
/**
124+
* Sets the Negative Button to Material Dialog without icon.
125+
*
126+
* @param name sets the name/label of button.
121127
* @param onClickListener interface for callback event on click of button.
122-
* @see this, for chaining.
128+
* @return this, for chaining.
123129
*/
124130
@NonNull
125131
public Builder setNegativeButton(@NonNull String name, @NonNull OnClickListener onClickListener) {
126132
return setNegativeButton(name, NO_ICON, onClickListener);
127133
}
128134

129-
/** Sets the Negative Button to Material Dialog with icon
130-
* @param name sets the name/label of button.
131-
* @param icon sets the resource icon for button.
135+
/**
136+
* Sets the Negative Button to Material Dialog with icon
137+
*
138+
* @param name sets the name/label of button.
139+
* @param icon sets the resource icon for button.
132140
* @param onClickListener interface for callback event on click of button.
133141
* @return this, for chaining.
134142
*/
@@ -138,7 +146,9 @@ public Builder setNegativeButton(@NonNull String name, int icon, @NonNull OnClic
138146
return this;
139147
}
140148

141-
/** It sets the resource json to the {@link com.airbnb.lottie.LottieAnimationView}.
149+
/**
150+
* It sets the resource json to the {@link com.airbnb.lottie.LottieAnimationView}.
151+
*
142152
* @param animationResId sets the resource to {@link com.airbnb.lottie.LottieAnimationView}.
143153
* @return this, for chaining.
144154
*/
@@ -148,7 +158,9 @@ public Builder setAnimation(@RawRes int animationResId) {
148158
return this;
149159
}
150160

151-
/** It sets the json file to the {@link com.airbnb.lottie.LottieAnimationView} from assets.
161+
/**
162+
* It sets the json file to the {@link com.airbnb.lottie.LottieAnimationView} from assets.
163+
*
152164
* @param fileName sets the file from assets to {@link com.airbnb.lottie.LottieAnimationView}.
153165
* @return this, for chaining.
154166
*/

MaterialDialogLibrary/src/main/java/com/shreyaspatil/MaterialDialog/interfaces/DialogInterface.java renamed to MaterialDialogLibrary/src/main/java/dev/shreyaspatil/MaterialDialog/interfaces/DialogInterface.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.shreyaspatil.MaterialDialog.interfaces;
1+
package dev.shreyaspatil.MaterialDialog.interfaces;
22

33
public interface DialogInterface {
44
void cancel();
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.shreyaspatil.MaterialDialog.interfaces;
1+
package dev.shreyaspatil.MaterialDialog.interfaces;
22

33
public interface OnCancelListener {
44
void onCancel(DialogInterface dialogInterface);

0 commit comments

Comments
 (0)