Android Question Getting different colours on different phones

stingrae

Member
Licensed User
Longtime User
Hi,

I have a B4A app that is acting very strange. I have two test phones, both Samsungs.

One one, whatever colours I select on the B4A designer come through on the phone.

On the other, they're completely ignored. I have cleaned the project, uninstalled, re-installed on both etc ... But still having the same issue.

For this one layout I have only one variant (the default) and the are no scripts on the designer.

What else could be causing the difference?

Thanks in advance.
 

emexes

Expert
Licensed User
What happens with a photo image? Do the colours change on that also? If so, do you have any night-light blue apps or filters installed, or are there any settings that might be doing it, like contrast enhancement for low-vision users?

What about other apps?
 
Upvote 0

stingrae

Member
Licensed User
Longtime User
hi @emexes ... good ideas that i hadn't thought of, but no. i just went through the phones and they'r practically identical in that regard.

I'll try creating a new blank app and see if i get the same problem. at the moment it's like i'm developing two completely different apps ... but I'm not. it's really frustrating.
 
Upvote 0

stingrae

Member
Licensed User
Longtime User
no, on a new app they both looked the same. i just tried a 3rd phone, another samsung S4 , and it is showing what i deem to be the correct colours. one phone, the S8 (GM-G950F) is still looking nothing like it should.
 
Upvote 0

emexes

Expert
Licensed User
I needed my teenage son to show me how to get his/our iPad out of the reverse display mode that I'd accidentally activated.

'twas something obvious like a two-fingered triple-tap... don't know how I missed finding that :-/
 
Upvote 0

emexes

Expert
Licensed User
Hang on, so you're saying that of your two apps: both apps appear ok on two of your phones, but only one of the apps displays ok on the S8 phone.

Hmm.

Perhaps try doing screen captures on a working and non-working phone, and then download the screenshots to your pc (B4A-Bridge has a FTP server) and see what the screenshots look like side-by-side.
 
Upvote 0

emexes

Expert
Licensed User
Did you try a range of colours in the new app (that displays correctly on all three phones)?

In particular: Colors.Red, Colors.Green, Colors.Blue and Colors.White
 
Upvote 0

emexes

Expert
Licensed User
My first thought was that the phones had different colour themes, but that sorta went down in flames when you said the new app did not have the problem.

Another theory was that perhaps the lcd driver/display on the S8 has lost one of the red/green/blue channels, but if that happened then you'd have noticed the effect on other apps and the home screen icons too.
 
Upvote 0

stingrae

Member
Licensed User
Longtime User
it's something very strange. when I connect the S8 to the WYSIWYG designer - when I clock on the labels and textboxes etc ... on the phone it shows them as selected (red border etc ..) but if I change the colours on them, say to a green text colour on a label, it doesn't do anything. but on the S4s it works perfectly.

o_O
 
Upvote 0

emexes

Expert
Licensed User
I just tried changing some display settings on an Android phone here and, even though the colours are distinctly different when I look at the phone screen, the screenshots are the same, ie, it must be applying the filter after constructing the screen contents for display.

upload_2019-7-7_14-25-40.png
upload_2019-7-7_14-26-0.png
 
Upvote 0

emexes

Expert
Licensed User
it's something very strange. when I connect the S8 to the WYSIWYG designer - when I clock on the labels and textboxes etc ... on the phone it shows them as selected (red border etc ..) but if I change the colours on them, say to a green text colour on a label, it doesn't do anything. but on the S4s it works perfectly.

o_O
Is there any green on the S8 screen at all? I am revisiting the broken red/green/blue lcd colour channel theory...

Try using each of the three primary colours. And... does white appear white, or tinted towards yellow, cyan or magenta?
 
Upvote 0

stingrae

Member
Licensed User
Longtime User
not really. all i can do to make it work is to go through every Layout and explicitly set the colours of each background and object. anything set to "Default" just appears different on the difference devices. but anything I set to a specific colour works the same. i made this short video to demonstrate it. maybe Erel or one of the other experts will be able to shed some light on to why.
here's the demo (sorry, a bit clunky trying to use one hand to film and one hand to do all the clicking):
https://www.stingrae.com.au/downloads/b4a.mp4
 
Upvote 0

emexes

Expert
Licensed User
Righto, then it must be to do with Android themes. Perhaps have a look in the Project -> Manifest Editor menu of the two projects, see if there is any difference between the two.

If not... I'm sure you're already on to this, but just in case anyway:

in designer, you can select/deselect multiple items by holding down the Ctrl key whilst clicking on them, and then when you change the background colour in the properties panel, that will change that property for *all* selected items (that have that property)

and/or you can select them in the "Views Tree" tab of the designer left-side panel
 
Last edited:
Upvote 0

emexes

Expert
Licensed User
Or perhaps everytime you do a LoadLayout, you could call a Sub that adds a full-activity-size black background panel to the background of the passed Activity, or that goes through all the views of the passed Activity and sets the background colour etc of Buttons and Labels and TextEdits to be whatever they need to be, if they are currently still default.

I do a similar thing with scaling views so that they fit the screen and the layout is centered horizontally and vertically. Works a treat, for aspect ratios that are within a reasonable distance of each other (ie, not so good for landscape vs portrait).
 
Upvote 0
Top