Android Question Getting different colours on different phones

Discussion in 'Android Questions' started by stingrae, Jul 7, 2019.

Tags:
  1. stingrae

    stingrae Member Licensed 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.
     
  2. emexes

    emexes Well-Known Member 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?
     
    stingrae likes this.
  3. stingrae

    stingrae Member Licensed 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.
     
  4. stingrae

    stingrae Member Licensed 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.
     
  5. emexes

    emexes Well-Known Member 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 :-/
     
    stingrae likes this.
  6. emexes

    emexes Well-Known Member 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.
     
  7. emexes

    emexes Well-Known Member 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
     
  8. emexes

    emexes Well-Known Member 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.
     
    stingrae likes this.
  9. stingrae

    stingrae Member 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
     
  10. emexes

    emexes Well-Known Member 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
     
    stingrae likes this.
  11. emexes

    emexes Well-Known Member Licensed User

    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?
     
    Shelby likes this.
  12. emexes

    emexes Well-Known Member Licensed User

    Any closer to solving this mystery?
     
    stingrae likes this.
  13. stingrae

    stingrae Member Licensed 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
     
  14. emexes

    emexes Well-Known Member 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: Jul 7, 2019
    stingrae and Shelby like this.
  15. emexes

    emexes Well-Known Member 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).
     
    stingrae and Shelby like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice