Android Question What is this tint called and how to change it?

Meigionel TS

Member
Licensed User
Hello, when I long press a radiobutton or a checkbox there appears a circular halo or tint behind the views. Look at the picture I have attached you will get the idea. I don't know what it is called, and I also want to change the color of it using JavaObject, please help me here.

Thanks.
 

Attachments

  • WhatsApp Image 2019-02-06 at 8.37.43 PM.jpeg
    WhatsApp Image 2019-02-06 at 8.37.43 PM.jpeg
    20.4 KB · Views: 197

Meigionel TS

Member
Licensed User
@Erel It does not have any effect on the radiobuttons and checkboxes, please look at the image in the first post and see that when I am long pressing a checkbox there appears a greenish halo (circular halo) which is appearing behind the view, I want to know what it is called and how to change it's color.

Thanks.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can change the checkbox color with:
B4X:
Sub SetBackgroundTintList(View As View,Active As Int, Enabled As Int)
   Dim States(2,1) As Int
   States(0,0) = 16842908     'Active
   States(1,0) = 16842910    'Enabled
   Dim Color(2) As Int = Array As Int(Active,Enabled)
   Dim CSL As JavaObject
   CSL.InitializeNewInstance("android.content.res.ColorStateList",Array As Object(States,Color))
   Dim jo As JavaObject = View
   jo.RunMethod("setButtonTintList", Array(CSL)) 'available from API 21. Need to check with Phone.SdkVersion
End Sub

However it doesn't change the halo color.
 
Upvote 0
Top