Enjoy this library from B4A https://github.com/apocalx/colortextview
Colors for TextViews
NOTE:
Use appcompat library
ColorTextView
Author: SMM
Version: 0.01
Sample
Colors for TextViews
NOTE:
Use appcompat library
B4X:
@DependsOn(values={"android-support-v4","android-support-v7-appcompat"})
Author: SMM
Version: 0.01
- ColorTextView
Events:- _click
- ba As BA
- BringToFront
- Initialize (EventName As String)
- Invalidate
- Invalidate2 (arg0 As 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 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)
- SetTextColorAnimated (arg0 As Int, arg1 As Int)
- SetTextSizeAnimated (arg0 As Int, arg1 As Float)
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- addTextColor (text As String, color As Int)
- apply
- Background As Drawable
- Color As Int [write only]
- Enabled As Boolean
- Gravity As Int
- Height As Int
- Left As Int
- Parent As Object [read only]
- Spaces As Boolean [write only]
- Tag As Object
- Text As String
- TextColor As Int
- TextSize As Float
- Top As Int
- Typeface As Typeface
- 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 demo As ColorTextView
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")
demo.Initialize("demo")
demo.Text="Begin"
demo.addTextColor("adipiscing elit, sed do eiusmod tempor incididunt",Colors.Green)
demo.addTextColor("incididunt ut labore et dolore magna aliqua.",Colors.White)
demo.addTextColor("Lorem ipsum dolor sit amet, consectetur",Colors.Yellow)
demo.Spaces=True
demo.apply
Activity.AddView(demo,0,0%y,100%x,100%y)
End Sub