Make your native android Dialog Fancy and Gify.

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.4'
}

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
                .setTitleTextColor(R.color.titleText)
                .setDescriptionTextColor(R.color.descriptionText)
                .setNegativeBtnText("Cancel") // or pass it like android.R.string.cancel
                .setPositiveBtnBackground(R.color.positiveButton) 
                .setPositiveBtnText("Ok") // or pass it like android.R.string.ok
                .setNegativeBtnBackground(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.")
                .setTitleTextColor(R.color.titleText)
                .setDescriptionTextColor(R.color.descriptionText)
                .setPositiveBtnText("Ok")
                .setPositiveBtnBackground(R.color.positiveButton)
                .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 | Mobile App Developer | Game Developer | API Developer | Software Developer | Web Developer | Open Source lover
Shashank Singhal
Flutter progress dialog. Support both Android and iOS platform.

Flutter Progress Dialog [pub packages] | Flutter progress dialog. Support both Android and iOS platform

Dylan Wu 22 Oct 9, 2022
Fancy design of radio buttons in Flutter (package).

A Flutter package for new radio button design. With Elegant Animation. Features Usage TODO: Include short and useful examples for package users. Add l

Aymen Boucheffa 0 Nov 26, 2021
Progress Dialog widget for flutter projects with ability to customize loading widget, background color and background blur.

DISCONTINUED Checkout ArsDialog ars_progress_dialog Customizable progress dialog for Flutter applications with smooth animation for background dim col

Arsam 8 Apr 15, 2022
Dialog-manager - A Flutter package that allows for neater declaration, abstraction and use of customisable dialogs

flutter_dialog_manager A Flutter package that allows for neater declaration, abs

Lucky Ebere 2 Dec 28, 2022
A multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.

A multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.

Carlos Eugenio Torres 73 Sep 7, 2022
SKAlertDialog - A highly customizable, powerful and easy-to-use alert dialog for Flutter.

SKAlertDialog A highly customizable, powerful and easy-to-use alert dialog for Flutter. GIF Screenshots SKAlertDialog Basic Alert Alert with buttons A

Senthil_Kumar 7 May 18, 2022
Display simple blurry dialog popup for flutter

Blurry Dialog Features Display simple blurry dialog popup Offer built-in themes Possibility to create you custom dialog button click handler callbacks

Kouki Badr 7 Dec 18, 2022
Widget to let the user search through a keyword string typed on a customizable keyboard in a single or multiple choices list presented as a dropdown in a dialog box or a menu.

searchable_dropdown Widget to let the user search through a keyword string typed on a customizable keyboard in a single or multiple choices list prese

Bobby Stenly Irawan 108 Sep 11, 2022
🚀🚀🚀 Semantic dialog

✨ flutter_custom_dialog [Language ~~] English | 中文文档 Global dialog function encapsulation, with a semantic way to fill the content inside the dialog,

YYDev 459 Dec 2, 2022
A Flutter widget to show a text form field to display a date or clock dialog

A Flutter widget to show a text form field to display a date or clock dialog. This widget extend TextField and has a similar behavior as TextFormField.

m3uzz Soluções em TI 82 Jan 6, 2023
Flutter overlay loading dialog example

flutter_overlay_loading_dialog_example Demo

Javeed Ishaq 4 Mar 24, 2022
A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter

flutter_floatwing A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter. Android only Features Pure Flu

Zoe 116 Dec 21, 2022
Provider support for overlay, make it easy to build toast and In-App notification.

overlay_support Provider support for overlay, make it easy to build toast and In-App notification. this library support ALL platform Interaction If yo

Bin 340 Jan 1, 2023
Flutter custom widget to make a group buttons. Included Radio and CheckBox buttons.

Flutter widget to create a group of buttons fast ?? Included Radio and CheckBox buttons models with custom groping types ?? Show some ❤️ and star the

Stanislav Ilin 162 Dec 26, 2022
A Flutter Widget to make interactive timeline widget.

Bubble Timeline Package A Flutter Widget to make interactive timeline widget. This widget can be used to make Event Timelines, or Timelines for certai

Vansh Goel 12 Sep 22, 2022
Widget, that can make any static located widget hidable

Installing See the official installing guidline from hidable/install Usage & Overview To start using Hidable widget, we have to create a ScrollControl

Anon 18 Dec 16, 2022
A basic Flutter app that includes some native Widgets like alerts, cards, avatars, animated container, inputs, etc.

Flutter components This project was created with Flutter and some native Widgets like alerts, cards, avatars, animated container, inputs, etc. Getting

Paúl 4 Nov 15, 2021
Flutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.

assorted_layout_widgets I will slowly but surely add interesting widgets, classes and methods to this package. Despite the package name, they are not

Marcelo Glasberg 122 Dec 22, 2022
PlutoGrid is a dataGrid that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.

PlutoGrid is a dataGrid that can be controlled by the keyboard on desktop and web.

Manki Kim 453 Jan 4, 2023