B4A Library [B4A] [XUI] BMPopUp v1.1

tsteward

Well-Known Member
Licensed User
Longtime User
For some reason it doesn't matter what I do but the lblContent will not wrap the text and insists on being single line.
 

Brian Michael

Active Member
Licensed User
For some reason it doesn't matter what I do but the lblContent will not wrap the text and insists on being single line.
If you are trying to create a custom label and its not fit you can try

PopUp.addRightAnchorView(YourView)

Also you can try:

PopUp.VScreenAdjust()
 

tsteward

Well-Known Member
Licensed User
Longtime User
If you are trying to create a custom label and its not fit you can try

PopUp.addRightAnchorView(YourView)

Also you can try:

PopUp.VScreenAdjust()
PopUp.VScreenAdjust() fixed it thank you
 

Brian Michael

Active Member
Licensed User
Just another example how to create a Custom PopUp:


Google Idea:



With BMPopUp:




B4X:
    Public PopUp As BMPopUp
    PopUp.Initialize(Activity, "PopUp", Me)
    PopUp.Style = PopUp.STYLE_CUSTOM
    PopUp.Width = 90%x
    PopUp.Height = 70dip
    PopUp.Left = 20dip
    PopUp.Duration = 10
    PopUp.isSwipeable = True
    PopUp.AnimationIn = PopUp.ANIMATION_BOUNCEDOWN
    PopUp.BackColor = Colors.RGB(241, 249, 244)
    PopUp.Border(30,5,Colors.RGB(209, 227, 213))

    Dim CustomIcon As Label = PopUp.addLabel("CustomIcon",3.5%x,15dip)
    CustomIcon.Text = Chr(0xF058)
    CustomIcon.Width = 32dip
    CustomIcon.Height = 32dip
    CustomIcon.TextColor = Colors.White
    CustomIcon.Gravity = Gravity.CENTER
    CustomIcon.Typeface = Typeface.CreateNew(Typeface.FONTAWESOME,Typeface.STYLE_BOLD)
    CustomIcon.TextSize = 16
    Dim CustomIconBorder As ColorDrawable
    CustomIconBorder.initialize2(Colors.RGB(81, 220, 107),100dip,2dip,Colors.ARGB(255,229, 248, 228))
    CustomIcon.background = CustomIconBorder
    
    Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",(CustomIcon.Left + CustomIcon.Width) + 10dip,14dip)
    CustomLabel.Text = "Congratulations!"
    CustomLabel.Width = PopUp.Width
    CustomLabel.Height = 35dip
    CustomLabel.Left = (CustomIcon.Left + CustomIcon.Width) + 10dip
    CustomLabel.TextColor = Colors.Black
    CustomLabel.Typeface = Typeface.CreateNew(Typeface.DEFAULT_BOLD,Typeface.STYLE_BOLD)
    
    Dim CustomText As Label = PopUp.addLabel("CustomText",(CustomIcon.Left + CustomIcon.Width) + 10dip, CustomLabel.TOP + 18dip)
    CustomText.Text = $"Your OS has been updated to the lastest version."$
    CustomText.Width = PopUp.Width * .50
    CustomText.TextColor = Colors.Black
    CustomText.TextSize = 12
    CustomText.Height = PopUp.Height - CustomText.Top
    CustomText.SingleLine = True
    'PopUp.addRightAnchorView(CustomText)
    'PopUp.addBottomAnchorView(CustomText)
    
    Dim CustomCloseButton As Label = PopUp.addLabel("CustomCloseButton",PopUp.Width*.90,15dip)
    CustomCloseButton.Text = Chr(0xF00D)
    CustomCloseButton.Width = 32dip
    CustomCloseButton.Height = 32dip
    CustomCloseButton.TextColor = Colors.DarkGray
    CustomCloseButton.Gravity = Gravity.CENTER
    CustomCloseButton.Typeface = Typeface.CreateNew(Typeface.FONTAWESOME,Typeface.STYLE_BOLD)
    CustomCloseButton.TextSize = 16

    
    PopUp.Show2
 

Brian Michael

Active Member
Licensed User
Hello, I will always be posting some examples of the designs that you can make with BMPopUp, the possibilities so far are very wide.

Google Idea
BMPopUp

B4X:
Public PopUp As BMPopUp
    PopUp.Initialize(Activity, "PopUp", Me)
    PopUp.Style = PopUp.STYLE_CUSTOM
    PopUp.Width = 100%x
    PopUp.Height = 100%y
    'PopUp.Left = 20dip
    PopUp.Duration = 10
    PopUp.isSwipeable = True
    PopUp.AnimationIn = PopUp.ANIMATION_BOUNCEDOWN
    PopUp.BackColor = Colors.LightGray
    'PopUp.Border(30,5,Colors.RGB(209, 227, 213))

    Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
    CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",(60dip),100dip)
    Dim border As ColorDrawable
    border.Initialize2(Colors.White,80,1,Colors.Transparent)
    CustomPanel.Background = border
    CustomPanel.Width = 70%x
    CustomPanel.Height = 35%y
    CustomPanel.SendToBack
    
    Dim CustomIcon As Label = PopUp.addLabel("CustomIcon",(CustomPanel.Width / 2)+25dip,(CustomPanel.Top - 25dip))
    CustomIcon.Text = Chr(0xF121)
    CustomIcon.Width = 64dip
    CustomIcon.Height = 64dip
    CustomIcon.TextColor = Colors.White
    CustomIcon.Gravity = Gravity.CENTER
    CustomIcon.Typeface = Typeface.CreateNew(Typeface.FONTAWESOME,Typeface.STYLE_BOLD)
    CustomIcon.TextSize = 32
    Dim CustomIconBorder As ColorDrawable
    CustomIconBorder.initialize2(Colors.RGB(0, 0, 0),100dip,2dip,Colors.ARGB(100,0, 0, 0))
    CustomIcon.background = CustomIconBorder
    
    Dim CustomCloseButton As Label = PopUp.addLabel("CustomCloseButton",CustomPanel.Width+15dip,CustomPanel.Top + 5dip)
    CustomCloseButton.Text = Chr(0xE5CD)
    CustomCloseButton.Width = 32dip
    CustomCloseButton.Height = 32dip
    CustomCloseButton.TextColor = Colors.LightGray
    CustomCloseButton.Gravity = Gravity.CENTER
    CustomCloseButton.Typeface = Typeface.CreateNew(Typeface.MATERIALICONS,Typeface.STYLE_NORMAL)
    CustomCloseButton.TextSize = 22

    Dim CustomText As Label = PopUp.addLabel("CustomText",(CustomPanel.Left) + 30dip, CustomIcon.TOP + 100dip)
    CustomText.Text = $"Your OS has been updated to the lastest version. Thanks for watch my Library."$
    CustomText.Width = CustomPanel.Width * .80
    CustomText.TextColor = Colors.Black
    CustomText.TextSize = 12
    CustomText.Gravity = Gravity.CENTER
    CustomText.Height = (CustomPanel.Height - CustomText.Top)
    CustomText.SingleLine = False
    
    Dim CustomAcceptButton As Label = PopUp.addLabel("CustomAcceptButton",((CustomText.Width) / 2)+13dip, CustomText.Top + 80dip)
    CustomAcceptButton.Text = "Subscribe"
    CustomAcceptButton.Width = 150dip
    CustomAcceptButton.Height = 30dip
    CustomAcceptButton.TextColor = Colors.White
    CustomAcceptButton.Gravity = Gravity.CENTER
    CustomAcceptButton.TextSize = 13
    Dim CustomBorder As ColorDrawable
    CustomBorder.initialize2(Colors.ARGB(255,53,110,218),20dip,1dip,Colors.ARGB(0,0, 0, 0))
    CustomAcceptButton.Background = CustomBorder
    
    Dim CustomCancelButton As Label = PopUp.addLabel("CustomCancelButton",((CustomText.Width) / 2)+13dip, CustomAcceptButton.Top+ 30dip)
    CustomCancelButton.Text = "Cancel"
    CustomCancelButton.Width = 150dip
    CustomCancelButton.Height = 30dip
    CustomCancelButton.TextColor = Colors.ARGB(255,53,110,218)
    CustomCancelButton.Gravity = Gravity.CENTER
    CustomCancelButton.TextSize = 12
    Dim CustomBorder As ColorDrawable
    CustomBorder.initialize2(Colors.ARGB(255,255,255,255),20dip,1dip,Colors.ARGB(0,0, 0, 0))
    CustomCancelButton.Background = CustomBorder
    
    PopUp.Show2
 

Brian Michael

Active Member
Licensed User
Just another example how to create a Custom PopUp:

Google Example:



BMPopUp:




Code #1:
Public PopUp As BMPopUp
    PopUp.Initialize(Activity, "PopUp", Me)
    PopUp.Style = PopUp.STYLE_CUSTOM
    PopUp.Width = 98%x
    PopUp.Height = 120dip
    PopUp.Duration = 5
    PopUp.isSwipeable = True
    PopUp.AnimationIn = PopUp.ANIMATION_SMOOTHDOWN
    PopUp.AnimationOut = PopUp.ANIMATION_SMOOTHUP
    PopUp.BackColor = Colors.RGB(239, 238, 240)
    PopUp.Border(30,1,Colors.Transparent)
    PopUp.Left = 1.1%x
    PopUp.Top = 1.1%y
    PopUp.BlurEffect = True
    
    Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
    Dim Top As Int = PopUp.IntToDIP((PopUp.Top) / 2)
    CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",25dip,PopUp.Top * Top)
    Dim border As ColorDrawable : border.Initialize2(Colors.Green,5,1,Colors.Transparent)
    CustomPanel.Background = border
    CustomPanel.Width = 40dip
    CustomPanel.Height = 40dip
    CustomPanel.SendToBack
    PopUp.SetGradientBackground(CustomPanel,Array As Int(Colors.RGB(149, 242, 130),Colors.RGB(94, 177, 65)),"TOP_BOTTOM")
    
    Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",CustomPanel.Left + 55dip,CustomPanel.Top - 5dip)
    CustomLabel.Text = "Welcome B4X Forum"
    CustomLabel.Width = PopUp.Width
    CustomLabel.Height = 35dip
    CustomLabel.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel.TextColor = Colors.Black
    CustomLabel.TextSize = 12
    
    Dim CustomLabel2 As Label = PopUp.addLabel("CustomLabel2", (PopUp.Width) * 0.87, CustomLabel.Top - 5dip)
    CustomLabel2.Text = "now"
    CustomLabel2.Width = PopUp.Width
    CustomLabel2.Height = 35dip
    CustomLabel2.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel2.TextColor = Colors.DarkGray
    CustomLabel2.TextSize = 11
    
    Dim CustomText As Label = PopUp.addLabel("CustomText",CustomPanel.Left + 55dip,CustomPanel.Top + 15dip)
    CustomText.Text = $"Lorem Ipsum is simply dummy text of the printing and typesetting industry."$
    CustomText.Width = ((PopUp.Width * .90)-CustomText.Left)
    CustomText.TextColor = Colors.Black
    CustomText.TextSize = 12
    CustomText.Height = PopUp.Height - CustomText.Top
    CustomText.SingleLine = False
    PopUp.addRightAnchorView(CustomText)
    PopUp.addBottomAnchorView(CustomText)






B4X:
    Public PopUp As BMPopUp
    PopUp.Initialize(Activity, "PopUp", Me)
    PopUp.Style = PopUp.STYLE_CUSTOM
    PopUp.mView.Top = 50%y
    PopUp.Width = 98%x
    PopUp.Height = 98dip
    PopUp.Duration = 5
    PopUp.isSwipeable = True
    PopUp.AnimationIn = PopUp.ANIMATION_SMOOTHDOWN
    PopUp.AnimationOut = PopUp.ANIMATION_SMOOTHUP
    PopUp.BackColor = Colors.RGB(239, 238, 240)
    PopUp.Border(30,1,Colors.Transparent)
    PopUp.Left = 1.1%x
    PopUp.Top = 1.1%y
    PopUp.BlurEffect = True
    
    Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
    Dim Top As Int = PopUp.IntToDIP((PopUp.Top) / 3)
    CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",25dip,PopUp.Top * Top)
    Dim border As ColorDrawable : border.Initialize2(Colors.Green,8,1,Colors.Transparent)
    CustomPanel.Width = 40dip
    CustomPanel.Height = 40dip
    CustomPanel.SendToBack
    PopUp.SetGradientBackground(CustomPanel,Array As Int(Colors.RGB(149, 242, 130),Colors.RGB(94, 177, 65)),"TOP_BOTTOM")
    
    Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",CustomPanel.Left + 55dip,CustomPanel.Top - 5dip)
    CustomLabel.Text = "B4X Forum"
    CustomLabel.Width = PopUp.Width
    CustomLabel.Height = 35dip
    CustomLabel.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel.TextColor = Colors.Black
    CustomLabel.TextSize = 12
    
    Dim CustomLabel2 As Label = PopUp.addLabel("CustomLabel2", (PopUp.Width) * 0.87, CustomLabel.Top - 5dip)
    CustomLabel2.Text = "now"
    CustomLabel2.Width = PopUp.Width
    CustomLabel2.Height = 35dip
    CustomLabel2.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel2.TextColor = Colors.DarkGray
    CustomLabel2.TextSize = 11
    
    Dim CustomText As Label = PopUp.addLabel("CustomText",CustomPanel.Left + 55dip,CustomPanel.Top + 15dip)
    CustomText.Text = $"Notification"$
    CustomText.Width = ((PopUp.Width * .90)-CustomText.Left)
    CustomText.TextColor = Colors.Black
    CustomText.TextSize = 12
    CustomText.Height = PopUp.Height - CustomText.Top
    CustomText.SingleLine = True
    PopUp.addRightAnchorView(CustomText)
    PopUp.addBottomAnchorView(CustomText)
    
    PopUp.Show2
 

Brian Michael

Active Member
Licensed User
Hello, this time I come to you with some news and the new version 1.2

Note: New version 1.2 needed. Not avalible yet.
It will be posted soon!


Function to convert Int to DIP (Useful to improve the sizes of the controls).



New function to add backgrounds with gradient colors:



New style Glass:


Light Background:
    Public PopUp As BMPopUp
    PopUp.Initialize(Activity, "PopUp", Me)
    PopUp.Style = PopUp.STYLE_CUSTOM
    PopUp.Width = 96%x
    PopUp.Height = 95dip
    PopUp.Duration = 5
    PopUp.isSwipeable = True
    PopUp.AnimationIn = PopUp.ANIMATION_FADEIN
    PopUp.AnimationOut = PopUp.ANIMATION_FLAT
    PopUp.Border(5,1,Colors.ARGB(0,255,255,255))
    PopUp.Left = 1.5%x
    PopUp.Top = 15%y
    PopUp.GlassEffect(75,"light")
   
    Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
    Dim Top As Int = PopUp.IntToDIP((PopUp.Top) / 4)
    CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",25dip,Top)
    Dim border As ColorDrawable : border.Initialize2(Colors.Green,5,1,Colors.Transparent)
    CustomPanel.Background = border
    CustomPanel.Width = 40dip
    CustomPanel.Height = 40dip
    CustomPanel.SendToBack
    PopUp.SetGradientBackground(CustomPanel,Array As Int(Colors.RGB(149, 242, 130),Colors.RGB(94, 177, 65)),"TOP_BOTTOM")
   
    Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",CustomPanel.Left + 55dip,CustomPanel.Top - 5dip)
    CustomLabel.Text = "Welcome B4X Forum"
    CustomLabel.Width = PopUp.Width
    CustomLabel.Height = 35dip
    CustomLabel.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel.TextColor = Colors.Black
    CustomLabel.TextSize = 13
    CustomLabel.Typeface = Typeface.DEFAULT_BOLD
   
    Dim CustomLabel2 As Label = PopUp.addLabel("CustomLabel2", (PopUp.Width) * 0.87, CustomLabel.Top - 5dip)
    CustomLabel2.Text = "now"
    CustomLabel2.Width = PopUp.Width
    CustomLabel2.Height = 35dip
    CustomLabel2.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel2.TextColor = Colors.ARGB(100,0,0,0)
    CustomLabel2.TextSize = 12
    CustomLabel2.Typeface = Typeface.DEFAULT_BOLD

   
    Dim CustomText As Label = PopUp.addLabel("CustomText",CustomPanel.Left + 55dip,CustomPanel.Top + 15dip)
    CustomText.Text = $"Lorem Ipsum is simply dummy text of the printing and typesetting industry."$
    CustomText.Width = ((PopUp.Width * .90)-CustomText.Left)
    CustomText.TextColor = Colors.Black
    CustomText.TextSize = 13
    CustomText.Height = PopUp.Height - CustomText.Top
    CustomText.SingleLine = False

    PopUp.Show2





Dark Background:
Public PopUp As BMPopUp
    PopUp.Initialize(Activity, "PopUp", Me)
    PopUp.Style = PopUp.STYLE_CUSTOM
    PopUp.Width = 96%x
    PopUp.Height = 95dip
    PopUp.Duration = 5
    PopUp.isSwipeable = True
    PopUp.AnimationIn = PopUp.ANIMATION_FADEIN
    PopUp.AnimationOut = PopUp.ANIMATION_FLAT
    PopUp.Border(5,1,Colors.ARGB(0,255,255,255))
    PopUp.Left = 1.5%x
    PopUp.Top = 15%y
    PopUp.GlassEffect(150,"light")
   
    Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
    Dim Top As Int = PopUp.IntToDIP((PopUp.Top) / 4)
    CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",25dip,Top)
    Dim border As ColorDrawable : border.Initialize2(Colors.Green,5,1,Colors.Transparent)
    CustomPanel.Background = border
    CustomPanel.Width = 40dip
    CustomPanel.Height = 40dip
    CustomPanel.SendToBack
    PopUp.SetGradientBackground(CustomPanel,Array As Int(Colors.RGB(149, 242, 130),Colors.RGB(94, 177, 65)),"TOP_BOTTOM")
   
    Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",CustomPanel.Left + 55dip,CustomPanel.Top - 5dip)
    CustomLabel.Text = "Welcome B4X Forum"
    CustomLabel.Width = PopUp.Width
    CustomLabel.Height = 35dip
    CustomLabel.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel.TextColor = Colors.Black
    CustomLabel.TextSize = 13
    CustomLabel.Typeface = Typeface.DEFAULT_BOLD
   
    Dim CustomLabel2 As Label = PopUp.addLabel("CustomLabel2", (PopUp.Width) * 0.87, CustomLabel.Top - 5dip)
    CustomLabel2.Text = "now"
    CustomLabel2.Width = PopUp.Width
    CustomLabel2.Height = 35dip
    CustomLabel2.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel2.TextColor = Colors.ARGB(160,0,0,0)
    CustomLabel2.TextSize = 12
    CustomLabel2.Typeface = Typeface.DEFAULT_BOLD

   
    Dim CustomText As Label = PopUp.addLabel("CustomText",CustomPanel.Left + 55dip,CustomPanel.Top + 15dip)
    CustomText.Text = $"Lorem Ipsum is simply dummy text of the printing and typesetting industry."$
    CustomText.Width = ((PopUp.Width * .90)-CustomText.Left)
    CustomText.TextColor = Colors.Black
    CustomText.TextSize = 13
    CustomText.Height = PopUp.Height - CustomText.Top
    CustomText.SingleLine = False
   
    PopUp.Show2



Other Examples:



Another Example:
Public PopUp As BMPopUp
    PopUp.Initialize(Activity, "PopUp", Me)
    PopUp.Style = PopUp.STYLE_CUSTOM
    PopUp.Width = 96%x
    PopUp.Height = 95dip
    PopUp.Duration = 5
    PopUp.isSwipeable = True
    PopUp.AnimationIn = PopUp.ANIMATION_FADEIN
    PopUp.AnimationOut = PopUp.ANIMATION_FLAT
    PopUp.Border(5,1,Colors.ARGB(0,255,255,255))
    PopUp.Left = 1.5%x
    PopUp.Top = 15%y
    PopUp.GlassEffect(150,"dark")
   
    Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
    Dim Top As Int = PopUp.IntToDIP((PopUp.Top) / 4)
    CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",25dip,Top)
    Dim border As ColorDrawable : border.Initialize2(Colors.Green,5,1,Colors.Transparent)
    CustomPanel.Background = border
    CustomPanel.Width = 40dip
    CustomPanel.Height = 40dip
    CustomPanel.SendToBack
    PopUp.SetGradientBackground(CustomPanel,Array As Int(Colors.RGB(149, 242, 130),Colors.RGB(94, 177, 65)),"TOP_BOTTOM")
   
    Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",CustomPanel.Left + 55dip,CustomPanel.Top - 5dip)
    CustomLabel.Text = "Welcome B4X Forum"
    CustomLabel.Width = PopUp.Width
    CustomLabel.Height = 35dip
    CustomLabel.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel.TextColor = Colors.White
    CustomLabel.TextSize = 13
    CustomLabel.Typeface = Typeface.DEFAULT_BOLD
   
    Dim CustomLabel2 As Label = PopUp.addLabel("CustomLabel2", (PopUp.Width) * 0.87, CustomLabel.Top - 5dip)
    CustomLabel2.Text = "now"
    CustomLabel2.Width = PopUp.Width
    CustomLabel2.Height = 35dip
    CustomLabel2.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel2.TextColor = Colors.ARGB(100,255,255,255)
    CustomLabel2.TextSize = 12
    CustomLabel2.Typeface = Typeface.DEFAULT_BOLD

   
    Dim CustomText As Label = PopUp.addLabel("CustomText",CustomPanel.Left + 55dip,CustomPanel.Top + 15dip)
    CustomText.Text = $"Lorem Ipsum is simply dummy text of the printing and typesetting industry."$
    CustomText.Width = ((PopUp.Width * .90)-CustomText.Left)
    CustomText.TextColor = Colors.White
    CustomText.TextSize = 13
    CustomText.Height = PopUp.Height - CustomText.Top
    CustomText.SingleLine = False

    PopUp.Show2

Another Example:

 
Last edited:

Brian Michael

Active Member
Licensed User
Hi, i have an Example how you can Display multiple notifications in a row.

Example:




B4X:
Dim lst as List : lst.Initialize

For i = 1 To 3
        Public PopUp As BMPopUp
        PopUp.Initialize(Activity, "PopUp"&i, Me)
        PopUp.Style = PopUp.STYLE_CUSTOM
        PopUp.Width = 96%x
        PopUp.Height = 95dip
        PopUp.Duration = 3
        PopUp.isSwipeable = True
        PopUp.AnimationIn = PopUp.ANIMATION_FADEIN
        PopUp.AnimationOut = PopUp.ANIMATION_FLAT
        PopUp.Border(5,1,Colors.ARGB(0,255,255,255))
        PopUp.Left = 1.5%x
        PopUp.Top = 15%y
        'PopUp.GlassEffect(150,"dark")
        PopUp.BackColor = Colors.ARGB(150,Rnd(0,255),Rnd(0,255),Rnd(0,255))
   
        Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
        Dim Top As Int = PopUp.IntToDIP((PopUp.Top) / 4)
        CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",25dip,Top)
        Dim border As ColorDrawable : border.Initialize2(Colors.Green,5,1,Colors.Transparent)
        CustomPanel.Background = border
        CustomPanel.Width = 40dip
        CustomPanel.Height = 40dip
        CustomPanel.SendToBack
        PopUp.SetGradientBackground(CustomPanel,Array As Int(Colors.RGB(149, 242, 130),Colors.RGB(94, 177, 65)),"TOP_BOTTOM")
       
        Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",CustomPanel.Left + 55dip,CustomPanel.Top - 5dip)
        CustomLabel.Text = "Welcome B4X Forum"
        CustomLabel.Width = PopUp.Width
        CustomLabel.Height = 35dip
        CustomLabel.Left = CustomLabel.Left - CustomLabel.Width
        CustomLabel.TextColor = Colors.White
        CustomLabel.TextSize = 13
        CustomLabel.Typeface = Typeface.DEFAULT_BOLD
       
        Dim CustomLabel2 As Label = PopUp.addLabel("CustomLabel2", (PopUp.Width) * 0.87, CustomLabel.Top - 5dip)
        CustomLabel2.Text = "now"
        CustomLabel2.Width = PopUp.Width
        CustomLabel2.Height = 35dip
        CustomLabel2.Left = CustomLabel.Left - CustomLabel.Width
        CustomLabel2.TextColor = Colors.ARGB(100,255,255,255)
        CustomLabel2.TextSize = 12
        CustomLabel2.Typeface = Typeface.DEFAULT_BOLD

        Dim CustomText As Label = PopUp.addLabel("CustomText",CustomPanel.Left + 55dip,CustomPanel.Top + 15dip)
        CustomText.Text = $"Lorem Ipsum is simply dummy text of the printing and typesetting industry."$
        CustomText.Width = ((PopUp.Width * .90)-CustomText.Left)
        CustomText.TextColor = Colors.White
        CustomText.TextSize = 13
        CustomText.Height = PopUp.Height - CustomText.Top
        CustomText.SingleLine = False
        lst.Add(PopUp)
        'Log(PopUp.mEventName & " Added")
    Next
   
    For Each P As BMPopUp In lst
        Wait For (P.Show2) Complete(R As Object)
        Do While P.isVisible
            Sleep(1000)
        Loop
        Sleep(0)
    Next
    lst.Clear
 
Last edited:

Brian Michael

Active Member
Licensed User
Hi, another example how you can Display multiple notifications dropdown.

Note: New version 1.2 needed. Not available yet.
It will be posted soon!





B4X:
Sub Button1_Click
   
    Public PopUp As BMPopUp
    PopUp.Initialize(Activity, "PopUp" & PopUp_List.Size, Me)
    PopUp.Style = PopUp.STYLE_CUSTOM
    PopUp.Width = 96%x
    PopUp.Height = 95dip
    PopUp.Duration = 3
    PopUp.isSwipeable = True
    PopUp.AnimationIn = PopUp.ANIMATION_VERTICAL
    PopUp.AnimationOut = PopUp.ANIMATION_FLAT
    PopUp.Border(5,1,Colors.ARGB(0,255,255,255))
    PopUp.Left = 1.5%x
    PopUp.Top = (12%y *  PopUp_List.Size)
    PopUp.BackColor = Colors.ARGB(150,Rnd(0,255),Rnd(0,255),Rnd(0,255))
   
    Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
    Dim Top As Int = PopUp.IntToDIP((PopUp.Height) / 4)
    CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",25dip,Top)
    Dim border As ColorDrawable : border.Initialize2(Colors.Green,5,1,Colors.Transparent)
    CustomPanel.Background = border
    CustomPanel.Width = 40dip
    CustomPanel.Height = 40dip
    CustomPanel.SendToBack
    PopUp.SetGradientBackground(CustomPanel,Array As Int(Colors.RGB(149, 242, 130),Colors.RGB(94, 177, 65)),"TOP_BOTTOM")
   
    Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",CustomPanel.Left + 55dip,CustomPanel.Top - 5dip)
    CustomLabel.Text = "Welcome B4X Forum #" & PopUp_List.Size
    CustomLabel.Width = PopUp.Width
    CustomLabel.Height = 35dip
    CustomLabel.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel.TextColor = Colors.White
    CustomLabel.TextSize = 13
    CustomLabel.Typeface = Typeface.DEFAULT_BOLD
   
    Dim CustomLabel2 As Label = PopUp.addLabel("CustomLabel2", (PopUp.Width) * 0.87, CustomLabel.Top - 5dip)
    CustomLabel2.Text = "now"
    CustomLabel2.Width = PopUp.Width
    CustomLabel2.Height = 35dip
    CustomLabel2.Left = CustomLabel.Left - CustomLabel.Width
    CustomLabel2.TextColor = Colors.ARGB(100,255,255,255)
    CustomLabel2.TextSize = 12
    CustomLabel2.Typeface = Typeface.DEFAULT_BOLD

    Dim CustomText As Label = PopUp.addLabel("CustomText",CustomPanel.Left + 55dip,CustomPanel.Top + 15dip)
    CustomText.Text = $"Lorem Ipsum is simply dummy text of the printing and typesetting industry."$
    CustomText.Width = ((PopUp.Width * .90)-CustomText.Left)
    CustomText.TextColor = Colors.White
    CustomText.TextSize = 13
    CustomText.Height = PopUp.Height - CustomText.Top
    CustomText.SingleLine = False
    PopUp_List.Add(PopUp)
   
End Sub

Sub Button2_Click
   
    For i = 1 To 3
        Public PopUp As BMPopUp
        PopUp.Initialize(Activity, "PopUp" & PopUp_List.Size, Me)
        PopUp.Style = PopUp.STYLE_CUSTOM
        PopUp.Width = 96%x
        PopUp.Height = 95dip
        PopUp.Duration = 3
        PopUp.isSwipeable = True
        PopUp.AnimationIn = PopUp.ANIMATION_VERTICAL
        PopUp.AnimationOut = PopUp.ANIMATION_FLAT
        PopUp.Border(5,1,Colors.ARGB(0,255,255,255))
        PopUp.Left = 1.5%x
        PopUp.Top = (12%y *  PopUp_List.Size)
        PopUp.BackColor = Colors.ARGB(150,Rnd(0,255),Rnd(0,255),Rnd(0,255))
   
        Dim CustomPanel As Panel : CustomPanel.Initialize("CustomPanel")
        Dim Top As Int = PopUp.IntToDIP((PopUp.Height) / 4)
        CustomPanel = PopUp.addCustomView(CustomPanel,"CustomPanel",25dip,Top)
        Dim border As ColorDrawable : border.Initialize2(Colors.Green,5,1,Colors.Transparent)
        CustomPanel.Background = border
        CustomPanel.Width = 40dip
        CustomPanel.Height = 40dip
        CustomPanel.SendToBack
        PopUp.SetGradientBackground(CustomPanel,Array As Int(Colors.RGB(149, 242, 130),Colors.RGB(94, 177, 65)),"TOP_BOTTOM")
       
        Dim CustomLabel As Label = PopUp.addLabel("CustomLabel",CustomPanel.Left + 55dip,CustomPanel.Top - 5dip)
        CustomLabel.Text = "Welcome B4X Forum #" & PopUp_List.Size
        CustomLabel.Width = PopUp.Width
        CustomLabel.Height = 35dip
        CustomLabel.Left = CustomLabel.Left - CustomLabel.Width
        CustomLabel.TextColor = Colors.White
        CustomLabel.TextSize = 13
        CustomLabel.Typeface = Typeface.DEFAULT_BOLD
       
        Dim CustomLabel2 As Label = PopUp.addLabel("CustomLabel2", (PopUp.Width) * 0.87, CustomLabel.Top - 5dip)
        CustomLabel2.Text = "now"
        CustomLabel2.Width = PopUp.Width
        CustomLabel2.Height = 35dip
        CustomLabel2.Left = CustomLabel.Left - CustomLabel.Width
        CustomLabel2.TextColor = Colors.ARGB(100,255,255,255)
        CustomLabel2.TextSize = 12
        CustomLabel2.Typeface = Typeface.DEFAULT_BOLD

        Dim CustomText As Label = PopUp.addLabel("CustomText",CustomPanel.Left + 55dip,CustomPanel.Top + 15dip)
        CustomText.Text = $"Lorem Ipsum is simply dummy text of the printing and typesetting industry."$
        CustomText.Width = ((PopUp.Width * .90)-CustomText.Left)
        CustomText.TextColor = Colors.White
        CustomText.TextSize = 13
        CustomText.Height = PopUp.Height - CustomText.Top
        CustomText.SingleLine = False
        PopUp_List.Add(PopUp)
    Next
   
    PopUp_List.Show3(1500)
End Sub

You can do the same effect with Loops, but it's easier just using the new Show3(WaitTime As Int).
 

Brian Michael

Active Member
Licensed User
Hello, I am adding some improvements to the glass effect that will be released in the new version 1.2

Having before the mode (LIGHT and DARK) now the mode (DOMINANT) has been added, it basically uses the dominant color behind the notification to give it a more beautiful and aesthetic visual effect.



LIGHT & DARK MODE DOMINANT MODE GRADIENT 2 DOMINANT COLORS

 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…