1

I've created an apps using LWUIT. It use the header bar, like this

enter image description here

It use the container. Under this header bar container I've created the scroll able list.

The strange part is, if I scroll this list, the color of the button (the menu button and filter button) in header bar changed. And it just happened when I tried the apps in device. When I try using it in emulator it just fine

Here is the code of the button I've created

    b_menu.getUnselectedStyle().setBorder(null);
    b_menu.getSelectedStyle().setBorder(null);
    b_menu.getPressedStyle().setBorder(null);
    b_menu.setIcon(ImageUtil.loadImage("/menu.png"));
    b_menu.setRolloverIcon(ImageUtil.loadImage("/menu.png"));
    b_menu.setPressedIcon(ImageUtil.loadImage("/menu.png"));
    b_menu.setName("menu");
    b_menu.getStyle().setBgTransparency(0);
    b_menu.getStyle().setBgPainter(new LinearGradientPainter(0xcf266a, 0xcf266a, false));
    b_menu.getSelectedStyle().setPadding(5, 5, 5, 5);
    b_menu.getSelectedStyle().setMargin(0, 0, 0, 0);
    b_menu.getUnselectedStyle().setPadding(5, 5, 5, 5);
    b_menu.getSelectedStyle().setMargin(0, 0, 0, 0);
    b_menu.getSelectedStyle().setBgColor(0xcf266a, false);
    b_menu.getSelectedStyle().setBgTransparency(0);
    b_menu.getSelectedStyle().setBgPainter(new LinearGradientPainter(0xcf266a, 0xcf266a, false));
    b_menu.getUnselectedStyle().setBgTransparency(0);
    b_menu.getUnselectedStyle().setBgPainter(new LinearGradientPainter(0xcf266a, 0xcf266a, false));
    b_menu.getPressedStyle().setBgTransparency(0);
    b_menu.getPressedStyle().setBgPainter(new LinearGradientPainter(0xcf266a, 0xcf266a, false));

Have you ever met and solve this problem?

Regards

Giri

giripp
  • 285
  • 1
  • 4
  • 13
  • How do you get to hide the native title Bar? I only get to set the app to full screen mode but I lost the top bar too. – Mun0n Aug 13 '13 at 10:30
  • 1
    @jmunoz try this `Display.getInstance().setTouchScreenDevice(true); Display.getInstance().setCommandBehavior(BACK);` – giripp Aug 16 '13 at 09:22
  • That doesn't work, I find a way to show the status bar using `Display.getInstance().setObjectTrait(Display.getInstance().getImplementation(), "nokia.ui.canvas.status_zone", Boolean.TRUE);` – Mun0n Aug 20 '13 at 10:50
  • But I've another question....when you put your app in full screen mode, I suppose that you lost the back native button in all of your interfaces. How do you build this back buttons? – Mun0n Aug 20 '13 at 10:52

1 Answers1

2

Oh, the answer is I also have to change the unselected style. Here the code

    b_menu.getUnselectedStyle().setBorder(null);
    b_menu.getSelectedStyle().setBorder(null);
    b_menu.getPressedStyle().setBorder(null);

    b_menu.setIcon(ImageUtil.loadImage("/menu.png"));
    b_menu.setRolloverIcon(ImageUtil.loadImage("/menu.png"));
    b_menu.setPressedIcon(ImageUtil.loadImage("/menu.png"));

    b_menu.setName("menu");

    b_menu.getStyle().setBgTransparency(0);
    b_menu.getStyle().setBgPainter(new LinearGradientPainter(0xcf266a, 0xcf266a, false));

    b_menu.getSelectedStyle().setPadding(5, 5, 5, 5);
    b_menu.getSelectedStyle().setMargin(0, 0, 0, 0);
    b_menu.getSelectedStyle().setBgTransparency(0);
    b_menu.getSelectedStyle().setBgPainter(new LinearGradientPainter(0xcf266a, 0xcf266a, false));

    b_menu.getUnselectedStyle().setPadding(5, 5, 5, 5);
    b_menu.getUnselectedStyle().setMargin(0, 0, 0, 0);
    b_menu.getUnselectedStyle().setBgTransparency(0);
    b_menu.getUnselectedStyle().setBgPainter(new LinearGradientPainter(0xcf266a, 0xcf266a, false));

    b_menu.getPressedStyle().setBgTransparency(0);
    b_menu.getPressedStyle().setBgPainter(new LinearGradientPainter(0xcf266a, 0xcf266a, false));

    b_menu.addActionListener(this);
    b_menu.repaint();

Thanks for viewing this question!

Regards

Giri

giripp
  • 285
  • 1
  • 4
  • 13