×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2009
    Location
    Guatemala
    Posts
    186

    How to detect phone's theme color at runtime (LWUIT for Series 40)

    Hi, this might be something very simple, but I have not found a way to do it.

    I want to detect the color used to paint the title on a LWUIT form, which depends on the theme selected in the phone settings. I want to write some text using that color.

    I have tried (without success):

    Code:
    form.getTitleStyle().getFgColor());
    form.getTitleComponent().getStyle().getFgColor());
    form.getTitleArea().getStyle().getFgColor());
    Any ideas?

    Thanks,
    -CarlosDL

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: How to detect phone's theme color at runtime (LWUIT for Series 40)

    LWUIT S40 uses the LCDUI colors (if NokiaPlatformColors is enabled)
    so you can get them like so:

    Display.getColor(javax.microedition.lcdui.Display.COLOR_BACKGROUND));
    Display.getColor(javax.microedition.lcdui.Display.COLOR_FOREGROUND));
    Display.getColor(javax.microedition.lcdui.Display.COLOR_HIGHLIGHTED_BORDER));
    Display.getColor(javax.microedition.lcdui.Display.COLOR_HIGHLIGHTED_BACKGROUND));

    Note the the Display class here is the LCDUI Display and not LWUIT Display

  3. #3
    Registered User
    Join Date
    May 2009
    Location
    Guatemala
    Posts
    186

    Re: How to detect phone's theme color at runtime (LWUIT for Series 40)

    Quote Originally Posted by shai.i View Post
    LWUIT S40 uses the LCDUI colors (if NokiaPlatformColors is enabled)
    so you can get them like so:

    Display.getColor(javax.microedition.lcdui.Display.COLOR_BACKGROUND));
    Display.getColor(javax.microedition.lcdui.Display.COLOR_FOREGROUND));
    Display.getColor(javax.microedition.lcdui.Display.COLOR_HIGHLIGHTED_BORDER));
    Display.getColor(javax.microedition.lcdui.Display.COLOR_HIGHLIGHTED_BACKGROUND));

    Note the the Display class here is the LCDUI Display and not LWUIT Display
    Great !

    The highlighted background color is what I wanted.

    Thanks Shai.
    -CarlosDL

Similar Threads

  1. How to detect Belle UI at runtime?
    By sergiogiogio in forum Symbian User Interface
    Replies: 1
    Last Post: 2011-09-27, 19:03
  2. Download Series 40 Theme Studio Themes to Phone
    By dclary in forum General Development Questions
    Replies: 30
    Last Post: 2011-02-19, 17:26
  3. How to detect ARMv6 CPU at runtime
    By mike.b in forum Symbian
    Replies: 7
    Last Post: 2010-11-05, 05:06
  4. Color change depending of the theme color
    By digitalsol in forum Symbian User Interface
    Replies: 2
    Last Post: 2010-06-28, 16:24
  5. Replies: 0
    Last Post: 2009-04-23, 08:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×