Hi Dianne,

thanks for your reply.

> "You'd need to set your view hierarchy to not correctly resize to adjust to its window"

How can I 'achieve' that (setting a view hierarchy that wouldn't correctly resize)? But even if the view hierarchy would be correctly set, why would it resize at all? It shall not. I definitely didn't set any flag regarding window resizing, neither in code nor in xml.


What's especially weird here:
if I hide my ListView by setting it to View.INVISIBLE, so that it even takes the same space(!) as if it would when View.VISIBLE, the behaviour is different: the window does *not* resize. And all I did here was changing the visibility-attribute, no changes to any window attribute or flag regarding resizing.

You can see an updated screenshot here - to compare the activity when the ListView is visible(1) and invisible(2) and it's behaviour when I press the search button.

http://img819.imageshack.us/img819/9330/screenshotsearch.png

As you can see, there are definitely also other elements in the layout that require some space (i.e. the black footer bar), and also since I just set the listView to 'invisible' rather than 'gone', I cannot find a logic explanation for the different behaviour.

Possibly a bug?


XML Layout:
http://pastebin.com/5zzVxjbK
(ListView has android:id="@+id/category_questions")

Thanks,
Mathias



On Sep 7, 11:28 am, Dianne Hackborn <hack...@android.com> wrote:
> The window is just resized if you set it to resize mode. You'd need to set > your view hierarchy to not correctly resize to adjust to its window, which
> is...  questionable.
>
>
>
>
>
> On Mon, Sep 6, 2010 at 7:57 PM, Mathias Lin <m...@mathiaslin.com> wrote:
> > Hi Ed,
>
> > On Sep 7, 6:25 am, Ed <edscha...@gmail.com> wrote:
> > > Instead of View.INVISIBLE try View.GONE.
>
> > Sorry, you misunderstood. View.INVISIBLE was just for testing purposes
> > to see if it makes any differences. In my app I cannot hide the
> > elements of course, I need them there to be visible to the user.
> > I just wanted to point out that by setting View.INVISIBLE to the
> > listView, the behaviour I want (the layout to stay fix) can be
> > achieved, but I am wondering *why* ? What's the logic behind it?
>
> > (So both View.INVISIBLE and View.GONE already have the same desired
> > effect; but I *do* want to show the element to the user of course.)
>
> > >http://developer.android.com/reference/android/view/View.html
>
> > > Also in your scroll view layout try setting
> > > android:fillViewport="true" on the scroll view.
>
> > The scroll view works fine, with the scrollView, the layout remains
> > fix (what I want); I want the layout that uses the *ListView* to stay
> > fixed as well when I press the search button.
>
> > I also already tried to set android:isScrollContainer="false" to the
> > list view, but it makes no difference either. (ListView doesn't have a
> > fillViewport attribute)
>
> > Mathias
>
> > > Ed
>
> > > On Sep 7, 12:03 am, Mathias Lin <m...@mathiaslin.com> wrote:
>
> > > > Interestingly though: when I set my ListView visibility to
> > > > View.INVISIBLE in my first activity, then the layout doesn not get
> > > > moved up anymore!
>
> > > > This is my layout/xml:
>
> > > > 1)http://pastebin.com/5zzVxjbK
> > > > ListView where layouts is been moved up by the softkeyboard
>
> > > > 2)http://pastebin.com/KFtPuHvP
> > > > ScrollView/LinearLayout, where layout remains fix by the softkeyboard
>
> > > > On Sep 6, 8:48 pm, Mathias Lin <m...@mathiaslin.com> wrote:
>
> > > > > How does Android determine whether to move the layout up when showing
> > > > > the softkeyboard?
>
> > > > > Note: I am aware that the activity property
> > > > > android:windowSoftInputMode="adjustResize|adjustResize|
> > > > > adjustUnspecified" exists, as described herehttp://
> > developer.android.com/guide/topics/manifest/activity-element.h...
> > > > > , but in my case it doesn't seem to have any effect. This is my
> > > > > problem:
>
> > > > > I have two activities, pretty much the same layout, but the first one > > > > > is using a ListView that holds a list of buttons. The second activity > > > > > holds a scrollview with buttons. The rest is the same, same number of
> > > > > buttons, same height of elements, etc. (All elements fit on the
> > > > > screen, so actually the user doesn't need to scroll in the scrollview
> > > > > or listview.)
> > > > > Please see my screenshot to get an idea:http://i.imgur.com/UNXPz.png
>
> > > > > Now, when I press the search button to open the search input bar, in
> > > > > my first activity, the entire layouts gets moved up. While on the
> > > > > second activity, the layout is not being moved up but the
> > softkeyboard
> > > > > just displays on top of it. This is actually how I want it to behave.
> > > > > How can I achieve the same with my activity that's using the
> > ListView?
>
> > > > > In my manifest, initially I didn't specify any
> > > > > android:windowSoftInputMode attribute, but even if I do, it doesn't
> > > > > make any difference; I tried all three values (adjustPan,
> > > > > adjustResize, adjustUndefined, without any difference).
>
> > > > > This is my layout:http://i.imgur.com/UNXPz.png
>
> > > > > (I'm not posting any code here for now, I'm more interested generally > > > > > how it's been exactly determined whether Android moves the layout up
> > > > > or just displays they softkeyboard right on top of the existing
> > layout
> > > > > without moving it.)
>
> > > > > I couldn't find a specific logic that's been followed. When I reduce > > > > > the number of buttons, when I even wrap the listView in a ScrollView
> > > > > (just for the sake of trying to see what's happening), the layout
> > just
> > > > > won't stay fix.
> > > > > On the other hand then, I have activities in my app that contain only > > > > > one large ListView, and on that one the layout also remains fixed.
> > > > > First I thought it's related to ListViews, but it seems not to.
>
> > > > > btw: nowhere in my manifest am I explicitly specifying the
> > > > > windowSoftInputMode attribute.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com<android-developers%2Bunsubs cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to