Skip to content

Commit 55b5bf5

Browse files
New Version v20.2.0
1 parent 4c10165 commit 55b5bf5

164 files changed

Lines changed: 3591 additions & 2460 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
2.9 MB
Binary file not shown.
0 Bytes
Binary file not shown.
800 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
1.1 KB
Binary file not shown.
0 Bytes
Binary file not shown.

.gradle/file-system.probe

0 Bytes
Binary file not shown.

.idea/workspace.xml

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

README.md

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
![](https://github.com/TutorialsAndroid/KAlertDialog/blob/master/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png)
22

3-
# New version released v20.1.0 on 13-10-2022
3+
# New version released v20.2.0 on 14-10-2022
44
## Changelogs
5-
- Auto dark mode
6-
- New Input field dialog
7-
- Dialog title alignment
8-
- Fixed crashing issue while using custom downloaded fonts
5+
- Added option to change button text color
6+
- Added option to tint vector drawable in dark mode
97
### Read the changes in README
108

119
Alert Dialog ![API](https://img.shields.io/badge/API-19%2B-brightgreen.svg?style=flat) [![Known Vulnerabilities](https://snyk.io/test/github/TutorialsAndroid/KAlertDialog/badge.svg?targetFile=library%2Fbuild.gradle)](https://snyk.io/test/github/TutorialsAndroid/KAlertDialog?targetFile=library%2Fbuild.gradle) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-KAlertDiaog-blue.svg?style=flat)](https://android-arsenal.com/details/1/7588) [![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
@@ -41,9 +39,12 @@ AlertDialog for Android, a beautiful and material alert dialog to use in your an
4139
- Change font style
4240
- Change text color
4341
- Change button color and background
42+
- Change button text color
43+
- Show vector drawable image with tint option in dark mode
4444
- Show Custom Image from URL in dialog (type: circleCrop, full-size)
4545
- Change the content text-alignment as you want
4646
- Change the title text alignment
47+
- Progress type dialog
4748
- Input field dialog
4849
- More features are coming soon
4950

@@ -67,7 +68,7 @@ Add it in your root build.gradle at the end of repositories:
6768
Step 2. Add the dependency
6869

6970
dependencies {
70-
implementation 'com.github.TutorialsAndroid:KAlertDialog:v20.1.0'
71+
implementation 'com.github.TutorialsAndroid:KAlertDialog:v20.2.0'
7172
}
7273

7374
## Usage
@@ -124,11 +125,11 @@ A title with gravity changed:
124125
![](https://github.com/TutorialsAndroid/KAlertDialog/blob/master/art/photo_2022-10-12_19-42-30.png)
125126

126127
new KAlertDialog(this, KAlertDialog.NORMAL_TYPE)
127-
.setTitleText("Lorem Ipsum")
128-
.setTitleTextGravity(Gravity.START) //you can specify your own gravity
129-
.setContentText("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
130-
.setConfirmText("Ok")
131-
.show();
128+
.setTitleText("Lorem Ipsum")
129+
.setTitleTextGravity(Gravity.START) //you can specify your own gravity
130+
.setContentText("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
131+
.setConfirmClickListener("OK", null)
132+
.show();
132133

133134
A error message:
134135

@@ -142,7 +143,7 @@ A warning message:
142143
new KAlertDialog(this, KAlertDialog.WARNING_TYPE)
143144
.setTitleText("Are you sure?")
144145
.setContentText("Won't be able to recover this file!")
145-
.setConfirmText("Yes,delete it!")
146+
.setConfirmClickListener("Yes,delete it!", null)
146147
.show();
147148

148149
A success message:
@@ -184,7 +185,7 @@ A message with a custom image URL
184185
.setTitleText("KAlertDialog")
185186
.setContentText("Here's a custom image.")
186187
.setURLImage("put your image url", displayType)
187-
.setConfirmText("OK")
188+
.setConfirmClickListener("OK", null)
188189
.show();
189190

190191
A dialog with input-field
@@ -194,8 +195,7 @@ A dialog with input-field
194195
KAlertDialog dialog = new KAlertDialog(this, KAlertDialog.INPUT_TYPE);
195196
dialog.setInputFieldHint("Write message");
196197
dialog.setTitleText("Edit Text");
197-
dialog.setConfirmText("OK");
198-
dialog.setConfirmClickListener(kAlertDialog -> {
198+
dialog.setConfirmClickListener("OK", kAlertDialog -> {
199199
kAlertDialog.dismissWithAnimation();
200200
kAlertDialog.getInputText(); //you get the input text by calling this
201201
Toast.makeText(this, kAlertDialog.getInputText(), Toast.LENGTH_SHORT).show();
@@ -211,8 +211,8 @@ To Hide Cancel And Confirm Button:
211211
.setTitleText("Sweet!")
212212
.setContentText("Here's a custom image.")
213213
.setCustomImage(R.drawable.custom_img)
214-
.setConfirmText("OK") //Do not call this if you don't want to show confirm button
215-
.setCancelText("CANCEL")//Do not call this if you don't want to show cancel button
214+
.showConfirmButton(false) //to hide the confirm button set it to true
215+
.showCancelButton(false) //to hide the cancel button set it to false
216216
.show();
217217

218218
To Change the font of only title:
@@ -226,7 +226,7 @@ To Change the font of only title:
226226
.setTitleText("Lorem Ipsum")
227227
.setTitleTTFFont("fonts/os.ttf")
228228
.setContentText("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
229-
.setConfirmText("Ok")
229+
.setConfirmClickListener("OK", null)
230230
.show();
231231

232232
To Change the font of only content:
@@ -240,7 +240,7 @@ To Change the font of only content:
240240
.setTitleText("Lorem Ipsum")
241241
.setContentText("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
242242
.setContentTTFFont("fonts/sf.ttf")
243-
.setConfirmText("Ok")
243+
.setConfirmClickListener("OK", null)
244244
.show();
245245

246246
To Change the color of title and content
@@ -263,8 +263,7 @@ Bind the listener to confirm button:
263263
new KAlertDialog(this, KAlertDialog.WARNING_TYPE, 0)
264264
.setTitleText("Are you sure?")
265265
.setContentText("Won't be able to recover this file!")
266-
.setConfirmText("Yes,delete it!")
267-
.setConfirmClickListener(new KAlertDialog.KAlertClickListener() {
266+
.setConfirmClickListener("Yes,delete it!",new KAlertDialog.KAlertClickListener() {
268267
@Override
269268
public void onClick(KAlertDialog sDialog) {
270269
sDialog.dismissWithAnimation();
@@ -277,10 +276,9 @@ Show the cancel button and bind listener to it:
277276
new KAlertDialog(this, KAlertDialog.WARNING_TYPE, 0)
278277
.setTitleText("Are you sure?")
279278
.setContentText("Won't be able to recover this file!")
280-
.setCancelText("No,cancel plx!")
281-
.setConfirmText("Yes,delete it!")
279+
.setConfirmClickListener("Yes,delete it!", null)
282280
.showCancelButton(true)
283-
.setCancelClickListener(new KAlertDialog.KAlertClickListener() {
281+
.setCancelClickListener("No,cancel plx!", new KAlertDialog.KAlertClickListener() {
284282
@Override
285283
public void onClick(KAlertDialog sDialog) {
286284
sDialog.cancel();
@@ -290,10 +288,26 @@ Show the cancel button and bind listener to it:
290288

291289
Customizing the alert dialog
292290

293-
.confirmButtonColor(R.color.colorPrimary) // you can change the color of confirm button
294-
.cancelButtonColor(R.color.colorAccent) // you can change the color of cancel button
295-
.setContentTextSize(50) // you can change the content text size
296-
.setTitleText("<h2>Title</h2><br><p>Description here</p>") //you can use html in title text
291+
//if your app is night mode then you can tint your vector drawable to specific color you want
292+
.setDrawableTintOnNightMode(true, R.color.white)
293+
294+
// you can change the color of confirm button
295+
.confirmButtonColor(R.color.colorPrimary)
296+
297+
// you can change the color of cancel button
298+
.cancelButtonColor(R.color.colorAccent)
299+
300+
//you can change the color of button text
301+
.setConfirmClickListener("OK", R.color.black, clickListener)
302+
303+
//you can change the color of button text
304+
.setCancelClickListener("CANCEL", R.color.black, clickListener)
305+
306+
// you can change the content text size
307+
.setContentTextSize(50)
308+
309+
//you can use html in title text and same in content text
310+
.setTitleText("<h2>Title</h2><br><p>Description here</p>")
297311

298312

299313
And if you want to change the button corners with color create a drawable file
Binary file not shown.

0 commit comments

Comments
 (0)