Open uheinema opened 4 years ago
Ok, I thought I had posted something like that already. I´ll have to finish my current project first though. Since Google+ shut down on April 2nd, 2019, the then-existing forum ended. Wouldn't you like to open a new forum at Google forums like this one? Just for specific APDE related stuff? I didn't do it myself already because I don't know how much time I still have. BTW You can find me on P4A forum here.
Thanks for pointing me there! Isn't the Processing forum the right place for this? Though I don't like the UI there very much. Keep it up!
I've added the Edit Text box. You can combine other views like buttons, textViews etc. Just add them to the the layout, like "fl.addView(myButton);" The order in which you set them is important because they "float" above each other. All of them must have an unique id number to be called in the sketch within a runnable. If it is working for you, please comment on which android mode.
Well, not too bad. Last line is buggy?? And superflous. Height way too small, increased:
So I thought, noting the View.OnKeyListener
:
Ok, forget the display, maybe I can finally capture soft input this way - eg. Ä, when typed on screen.
But alas, the same as with all other methods i tried (overloading onkey..., dispatcher, what else...), different soft keyboards.. All with the same result: There simply is no event/call ... happening. All work with hardware (Blietooth) keyboards and on Ascii chars. No clue...and I'm not alone. From https://stackoverflow.com/questions/5419766/how-to-capture-soft-keyboard-input-in-a-view/7386854
Turns out that I did in fact need to subclass TextView and the use addTextChangedListener() to add my own implementation of TextWatcher in order to listen to soft key events. I couldn't find a way to do this with a plain old View.
And so speaks Android Developers:
Key presses in software keyboards will generally NOT trigger this listener, although some may elect to do so in some situations. Do not rely on this to catch software key presses.
Of course afaik nowhere is explained HOW to catch software keypresses...
So after some tinkering, this
https://github.com/uheinema/BoxDrop-Example/blob/master/Editfield/multiline.pde
is almost all I need.
edit.setTextSize(TypedValue.COMPLEX_UNIT_PX, ts);
edit.setGravity(Gravity.START);
Just can't get scrollbars.
Tnx, Best regards
PS: If you like fancy buttons, I do them in a GLSL fragment shader...but that's another story.
Hi again.
After some tinkering, it doesnt look too bad:
See
https://github.com/uheinema/BoxDrop-Example/blob/master/README.md
As a Dialog or (better!) as a (transparent) overlay of your sketch display.
Great stuff!
Lots of tnx
Your brother in APDE.