Giter Club home page Giter Club logo

sweet-alert-dialog's Introduction

sweet-alert-dialog's People

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

sweet-alert-dialog's Issues

setCancelButtonBackgroundColor not working

java.lang.ClassCastException: com.google.android.material.button.MaterialButtonBackgroundDrawable cannot be cast to android.graphics.drawable.StateListDrawable
        at cn.pedant.SweetAlert.ViewUtils.getDrawable(ViewUtils.java:11)
        at cn.pedant.SweetAlert.SweetAlertDialog.setButtonBackgroundColor(SweetAlertDialog.java:482)
        at cn.pedant.SweetAlert.SweetAlertDialog.setCancelButtonBackgroundColor(SweetAlertDialog.java:472)
        at cn.pedant.SweetAlert.SweetAlertDialog.onCreate(SweetAlertDialog.java:224)

Implementation with asynctakloader

Hi,

I've used this library in my project in particular I create the loader with:

loadingDialog = new SweetAlertDialog(this, PROGRESS_TYPE); loadingDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86")); loadingDialog.setTitleText("Loading");

and in the onCreateLoader:
loadingDialog.show();

and finally when the loading task is completed ( onLoadFinish) I use:
loadingDialog.dismissWithAnimation();

What happens here is that when the activity is created everything is fine and the dialog is shows and dissapears as expect. The real issue happens when i restart the loader and then the activity becomes unclicable.

Do you have any idea on what could be causing this issue?

setContentText display cutted text without last line

Hi, in some case I noticed the last line in dialog is cutted, whether you use setContentText() or use setCustomView(textView). It isn't cutted at fixed number of lines it's vary from the lenght of the last line.
It is not cut to a fixed number of lines, but changes according to the length of the last line, I think.
One example is:
final SweetAlertDialog koDialog = new SweetAlertDialog(MainActivity.this, SweetAlertDialog.ERROR_TYPE)
.setTitleText(getResources().getString(R.string.ko_error))
.setContentText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam
interdum commodo felis, et lobortis quam interdum at. ")
.setConfirmText(getResources().getString(android.R.string.ok));
koDialog.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
@OverRide
public void onClick(SweetAlertDialog sDialog) {
sDialog.dismissWithAnimation();
}
});
koDialog.setCancelable(false);
koDialog.show();
Try with different text and check if the last word is visible. I've also tried by adding concat("\n") but sometimes also this method dosen't work.

There is another problem if I set ratingbar inside a customview sometimes the last star is cutted.

Thanks

OK button text not centered vertically

I have noticed that button text is not centered vertically, either when I do not use setConfirmButton (then button says Ok) and when I use setConfirmButton (to make button text uppercase):

        String html = "Powiadomienia zostaną wyłączone do czasu ponownego uruchomienia aplikacji.";

        new SweetAlertDialog(this, SweetAlertDialog.NORMAL_TYPE)
                .setTitleText("Uśpij aplikację")
                .setContentText(html)
                .setConfirmButton("OK", sweetAlertDialog -> {

                    // TODO disable notifications
                    finish();
                })
                .show();

image

It would be great if you can give me some advice if it is possible to center it vertically - thank you :)

dismissWithAnimation issue

When I create a dialog instance and call .dismissWithAnimation() the dialog goes useless. If I call .show() again on it does not appear, just got black overlay on the screen. I think this is product of the out animation, in the dismissWithAnimation impl the alpha animation is set on the child view and that alpha never goes back to 1.0f.

.setCancelable(false) not working. Please add it

new SweetAlertDialog(UserComplaintRegistration.this, SweetAlertDialog.NORMAL_TYPE)
.setTitleText("a"))
.setContentText("b")
.setConfirmText("c")
.setCancelable(false)
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
@OverRide
public void onClick(SweetAlertDialog sDialog) {

                    sDialog.dismiss();
                }
            })
            .show();

.setCancelable(false) not working. Please add it

PROGRESS_TYPE dialog height

Hello

There is space below Loading text. So what can i do to remove it?

capture

`Here is my code

    SweetAlertDialog pDialog = new SweetAlertDialog(Pilot.this, SweetAlertDialog.PROGRESS_TYPE);

    @Override
    protected void onPreExecute() {
        super.onPreExecute();

        pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
        pDialog.setTitle("Loading");
        pDialog.setCancelable(false);
        pDialog.show();
    }`

Disable navbar reenabled on sweetalertdialog show

I am disabling navbar with below:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

Once I run a SweetAlertDialog, the navbar is enabled again.
If I leave the activity and return it is correctly disabled once more, but then comes back on again with another SweetAlertDialog.

Error on Building (Marge Manifest)

Got this error :

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:12:9-43
is also present at [com.pnikosis:materialish-progress:1.0] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher).
Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:10:5-61:19 to override.

Maybe need to update materialish-progress

Content text cut off

Text of the content is not showing as the string is. It will cut some text from the end. I have tested on moto g6 play and one plus five.

The original string is : "Thank you for posting your load.\nPlease be on the standby for transports associate bid." I have declared string in string.xml file.
sweet_alert_oneplus
sweet_alert_g6

Text not wrapping on custom view (more than 5 lines)

Im not sure if its because of the framelayout, instead of linear layout, but overall, it should work the way it is implemented, but for some reason, if you add a text view at setCustomView(textView) with more than 5 lines of text, it only shows the first 4 lines and omit the rest.

Any fix ? Thanks

I got error on Android 8

I got error on Android 8 on firebase

Fatal Exception: android.view.WindowManager$BadTokenException Unable to add window -- token android.os.BinderProxy@17f2660 is not valid; is your activity running? project.helper.CheckUpdateHelper.showDialogForUpdate

This crash is usually caused by your app trying to display a dialog using a previously-finished Activity as a context. For example, this can happen if an Activity triggers an AsyncTask that tries to display a dialog when it is finished, but the user navigates back from the Activity before the task is completed.

External resources
Android – Displaying Dialogs From Background Threads
Error : BinderProxy@45d459c0 is not valid; is your activity running?

How do you display long text?

长文字怎么显示?我看超过两行就后面的不显示。
How do you display long text? I see more than two lines on the back does not show.

MergeResource conflict

 <attr name="sa_pivotX" format="fraction"/>
 <attr name="sa_pivotY" format="fraction" />

Please rename to avoid conflicts with constraint layout having the latest version in androidx

Spinner

Hello Sir
Can I use the dialog to show list of items in Spinner

Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation

Getting this error after enabling obfuscation, here is a full stack trace

2021-09-11 23:36:45.152 10096-10096/<packagename> E/AndroidRuntime: FATAL EXCEPTION: main
    Process: <packagename>, PID: 10096
    java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation
        at a2.b.b(:83)
        at a2.b.b(:65)
        at a2.b.a(:41)
        at a2.b.c(:22)
        at a2.k.<init>(:125)
        at androidx.fragment.app.Fragment.n1(:2987)
        at androidx.fragment.app.t.f(:546)
        at androidx.fragment.app.t.m(:282)
        at androidx.fragment.app.m.d0(:2189)
        at androidx.fragment.app.m.a1(:2106)
        at androidx.fragment.app.m.a0(:2002)
        at androidx.fragment.app.m$g.run(:524)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:251)
        at android.app.ActivityThread.main(ActivityThread.java:7465)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)

Tried adding the following rules to my proguard-rules.pro file but the error still persists

keep class cn.pedant.** { *; }
-keep class cn.pedant.SweetAlert.Rotate3dAnimation {
    public <init>(...);
 }
-keep class cn.pedant.SweetAlert.Rotate3dAnimation

Set full width sweet alert dialog

Hi,
I'm using sweet alerts for my android app.but it's not getting full width. any way to resolve this? android version :- kitkat.
Thanks.

IMG_20190502_104227

Bug

Fatal Exception: java.lang.RuntimeException
Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation
cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml
keyboard_arrow_down

Button Text

Hello
I have problems in Button text. All text is not displaying.

Three buttons are: Cancel,PRESCRIPTION,BILL

capture

cn.pedant.SweetAlert.Rotate3dAnimation

E/UncaughtException: java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation

Set custom font

Good to see the project went on, have you implemented a method to set custom text/font yet?

Change button color back to blue

Hi,

thank you very much for your work! Still, I have one question: How can I change the button color back to blue? Your version has green buttons, but they don't really work out with my design.

Thank you, keep up the good work!

Dark background not used for Theme.MaterialComponents.DayNight

I am using material DayNight theme:

<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">

This theme is set as used always in my custom App class (this clas is set properly in manifest):

public class MyApplication extends Application {

    public void onCreate() {
        super.onCreate();

        AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
    }
}

The problem is that my app uses dark theme, but this beautiful dialogs has white theme. How to fix that?

Manifest error

I can't compile . I changed name of icon but it's still not working

Error building : duplicate Attributes

Hi,

The latest version fails to build due to conflict of duplicated attributes
pivotX and pivotY were introduced in the latest versions of constraint layout.

values.xml:6875: error: duplicate value for resource 'attr/pivotX' with config ''.
values.xml:6875: error: duplicate value for resource 'attr/pivotY' with config ''.

Bug

When I released my apk in android studio it makes my app to crash but in debug mode it does not.
I am using Kotlin.
The crash caused by this.
java.lang.RuntimeException: Unknown animation name: pedant.SweetAlert.Rotate3dAnimation

Confirm button warning type not work or not call

Hey , I'm using kotlin for this library. When I want to click onConfirm clickListener , nothing happens.

                val pDialog = SweetAlertDialog(activity, SweetAlertDialog.WARNING_TYPE)

                pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"))
                pDialog.setTitleText("Warning!")
                pDialog.setConfirmText("OK")
                pDialog.setContentText("For Recieving Menu of Restaurant Please Turn Your Bluetooth On")
                pDialog.setConfirmClickListener {
                    object:SweetAlertDialog.OnSweetClickListener{
                        override fun onClick(sweetAlertDialog: SweetAlertDialog?) {
                            Log.d("TAGG","enter click")
                            sweetAlertDialog!!.dismissWithAnimation()
                            val enableIntent = Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)
                            startActivityForResult(enableIntent, 0)

                        }
                    }
                }
                pDialog.show()

Dialog is appeared but My OK click not work. I write a code for turning on Bluetooth , it does not work either. what am i wrong about?

Large padding bottom

There is large padding bottom when the dialog type is SweetAlertDialog.PROGRESS_TYPE. Is it possible to change this size manually ? And if not, can you fix this problem ? Thanks a lot.

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.