simonvt / messagebar Goto Github PK
View Code? Open in Web Editor NEWAn Android Toast replacement, similar to the one seen in the GMail app.
Home Page: http://simonvt.github.com/MessageBar/
License: Apache License 2.0
An Android Toast replacement, similar to the one seen in the GMail app.
Home Page: http://simonvt.github.com/MessageBar/
License: Apache License 2.0
I'm new to your great libraries and I have a hard time making up what each library does.
Screenshots might help a lot.
Cheers,
C.
As the title stats, when an AlertDialog is showing and MessageBar(...)
is called, the MessageBar is always displayed behind the dimmed background of the AlertDialog.
I think this has to be fixed because a Toast is able to be displayed above/infront of an AlertDialog.
I tried playing around with the internal mContainer
View by calling the View.bringToFront() method, but that didn't work either.
It doesn't work. The log shows that NullPointerException occurs at "new MessageBar(this)" in the sample project. I don't understand why. My device is Samsung GT-7562. Does anybody other encounter trouble like this?
This is a neat library, but one thing that would really make it more useful is the ability to pass in a style. For example, maybe I want red messagebars for errors.. green for confirmations.. and grey for general messages?
Theres no easy way to mix and match right now, because you're tied to what you do in the style that you declare for the activity.
I embed the MessageBar in an Fragment. It works fine at first. But when I switch out and in to the same Fragment again. An empty MessageBar displays at the bottom of the screen and never disappears. I have no clue how to fix this.
Is it because in Fragment you can't construct a MessageBar instance using MessageBar mb = new MessageBar(getActivity()); ? I note in the doc it says that in Fragment you have to use a different method. But after following the doc and run the app, it crashes and reports a bug in init() of MessageBar saying that "layout_width" attribute not provided...
In the sample I noticed that there is no demo showing how to use one in Fragment. Would you please complete the demo? Thank you!
Calling MessageBar messageBar = new MessageBar(this); from an activity extending ActionBarActivity (Support Library v7) gives an XML Inflating error:
Binary XML file line #25: Error inflating class android.support.v7.internal.widget.ActionBarView
It seems that by "injecting" the message layout into the activity layout breaks the ActionBarView layout, thus causing the error.
I've tried the same with a regular activity and it works.
Can you give it a try and see if it works on your side?
I was clicking the button on the toast during the fade out animation and I got this:
E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: net.simonvt.messagebar.samples, PID: 3073
java.lang.NullPointerException
at net.simonvt.messagebar.samples.SampleActivity.onMessageClick(SampleActivity.java:67)
at net.simonvt.messagebar.MessageBar$2.onClick(MessageBar.java:151)
at android.view.View.performClick(View.java:4456)
at android.view.View$PerformClick.run(View.java:18462)
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:5102)
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:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
You handle the case that the actionMessage is null and only show the text in that case. Could you also add the opposite? If the message is null, the button will take the full width of the MessageBar.
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.