Keyboard always visible in codenameone - codenameone

I would like to know if it's possible to have the native keyboard always visible. So I don't need to tap to have the text field in focus.
Thanks in advance.

That is the default behavior of Codename One at least on iOS & Android unless a fallback mode happened. This fallback mode happens when components can't be scrolled to e.g. if the text fields weren't in a box layout Y that's scrollable on a Y axis.

Related

React Native: Inaccurate click on Text

I have Text components in one Text component. Onpress for Text components fires on the Text below the one pressed on Android device.
On Web works good.
Seems like due to default extra top padding for a Text - this is why when pressing on one Text the finger touches the one below.
Any help apprecciated.
Line-height doesn't help, increasing padding-bottom works but since it's an inline component I have to change it to inline-block but it doesn't work for Android.

React/Material-ui : Make dialog not change when mobile keyboard is brought up

I have a dialog that contains a few text fields where the user can provide input, like this.
The problem im having is that whenever the user clicks on one of the textfields , the mobile keyboard messes everything up. It looks like this:
I want to have the dialog remain the same - as in, it shouldnt shrink and force the user to scroll down to see the full dialog. I tried using the FullscreenDialog-component, but the problem remains the same - the mobile keyboard just shrinks it and makes it scrollable for some reason. Is there any way to fix this?
EDIT I found a way to sort-of fix this, at least temporarily - add a minHeight to the bodyStyle in the dialog and the keyboard won't overwrite it. Obviously you have to move the dialog up so that the keyboard doesn't block it when it appears :)
I've experienced a similar problem but the solution may not help in every situation.
In my case, the main <Paper /> component height was set to window.innerHeight and another <Paper /> component inside it was set to about window.innerHeight * 0.6. I use this and not simply a CSS unit 'vh' since it compensates for the URL bar.
In the nested paper, I had a <TextField /> and the same problem you described occurred. The solution is basically to listen to onresize event since it fires when the keyboard opens, then you simply use the maxheight of all those measures.
To make it perfect you may want to respect device rotation since it really does require you to use the new height, and of course make sure the component is positioned correctly.

react native - Creating header above FlatList which scrolls up when scroll drag hits it

The effect I'm looking for is a bit hard to describe, but I'm basically trying to implement a header above a scrollView which allows you to scroll normally when touching inside the scrollView, but then when you drag up out of the scrollView onto the header, it moves the header up.
This effect is used with the iPhone keyboard as a footer for messages for example, where you can scroll through messages normally and the keyboard will stay. However, if you scroll down into the keyboard, it drags the keyboard down.
https://facebook.github.io/react-native/docs/scrollview.html#keyboarddismissmode 'interactive' is the effect I'm trying to achieve, but instead of for a keyboard I'm looking to do it for some custom header component which is above my scrollView.
I figure I could match the scroll to the components Y translate Y, however I only want to do this depending on where my touch is. Sadly, the onScroll event doesn't seem to contain any information on the touch location, so I can't tell where the user is dragging. Any help or ideas for other ways to implement this would be greatly appreciated.

How to get Codename One Form feature vertical scroll?

My Codename One app features a Form with 3 SpanLabels containing text and one Container in LayeredLayout with an image and an overlay.
this.add(BorderLayout.NORTH, spanLab1);
this.add(BorderLayout.CENTER, imageCont);
this.add(BorderLayout.SOUTH, BoxLayout.encloseY(spanLab2, spanLabl3));
This yields to the following:
This is not satisfactory as the image (that appears in the center and should be CN1 icon) is not scaled but cut because it is not possible to scroll down.
I tried to force the Form to be scrollable (this.setScrollableY(true)) without success.
Did I make a mistake somewhere, for example should all my content be placed in the BorderLayout.CENTER since according to the documentation the NORTH position is dedicated for the title and the SOUTH one for an optional menu bar (I tried this without success)?
Or should I show a Dialog instead (that offers Y-Scroll out of the box) ? What is actually the proper way to show all my (long) content with no picture cut or text overlaping ?
EDIT December 22nd 2016
As #Tizbn wrote the Form's ContentPane has to be in Vertical BoxLayout. So the call to the parent constructor has to be written :
super(new BoxLayout(BoxLayout.Y_AXIS));
Thank you very much for any help!
Vertical Scroll is disable in BorderLayout . For that BoxLayout with Y-axis can be used and make setScrollableY(true) in the Boxlayout. Hope it will help .

how to get tooltip like effects on touching on a component in codenameone

Is there any way or class to show tooltip like effects on touching on component to provide extra information instead of displaying it on dialog box ?
You can use the LayeredPane, LayeredLayout (on which LayeredPane is based) or GlassPane each of which has its advantages/drawbacks.
Generally InteractionDialog is a dialog type that doesn't "block" and can float and its based on the LayeredPane.
See:
http://www.codenameone.com/blog/not-a-dialog-again
http://www.codenameone.com/blog/completion-ios-7-update-and-the-20m-mark.html
http://www.codenameone.com/blog/walk-thru-tutorial

Resources