Stacking a ListView with other widgets below?

by Romain Guy » Sat, 14 Nov 2009 07:13:49 GMT


Sponsored Links
 Don't use a ScrollView, it won't work. Add footers to your ListView.



>



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sat, 14 Nov 2009 07:27:35 GMT


 Hi Romain,

If I use a footer view, it can get focus, but its internal controls
cannot be focused using the scroll ball? For example, this is a simple
footer view:

  LinearLayout llFooter = new LinearLayout(this);
  llFooter.setLayoutParams(new AbsListView.LayoutParams
(AbsListView.LayoutParams.FILL_PARENT,
AbsListView.LayoutParams.WRAP_CONTENT));

   Button btn1 = new Button(this);
   btn1.setText("Btn1");
   llFooter.addView(btn1);

When I use the scroll ball the navigate to the footer, the entire
background gets highlighted, and I cannot access the button on the
layout. Is there some way of doing that for a better user experience,
or do users just have to touch with their finger?

Thanks





> >


Sponsored Links


Stacking a ListView with other widgets below?

by Romain Guy » Sat, 14 Nov 2009 07:40:46 GMT


 When you add the footer to the listview you need to indicate it can
receive focus: 
 http://d.android.com/reference/android/widget/ListView.html #setItemsCanFocus(boolean)





>> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sat, 14 Nov 2009 07:53:01 GMT


 Romain, thanks, that saved me.






> >> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sun, 15 Nov 2009 02:08:26 GMT


 ne more question on this - it seems like if we use a header or footer
view - then our activity can not add any other views? Example:

<LinearLayout>
<ListView> // with header and footer views.
</LinearLayout>

the above works perfectly with focus getting routed correctly etc. The
focus acts strangely in this case though:

<LinearLayout>
<LinearLayout>
<Button>
</LinearLayout>
<ListView>
</LinearLayout>

if the list view has focusable items - then the focus jumps back up to
the top LinearLayout-button after hitting down key again. This is kind
of strange, should this be happening? To explain further:

<LinearLayout>
<LinearLayout>
<Button>
</LinearLayout>
<ListView>
// listview is composed of:
TextView
TextView
Button
TextView
</ListView>
</LinearLayout>

so focus is fine up until it hits the row with the Button. The button
gets highlighted (since itemsCanFocus=true), but then hitting the down
arrow key again jumps focus up to the top linear layout button,
instead of continuing focus to the next row of the ListView. Normally
I could just use a header view instead, but is there an undocumented
rule in which we cannot add other views to our layout if using a
ListView with setItemsCanFocus=true?

Thanks

On Nov 13, 6:52pm, Mark Wyszomierski <mar...@gmail.com> wrote:
> > >> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sun, 15 Nov 2009 04:03:04 GMT


 his is problem is probably related to this ListView bug:
http://code.google.com/p/android/issues/detail?id=4255#c2

On Nov 14, 1:07pm, Mark Wyszomierski <mar...@gmail.com> wrote:
> > > >> >



Other Threads

1. glGenTextures going crazy on actual device

Hey everyone!

I'm working on a game for school and I ran into some problems with
glGenTextures :/
It works perfectly fine on the emulator but after 4 textures it breaks
on my Motorola Milestone.

Here's what I'm doing to setup my texture buffer:

        // array with textures
        public static final int[] texIds = new int[8];
        public static int texIndex = -1;

        public static void setupTetureBuffer( GL10 gl ) {

                // generate n textures
                gl.glGenTextures( texIds.length, texIds, 0 );
                texIndex = 0;

                // DEBUG
                for ( int i = 0; i < texIds.length; i++ ) {
                        // write to logcat
                        GameActivity.log( "%d -> %d", i, texIds[i] );
                }

                // checks for erros
                GLView.checkGlState( gl );
        }


And I'm using those slots to load my textures (which works nicely)

On the emulator I get this:

0 -> 1
1 -> 2
2 -> 3
3 -> 4
4 -> 5
5 -> 6
6 -> 7
7 -> 8

And all textures can be loaded.

But when I run it on my Milestone I get:

0 -> 100271
1 -> 315638026
2 -> 534244737
3 -> 1505553200
4 -> -1563003837
5 -> -867317458
6 -> -1700480907
7 -> -2028555960

Here only the first 4 work, the other 4 stay white.

Memory shouldn't be the problem (As I'm loading 64x64 pixel RGBA's)
I'm calling the whole setup and loading stuff in onSurfaceCreated
(also tested onSurfaceChanged, no difference)

I would really appreciate some help with this ^^
- borsty

-- 

2. HTC Dream saya mati :(

Siang semua. Saya mau tanya sekaligus minta tolong nih. Dream/G1 saya
bermasalah jadi kejadaiannya kemarin lusa. Saya jatuh dr motor terus
handphone saya keikut jatoh juga. Besokannya HH saya mati nyala sendiri dan
tadi pagi akhirnya mati nyalanya lebih parah. Cuma sekitar 5 menit hidup
langsung mati dan buat nyalainnya saya harus cabut baterai dulu tapi kadang
juga ngga nyala. HH saya masi {*filter*} belum pernah di root atau apa2. Saya
juga masih newbie.. Td udah coba yang Pwr button sama camera button juga
kaya begitu, udah saya alt +s pas dipencet home+power tapi tetep sama. Udah
dicoba charge 8 jam, Ada solusinya gak ya? Sedih banget saya huhu. Thanks ya
temen - temen.

-- 
"Indonesian Android Community [id-android]" 

Join:  http://www.***.com/ 
Moderator: id.andr...@gmail.com
ID Android Developer:  http://www.***.com/ 
ID Android Surabaya:  http://www.***.com/ 
ID Android on FB:  http://www.***.com/ 

3. Calculate Time Elapsed

4. Random pauses with 鈥淜ey dispa tching timed out sending to <null>鈥?when closing Android S urfaceView

5. HeapWorker is wedged problem

6. Bitmap memory handling with ImageView.setimage

7. Update ongoing notification only when notification window shown?