ionalert 1.3 1.6 Java Sweetalert, Dialog, Alert Dialog

Related tags

Dialog ionalert
Overview

ionalert - Android Alert Dialog

License Downloads

A beautiful design Android Alert Dialog, alternative of Sweet Alert Dialog based on KAlertDialog using MaterialComponent

Screenshot

Screenshot Screenshot
enter image description here enter image description here
enter image description here enter image description here
enter image description here enter image description here

Gradle

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
        implementation 'com.github.oktavianto:ionalert:1.0.4'
}

Usage

A basic message:

new IonAlert(this)
    .setTitleText("Here's a message!")
    .show();

A title with a text under:

new IonAlert(this)
    .setTitleText("Here's a message!")
    .setContentText("It's pretty, isn't it?")
    .show();

A error message:

new IonAlert(this, IonAlert.ERROR_TYPE)
    .setTitleText("Oops...")
    .setContentText("Something went wrong!")
    .show();

A warning message:

new IonAlert(this, IonAlert.WARNING_TYPE)
    .setTitleText("Are you sure?")
    .setContentText("Won't be able to recover this file!")
    .setConfirmText("Yes,delete it!")
    .show();

A success message:

new IonAlert(this, IonAlert.SUCCESS_TYPE)
    .setTitleText("Good job!")
    .setContentText("You clicked the button!")
    .show();

A message with a custom icon:

new IonAlert(this, IonAlert.CUSTOM_IMAGE_TYPE)
    .setTitleText("Sweet!")
    .setContentText("Here's a custom image.")
    .setCustomImage(R.drawable.custom_img)
    .show();

Bind the listener to confirm button:

new IonAlert(this, IonAlert.WARNING_TYPE)
    .setTitleText("Are you sure?")
    .setContentText("Won't be able to recover this file!")
    .setConfirmText("Yes,delete it!")
    .setConfirmClickListener(new IonAlert.ClickListener() {
        @Override
        public void onClick(IonAlert sDialog) {
            sDialog.dismissWithAnimation();
        }
    })
    .show();

Show the cancel button and bind listener to it:

new IonAlert(this, IonAlert.WARNING_TYPE)
    .setTitleText("Are you sure?")
    .setContentText("Won't be able to recover this file!")
    .setCancelText("No,cancel plx!")
    .setConfirmText("Yes,delete it!")
    .showCancelButton(true)
    .setCancelClickListener(new IonAlert.ClickListener() {
        @Override
        public void onClick(IonAlert sDialog) {
            sDialog.cancel();
        }
    })
    .show();

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

Change the dialog style upon confirming:

new IonAlert(this, IonAlert.WARNING_TYPE)
    .setTitleText("Are you sure?")
    .setContentText("Won't be able to recover this file!")
    .setConfirmText("Yes,delete it!")
    .setConfirmClickListener(new IonAlert.ClickListener() {
        @Override
        public void onClick(IonAlert sDialog) {
            sDialog
                .setTitleText("Deleted!")
                .setContentText("Your imaginary file has been deleted!")
                .setConfirmText("OK")
                .setConfirmClickListener(null)
                .changeAlertType(IonAlert.SUCCESS_TYPE);
        }
    })
    .show();

Loading Spin Animation Using Android-SpinKit

loadingDialog = IonAlert(this, IonAlert.PROGRESS_TYPE)  
        .setSpinKit("DoubleBounce")  
        .showCancelButton(true)  
        .show();

For dismiss

loadingDialog.dismiss();

Change Loading Spin Style

.setSpinKit("DoubleBounce")

Change Loading Spin Color

.setSpinColor("#000000") // hex color
Style Preview
RotatingPlane RotatingPlane
DoubleBounce DoubleBounce
Wave Wave
WanderingCubes WanderingCubes
Pulse Pulse
ChasingDots ChasingDots
ThreeBounce ThreeBounce
Circle Circle
CubeGrid CubeGrid
FadingCircle FadingCircle
FoldingCube FoldingCube
RotatingCircle RotatingCircle

Some Properties

Confirm Button Color

.setConfirmButtonColor(Color.RED) // color int

Cancel Button Text Color

.setCancelButtonColor(Color.RED) // color int

Confirm Button Text Size

.setConfirmTextSize(int size)

Cancel Button Text Size

.setCancelTextSize(int size)

Alert Content Text Size

.setContentTextSize(int size)

Support

Supported by Ionbit Indonesia - Professional App Development

License

Copyright 2020 ionalert

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
       
You might also like...
a quick custom android dialog project
a quick custom android dialog project

QustomDialog Qustom helps you make quick custom dialogs for Android. All this is, for the time being, is a way to make it easy to achieve the Holo loo

Android library that allows applications to add dialog-based slider widgets to their settings
Android library that allows applications to add dialog-based slider widgets to their settings

Android Slider Preference Library Overview Slider represents a float between 0.0 and 1.0 Access with SliderPreference.getValue() or SharedPreferences.

An Android library for displaying a dialog where it presents new features in the app.
An Android library for displaying a dialog where it presents new features in the app.

WhatIsNewDialog What is new dialog for Android is used for presenting new features in the the app. It can be used in the activity starts, from menu or

Android library to show
Android library to show "Rate this app" dialog

Android-RateThisApp Android-RateThisApp is an library to show "Rate this app" dialog. The library monitors the following status How many times is the

An easy to use, yet very customizable search dialog
An easy to use, yet very customizable search dialog

search-dialog An awesome and customizable search dialog with built-in search options. Usage First add jitpack to your projects build.gradle file allpr

Common dialog fragments
Common dialog fragments

Common dialog fragments

Custom Dialog
Custom Dialog

Custom Dialog use Lottie Dialog How To Use? If yow want specific lottie file you must put your assets to under app → src → main → assets folder Add li

Extremely useful library to validate EditText inputs whether by using just the validator for your custom view or using library's extremely resizable & customisable dialog
Extremely useful library to validate EditText inputs whether by using just the validator for your custom view or using library's extremely resizable & customisable dialog

Extremely useful library for validating EditText inputs whether by using just the validator (OtpinVerification) for your custom view or using library's extremely resizable & customisable dialog (OtpinDialogCreator)

A simple library to show custom dialog with animation in android
A simple library to show custom dialog with animation in android

SmartDialog A simple library to show custom dialog in android Step 1. Add the JitPack repository to your build file allprojects { repositories {

Comments
  • Error with theme

    Error with theme "Theme.MaterialComponents.Light.NoActionBar"

    FATAL EXCEPTION: main java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:843) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:806) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:693) at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:95) at androidx.appcompat.app.AlertController.installContent(AlertController.java:232) at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279) at id.ionbit.ionalert.IonAlert.onCreate(IonAlert.java:99) at android.app.Dialog.dispatchOnCreate(Dialog.java:421) at android.app.Dialog.show(Dialog.java:315)

    opened by ashutosh-mulik 1
Releases(1.0.4)
Owner
Excel Dwi Oktavianto
idk
Excel Dwi Oktavianto
Alert Dialog - You can use this extension instead of creating a separate Alert Dialog for each Activity or Fragment.

We show a warning message (Alert Dialog) to the user in many parts of our applications. You can use this extension instead of creating a separate Alert Dialog for each Activity or Fragment. Thanks to this extension, you can create a Dialog and call it in the Activity or Fragment you want and customize the component you want.

Gökmen Bayram 0 Jan 9, 2022
AlertDialog for Android, a beautiful and material alert dialog to use in your android app.

AlertDialog for Android, a beautiful and material alert dialog to use in your android app. Older verion of this library has been removed

Akshay Masram 124 Dec 28, 2022
AlertDialog - Explain about Alert Dialog in Android

AndroidTemplate I got a problem to create Android project with Java 11 and anoth

Monthira Chayabanjonglerd 1 Feb 13, 2022
Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code.

FancyGifDialog-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ...

Shashank Singhal 522 Jan 2, 2023
Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.

# Media Recorder Dialog ![](https://img.shields.io/badge/Platform-Android-brightgreen.svg) ![](https://img.shields.io/badge/Android-CustomView-blue.sv

Abdullah Alhazmy 73 Nov 29, 2022
Advanced dialog solution for android

DialogPlus Simple and advanced dialog solution. Uses normal view as dialog Provides expandable option Multiple positioning Built-in options for easy i

Orhan Obut 5k Dec 29, 2022
An Android Dialog Lib simplify customization.

FlycoDialog-Master 中文版 An Android Dialog Lib simplify customization. Supprot 2.2+. Features [Built-in Dialog, convenient to use](#Built-in Dialog) [Ab

Flyco 2.3k Dec 8, 2022
[Deprecated] This project can make it easy to theme and custom Android's dialog. Also provides Holo and Material themes for old devices.

Deprecated Please use android.support.v7.app.AlertDialog of support-v7. AlertDialogPro Why AlertDialogPro? Theming Android's AlertDialog is not an eas

Feng Dai 468 Nov 10, 2022
Android library to show "Rate this app" dialog

Android-RateThisApp Android-RateThisApp is an library to show "Rate this app" dialog. The library monitors the following status How many times is the

Keisuke Kobayashi 553 Nov 23, 2022
A simple file/ directory picker dialog for android

FileListerDialog FileListerDialog helps you to list and pick file/directory. Library is built for Android Getting Started Installing To use this libra

Yogesh S 446 Jan 7, 2023