B4A Library [B4X] [XUI] AS Chips - Display your Hashtags, Filters or Categories

With this view you can display and interact with your hashtags, filters or categories. The view can expand itself if more chips are added than there is space for. (AutoExpand = True)

I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee. :)

Scrolling alternative:

eIcZ6TnN621P6qGokntMQXjhB1XAlYp5U2fu2IOOqJJXEWHfA1.jpeg
Y6OyufOoB4UdttsHsRC1anyTNBCbsIErhrPvdogXkkqFbyebQG.jpeg


ASChips
Author: Alexander Stolte
Version: 1.00

  • ASChips_Chip
    • Fields:
      • Icon As B4XBitmap
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Tag As Object
      • Text As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASChips_ChipProperties
    • Fields:
      • BackgroundColor As Int
      • BorderSize As Float
      • CornerRadius As Float
      • Height As Float
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • TextColor As Int
      • TextGap As Float
      • xFont As B4XFont
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASChips_RemoveIconProperties
    • Fields:
      • BackgroundColor As Int
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • TextColor As Int
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • AS_Chips
    • Events:
      • ChipClick (Chip As ASChips_Chip)
      • ChipLongClick (Chip As ASChips_Chip)
      • ChipRemoved (Chip As ASChips_Chip)
      • HeightChanged (Height As Float)
      • HiddenChipsClicked (ListChips As List)
    • Fields:
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • AddChip (Text As String, Icon As B4XBitmap, xTag As Object) As String
      • Class_Globals As String
      • CreateASChips_ChipProperties (Height As Float, BackgroundColor As Int, TextColor As Int, xFont As B4XFont, CornerRadius As Float, BorderSize As Float, TextGap As Float) As ASChips_ChipProperties
      • CreateASChips_RemoveIconProperties (BackgroundColor As Int, TextColor As Int) As ASChips_RemoveIconProperties
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • FontToBitmap (text As String, IsMaterialIcons As Boolean, FontSize As Float, color As Int) As B4XBitmap
      • getAutoExpand As Boolean
      • GetChip (Index As Int) As ASChips_Chip
      • GetChipProperties (Index As Int) As ASChips_ChipProperties
      • getChipPropertiesGlobal As ASChips_ChipProperties
        Can only influence the appearance before the respective chip has been added
      • getRemoveIconProperties As ASChips_RemoveIconProperties
        Call RefreshChips if you change something
      • getShowRemoveIcon As Boolean
      • getSize As Int
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • RefreshChips As String
      • RemoveChip (Index As Int) As String
      • setAutoExpand (Expand As Boolean) As String
      • SetChipProperties (Index As Int, Properties As ASChips_ChipProperties) As String
        Call RefreshChips if you change something
      • setShowRemoveIcon (Show As Boolean) As String
    • Properties:
      • AutoExpand As Boolean
      • ChipPropertiesGlobal As ASChips_ChipProperties [read only]
        Can only influence the appearance before the respective chip has been added
      • RemoveIconProperties As ASChips_RemoveIconProperties [read only]
        Call RefreshChips if you change something
      • ShowRemoveIcon As Boolean
      • Size As Int [read only]
Changelog
  • 1.00
    • Release
  • 1.01
    • Add some properties
Have Fun :)
 

Attachments

  • AS_Chips Example.zip
    179 KB · Views: 24
  • AS_Chips.b4xlib
    4.2 KB · Views: 25
Last edited:

CryoGenID

Active Member
Licensed User
Longtime User
Hello Alexander,

thanks!
But isn't that exactly what I am trying to do?
I change the "top" value of all views that are "below" the auto-sizing asChips view...
But for some reason the views inside the CLV do not update visually... In debug mode I can see that the calculated top values are higher than the values before but the views are not "moving down" :-/

Or did I miss something with your approach vs. mine (which I believe are the same)?

Thanks for any enlightenment :)

Best regards,

Chris
 
Top