Skip to content

Android 7 the checkbox icons on the tabs do not color correctly #2652

@mab1423

Description

@mab1423

IDE: NetBeans/Eclipse/IDEANetbeans 8.2
Desktop OS Windows 10 Pro
Simulator Latest
Device Android 7

Have a Tabs component where each tab's icon is a colored checkbox. (green, yellow, red) (materialIcon)
On my Android 7 the checkbox icons on the tabs do not color correctly
On My Android 4.42, PC and IOS, The Tab Icon Coloring is as expected

I have skeleton project demonstrating issue. (TabsWithChkBox.zip)
https://drive.google.com/file/d/1yjWO_D6p1XDBaxQo-LrquBmnKVe3iCkI/view?usp=sharing

Here is the simple reproducible case.
I can send screen shots if needed.

Form hi = new Form("", new BorderLayout());

        int green = 0x00cc66;
        int yellow = 0xffff00;
        int red = 0xff0000;

        Tabs MpiInspectionForm = new Tabs(Component.TOP);
        Tabs SubSystemTabs = new Tabs(Component.LEFT);
        SubSystemTabs.setTabTextPosition(Tabs.LEFT);
//        SubSystemTabs.setTabUIID("tab");
        MpiInspectionForm.setTabUIID("tab");
        MpiInspectionForm.setTabTextPosition(Tabs.LEFT);
        MpiInspectionForm.addTab("Mpi Sub Systems  ",materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, red), SubSystemTabs);
        Container container2 = new Container(new BoxLayout(BoxLayout.Y_AXIS));
        container2.addComponent(getMpiOkSoonNowContainer());
        SpanLabel spl2 = new SpanLabel("Some text directly in the tab 345");
        SubSystemTabs.addTab("Check Fill & Replace  ",materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, green), MpiSubSystemsContainer());
        SubSystemTabs.addTab("Common Consumable Items  ",materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, yellow), container2);
        SubSystemTabs.addTab("BRAKING SYSTEM  ", spl2);
        SubSystemTabs.addTab("DRIVE BELTS", new SpanLabel("Some text directly in the tab"));
        SubSystemTabs.setTabTitle(SubSystemTabs.getTabTitle(0), materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, green), 0);
        SubSystemTabs.setTabSelectedIcon(0, materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, green));

        SubSystemTabs.setTabTitle(SubSystemTabs.getTabTitle(1), materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, yellow), 1);
        SubSystemTabs.setTabSelectedIcon(1, materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, yellow));

        SubSystemTabs.setTabTitle(SubSystemTabs.getTabTitle(2), materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, red), 2);
        SubSystemTabs.setTabSelectedIcon(2, materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, red));

        SubSystemTabs.setTabTitle(SubSystemTabs.getTabTitle(3), materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, green), 3);
        SubSystemTabs.setTabSelectedIcon(3, materialIcon(FontImage.MATERIAL_CHECK_BOX, 4, green));

        hi.add(BorderLayout.NORTH, MpiInspectionForm);
        hi.show();





    public static FontImage materialIcon(char charCode, float size, int color) {

        Font fnt = Font.createTrueTypeFont("native:MainBold", "native:MainBold").derive(CN.convertToPixels(size), Font.STYLE_PLAIN);

        Style s = new Style(color, 0, fnt, (byte) 0);
        FontImage fm = FontImage.createMaterial(charCode, s);
        return fm;
    }

    public Container MpiSubSystemsContainer() {
        Container MpiSubSystemsContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
        MpiSubSystemsContainer.setScrollableY(true);
        MpiSubSystemsContainer.addComponent(getMpiOkSoonNowContainer());
        return MpiSubSystemsContainer;
    }

    public Component getMpiOkSoonNowContainer() {
        CheckBox button = new CheckBox("Ok");
        button.setUIID("greenHeaderTextArea");
        
        CheckBox button1 = new CheckBox("Soon");
        button1.setSelected(true);
        button1.setUIID("yellowHeaderTextArea");

        CheckBox button2 = new CheckBox("Needed");
        button2.setUIID("redHeaderTextArea");

        Container containerA = new Container(new BoxLayout(BoxLayout.Y_AXIS));
        containerA.addComponent(button);
        containerA.addComponent(button1);
        containerA.addComponent(button2);
        return containerA;
    }

Attached is the theme.

Thanks In Advance.

PS. I suspect the solution will solve other coloring issues such as lists in a dialog do not color until a pressed event. Very Odd.

Happy Holidays!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions