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

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

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

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
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…