Code Monkey home page Code Monkey logo

fancygifdialog-android's Introduction

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

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.

fancygifdialog-android's People

Contributors

karntrehan avatar shashank02051997 avatar yerenutku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fancygifdialog-android's Issues

build.gradle failed

ERROR: Failed to resolve: com.github.Shashank02051997:FancyGifDialog-Android:1.2

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.

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();
                 }

              }
                 });
         }

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?

Not working in a fragment

When I pass getActivity() in new FancyAlertDialog.Builder(getActivity()) no error though it doesn't show up

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

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)

PositiveButton

How do you go about closing the dialog after some positive action?

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.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.