Android Question Checkbox colors for a disabled CB

MrKim

Well-Known Member
Licensed User
Longtime User
Sometimes I feel like I must be missing something obvious. I can't believe the default colors for a disabled CB means you can't tell if it is checked or not!

Can anyone recommend appropriate colors for a disabled CheckBox? I am setting it in code and don't want the user to change it. The default colors show up fine Enabled, disabled - you can barely tell it is checked, I hate to cover it with a panel - or write code to keep setting it back. I have tried black, white, and a bunch of colors in between. I have messed with the Alpha - nothing seems to make it something that you don't have to squint to see.

Any ideas greatly appreciated.
 

MrKim

Well-Known Member
Licensed User
Longtime User
This is what it looks like on my New insignia 10" tablet with the background set to our company standard color. I only have one check box on the form so there is nothing else to compare it to. I know personally I would not be sure what this meant without some training.



This is what you get with a white background - I had to change the text color to even get it to display:

This is the same as above but enabled - pretty clear:

Our company standard background enabled.


So I guess in the absence of any better ideas the best solution is to leave my CB enabled and put a panel over the top to prevent the user from accessing?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Add this code to the manifest editor:
B4X:
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values-v20, theme.xml,
<resources>
  <style
  name="LightTheme" parent="@android:style/Theme.Material.Light">
  </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
  <style
  name="LightTheme" parent="@android:style/Theme.Holo.Light">
  </style>
</resources>
)

It will set the theme to a light theme and it will probably look better with your light background.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…