Android Question View vertical offset due to keyboard appearance

Semen Matusovskiy

Well-Known Member
Licensed User
Hi, guys --

A fullscreen activity has adjustResize attribute. When user types a text, adjustResize lifts a window content.
In general this effect is desired. But in the top of activity I placed a logotype and I want to redraw it when the keyboard appears on the screen. To redraw a logotype, I need to know vertical offset of the window.

Android obviously keeps somewhere vertical offset, but I can't find where. Any ideas ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is a known OS issue with full screen activities and adjustResize. The event is not always raised.

When adjustResize works properly, the OS doesn't push the window at all. The behavior you are describing is actually the behavior of adjustPan.

Handling adjustResize: Handle the soft keyboard with the IME library
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
Erel --

To fix an issiue, which you mentioned, I used a timer to control getWindowVisibleDisplayFrame. Non elegant way, but works.

Just now I am interesting in calculations. I assumed that OS lifts window until the bottom of textbox become visible. This allows to calculate "view's vertical offset" and to reduce logotype size.

But to use assumptions is a bad style. So, my question is, where Android keeps "vertical offset" ?
 
Upvote 0
Top