You can't do this.  If your window is on top of the IME, then it is not
resized for it -- the window manager starts at the top of the Z-order list
and determines the space needed for each window and uses that to impact the
windows behind it.

There are tricks you can play to cause the IME to go in front of your
window, but for a system window you really do not want to do this.

And I'll be honest -- what you are doing is really on the outer bounds of
what apps should be doing, if not beyond.  There is a reason this is called
a "system" window type.  It is for the system, not applications.  There is
a very good chance that any use of it you make at all is going to have
subtle problems as the platform evolves, because the way the system UI is
constructed is always evolving and so the assumptions are implicitly making
about that implementation will likely change in the future.  And as you
play more and more games to try to do things like you are requesting here,
the more and more likely you are to end up with a mess that is a horror to
maintain across platform releases.

I really regret ever letting these window types get into the original SDK.
 There are a lot of good reasons why they should be removed.

On Wed, Feb 8, 2012 at 8:19 AM, Doudou Rainbow <[email protected]>wrote:

> My project is to have an over the top button which enables to launch
> my activity from anywhere.
> For that purpose, I have a service that displays this button in a
> specific window.
> In the layout params of this window, I have the type
> "WindowManager.LayoutParams.TYPE_SYSTEM_ALERT" to be on top.
> I also have the flag "WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE",
> in that way the user can have access to other applications under my
> window and to hard keyboard keys (only the click in my window is
> considered)
> I get the windowManager to which is added my view  through
> "context.getSystemService(Context.WINDOW_SERVICE)"
>
> Everthing is working good, but there is something annoying about the
> keyboard. When other applications display the keyboard (ie the
> messaging application) my button is staying at the same place and can
> overlay the keyboard which is frustating for the user.
> What I want is to put my window up when the keyboard is displayed.
>
> I added in the layout params softInputMode
> "WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE" but the problem
> seems to be more complicated as the keyboard is displayed from
> somewhere else than my service.
> If I include an edittext in my window (and delete FLAG_NOT_FOCUSABLE)
> my layout can go up when I click on the edittext as this is the same
> window I suppose ? But when other windows display a keyboard, my
> button do not consider it (no call to "onLayout", "onMeasure methods"
> etc)
>
> How can I make my window react to the keyboard even if launched from
> another activity (below my window) ?
> As my window is above the keyguard window, is it ignoring it ?
> Is there some registration to do to say to the window manager that my
> window should also consider keyboard display ?
>
> Can some window layers experts explain me what is happening with my
> window and suggest me an idea to reach my goal ?
> I tried other attributes for "type" and "flags" but did not manage to
> get the desired result..
> I have passed days, my android knowledge has reached its limits :)
> Thank by advance for your help !
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to