This happens because when you call $this.datepicker() it only initializes the date picker without ever showing it up.

So if you click it again, that will be the time that the date picker will show itself since it was already initialized.

What you can do to show the date picker right away on first click is to call it like this:

That should do it.

One might think the quickest and easiest way to hide a Surface object in is to set its opacity to transparent.

While true, you will also have to set its other properties like text color and such which is a hassle. Okay, so if you do not find that a hassle, there is another problem.

All input events like mouse clicks will be absorbed by this surface. So if you intentionally wanted to hide the Surface because the you want the other Surface below it to receive events, it will not work.

What I did was to make use of the Modifier that was used to add the Surface to the View. It has a setOrigin method that you can take advantage of to move this Surface object away from the user’s screen.

Say, setOrigin(0.5, 0.5) moves the Surface object to the center of the screen. You can do setOrigin(-0.5, -0.5) to move it out of the user’s screen making the user think that you actually hid the Surface object when in fact, you just moved it.

To show the Surface object back, just set the values to non-negative. That’s it!

I tried quite a number of suggestions while I sifted through the Stackoverflow forum but one of them worked without hassles.

It is short and simple: simulate a tap on the EditText component.

You can do this by doing:

That’s all.

Of course, when doing it programmatically, the first thing we do is call requestFocus() but there are certain cases where the soft keyboard will not show up. The code above will ensure that the soft keyboard will always show when it is called.

Related Posts Plugin for WordPress, Blogger...