I took the original Badger code from @Erel and modified it to create a new view.
I spend a lot of time in creating views, some views i need by my self, but some views not and to create a high quality view cost a lot of time. If you want to support me, then you can do it here by Paypal or with a coffee.
		
		
	
	
		
	
		
	
		
	
		
	
TextAnimation_Slide
		
	
TextAnimation_Growth
		
	
TextAnimation_FadeIn
		
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
ASBadges
Author: Alexander Stolte
Version: 1.01
Have Fun
	
			
			I spend a lot of time in creating views, some views i need by my self, but some views not and to create a high quality view cost a lot of time. If you want to support me, then you can do it here by Paypal or with a coffee.
TextAnimation_Slide
TextAnimation_Growth
TextAnimation_FadeIn
			
				B4X:
			
		
		
		Dim BadgeProperties As AS_Badges_BadgeProperties = AS_Badges1.BadgeProperties
BadgeProperties.BackgroundColor = xui.Color_Red
BadgeProperties.Orientation = AS_Badges1.Orientation_TopLeft
AS_Badges1.SetBadge2(xlbl_Label,8,BadgeProperties)
	Author: Alexander Stolte
Version: 1.01
- AS_Badges
- Functions:
- Class_Globals As String
 - CreateAS_Badges_BadgeProperties (BackgroundColor As Int, TextColor As Int, xFont As B4XFont, Orientation As String) As AS_Badges_BadgeProperties
 - GetBadgeCounter (view As B4XView) As Int
Gets the Count of the badge on this view - getBadgeProperties As AS_Badges_BadgeProperties
 - getFadeInDuration  As Long
Default: 250 - getOrientation_BottomLeft As String
 - getOrientation_BottomRight As String
 - getOrientation_TopLeft As String
 - getOrientation_TopRight As String
 - getRadius As Float
 - getTextAnimation As String
 - getTextAnimation_FadeIn As String
 - getTextAnimation_Growth As String
 - getTextAnimation_Slide As String
 - getTextDuration  As Long
Default: 250 - Initialize As String
 - IsInitialized  As Boolean
Tests whether the object has been initialized. - SetBadge (View As B4XView, Badge As Int) As String
 - SetBadge2 (View As B4XView, Badge As Int, Properties As AS_Badges_BadgeProperties) As String
 - setBadgeProperties (Properties As AS_Badges_BadgeProperties) As String
 - setFadeInDuration (Duration As Long) As String
 - setRadius (Radius As Float) As String
 - setTextAnimation (AnimationName As String) As String
 - setTextDuration (Duration As Long) As String
 
 - Properties:
- BadgeProperties As AS_Badges_BadgeProperties
 - FadeInDuration As Long
Default: 250 - Orientation_BottomLeft As String [read only]
 - Orientation_BottomRight As String [read only]
 - Orientation_TopLeft As String [read only]
 - Orientation_TopRight As String [read only]
 - Radius As Float
 - TextAnimation As String
 - TextAnimation_FadeIn As String [read only]
 - TextAnimation_Growth As String [read only]
 - TextAnimation_Slide As String [read only]
 - TextDuration As Long
Default: 250 
 
 - Functions:
 - AS_Badges_BadgeProperties
- Fields:
- BackgroundColor As Int
 - IsInitialized As Boolean
Tests whether the object has been initialized. - Orientation As String
 - TextColor As Int
 - xFont As B4XFont
 
 - Functions:
- Initialize
Initializes the fields to their default value. 
 - Initialize
 
 - Fields:
 
- 1.00
- Release
 
 - 1.01 (read more)
- B4J BugFix - The text animation now no longer slips outside the badge
 - Add get and set TextAnimation - Various text change animations
- Default: TextAnimation_Slide
 - TextAnimation_Slide - The old text slides out to the right
 - TextAnimation_Growth - The font grows animated
 - TextAnimation_FadeIn - The alpha of the new text is increased animatedly
 
 
 - 1.02 (read more)
- Breaking Change - Initialize needs now a CallBack and a EventName
 - Add Event Click
 
 - 1.03 (read more)
- BugFixes
 - Add set AutoRemove - Removes the badge if the value is 0
- Default: True
 
 
 - 1.04
- Property descriptions added
 - Add get and set xGap and yGap - This allows you to change the position of the badge. e.g. position it further to the left or higher up so that it matches the design.
- Default: 0
 
 
 
Have Fun
Attachments
			
				Last edited: