tapadoo / alerter Goto Github PK
View Code? Open in Web Editor NEWAn Android Alerting Library
License: MIT License
An Android Alerting Library
License: MIT License
ndroid.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/ 4.4.2 huawei crash
Is it possible to create an global alerter regardless on which activity?
It will be create to have an option for custom animation of exit and enter of the alert other than slide in and slide out effect.
I've run into a strange behaviour while defining an OnClickListener
in a TextView
in order to show an alerter. It doesn't show at the first click, while the second triggers it twice. You can observe the same behaviour every second click. I just reproduced it in the example application by adding a TextView
to the layout and:
@Override
protected void onCreate(Bundle savedInstanceState) {
...
findViewById(R.id.textttt).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showAlertDefault();
}
});
}
I have an icon named ic_notifications when the Alert is showing, my icon tints to white color, its due to the fact that the library has the same name as my icon. A possible solution would be to change the icons name to something that is tied to the library name.
How to handle this scenario?
Hi,
The library is crashing.
Please provide a fix.
java.lang.NullPointerException:
at com.tapadoo.alerter.Alerter$1.run(Alerter.java:90)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1119)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1239)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:766)
at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:860)
at android.view.Choreographer.doCallbacks(Choreographer.java:672)
at android.view.Choreographer.doFrame(Choreographer.java:605)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:846)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method:0)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Hello guys! First of all, thanks so much for this amazing library.
Is there any way to change the color of the progress bar?
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference
at com.tapadoo.alerter.Alerter$1.run(Alerter.java:90)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1140)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1239)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:766)
at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:894)
at android.view.Choreographer.doCallbacks(Choreographer.java:696)
at android.view.Choreographer.doFrame(Choreographer.java:628)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:880)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5740)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)
In the sample app, if you press a bunch of times on DEFAULT ALERT you end up with a stack of Alerts on top of each other, it just looks like one. If you then press on e.g. COLOURED ALERT it'll call clearCurrent
and remove the first of the existing Alerts that it finds, but when the coloured Alert goes away you can see the old Alerts still there. If you do COLOURED ALERT (slowly) enough times eventually you clear the stack of Alerts, but that doesn't seem like the right behaviour.
As of now the integration of the lib requires that one has to checkout the code and include the module.
If published to jitpack/bintray other devs need only include a single line for the dependency and gradle would pull the dependency.
Hi guys!
I tried to import the project. The current build.gradle for the alerter module will throw an error if no Bintray credentials are not present. This means no one can open the project, until they go to their gradle.properties file and provide dummy credentials.
See here:
I think this is not what you want, so I fixed it in this PR: #5
Hi! Is there a way to don't show any icon? I tried "null" and color trasparent but it has to be a Drawable so it doesn't work. I could make a trasparent drawable but it would be very easy to check if drawable exists or is null and set icon to null if that.
If there is a way I couldn't find it and if there is not we could add that option.
Currently, I'm using Reflection to hide the alert, but I think it would be much better to have a public method to do it.
Is there any way to change the ProgressBar color?
how to Disable close alert by click ?
For my Requirements, I need to decrease the Alerter Height. Any Possible way to do so?
Or should i resort to removing the Title?
Is there Any support for RTL Languages?!
It's fairly simple to change the alerter_alert_view.xml and make it RTL Friendly!
I use this on Android Studio,and exception happened:
android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class android.support.v7.widget.AppCompatImageView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.view.View.inflate(View.java:19784)
at com.tapadoo.alerter.Alert.initView(Alert.java:108)
at com.tapadoo.alerter.Alert.(Alert.java:79)
at com.tapadoo.alerter.Alerter.create(Alerter.java:56)
at com.coldstorage3.AlarmNotificationPackage.AlarmNotification.rnCallNative(AlarmNotification.java:64)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:368)
at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:138)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:148)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208)
at java.lang.Thread.run(Thread.java:818)
Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class android.support.v7.widget.AppCompatImageView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
can you give me some propose?
Thanks.
When the Alerter is shown, the PorterDuffView will not call the method onDraw until it is hiden.
Here is my code:
setContentView(new PorterDuffView(this));
Alerter.create(this)
.setIcon(R.mipmap.ic_launcher)
.setText("hello world")
.setDuration(3000)
.setBackgroundColor(R.color.colorPrimary)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
})
.show();
Hi,
It's can update title/text/icon after the Alerter
showing?
In my app, use Alerter
to notify user when receive new audio message.
And I want to show audio playing duration in text
.
Thanks,
Fatal Exception: java.lang.NullPointerException
at com.tapadoo.alerter.Alerter$1.run(SourceFile:90)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1035)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1056)
at android.animation.ValueAnimator.access$400(ValueAnimator.java:50)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:644)
at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:660)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:572)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(NativeStart.java)
Thanks a lot for this lib, I have issues in using inside OnReceive
Alerter.create(context)
.setTitle("Alert Title")
.setText("Alert text...")
.show();
Hello,
I am not able to load this library in my code.
I get this error when I include it in gradle: Failed to resolve: com.tapadoo.android:alerter:1.0.9
My Gradle version : 2.2.0
My Android Studio version : 2.3.1
com.tapadoo.android:alerter:1.0.8 works
I'm unable to add this compile 'com.tapadoo.android:alerter:1.0.4' dependency in build.gradle file
I'm getting error:
Failed to resolve: com.tapadoo.android:alerter:1.0.4
What to do to resolve that error?
Says Alterting Library
instead of Alerting Library
😉
It would be cool if the haptic feedback was optional instead of mandatory since it can be sometimes annoying
I think it would be a great feature to be able to swipe and dismiss the alert, in case onClick is used for something else.
Or another close button at the top right if that's easier.
Hello,
This is an amazing library I just loved it.
It has a potential to replace boring Alert/Popups.
I request you to Add Buttons on it.
Our app is viewed by drivers and the default text is a bit too small. Any chance of getting a jumbo text mode?
Thank you
BTW this is a very nicely designed component and api. Thanks for creating it.
Would you like to support alert to show in bottom location
Thanks for the awesome lib!
In multiple new Google apps a very thin progress bar is used (e.g. the new web login form)
It would be handy if a similar progress bar is indicating the remaining time of an Alerter until automatically disappearing when millis are given.
NotFoundException for com.aitrich.android.orderpro
android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/ic_map_marker_white_48dp.png from xml type xml resource ID #0x7f020102
at android.content.res.Resources.loadXmlResourceParser(Resources.java:3059)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:3014)
at android.content.res.Resources.getXml(Resources.java:1383)
at android.support.graphics.drawable.VectorDrawableCompat.create(VectorDrawableCompat.java:586)
at com.tapadoo.alerter.Alert.setIcon(Alert.java:471)
at com.tapadoo.alerter.Alerter.setIcon(Alerter.java:342)
at com.aitrich.android.orderpro.ui.fragment.operation.InventoryVoucherFormFragment$4.onClick(InventoryVoucherFormFragment.java:1732)
at android.view.View.performClick(View.java:5269)
at android.view.View$PerformClick.run(View.java:21556)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Caused by: java.io.FileNotFoundException: Corrupt XML binary file
at android.content.res.AssetManager.openXmlAssetNative(Native Method)
at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:504)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:3041)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:3014)
at android.content.res.Resources.getXml(Resources.java:1383)
at android.support.graphics.drawable.VectorDrawableCompat.create(VectorDrawableCompat.java:586)
at com.tapadoo.alerter.Alert.setIcon(Alert.java:471)
at com.tapadoo.alerter.Alerter.setIcon(Alerter.java:342)
at com.aitrich.android.orderpro.ui.fragment.operation.InventoryVoucherFormFragment$4.onClick(InventoryVoucherFormFragment.java:1732)
at android.view.View.performClick(View.java:5269)
at android.view.View$PerformClick.run(View.java:21556)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Alerter.create(getActivity())
.setText("Eelect destination location")
.setBackgroundColorRes(R.color.colorAccent)
.setIcon(R.drawable.ic_map_marker_white_48dp)
.show();
I want to disable the outside touch when the Alerter is showing. Can I do that with your Library?
or by Any other way?
let me know ASAP.
thanks.
Something I could see useful, is allowing custom layout files to be provided, is this something planned for in the future?
This could allow much more flexibility, such as custom fonts, no icons, etc.
How To Change Font Face ?
how to make alerter in service ?
add setLayoutDirection so that we could change layout direction for RTL texts in non RTL phones as well
How to know alerter is running ?
isShowing() ?
Hello friend, incredible LIB that you have created, I've been using it in a project and would like to know if it's possible to include buttons inside the notification. Example: When a notification appears, there is also option A and option B each with a different activity.
Thanks for help. ;)
dismiss Listener? show Listener
Wondering if min sdk is 16 for a reason... Do you foresee any problems by having a min sdk < 16? In my case would be 15.
Would there be any way to set an action? For example, if someone accidentally deletes something in a coordinator layout with a snackbar I can do .setAction and set a button to undo.
java.lang.NullPointerException at com.tapadoo.alerter.Alerter$1.run(Alerter.java:91) at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1050) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1056) at android.animation.ValueAnimator.access$400(ValueAnimator.java:50) at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:644) at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:660) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:788) at android.view.Choreographer.doCallbacks(Choreographer.java:591) at android.view.Choreographer.doFrame(Choreographer.java:559) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:774) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:229) at android.app.ActivityThread.main(ActivityThread.java:5493) 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:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:676) at dalvik.system.NativeStart.main(Native Method)
Hi, I run the demo project and found the view has an extra bottom shadow. How to remove it?
My device: Samsung note4, Android 6.0.1
The screenshot :
http://imgur.com/vMk5LVK
I want to use it when app exist but its not show.
How to solve this?
Could you give me some proposes?
Thanks.
The library is awesome. I wanna know can the alert view slide down from the bottom of toolbar?
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.