B4A Library ToastMessageShow v2.10

ToastMessageShow
Author:
Giuseppe Salvi
Version: 2.0
 

Attachments

  • ToastMessageShow v1.80.zip
    293 KB · Views: 1,642
  • Normal toast from  xml.png
    Normal toast from xml.png
    24.2 KB · Views: 2,578
  • Normal toast with nine-patch.png
    Normal toast with nine-patch.png
    27.4 KB · Views: 2,489
  • standard toast.png
    standard toast.png
    22.7 KB · Views: 2,286
  • Toast with button and bacckground image.png
    Toast with button and bacckground image.png
    117.4 KB · Views: 2,208
  • Toast with button background color and text shadow.png
    Toast with button background color and text shadow.png
    42.2 KB · Views: 2,211
  • Toast with buttton and resources nine-patch.png
    Toast with buttton and resources nine-patch.png
    81.7 KB · Views: 2,185
  • Toast with buttton and with background resources.png
    Toast with buttton and with background resources.png
    77.8 KB · Views: 2,255
  • Toast with buttton gradient and custom font.png
    Toast with buttton gradient and custom font.png
    190.4 KB · Views: 2,251
  • ToastMessageShowv2.10.zip
    50.2 KB · Views: 1,448
Last edited:

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi All, ToastMessageShow is updated v1.70 what's new:

ShowDialogButton
- Show or hide the buttons - by default is hidden


ShowOkButton - True or False - by default is hidden
ShowNoButton - True or False - by default is hidden
ShowCancelButton - True or False - by default is hidden

SetOkTextButton - by default is "Ok"
SetNoTextButton - by default is "No"
SetCancelTextButton - by default is "Cancel"


Tag return the tag of the button ( OK_BUTTON , NO_BUTTON , CANCEL_BUTTON )

Events:

ButtonClick(Index As Int,Tag As Object)
ButtonLongClick(Index As Int,Tag As Object)

Index Return -1 For Ok button , -2 for No button and -3 for Cancel button.

Tag like Tag above.
 

Attachments

  • ToastMessageShowWithButton.png
    ToastMessageShowWithButton.png
    44.6 KB · Views: 420

Shay

Well-Known Member
Licensed User
Longtime User
is there any toast_done ?
I wish to do something once message is gone (after showing the message)
 

MhdBoy

Member
Licensed User
Longtime User
very useful
how i can use the color
i don't konw this format color! : 0x77553377

what's this hex color: #1BA39C ?
how i can convert color?
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
Sub GetColor(hex As String) As Double
    Dim bc As ByteConverter
    Dim r,g,b As Int
    ' 0xE3E2E1
    Log(hex.SubString2(1,3))
    r = Bit.ParseInt(hex.SubString2(1,3), 16)
    g = Bit.ParseInt(hex.SubString2(3,5), 16)
    b = Bit.ParseInt(hex.SubString2(5,7), 16)
    Return Colors.RGB(r, g, b)
End Sub

B4X:
Log(GetColor("#1BA39C"))
 

iz0ndg

Active Member
Licensed User
Longtime User
I'm sorry, but to me the buttons do not work ! ( With your example app)
Tried on two physical devices (S3 cyano11, thl w200s stock)
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi, all ToastMessageShow is updated v1.8 what's new:

Added:

TextColor2
TitleColor2

BackGroundColor2
ToastDone


B4X:
toast.TextColor2 = "#ffa500"

toast.TitleColor2 = "#b33ecd"

toast.BackGroundColor2  = "#603b64"

'*******************************

Sub toast_ToastDone
   
ToastMessageShow("Done",False)
   
End Sub
 

uri kupfer

New Member
Licensed User
Longtime User
hi lonleystar
i think that there is a little error in th library , you have to add this line:
"ToastMessageShowWrapper._showToast.setView(_mainLayout);"
to "public void onTick" in "class TimeExpander".
uri
 

lonleystar

Well-Known Member
Licensed User
Longtime User
hi lonleystar
i think that there is a little error in th library , you have to add this line:
"ToastMessageShowWrapper._showToast.setView(_mainLayout);"
to "public void onTick" in "class TimeExpander".
uri

Hi, what do you mean for the little error.
 

uri kupfer

New Member
Licensed User
Longtime User
hi, without this line i get an error , i have nexus 4 with android 5, after th android 5 instalation i got this error.
 

Shay

Well-Known Member
Licensed User
Longtime User
Hi

Is there a way to put background image instead of color?
 

TheMightySwe

Active Member
Licensed User
Longtime User
Hi, do you think its possible to get this toast with a border, it already looks really nice, but with a border it would look perfect.

Regards,
TMS
 

Tom1s

Member
Licensed User
Longtime User
Hi

Is it normal that if I call:
B4X:
toast.Location = toast.Gravity.CENTER_BOTTOM
toast.Show3("Hello",toast.INFO_ICON)
for example and duration is 10000(10s), I cant get any other toast.show3 to show ?
If I call toast.stop before the next toast.show3 it goes "grazy" and blinks.

Normal ToastMessageShow("Hello2" ,True) shows.
 
Top