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:
ASChips
Author: Alexander Stolte
Version: 1.00
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:
[B4X] [XUI] AS ScrollingChips based on xCustomListView - Display your Hashtags or Categories
I removed the old code and took the code from the AS_Chips to make this view even better. 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. :) Without scroll...
www.b4x.com
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.
- Initialize
- Fields:
- 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.
- Initialize
- Fields:
- 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.
- Initialize
- Fields:
- 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
FontAwesome To Bitmap
Unlike an older "TextToBitmap" sub that you can find in the forum, this code vertically centers the icon. It can also be used in B4J and B4i (only need to change the font line). Sub Activity_Create(FirstTime As Boolean) 'usage example Activity.AddMenuItem3("Android", "Test"...www.b4x.com - 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]
- Events:
- 1.00
- Release
- 1.01
- Add some properties
- 1.02
- Add AddChip2 - with one more parameter
- ChipColor
- Add AddChip2 - with one more parameter
- 1.03
- Add Clear - removes all chips
- Add get and set GapBetween
- 1.04 (read more)
- Add Event CustomDrawChip
- Add Event EmptyAreaClick
- 1.05
- Add Index to ASChips_Chip Type
- 1.06
- Add get and set TopGap - Gap between items vertical
- Default: 5dip
- Add get and set TopGap - Gap between items vertical
- 1.07
- Add Designer Property SelectionMode - An integrated selection system
- Modes
- None
- Single
- Multi
- Default: None
- Modes
- Add Designer Property CanDeselect - If true, then the user can remove the selection by clicking again
- Default: True
- Add set Selection
- Add ClearSelections
- Add get Selections
- Add CopyChipPropertiesGlobal
- Add RefreshProperties - Updates just the font and colors
- Add Designer Property SelectionBackgroundColor
- Default: Transparent
- Add Designer Property SelectionMode - An integrated selection system
- 1.08
- BugFix
- 1.09
- Add Designer Property SelectionTextColor
- Default: White
- Add SetSelections
- Add Designer Property SelectionTextColor
- 1.10
- BugFixes
- 1.11
- Add SetSelections2 - Set the selected items via a list of indexes
- Add SetSelections3 - Set the selected items via a map of chip tags
- 1.12
- BugFixes
- Add get and set MaxSelectionCount - Only in SelectionMode = Multi - Defines the maximum number of items that may be selected
- Default: 0
- 1.13
- Add GetLabelAt - Gets the chip text label
- Add GetBackgroundAt - Gets the chip background panel
Attachments
Last edited: