B4A Library ImageBadgeView

Enjoy https://github.com/nikartm/Image-Support in B4A

ibv.jpg

ImageBadgeView

Author: SMM
Version: 0.01
  • ImageBadgeView
    • Events:
      • click
    • Fields:
      • BADGEPOSITION_BOTTOM_LEFT As Int
      • BADGEPOSITION_BOTTOM_RIGHT As Int
      • BADGEPOSITION_CENTER As Int
      • BADGEPOSITION_TOP_LEFT As Int
      • BADGEPOSITION_TOP_RIGHT As Int
    • Functions:
      • BringToFront
      • Initialize (EventName As String)
      • Invalidate
      • Invalidate2 (arg0 As android.graphics.Rect)
      • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
      • IsInitialized As Boolean
      • RemoveView
      • RequestFocus As Boolean
      • SendToBack
      • SetBackgroundImage (arg0 As android.graphics.Bitmap)
      • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
      • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
      • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
      • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • Properties:
      • Background As android.graphics.drawable.Drawable
      • BadgeBackground As android.graphics.drawable.Drawable [write only]
      • BadgeOvalAfterFirst As Boolean [write only]
      • BadgePadding As Int [write only]
      • BadgePosition As Int [write only]
      • BadgeTextFont As Typeface [write only]
      • BadgeTextSize As Int [write only]
      • BadgeValue As Int [write only]
      • Color As Int [write only]
      • Enabled As Boolean
      • Height As Int
      • Left As Int
      • LimitBadgeValue As Boolean [write only]
      • MaxBadgeValue As Int [write only]
      • Padding As Int()
      • Parent As Object [read only]
      • ShowCounter As Boolean [write only]
      • Tag As Object
      • Top As Int
      • Visible As Boolean
      • Width As Int

Sample :
B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim ibv As ImageBadgeView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    ibv.Initialize("ibv")
    Activity.AddView(ibv,0,0,50%x,50%y)
    ibv.SetBackgroundImage(LoadBitmap(File.DirAssets,"bg.png"))
    ibv.BadgePosition=ibv.BADGEPOSITION_CENTER
    ibv.BadgeValue=3
    ibv.BadgePadding=6
End Sub
 Sub ibv_click
     ibv.BadgeValue=Rnd(3,9)
End Sub
 

Attachments

  • ImageBadgeView.zip
    31.5 KB · Views: 336
Top