PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV Mobile 2024 → WM - Virtual Keyboard Hiding Controls
WM - Virtual Keyboard Hiding Controls
Iniciado por REVOLUTIONCHAIN, dez., 16 2019 8:05 PM - 9 respostas
Membro registado
12 mensagems
Publicado em dezembro, 16 2019 - 8:05 PM
Hello everyone,
I'm getting mad with something I'm sure you guys have already experienced.
I have a chat alike Window (which works fine used sockets), the issue is that when I'm entering in the bottom EDT Control (which is anchored to the bottom), the Virtual Keyboard pops up hiding most of my EDT controls, including part of the above looper, and header. (The whole window gets moved up, off screen).

I tried using floating properties or by setting a parallax value to the controls with no result.










Thank you
Nicola
Mensagem modificada, dezembro, 16 2019 - 8:15 PM
Membro registado
514 mensagems
Publicado em dezembro, 16 2019 - 10:31 PM
Hi REVOLUTIONCHAIN

I have this issue too.

I try everything I can do it but Windev always hide all the above of my controls even the action bar an everything.
what I could maybe put it to work was to create a control below everything then I call an internal window on my window and show a control with an edit I can write.

what I mean?
Well I slip in two the part when you read the messages and the part when you write a message.

I set a super control with a multilinezone on it, the multizone can be duplicated it like a looper but becareful because you can't have a lot of Multiline Zone on your window..

I set my window with automatic scrollbar to manage to always show what was the last message on my super control with multiline zone I always play with the scrollbar of my window and my Super control Just to the user see the message he is writing and what was the last message of the chat.
The problem with this on Android it's that you can't scrollbar up to see the messages above the last one unless you hide the keyboard and the internal window then only left the super control (it's super annoying)

also My internal window have the edit to send the message and the button to make the action to send.

I play with the height of my super control and for my internal window to show it propertly on my window.

but everything I said never fix the visual error that when the Keyboard appear it push up everything else
So a UI chat it's not viable with WM 23 and not even WM24
maybe WM25 but I don't keep my hopes up.

If you manage to fix this issue please post it right away I will be glad to read it because I'm stuck with this problem I'm not getting anywhere.
I let my chat like that because I don't see the ligth with this, I search everything and I never find anything and PcSoft only read my email and maybe just MAYBE We can get a control to manage a chat app or something I hope so they said to me that it will me consider what I send them on my email...
But for now we only can get some sor of chat right now with some visual errors.

--
Best Regards
ARV
Membro registado
12 mensagems
Publicado em dezembro, 17 2019 - 10:30 AM
I'm sure a fix does exist. When I started with app development, back in 2016, I've seen tons of Clients asking me for a chat system, integrated directly in their application. Seems weird that a big software house like PCSoft, after years of development, didn't think about a solution.
I don't know, maybe a floating EDT control?

I've sent a message directly to PCSoft, pointing at this thread.

Meanwhile can you paste here some screenshots of your solution? Thank you ARV :)
Membro registado
514 mensagems
Publicado em dezembro, 17 2019 - 8:28 PM
Hi REVOLUTIONCHAIN

I can send some screenshotf of the controls I use and some ideas but nothing more, I work for an enterprise and I can put code because all I code have copyright but how to manage some "errors" with screenshots should be fine and then:






I use a super control






On the super control I put a MultiLine-Zone (Could it be a Looper if you want to) make sure this MultiLine-Zone could be repeated






On the MultiLine-Zone I have an edit to manage the message are send and recieve






On the bottom of my window I put a button this button called an internal window






This is my internal window with an edit and a button to write the message and then send it


IMPORTANT:
Make sure your window have an automatic scrollbar
Why?
Because if you play with the scrollbar of your window you could put it at the maximum just to make sure your edit of your internal window could it be seeing above the virtual keyboard of the Android OS if you do not put the scrollbar of the window on the max you will still having the visual error of the edit being half cut by the keyboard of the OS.
You can also use and edit and a button on the bottom of your window and play with the scrollbar of your window and do as I said.

You can calso play with the scrollbar of your Super Control to show the last message.

If you use MultiLine-Zone You can't display infinity rows on iOS
on Android I'm not so sure but it also have a limit, make sure you show it one by one or block by block.

Hope this could help you

--
Best Regards
ARV
Membro registado
12 mensagems
Publicado em dezembro, 18 2019 - 1:27 AM
Thanks again for you reply!
I'll try to setup a test enviroment next morning like you've suggested! Also, feel free to reach me using the contact form on my website, I'll be more than happy to share my UI/Looper code if you want to try with a pure looper (just search my name online, you'll find me :-)

Ps: I'll keep you updated on this, still waiting to hear from PCSoft an official statement (hopefully telling us they have a patch or something! :-D)
Publicado em dezembro, 19 2019 - 6:18 PM
To accomplish this properly you do have to do some actual programming in Java if Android or SWIFT if IOS, first you need to create an event listener so you know when the keyboard is showing and when the keyboard is hidden again to be able to react to that behavior. after that you need to write the code that will return to you the coordinates of the keyboard frame so you know how high or wide the keyboard is. and then with that information move the EDT control accordingly on the screen based on the events mentioned above.... and presto....whatsapp alike behavior of the keyboard and text message field.
Membro registado
12 mensagems
Publicado em dezembro, 20 2019 - 11:50 AM
Uhm..can you elaborate it better?
Have you ever done this? Can you provide an example for ARV & me if you have any? :-)
Publicado em dezembro, 21 2019 - 12:42 AM
Yes i have done it with windev mobile (and have it implemented that technique in 4 applications i have made, and it works quite well) both in Android and IOS using custom Java code for Android and SWIFT code for IOS. Now in regards to give my code out, i am sorry i dont do that i dont share my code. Remember that you can write this functionality and use any java functions in your Windev mobile app and you can use any SWIFT code in your IOS solution. I can leave you a youtube video where someone does it in IOS with SWIFT and XCODE and you can adapt that code to your solution. For android is exactly the same technique but using the libraries provided by the Android SDK. Here is the link for the YouTube video where someone implements just that in XCODE.

Publicado em dezembro, 21 2019 - 9:15 PM
Hello there, yes i have implement the solution i told you about in Windev Mobile in both Android and IOS. It works exactly as the example in the video and works very well in both operative systems. In regards to the question of sharing my code, i do not share my code ever do to copyright reasons nor i use time to be making functional samples. What i do is to tell you where to look and point the way. the rest is up to you to implement the solution.

here is a guide in how to implement the solution in IOS

Membro registado
12 mensagems
Publicado em janeiro, 02 2020 - 11:35 AM
Eureka!
Enable automatic scrollbars for the window!









The IDE prompts you to disable the automatic scrollbars because the EDT_ used for the message has automatic scrollbars enabled and I guess everyone did!

So: bottom anchoring and automatic scrollbars enabled for the window

I'm gonna test the same thing over iOS but I'm pretty confident!