Skip to content

Commit

Permalink
New Version v20.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TutorialsAndroid committed Oct 14, 2022
1 parent 4c10165 commit 55b5bf5
Show file tree
Hide file tree
Showing 164 changed files with 3,591 additions and 2,460 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.
232 changes: 109 additions & 123 deletions .idea/workspace.xml

Large diffs are not rendered by default.

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

# New version released v20.1.0 on 13-10-2022
# New version released v20.2.0 on 14-10-2022
## Changelogs
- Auto dark mode
- New Input field dialog
- Dialog title alignment
- Fixed crashing issue while using custom downloaded fonts
- Added option to change button text color
- Added option to tint vector drawable in dark mode
### 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 @@ -41,9 +39,12 @@ AlertDialog for Android, a beautiful and material alert dialog to use in your an
- Change font style
- Change text color
- Change button color and background
- Change button text color
- Show vector drawable image with tint option in dark mode
- Show Custom Image from URL in dialog (type: circleCrop, full-size)
- Change the content text-alignment as you want
- Change the title text alignment
- Progress type dialog
- Input field dialog
- More features are coming soon

Expand All @@ -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.1.0'
implementation 'com.github.TutorialsAndroid:KAlertDialog:v20.2.0'
}

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

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

A error message:

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

A success message:
Expand Down Expand Up @@ -184,7 +185,7 @@ A message with a custom image URL
.setTitleText("KAlertDialog")
.setContentText("Here's a custom image.")
.setURLImage("put your image url", displayType)
.setConfirmText("OK")
.setConfirmClickListener("OK", null)
.show();

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

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

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

To Change the color of title and content
Expand All @@ -263,8 +263,7 @@ Bind the listener to confirm button:
new KAlertDialog(this, KAlertDialog.WARNING_TYPE, 0)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setConfirmText("Yes,delete it!")
.setConfirmClickListener(new KAlertDialog.KAlertClickListener() {
.setConfirmClickListener("Yes,delete it!",new KAlertDialog.KAlertClickListener() {
@Override
public void onClick(KAlertDialog sDialog) {
sDialog.dismissWithAnimation();
Expand All @@ -277,10 +276,9 @@ Show the cancel button and bind listener to it:
new KAlertDialog(this, KAlertDialog.WARNING_TYPE, 0)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setCancelText("No,cancel plx!")
.setConfirmText("Yes,delete it!")
.setConfirmClickListener("Yes,delete it!", null)
.showCancelButton(true)
.setCancelClickListener(new KAlertDialog.KAlertClickListener() {
.setCancelClickListener("No,cancel plx!", new KAlertDialog.KAlertClickListener() {
@Override
public void onClick(KAlertDialog sDialog) {
sDialog.cancel();
Expand All @@ -290,10 +288,26 @@ Show the cancel button and bind listener to it:

Customizing the alert dialog

.confirmButtonColor(R.color.colorPrimary) // you can change the color of confirm button
.cancelButtonColor(R.color.colorAccent) // you can change the color of cancel button
.setContentTextSize(50) // you can change the content text size
.setTitleText("<h2>Title</h2><br><p>Description here</p>") //you can use html in title text
//if your app is night mode then you can tint your vector drawable to specific color you want
.setDrawableTintOnNightMode(true, R.color.white)

// you can change the color of confirm button
.confirmButtonColor(R.color.colorPrimary)

// you can change the color of cancel button
.cancelButtonColor(R.color.colorAccent)

//you can change the color of button text
.setConfirmClickListener("OK", R.color.black, clickListener)

//you can change the color of button text
.setCancelClickListener("CANCEL", R.color.black, clickListener)

// you can change the content text size
.setContentTextSize(50)

//you can use html in title text and same in content text
.setTitleText("<h2>Title</h2><br><p>Description here</p>")


And if you want to change the button corners with color create a drawable file
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:wheel="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/loading"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
android:orientation="vertical"
android:background="?attr/alertDialogDark"
android:padding="10dp">

<RelativeLayout
android:id="@+id/custom_image_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">

<ImageView
android:id="@+id/custom_image"
android:layout_width="56dp"
android:layout_height="56dp"
android:visibility="gone"
android:scaleType="fitCenter"
tools:ignore="ContentDescription" />

<ImageView
android:id="@+id/custom_big_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:scaleType="fitCenter"
tools:ignore="ContentDescription" />

<com.developer.progressx.ProgressWheel
android:id="@+id/image_loading"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
wheel:matProg_barColor="?attr/alertDialogProgressColor"
wheel:matProg_progressIndeterminate="true"
android:visibility="gone"/>
</RelativeLayout>

<FrameLayout
android:id="@+id/error_frame"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginTop="5dp"
android:visibility="gone">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/error_circle" />

<ImageView
android:id="@+id/error_x"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/app_name"
android:src="@drawable/error_center_x"
android:scaleType="center" />

</FrameLayout>

<FrameLayout
android:id="@+id/success_frame"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginTop="5dp"
android:visibility="gone">

<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/success_bow" />

<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/success_circle" />

<ImageView
android:id="@+id/success_x"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/app_name"
android:src="@drawable/ic_success_tick"
android:scaleType="center" />

</FrameLayout>

<FrameLayout
android:id="@+id/warning_frame"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginTop="5dp"
android:visibility="gone">

<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/warning_circle" />

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/app_name"
android:src="@drawable/warning_sigh"
android:scaleType="center" />
</FrameLayout>

<FrameLayout
android:id="@+id/progress_dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="9dp"
android:layout_gravity="center"
android:orientation="vertical"
android:visibility="gone">

<com.developer.progressx.ProgressWheel
android:id="@+id/progressWheel"
android:layout_width="80dp"
android:layout_height="80dp"
wheel:matProg_progressIndeterminate="true"
android:layout_gravity="center" />
</FrameLayout>

<TextView
android:id="@+id/title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="21sp"
android:layout_marginTop="10dp"
android:singleLine="true"
android:visibility="gone"
android:textColor="?attr/alertDialogTextColor"
android:text="@string/dialog_default_title" />

<TextView
android:id="@+id/content_text"
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:visibility="gone"
android:textColor="?attr/alertDialogContentTextColor"/>

<FrameLayout
android:id="@+id/custom_view_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible">

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColorHint="?attr/alertDialogInputFieldHintColor">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>

</FrameLayout>

<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">

<androidx.appcompat.widget.AppCompatButton
style="@style/dialog_blue_button"
android:id="@+id/cancel_button"
android:text="@string/dialog_cancel"
android:visibility="gone"
android:layout_marginEnd="10dp" />

<androidx.appcompat.widget.AppCompatButton
style="@style/dialog_blue_button"
android:id="@+id/custom_confirm_button"
android:visibility="gone"
android:text="@string/dialog_ok"/>
</LinearLayout>
</LinearLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="dialog_blue_button" parent="android:Widget.Button">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">32dp</item>
<item name="android:background">@drawable/button_background</item>
<item name="android:textSize">16sp</item>
<item name="android:paddingLeft">21dp</item>
<item name="android:paddingRight">21dp</item>
<item name="android:textColor">@color/button_text_color</item>
</style>
</resources>
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 modified library/build/intermediates/aar_main_jar/release/classes.jar
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 modified library/build/intermediates/full_jar/release/full.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Wed Oct 12 19:27:41 IST 2022
#Fri Oct 14 12:06:10 IST 2022
com.developer.kalert.library-pngs-0\:/drawable-xxhdpi/ic_success_tick.png=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\drawable-xxhdpi-v4\\ic_success_tick.png
com.developer.kalert.library-main-7\:/layout/alert_dialog.xml=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\layout\\alert_dialog.xml
com.developer.kalert.library-main-7\:/drawable/success_circle.xml=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\drawable\\success_circle.xml
Expand All @@ -17,6 +17,7 @@ com.developer.kalert.library-main-7\:/drawable/dialogdark.xml=D\:\\Projects\\And
com.developer.kalert.library-main-7\:/anim/success_mask_layout.xml=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\anim\\success_mask_layout.xml
com.developer.kalert.library-main-7\:/drawable/gray_button_background.xml=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\drawable\\gray_button_background.xml
com.developer.kalert.library-pngs-0\:/drawable-xxxhdpi/ic_success_tick.png=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\drawable-xxxhdpi-v4\\ic_success_tick.png
com.developer.kalert.library-main-7\:/layout-sw600dp/alert_dialog.xml=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\layout-sw600dp-v13\\alert_dialog.xml
com.developer.kalert.library-pngs-0\:/drawable-ldpi/ic_success_tick.png=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\drawable-ldpi-v4\\ic_success_tick.png
com.developer.kalert.library-main-7\:/anim/error_x_in.xml=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\anim\\error_x_in.xml
com.developer.kalert.library-main-7\:/drawable/dialog_background.xml=D\:\\Projects\\AndroidLibraries\\KAlertDialog-master\\library\\build\\intermediates\\packaged_res\\debug\\drawable\\dialog_background.xml
Expand Down
Loading

0 comments on commit 55b5bf5

Please # to comment.