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.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is how the default disabled checkbox looks in the material theme:

SS-2017-10-17_18.00.06.png


You can see that the first one is checked.
 
Upvote 0

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.

upload_2017-10-17_10-55-12.png


This is what you get with a white background - I had to change the text color to even get it to display:
upload_2017-10-17_11-12-59.png

This is the same as above but enabled - pretty clear:
upload_2017-10-17_11-16-57.png

Our company standard background enabled.
upload_2017-10-17_13-18-39.png


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
Top