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.

Overview

FancyGifDialog-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 {
	...
	implementation 'com.github.Shashank02051997:FancyGifDialog-Android:1.3'
}

Fancy Gif Dialog

Dialog with two buttons:

new FancyGifDialog.Builder(this)
                .setTitle("Granny eating chocolate dialog box") // You can also send title like R.string.from_resources
                .setMessage("This is a granny eating chocolate dialog box. This library is used to help you easily create fancy gify dialog.") // or pass like R.string.description_from_resources
                .setNegativeBtnText("Cancel") // or pass it like android.R.string.cancel
                .setPositiveBtnBackground("#FF4081") // or pass it like R.color.positiveButton
                .setPositiveBtnText("Ok") // or pass it like android.R.string.ok
                .setNegativeBtnBackground("#FFA9A7A8") // or pass it like R.color.negativeButton
                .setGifResource(R.drawable.gif1)   //Pass your Gif here
                .isCancellable(true)
                .OnPositiveClicked(new FancyGifDialogListener() {
                    @Override
                    public void OnClick() {
                        Toast.makeText(MainActivity.this,"Ok",Toast.LENGTH_SHORT).show();
                    }
                })
                .OnNegativeClicked(new FancyGifDialogListener() {
                    @Override
                    public void OnClick() {
                        Toast.makeText(MainActivity.this,"Cancel",Toast.LENGTH_SHORT).show();
                    }
                })
                .build();

Dialog with one button:

new FancyGifDialog.Builder(this)
                .setTitle("Granny eating chocolate dialog box")
                .setMessage("This is a granny eating chocolate dialog box. This library is used to help you easily create fancy gify dialog.")
                .setPositiveBtnText("Ok")
                .setPositiveBtnBackground("#FF4081")
                .setGifResource(R.drawable.gif1)   //Pass your Gif here
                .isCancellable(true)
                .OnPositiveClicked(new FancyGifDialogListener() {
                    @Override
                    public void OnClick() {
                        Toast.makeText(MainActivity.this,"Ok",Toast.LENGTH_SHORT).show();
                    }
                })
                .build();

Screenshots

Please click the image below to enlarge.

Dependencies

This project use this libraries ~ Thanks to them.

android-gif-drawable

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
  • same issue #12 (set message not working )

    same issue #12 (set message not working )

    image

    and my code

                @Override
                     public void onBindViewHolder(@NonNull batsal_testAdapter.ItemViewHolder holder, 
             final int position) {
             holder.onBind(listData.get(position));
            holder.mview.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Context context=view.getContext();
                Intent intent=new Intent(context, Training_batsal.class);
                if(position==0){
                    /* source this library:  https://github.com/Shashank02051997/FancyGifDialog-Android   
                */
                    new FancyGifDialog.Builder((Activity)context)
                            .setTitle("하이 니즈")
                            .setMessage("무릎이 위로 올라가도록 abcdabcd ")
                            .setNegativeBtnText("Cancel")
                            .setPositiveBtnBackground("#FF4081")
                            .setPositiveBtnText("Ok")
                            .setNegativeBtnBackground("#FFA9A7A8")
                            .setGifResource(R.drawable.gif1)   //Pass your Gif here
                            .isCancellable(true)
                            .OnPositiveClicked(new FancyGifDialogListener() {
                                @Override
                                public void OnClick() {
                                   // Toast.makeText(MainActivity.this,"Ok",Toast.LENGTH_SHORT).show();
                                }
                            })
                            .OnNegativeClicked(new FancyGifDialogListener() {
                                @Override
                                public void OnClick() {
                                    //Toast.makeText(MainActivity.this,"Cancel",Toast.LENGTH_SHORT).show();
                                 }
                                })
                            .build();
                     }
    
                  }
                     });
             }
    
    enhancement 
    opened by saechimdaeki 4
  • Negative Button Bug

    Negative Button Bug

    the ".setNegativeBtnText()" is always "RATE" when i dont set it I only use "setPositiveBtnText()" but NetgativeBtn is always shown with "Rate" text this should be fixed. thanks

    opened by essare 4
  • Message gets invisible in dark mode.

    Message gets invisible in dark mode.

    Add support for dark mode. Message text disappears in the dark mode. Atleast provide a method to change textcolor so that we can use daynight resources.

    enhancement 
    opened by fantasticrahulrai 3
  • Not working in fragment

    Not working in fragment

    I want to use it in a fragment. I get this error:

    java.lang.ClassCastException: android.graphics.drawable.RippleDrawable cannot be cast to android.graphics.drawable.GradientDrawable

    How can I solve it?

    opened by stateman92 2
  • Handle OnPositiveClicked

    Handle OnPositiveClicked

    hello, is it possible to override the OnPositiveClicked, i want it to change the GifResource for 2 seconds before closing the dialog.

    Thank you, very good library

    opened by salimido 2
  • The GIF banner should fit to the Dialog UI and/or Dialog UI should stretch enough on screen

    The GIF banner should fit to the Dialog UI and/or Dialog UI should stretch enough on screen

    Hi Shashank,

    The banner does not 'fit' in the area provided as well as dialog does not use the available 'room' either. See the attached image for your reference. Unnecessary tall dialog looks odd per say. Animation did worked nicely though.

    snap

    opened by nbaua 1
  • Button colors do not work

    Button colors do not work

    I tried to add the ID of the button color and it does not change. I have also tried to add a string with the hexadecimal of the color. But it fails completely, because it needs an ID of the COLOR.

    I don't know if it has something to do, but now the buttons by default comes with the XML attribute to change the background of the button, called: app:backgroundTint.

    I don't know if I need to update the FancyDialog code, or maybe I'm doing something wrong. So that the change of colors of the fancydialog buttons is not realized concretely: setNegativeBtnBackground and setPositiveBtnBackground.

    opened by fumatamax 4
  • Not working at all

    Not working at all

    ClassCastException: android.graphics.drawable.RippleDrawable cannot be cast to android.graphics.drawable.GradientDrawable

    Used the library in this project for almost 6 months now, really appreciate you, please fix this :)

    2019-07-10 08:45:02.070 28829-28829/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.jitunInc.jitun, PID: 28829 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jitunInc.jitun/com.jitunInc.jitun.Activity.JitunHomeActivity}: java.lang.ClassCastException: android.graphics.drawable.RippleDrawable cannot be cast to android.graphics.drawable.GradientDrawable at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3037) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6863) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.ClassCastException: android.graphics.drawable.RippleDrawable cannot be cast to android.graphics.drawable.GradientDrawable at c.e.a.a.c$a.a(Unknown Source:106) at com.jitunInc.jitun.Activity.JitunHomeActivity.onCreate(Unknown Source:354) at android.app.Activity.performCreate(Activity.java:7149) at android.app.Activity.performCreate(Activity.java:7140) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6863)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)  2019-07-10 08:45:02.105 562-562/? E/SELinux: avc: denied { find } for service=opdiagnose pid=28829 uid=10586 scontext=u:r:untrusted_app:s0:c74,c258,c512,c768 tcontext=u:object_r:opdiagnose_service:s0 tclass=service_manager permissive=0 2019-07-10 08:45:02.105 562-562/? E/SELinux: avc: denied { find } for service=opdiagnose pid=28829 uid=10586 scontext=u:r:untrusted_app:s0:c74,c258,c512,c768 tcontext=u:object_r:opdiagnose_service:s0 tclass=service_manager permissive=0 2019-07-10 08:45:02.162 885-1495/? E/InputDispatcher: channel '4669927 com.jitunInc.jitun/com.jitunInc.jitun.Activity.SplashActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 2019-07-10 08:45:02.172 885-2775/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.teslacoilsw.launcher/com.teslacoilsw.launcher.NovaLauncher/61161 2019-07-10 08:45:02.343 885-3002/? E/JobScheduler: jobid:20536 java.lang.IllegalStateException: Same jobid in systemuid. at com.android.server.job.JobSchedulerService.scheduleAsPackage(JobSchedulerService.java:888) at com.android.server.job.JobSchedulerService$JobSchedulerStub.schedule(JobSchedulerService.java:2592) at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:44) at com.android.server.backup.FullBackupJob.schedule(FullBackupJob.java:54) at com.android.server.backup.BackupManagerService$3.run(BackupManagerService.java:1925) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.os.HandlerThread.run(HandlerThread.java:65)

    opened by nixonok 1
Releases(1.5)
Owner
Shashank Singhal
Google Certified Android Developer | Freelancer | Android App Developer | Game Developer | API Developer |Software Developer | Web Developer | Open Source lover
Shashank Singhal
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
ionalert 1.3 1.6 Java Sweetalert, Dialog, Alert Dialog

ionalert - Android Alert Dialog A beautiful design Android Alert Dialog, alternative of Sweet Alert Dialog based on KAlertDialog using MaterialCompone

Excel Dwi Oktavianto 23 Sep 17, 2022
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
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)

Ehma Ugbogo 17 Oct 25, 2022
Make a Popup appear long pressing on a view and handle drag-release events on its elements

LongPressPopup You can try the demo app on google play store. https://play.google.com/store/apps/details?id=rm.com.longpresspopupsample Or see the ful

Riccardo Moro 253 Dec 29, 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
An beautiful and easy to use dialog library for Android

An beautiful and easy to use dialog library for Android

ShouHeng 22 Nov 8, 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
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.

Jay Petacat 135 Nov 29, 2022
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

NonZeroApps 22 Aug 23, 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 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 {

claudysoft 9 Aug 18, 2022
CuteDialog- Android Custom Material Dialog Library

A Custom Material Design Dialog Library for Android Purpose CuteDialog is a Highly Customizable Material Design Android Library. CuteDialog allows dev

CuteLibs - Smart & Beautiful Android Libraries 7 Dec 7, 2022
A flutter plugin allows you to create native android floating window.

A flutter plugin allows you to create native android floating window.

7c00 37 Dec 13, 2022
SweetAlert for Android, a beautiful and clever alert dialog

Sweet Alert Dialog SweetAlert for Android, a beautiful and clever alert dialog 中文版 Inspired by JavaScript SweetAlert Demo Download ScreenShot Setup Th

书呆子 7.3k Dec 30, 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
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
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

Daniel Smith 183 Nov 20, 2022