visual problems between Android 2.2 and 4.2

enonod

Well-Known Member
Licensed User
Longtime User
I have now the chance to test program developed using Android 2.2 device, on a 4.2 device.
Buttons on the original are round cornered and non transparent but on the new device the buttons look like square panels and transparent. Colouring them leaves them square. I naturally prefer that they remain the same on all especially rounded corners.

The edges of a TextEdit do not show up on the new version and also RadioButtons only show if selected.

Can somebody please suggest what I have done wrong, not accounted for or tell me where to read.
 

bishmedia

Member
Licensed User
Longtime User
I had a similar issue to this a while back and managed it by changing an item in
Project/Manifest Editor

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

By amending the tagetSdkVersion to a lower number it sorted my problem.

Hope it helps in some way
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Thank you for that suggestion.
I confess that I do not understand how this can have the effect that it did but I changed 14 to 10 and the RadioButtons became perfect. The ordinary buttons did not seem to show as with v2.2. [Edit] Changing from 14 to 8 improved most of the buttons, but still did not get the rounded corners back.

Perhaps you or someone can explain the significance of this change.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The default look of Android 4 is different than previous versions (holo theme). When you set the targetSdkVersion to 14 you are telling the system that it can use the new style on new devices. In most cases it is better to use the new style.

Note that you can see the style differences with the UI cloud as it includes devices running different versions of Android.
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Thank you Erel
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
I have reverted to the norm as advised but I have a panel with RadioButtons and the only one that shows is the centre colour when selected, nothing else is visible, but it is perfect on a device with Android 2.2.2.
Any suggestions please?
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
I am afraid I don't use Designer so I have extracted relevant parts and modified to work alone.
I have changed the background to ensure that it was not masking. It does show enough to see the extra label beside the RadioButtons. It is perfect on 2.2.2.
Perhaps you can spot something for me.
Thanks
[Edit]I should add the 2.2.2 device is 7 inch scale 1 the other 10 inch Scale 1
 

Attachments

  • Radiobuttons.zip
    6.3 KB · Views: 149
Last edited:
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Thank you for looking Erel. I see the selected item that is visible, fully round and all numbers above. I can try your suggestion, against your earlier advice, but am concerned as to the cause. Presumably it is not a obvious code problem. My assumption is that Android improves per version. Please do you have any suggestions if we assume I was to exclude the 2.2.2 version?
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Oh! Blush. Sorry. Having altered the target version no. and it worked I did not think it could therefore be anything else.
Sorry again.
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Despite my previous comment, it is not the case that the RBs are too small.
I have made them larger, big enough to fully see all numbers including that which belongs to the view itself. The central portion when selected is very visible and suggests the size of the outer ring, which is not visible.
When a RB is touched it flashes such that the outer ring and colour between the rings is visible briefly and the inner ring (selected) flashes white then back to stable colour.
Setting the RB colour to contrast simply produces a large square of that colour with the RB text dead centre but still does not show the RB. The centre 'selected' ring shows on the left of the 'label?' and when it flashes it is clearly well within the square.
The device is a Asus Transformer T301 1280 x 752 Scale 1
It is perfect on Viewsonic VPAD 7" 800 x 480 Scale 1 with no changes
Will you be kind enough to look further into this please?
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
This was taken on the Asus Transformer. The visible dot is the size of a 'selected' centre. The outer ring should be easily visible at this size. No matter what size they do not show. Bringtofront, just in case, makes no difference.

[EDIT] I have as before changed the colour to red and it shows, like a label with the RB on it. Altering sizeof view only alters the back label not the size of the RB rings. I now have it 400dips square but the selected ring is still the same. I can find no other parameter that alters the ring size.
[EDIT1] Remarkably the same is true of CheckBox, only the tick is visible. TargetSDKVersion 4 works perfectly on both devices but does not seem like a good solution.
Probably a stupid question but is it possible to use a different image for the device, can it be programmed?
 

Attachments

  • IMG_20130415_155946.JPG
    29.3 KB · Views: 149
Last edited:
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
I am sorry to be dense or maybe I misunderstand you but the colour of the background panel has been changed from cyan to red to lightgray, no difference. On v2.2.2 the buttons show the inter ring colour as gray or lightgray and cannot be changed ! Surely that doesn't change to match the panel color like a chamelion or rather, invisible man. That is why I , in the example chose cyan, to overcome the panel possibly being the same colour. The button colour cannot be changed as explained, doing so only changes the colour of its in built panel or label square, which I am sure you will have observed.
I have also discovered that the button or rather RB size (of the circles) cannot be changed anyway, so it was not the size as originally suggested.
I think there is more to this and therefore I cannot be alone. I have also changed background of panel to colordrawable with no change.
 
Last edited:
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
It appears that on cyan and lightgray background it is invisible on Nexus 7 inch but visible in different degrees on all others.
With yellow background it is the 'selected' centre only that is visible on Nexus 7 again with differing degrees of visibility on others. This coincides with my own device but with cyan. Thus only the selected one is visible.

Am I to take it that RadioButtons and probably other views require different backgrounds that are of course unpredictable under normal circumstances and may also require different colours per view thus rendering some unusable with others?

The scenario I envisage is having to use views that only show on a particular background unless one can produce a multicoloured background depending what one wishes to look at. Perhaps it could change colour as one touches different parts so as to show different devices.

I am not suggesting that this is in any way a fault of B4A
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Am I to take it that RadioButtons and probably other views require different backgrounds that are of course unpredictable under normal circumstances and may also require different colours per view thus rendering some unusable with others?
Yes. One solution is to use the DEFAULT color in the designer. The UI Cloud can help with this.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…