Bug? CheckBox color

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
I noticed that, while displaying a checkbox, its symbol color is different when using the emulator or a real device. Namely, in the first case, the symbol is green if checked and gray if not, while, in the second case, it is gray when checked and not visible (probably same color of the background) if not checked. Emulator behavior is acceptable. Instead, latter behavior could be acceptable, if there were the possibility to change the color of the symbol, when checked (if not checked the empty box is meaningful anyway, for me).. Actually I don't see this last possibility..
 

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Thanks for answering to everybody, as I see. My compliments to your professionality. I didn't explain well. Actually my situation cannot tested on the cloud because the checkboxes are inserted in lines of a scroll view, not in the designer. (At least I don't see the way). What I mean is showed in the attached file. I did some raw manipulation to show the behavior on real devices.
 

Attachments

  • checkboxes_in_ScrollView.png
    checkboxes_in_ScrollView.png
    30.1 KB · Views: 250

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Sorry, for late answer. The version is 4.1.2 kernel 3.4.0. This on an LG smartphone. Instead 4.04 on Samsung tablet GT-PT3100. Behavior is the same on the two devices.
 

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi. I don't understand the Nzb file in the message. Anyway after your indication, I did some trials on the manifest file. I haven't dealt with it before, so perhaps did some mistake. In the manifest file there is a line like android:minSdkversion=4. I tried either to modify the 4 with 14, or to add the line you wrote or even taking away the existing one leaving only yours. Graphic behavior changes, but things become even worse. Apart button enabled/disabled state is less understandable etc., in all cases now the checkbox simply totally disappears. This on 4.1.2 version on LG for sure. Thanks for your patience. I can do some further investigation by myself, if you just give me some hints.
 

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
It seems not to resolve. Here is the modified manifest copy/pasted, but it seems to contain strange characters, avoiding to rearrange it in this messge)
'This code will be applied to the manifest file during compilation.

'You do not need to modify it in most cases.

'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136

AddManifestText(

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>

<supports-screens android:largeScreens="true"

android:normalScreens="true"

android:smallScreens="true"

android:anyDensity="true"/>)

SetApplicationAttribute(android:icon, "@drawable/icon")

SetApplicationAttribute(android:label, "$LABEL$")

'End of default text.

Of course I changed the panel color to default.. as shown in the attached panel.. By the way, settinng the target version to 14, gives a rather worse estetical effect on LG device..
 

Attachments

  • emulator.png
    emulator.png
    26.6 KB · Views: 250
  • foto.jpg
    foto.jpg
    66.5 KB · Views: 214

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
By the way, letting the default manifest, without the targetversion to 14, the checkboxes are visible. Only the "check mark" is not green, but gray. Moreover, with the targetversion=14, edittext fields appear with a "gradient" effect color, in my LG smartphone, while this doesn't happen on emulator.
 

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi, thanks for your suggestion, but, before posting here the question, I also tried that stuff. Now, could be that things work well using those functions, but I noticed that the graphical appearance of those checkboxes is worse than the standard one. Moreover mine here was a "possible bug report" more than a search of a solution. As a matter of fact the actual problem is the color of the "mark symbol". The fact must be investigated. Hopefully it is some bug in my code, otherwise you understand that changing the targetsdk, according to Erel's suggestions, till now, things went even worse, and this opens an unpleasant scenario where we cannot rely on emulator behavior. Anyway, as I said, very much probably it is some subtle error in my code... as usual.. Thanks again for your interest in my problem...
 

stevel05

Expert
Licensed User
Longtime User
I think this problem stems from the fact that the image resources used by the OS change from version to version, and on top of that, each manufacturer can apply their own resources to get the look that they want as standard for their device. If you change one thing in the layout, background colour of a panel or scrollview for instance, there is no guarantee that the rest of the theme will then match your imposed colour scheme.

If the developer changes one colour from the default, it is then their responsibility to make sure that the rest of the colour scheme matches.
 

moster67

Expert
Licensed User
Longtime User
I agree with what Steve says. Perhaps you could opt for the graphical option which Steve mentioned in his post

It would be fairly straight forward to change the routine to use a graphic instead of a character if you prefer or change the shape of the checkbox for a circle or star graphic maybe.

This would probably make the appearance more uniform regardless of SDK and manufacturer's resource/system settings. How to do that I don't know because I haven't tried it since I don't need it.
 

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Ok. Thanks all for your observations. If I understand well, being practical, I should do two bitmaps to represent the checked and unchecked state. Besides my poor graphical ability, then what will happen with differet resolutions/scale_factors/densities? Probably they will be stretched and give poor results too...
 
Top