B4A Library Customtoast library

Hey,

I was just a bit bored and decided to make a small library for fun.
It's nothing special. With this library, you are able to position your toastmessage and choose the duration.

The duration is approximately and not correct.

B4X:
Dim ct1 As CustomToast
ct1.Initialize
ct1.Show("This is a custom toast message.",10000,Gravity.TOP,0,0)

It also works when the activity is closed.

Cheers,

Tomas
 

Attachments

  • Customtoast.zip
    3.7 KB · Views: 2,567
Last edited:

pluton

Active Member
Licensed User
Longtime User
It is great.

I saw on web examples of toast message in eclipse. Is it possible like on the pictures

Does it possible to made library with make toast message like this:

toast3.png
toast4.png


Link where is explained is:
B4X:
http://www.codeproject.com/KB/android/toasts-android.aspx
:sign0188:
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
Thanks guys!

Customtoast library has been updated.
Now you are able to add an image to the toast message shown on the post above. However it's not possible to add the Attention(see the right image) as you'd need your own custom xml files.

E.g

B4X:
Dim btmp As Bitmap
btmp.Initialize(File.DirAssets,"rs.png")
Dim ct1 As CustomToast
ct1.Initialize
ct1.ShowBitmap("This is a custom toast message.",10000,Gravity.FILL,0,0,btmp)

This will make a toast message covering the whole screen for approx. 10 seconds, showing a logo at the top and text beneath it.

XverhelstX
 
Last edited:

ssg

Well-Known Member
Licensed User
Longtime User

XverhelstX

Well-Known Member
Licensed User
Longtime User
Thanks guys!
Feels good to help out other people and 'expand' B4A with new libraries.
I'm already started my next library and I hope to get it released later today.

@ SSG, seems like a nice game. i think the Custom Toast with the trophee actually fits it. :icon_clap: Nice work

XverhelstX
 
Last edited:

alibaba

Member
Licensed User
Longtime User
Great Work many thanks ! :sign0098:

Is it possible do change the Font Size ?

regards
 

Nyptop

Active Member
Licensed User
Longtime User
Thanks for the Brilliant Library :)

Is it possible to have an 'ok' button like in a normal toast message with this feature?

Neil
 

pluton

Active Member
Licensed User
Longtime User
Thanks for the Brilliant Library :)

Is it possible to have an 'ok' button like in a normal toast message with this feature?

Neil
I think that toastmessage doesn't have "OK" button or any button.

Did you mix it with MsgBox ???
 

Nyptop

Active Member
Licensed User
Longtime User
Oh dear yes, could you set me on the right track for finding out how to do this with an MsgBox. Thanks again,

Neil
 

pamoxi

Member
Licensed User
Longtime User
Change font size

Is it possible to add the ability to change the size and font color?
Thank you, excellent library.
 

salmander

Active Member
Licensed User
Longtime User
The toast message on android has a slight transparency. Can you add this into this library please?
 
Top