Skip to content

Commit

Permalink
New Version v20.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TutorialsAndroid committed Oct 18, 2022
1 parent 42a638b commit 94937c5
Show file tree
Hide file tree
Showing 32 changed files with 40 additions and 20 deletions.
Binary file modified .gradle/7.4/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/7.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/file-system.probe
Binary file not shown.
11 changes: 3 additions & 8 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
![](https://github.com/TutorialsAndroid/KAlertDialog/blob/master/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png)

# New version released v20.2.1 on 18-10-2022
# New version released v20.2.2 on 18-10-2022
## Changelogs
- Fixed issue in button not changing color in NORMAL_TYPE dialog
- Now you can hide confirm and cancel button on alert dialog type change
### Read the changes in README

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)
Expand Down Expand Up @@ -67,7 +68,7 @@ Add it in your root build.gradle at the end of repositories:
Step 2. Add the dependency

dependencies {
implementation 'com.github.TutorialsAndroid:KAlertDialog:v20.2.1'
implementation 'com.github.TutorialsAndroid:KAlertDialog:v20.2.2'
}

## Usage
Expand Down Expand Up @@ -336,6 +337,26 @@ And if you want to hide Title Text and Content Text of alert dialog
.setTitleText("Are you sure?") //just don't write this line if you want to hide title text
.setContentText("Won't be able to recover this file!") // don't write this line if you want to hide content text

And if you want to hide Title Text and Content Text on alert type change

new KAlertDialog(this, KAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.showCancelButton(true)
.setCancelClickListener("No,cancel plx!", sDialog ->
sDialog.setTitleText(null)
.setContentText("Your imaginary file is safe :)")
.showCancelButton(false)
.setConfirmClickListener("OK", null)
.changeAlertType(KAlertDialog.ERROR_TYPE))
.setConfirmClickListener("Yes,delete it!",sDialog ->
sDialog.setTitleText("Deleted!")
.showCancelButton(false)
.setContentText(null)
.setConfirmClickListener("OK",null)
.changeAlertType(KAlertDialog.SUCCESS_TYPE))
.show();

**Change** the dialog style upon confirming:

new KAlertDialog(this, KAlertDialog.WARNING_TYPE, 0)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 11 additions & 7 deletions library/src/main/java/com/developer/kalert/KAlertDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public KAlertDialog setTitleText(String text) {

mTitleText = text;
if (mTitleTextView != null && mTitleText != null) {
showTitleText();
showTitleText(true);
if (titleTextSize != 0) {
mTitleTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, spToPx(titleTextSize, getContext()));
}
Expand All @@ -284,6 +284,8 @@ public KAlertDialog setTitleText(String text) {
}else {
mTitleTextView.setText(Html.fromHtml(mTitleText));
}
} else {
showTitleText(false);
}
return this;
}
Expand All @@ -300,11 +302,11 @@ public KAlertDialog setTitleTextGravity(int gravity) {
return this;
}

private void showTitleText() {
private void showTitleText(boolean isShow) {
mShowTitleText = true;
if (mTitleTextView != null) {
mTitleTextView.setVisibility(View.VISIBLE);
mContentTextView.setAutoLinkMask(Linkify.ALL);
mTitleTextView.setVisibility( isShow ? View.VISIBLE : GONE );
mTitleTextView.setAutoLinkMask(Linkify.ALL);
}
}

Expand Down Expand Up @@ -400,7 +402,7 @@ public boolean onResourceReady(Drawable resource, Object model, Target<Drawable>
public KAlertDialog setContentText(String text) {
mContentText = text;
if (mContentTextView != null && mContentText != null) {
showContentText();
showContentText(true);
if (contentTextSize != 0) {
mContentTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, spToPx(contentTextSize, getContext()));
}
Expand All @@ -419,6 +421,8 @@ public KAlertDialog setContentText(String text) {
}else {
mContentTextView.setText(Html.fromHtml(mContentText));
}
} else {
showContentText(false);
}
return this;
}
Expand Down Expand Up @@ -461,10 +465,10 @@ private KAlertDialog dialogContentFont(String path) {
return this;
}

private void showContentText () {
private void showContentText (boolean isShow) {
mShowContent = true;
if (mContentTextView != null) {
mContentTextView.setVisibility(View.VISIBLE);
mContentTextView.setVisibility(isShow ? View.VISIBLE : GONE);
mContentTextView.setAutoLinkMask(Linkify.ALL);
}
}
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.developer.kalert.alert"
minSdkVersion 19
targetSdkVersion 33
versionCode 27
versionName "20.2.0"
versionCode 29
versionName "20.2.2"
}


Expand Down
Binary file modified sample/build/intermediates/apk/debug/sample-debug.apk
Binary file not shown.
Binary file modified sample/build/intermediates/dex/debug/mergeDexDebug/classes.dex
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue Oct 18 14:05:31 IST 2022
#Tue Oct 18 14:57:15 IST 2022
base.0=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\sample\\build\\intermediates\\dex\\debug\\mergeDexDebug\\classes.dex
renamed.0=classes.dex
path.0=classes.dex
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 94937c5

Please sign in to comment.