Make your native android Dialog Fancy. A library that takes the standard Android Dialog to the next level with a variety of styling options. Style your dialog from code.

Overview

FancyAlertDialog-Android

platform API License Android Arsenal

Get it on Google Play

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

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

Dependency

Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):

dependencies {
	...
	compile 'com.github.Shashank02051997:FancyAlertDialog-Android:0.1'
}

Fancy Alert Dialog

new FancyAlertDialog.Builder(this)
                .setTitle("Rate us if you like the app")
                .setBackgroundColor(Color.parseColor("#303F9F"))  //Don't pass R.color.colorvalue
                .setMessage("Do you really want to Exit ?")
                .setNegativeBtnText("Cancel")
                .setPositiveBtnBackground(Color.parseColor("#FF4081"))  //Don't pass R.color.colorvalue
                .setPositiveBtnText("Rate")
                .setNegativeBtnBackground(Color.parseColor("#FFA9A7A8"))  //Don't pass R.color.colorvalue
                .setAnimation(Animation.POP)
                .isCancellable(true)
                .setIcon(R.drawable.ic_star_border_black_24dp,Icon.Visible)
                .OnPositiveClicked(new FancyAlertDialogListener() {
                    @Override
                    public void OnClick() {
                        Toast.makeText(getApplicationContext(),"Rate",Toast.LENGTH_SHORT).show();
                    }
                })
                .OnNegativeClicked(new FancyAlertDialogListener() {
                    @Override
                    public void OnClick() {
                        Toast.makeText(getApplicationContext(),"Cancel",Toast.LENGTH_SHORT).show();
                    }
                })
                .build();

Animation

There are 3 type of pre-defined animation you can use : POP, SLIDE and SIDE

Pop Animation

You can add this animation to your dialog by using .setAnimation(Animation.POP)

Side Animation

This animation let dialog enter screen from left and exit from right. You can add this animation to your dialog by using .setAnimation(Animation.SIDE)

Slide Animation

This animation let dialog enter screen from bottom and exit from bottom. You can add this animation to your dialog by using .setAnimation(Animation.SLIDE)

Screenshots

Please click the image below to enlarge.

Contributing

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .

Contact - Let's become friend

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

Buy Me A Coffee

License

Copyright 2018 Shashank Singhal

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.
Comments
  • cannot change btn's colors

    cannot change btn's colors

    i have follow the steps as the read.me guide it, but i cannot change the color of the two buttons. Neither the .setNegativeBtnBackgroundRes not the .setNegativeBtnBackground seems to work properly (same for the positive button). Is anything i can do to change the default color or did I have to do anything more in order to change the btn's color?

    opened by dmatsanganis 1
  • Help conflict with 26.1.0 - 23.1.1

    Help conflict with 26.1.0 - 23.1.1

    Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

    opened by AnguelSC 1
  • minor update

    minor update

    • updated dependencies
    • changed initialisation
    • replaced visibility handling and color/drawable resource setting using support annotations
    • decreased min SDK to 15 (i don't see any higher SDK functions used to justify higher versions, did I miss any?)
    • changed sourceCompatibility to jdk8
    • added javadoc generation
    opened by kibotu 1
  • D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main

    D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main

    E/AndroidRuntime: FATAL EXCEPTION: main Process: com.poc.srtantiphising, PID: 15591 java.lang.ClassCastException: android.graphics.drawable.RippleDrawable cannot be cast to android.graphics.drawable.GradientDrawable at com.shashank.sony.fancydialoglib.FancyAlertDialog$Builder.build(FancyAlertDialog.java:159) at com.poc.app.appActivity.ResultActivity$onCreate$12.run(ResultActivity.kt:200) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7076) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

    opened by ayodkay 2
  • How do I add a textview on the alert dialog?

    How do I add a textview on the alert dialog?

    Hello, I want to attatch a textview on the dialog but I think there isn't an option to do that. would you please tell me the way to add it or add the function to it? Thanks for the fancy alert dialog.

    opened by mooner1022 3
Releases(0.3)
Owner
Shashank Singhal
Google Certified Android Developer | Freelancer | Android App Developer | Game Developer | API Developer |Software Developer | Web Developer | Open Source lover
Shashank Singhal
A backport of the SwitchPreference component that was introduced on Android 4 (ICS / level 14). This port works on Android 2.1+ (Eclair MR1 / level 7).

Android Switch Preference Backport A backport of the SwitchPreference component that was introduced on Android 4 (ICS / level 14). This port works on

Benoit Lubek 498 Dec 29, 2022
A cool Open Source CoverFlow view for Android with several fancy effects.

FancyCoverFlow THIS PROJECT IS NO LONGER MAINTAINED! What is FancyCoverFlow? FancyCoverFlow is a flexible Android widget providing out of the box view

David Schreiber-Ranner 1.1k Nov 10, 2022
Takes the input from the Android MediaPlayer and displays visualizations, like in iTunes or WinAmp

Android Visualizer A View subclass that Takes the input from the Android MediaPlayer and displays visualizations, like in iTunes or WinAmp The Visuali

null 798 Dec 22, 2022
Nature takes back over.

ShatteredReclamation This is a plugin that allows the wild to slowly take player creations back over. Config Threads This plugin uses multiple threads

ShatteredSoftware 3 Jul 15, 2022
NeoPOP was created with one simple goal; to create the next generation of a beautiful, affirmative design system

NeoPop is CRED's inbuilt library for using NeoPop components in your app

CRED 254 Dec 29, 2022
:bread: Make your native android Toasts Tasty

TastyToast Make your native android toast look beautiful. Preview About Refer Here Wiki Grab the above demo app from here : Dependency Add dependency

Rahul Yadav 2k Dec 29, 2022
Multi Roots TreeView implementation for Android Platform with a lot of options and customization

Multi roots TreeView :palm_tree: implementation for Android Platform with a lot of options and customization

Amr Hesham 112 Jan 3, 2023
A full options clock view

Clock View Full options Clock view. You are now able to create and design your own clock view with changing just attributes. Over 20 attributes are av

Belkilani Ahmed Radhouane 65 Dec 9, 2022
Allows you to launch various /hidden/ options of the Oculus Quest (2)

vrLauncher Allows you to launch various /hidden/ options of the Oculus Quest (2) Using it Sideload the apk onto your Oculus Quest (2) Choose the optio

Bastian 153 Dec 25, 2022
Card with swipe options in Jetpack Compose

SwipeableActionCard Card with swipe options in Jetpack Compose Tutorial: Click Here Import SwipeableActionCard library Add this in project level build

Harsh Mahajan 1 Nov 23, 2021
Provides 9-patch based drop shadow for view elements. Works on API level 9 or later.

Material Shadow 9-Patch This library provides 9-patch based drop shadow for view elements. Works on API level 14 or later. Target platforms API level

Haruki Hasegawa 481 Dec 19, 2022
🗨️ Beautiful Dialog is a Simple and Beautiful custom dialog

Beautiful Dialog ??️ Beautiful Dialog is a Simple and Beautiful custom dialog. Screenshots Including in your project Gradle Add below codes to your ro

Geovani Amaral 21 Jan 6, 2023
Display code with syntax highlighting :sparkles: in native way.

CodeView (Android) CodeView helps to show code content with syntax highlighting in native way. Description CodeView contains 3 core parts to implement

Kirill Biakov 827 Dec 22, 2022
Make a cool intro for your Android app.

AppIntro AppIntro is an Android Library that helps you build a cool carousel intro for your App. AppIntro has support for requesting permissions and h

AppIntro Team 10.3k Dec 30, 2022
Make a cool intro for your Android app.

AppIntro AppIntro is an Android Library that helps you build a cool carousel intro for your App. AppIntro has support for requesting permissions and h

AppIntro Team 40 Jan 3, 2023
Bootstrap style widgets for Android, with Glyph Icons

Android-Bootstrap Android Bootstrap is an Android library which provides custom views styled according to the Twitter Bootstrap Specification. This al

Bearded Hen 7.3k Jan 3, 2023
A util for setting status bar style on Android App.

StatusBarUtil A util for setting status bar style on Android App. It can work above API 19(KitKat 4.4). 中文版点我 Sample Download StatusBarUtil-Demo Chang

Jaeger 8.8k Jan 7, 2023
An Android custom view to display digits rendered as dots in a grid, with a style like a 1970s LED clock.

#DotMatrixView This is an Android library project providing a custom view that can display things on a grid of dots. When the displayed value changes,

Mark Roberts 48 Apr 21, 2022
This is a sample Android Studio project that shows the necessary code to create a note list widget, And it's an implementation of a lesson on the Pluralsight platform, but with some code improvements

NoteKeeper-Custom-Widgets This is a sample Android Studio project that shows the necessary code to create a note list widget, And it's an implementati

Ibrahim Mushtaha 3 Oct 29, 2022