pedant / sweet-alert-dialog Goto Github PK
View Code? Open in Web Editor NEWSweetAlert for Android, a beautiful and clever alert dialog
Home Page: http://pedant.github.io
SweetAlert for Android, a beautiful and clever alert dialog
Home Page: http://pedant.github.io
I wanted to use this library on Eclipse but I can't get it working, can you explain me how to do it without Maven and Gradle?
java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation
at com.zhuhean.dongxi.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:77)
at com.zhuhean.dongxi.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:64)
at com.zhuhean.dongxi.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:41)
at com.zhuhean.dongxi.SweetAlert.OptAnimationLoader.loadAnimation(OptAnimationLoader.java:22)
at com.zhuhean.dongxi.SweetAlert.SweetAlertDialog.(SweetAlertDialog.java:74)
at com.zhuhean.dongxi.SweetAlert.SweetAlertDialog.(SweetAlertDialog.java:66)
at com.zhuhean.dongxi.settings.UserSettings$2.onPreferenceClick(UserSettings.java:32)
at android.preference.Preference.performClick(Preference.java:1011)
at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:222)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1288)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2972)
at android.widget.AbsListView$1.run(AbsListView.java:3767)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5326)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:848)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:615)
at dalvik.system.NativeStart.main(Native Method)
I am getting this exception when running robolectric tests:
android.content.res.Resources$NotFoundException: Resource ID #0x7f0a0001
at android.content.res.Resources.getValue(Resources.java:1118)
at android.content.res.Resources.getDimensionPixelSize(Resources.java:613)
at cn.pedant.SweetAlert.ProgressHelper.<init>(ProgressHelper.java:22)
at cn.pedant.SweetAlert.SweetAlertDialog.<init>(SweetAlertDialog.java:78)
at com.myapp.activity.register.RegisterActivity.showNotConnectedToTheInternetDialog(RegisterActivity.java:213)
If i add the library project in the projet.properties file like this:
android.library.reference.1=gen-external-apklibs/cn.pedant.sweetalert_library_1.3.1
then I get this exception:
java.lang.RuntimeException: Unknown animation name: sweet:cn.pedant.SweetAlert.Rotate3dAnimation error:sweet:cn.pedant.SweetAlert.Rotate3dAnimation
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:77)
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:64)
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:41)
at cn.pedant.SweetAlert.OptAnimationLoader.loadAnimation(OptAnimationLoader.java:22)
at cn.pedant.SweetAlert.SweetAlertDialog.<init>(SweetAlertDialog.java:80)
at com.myapp.activity.register.RegisterActivity.showNotConnectedToTheInternetDialog(RegisterActivity.java:213)
Have you tried running robolectric tests yourself ?
Description Resource Path Location Type
error: Error: No resource found that matches the given name (at 'style' with value '@style/dialog_blue_button'). sample_activity.xml /SampleActivity/res/layout line 32 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'style' with value '@style/dialog_blue_button'). sample_activity.xml /SampleActivity/res/layout line 52 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'style' with value '@style/dialog_blue_button'). sample_activity.xml /SampleActivity/res/layout line 72 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'style' with value '@style/dialog_blue_button'). sample_activity.xml /SampleActivity/res/layout line 92 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'style' with value '@style/dialog_blue_button'). sample_activity.xml /SampleActivity/res/layout line 113 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'style' with value '@style/dialog_blue_button'). sample_activity.xml /SampleActivity/res/layout line 133 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'style' with value '@style/dialog_blue_button'). sample_activity.xml /SampleActivity/res/layout line 153 Android AAPT Problem
there is no .setCancelable() function available in this library to prevent the cancellation of dialog on back button press.
How can i change the font of text inside dialog message?
SweetAlertDialog dialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE);
...
// show for the first time
dialog.show();
...
dialog.dismissWithAnimation(); // prefer this because of the cool animation
...
// reuse the dialog and show it again
dialog.show(); // this won't work properly, the window dims, but dialog won't show up, and you can't click anything on the window
If I use dialog.dismiss()
inherited from Dialog instead of dialog.dismissWithAnimation()
, then I am able to reuse that dialog.
In my app, there's no status bar (see my way below to hide status bar). However, every time I show alert dialog, the status bar is coming annoying again.
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.hide();
}
I am using sweet dialog to show dialog on in my app
here is my code,
SweetAlertDialog pDialog = new SweetAlertDialog(mContext, SweetAlertDialog.PROGRESS_TYPE);
pDialog.getProgressHelper().setBarColor(Color.parseColor("#A5DC86"));
pDialog.setTitleText("Loading");
pDialog.setCancelable(false);
pDialog.show();
Got Runtime Error:
E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoSuchFieldError: cn.pedant.SweetAlert.R$id.title_text
at cn.pedant.SweetAlert.SweetAlertDialog.onCreate(SweetAlertDialog.java:143)
at android.app.Dialog.dispatchOnCreate(Dialog.java:351)
at android.app.Dialog.show(Dialog.java:256)
at com.cloudvisionsystems.webapp.ShowWebView$1.onLoadResource(ShowWebView.java:98)
at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:529)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Is there any gradle or maven port that we can use to import it in projects without copying the jar to lib.
As titled
Is it possible to support dialog with custom view like edit text input?
After I add compile 'cn.pedant.sweetalert:library:1.3'
into my Android Studio Gradle build file, I got an error message in build
`Error:Gradle: Execution failed for task ':XXX:processOfficialDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\ProgramPortable\android-sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1`
I tried many solutions like re-install the build tool, but it does not work.
This may be a environment issue, however, it works well after I change v1.3 to v1.2.
ps.add tools:replace="android:icon" into androidmanifest.xml is useless.
Thanks
When using version 1.3 with materialish-progress, when compiling an application, I get an Error Code: 139. This seems to point to a problem with a strings definition that doesn't exist. I can provide more of the error if needed. Version 1.2 works and compiles from gradle no problem.
Would be great if, beside the confirm and cancel buttons there could be the "neutral" button.
It can be used, for example, in "rate this app" dialogs: Yes/No/Later
File: alert_dialog.xml
Line: 125
Code: android:textColor="#575757"
Expected: android:textColor="@color/textcolor"
Current : hardcoded color
Now way to override color without XML change
java.lang.NoSuchFieldError: cn.pedant.SweetAlert.R$id.title_text
Good library is excellent but when adding the file Gradle me the following error causes the application icon:
Error:(7, 9) Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:7:9
Could u please update the maven central with latest version. Unable to use Materialish progress.
Thanks
Hi,
I love sweet alert. I'm damn sure my app user will also love. But I have a doubt, shall we configure the position and size of the sweet alert ?? Because it's occupying more space :(
*Note: This is not an issue, I don't know where to ask questions. :( *
I'm trying to compile this project.
I used ./gradlew assemble and it showed "BUILD SUCCESSFUL" at the end of the run.
It generated /library/build/libs/library-1.3-sources.jar at size of 8kb. I tried putting it in my libs folder of my project, but it doesn't seem to be working. If I try to decompile the jar file I see that the classes inside are empty.
How do I use this library?
java.lang.NoClassDefFoundError: com.networkbench.agent.impl.background.NBSApplicationStateMonitor
at cn.pedant.SweetAlert.sample.SampleActivity.onStart(SampleActivity.java)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5304)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2171)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2259)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5061)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:812)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
at dalvik.system.NativeStart.main(Native Method)
I was trying to use sweet alert dialog(which is dependent on materialish-progress) with another library and on gradle compile, I receive following error.
Error:Attribute "barColor" has already been defined
I raised issue with materialish-progress (nico2sh/materialish-progress#11) to prefix attributes with some name so that they never clash with any other names and they have fixed this issue.
Can you now please update your lib to use latest materialish-progress build.
I use Eclipse to develop android and want to use your library, first I import it into Eclipse, second click right button and chose property then let it be a library.
finally, use the same method to add it as a dependency of my project, but it show me the "The constructor SweetAlertDialog(new Handler(){}, int) is undefined", I think my step is correct.
Is it can't use this way to import?
Error:(26, 9) Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:26:9
Error:(26, 9) Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:26:9
is also present at com.pnikosis:materialish-progress:1.0:13:9 value=(@drawable/ic_launcher)
Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:23:5 to override
Since the dismiss() method is doing some async work there(modal out animation, https://github.com/pedant/sweet-alert-dialog/blob/master/library/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java#L310 ) , Dialog.dismiss() may not be invoked before the container activity actually stopped/finished.
Would be great if we can provide some sync dismiss() method there.
Hello,
was trying to use the dialog, and me something strange happens, the "ok" and the error icon, warning and succed button are outside the top of the dialog as shown in the attached catch (me not happen in the app demo) only when I integrate my app.
use: telephone motomaxx (droidturbo), android 4.4.4, other libraries that use "betterpickers", "navasmdc: MaterialDesign"
I hope you can help me, thank you very much beforehand hands by your beautiful library.
I mean can i change background colors and ets?
gradle 1.3找不到
Is it possible?
Hello sir,
I am wishing to use sweet alert dialog in my app.I'm trying to integrate package
"cn.pedant.SweetAlert".But,I'm facing error due to missing class ProgressWheel,Because this class not included in your package.Please help me to solve the issue.Thnaks in advance
在混淆文件中设置了
-keep class cn.pedant.sweetalert.**{ *; }
-keep class com.pnikosis.materialishprogress.**{ *; }
依旧出错
Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation
要如何设置,以避免代码混淆?
java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error: [class android.content.Context, interface android.util.AttributeSet]
at cn.pedant.SweetAlert.OptAnimationLoader.a(OptAnimationLoader.java:77)
at cn.pedant.SweetAlert.OptAnimationLoader.a(OptAnimationLoader.java:64)
at cn.pedant.SweetAlert.OptAnimationLoader.a(OptAnimationLoader.java:41)
at cn.pedant.SweetAlert.OptAnimationLoader.a(OptAnimationLoader.java:22)
at cn.pedant.SweetAlert.SweetAlertDialog.(SweetAlertDialog.java:80)
public void setTitle(CharSequence title) {
mWindow.setTitle(title);
mWindow.getAttributes().setTitle(title);
}
public void setTitle(int titleId) {
setTitle(mContext.getText(titleId));
}
setTitle(mContext.getText(titleId));
change to
mWindow.setTitle(mContext.getText(titleId));
mWindow.getAttributes().setTitle(mContext.getText(titleId));
?
oh,sorry, setTitleText can change title,but setTitle(int) can change what?
setting setCanceledOnTouchOutside(true);
on touch outside app hangs up.
When i have a long string, I can't seem to copy the message content. While the cursor is displayed, when i try to click and drag nothing is selected.
可以只有單純轉進度條不要有Title的部份嗎?
就一個Loading框不用文字,目前好像不設定都會補齊
please can u implement progress dialog?
Is there any way i can the color of the action buttons from blue ?
java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation
at cn.pedant.SweetAlert.a.a(Unknown Source)
at cn.pedant.SweetAlert.a.a(Unknown Source)
at cn.pedant.SweetAlert.a.a(Unknown Source)
at cn.pedant.SweetAlert.a.a(Unknown Source)
at cn.pedant.SweetAlert.j.(Unknown Source)
at cn.pedant.SweetAlert.j.(Unknown Source)
at my.app.a.a(Unknown Source)
at my.app.a.f.onClick(Unknown Source)
at android.view.View.performClick(View.java:4443)
at android.view.View$PerformClick.run(View.java:18433)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
How can I set the font size and font family of the elements in the dialog? How can set a style for the buttons?
Also thanks for the great work, using it both, on web and on android!
i try to import this library, but i cant do this.
Thanks.
sorry for my poor english
我设置为true 点旁边区域 没有反应呢?
Dialog dialog = new ShareAlertDialog(this, 1);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
dialog.show();
hi in my application whenever user copies something i show a dialog to find it in a dictionary now suppose i showed 5 dialogues then the user wants to leave activity he has to press back button 5 times to exit how can i correct this issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.