How to disable the interfase input???

21 views
Skip to first unread message

romanca...@gmail.com

unread,
Oct 28, 2016, 10:49:20 PM10/28/16
to CodenameOne Discussions
HI SHAI! im interested to disable the interfase (touch screen) while im doing some query's i tryed with         Display.getInstance().setTouchScreenDevice(false)  but the device stills responding to the touch. what im doing wrong?

my code is:

    public void showInfiniteProgress()
    {
        if (infiniteGenerado == false)
        {
            glass.setUIID("InfiniteProgress");
            glass.setLayout(new BorderLayout());
            Container infiniteContainer = new Container();
            glass.addComponent(BorderLayout.CENTER, infiniteContainer);

            TableLayout tl = new TableLayout(1, 1);
            infiniteContainer.setLayout(tl);
            Constraint consTL = tl.createConstraint();
            consTL.setWidthPercentage(100);
            consTL.setHeightPercentage(100);
            consTL.setHorizontalAlign(Component.CENTER);
            consTL.setVerticalAlign(Component.CENTER);
            infiniteContainer.addComponent(consTL, new InfiniteProgress());
            infiniteGenerado = true;
        }
        if (super.contains(glass))
        {
            super.removeComponent(glass);
        }

        super.addComponent(glass);
        Display.getInstance().setTouchScreenDevice(false);
    }

    public void removeInfiniteProgress()
    {
        super.removeComponent(glass);
        //      Display.getInstance().getCurrent().setLeadComponent(null);
        Display.getInstance().setTouchScreenDevice(true);

    }

thanks


If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device

Shai Almog

unread,
Oct 29, 2016, 10:18:59 PM10/29/16
to CodenameOne Discussions, romanca...@gmail.com
Hi,
just show a dialog with a Container style. Make sure to set the tint color of the parent form to 0 first.

romanca...@gmail.com

unread,
Oct 30, 2016, 9:52:35 AM10/30/16
to CodenameOne Discussions, romanca...@gmail.com
Yes shai, i know but, if a show a dialog, when i close the dialog, it draws again the whole form and i need just to block the input from the user.

im using a form (main form) who encloses a container where i show the modules.

any idea

Shai Almog

unread,
Oct 30, 2016, 9:30:45 PM10/30/16
to CodenameOne Discussions, romanca...@gmail.com
You won't see the dialog.

Another alternative is to override the Form pointer pressed/released/dragged method and not invoke super.
Reply all
Reply to author
Forward
0 new messages