[android-developers] Clickable inflated Gallery Item, but not scrollable when touching on the Gallery items

2011-06-09 Thread Mingchung
Hi, all

I have a gallery, and its items are dynamically show-up by inflating a
layout xml file


I need the views inside (say buttons) that layout xml file are
clickable...
Here is my xml file
Linearlayout orient=vertical layout_width=fill_parent
layout_height=fill_parent
Linearlayout background=RED layout_weight=1
width=fill_parent height=fill_parent clickable=true /
Linearlayout background=GREEN layout_weight=1
width=fill_parent height=fill_parent clickable=true /
/Linearlayout


when I inflate the layout at the adapter, the gallery can't not
scrolled when touching on the gallery item.  I think that is because
the clicking event was issued to only the inflated gallery-item, but
didn't bypass to the gallery... (when I remove the clickable
attribute, the gallery will scroll fine)

I think my problem could be solved in 2 ways.
1. at the gallery-item onClick event handler, do something to bypass
the clicking event to gallery
2. at the gallery itself, i could implement 'onItemClick' method. But
how to get the coordinate?

-- 
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


[android-developers] Re: How to update one of views(setText, setImage) in item already added on ListView

2010-12-29 Thread Mingchung
TreKing

*thank you for your replying*

Yes, I did search google with term: BaseAdapter getView

Just like you said, pretty many results showing that the layout is
decided(addView, inflate) at overrided getView method.

*my question is*
Is that meaning the layout of ListView item is decided when 'getView'
method called somewhere? I mean, the behavior is not that fit to the
method name getView

Mingchung

On 12月24日, 上午11時40分, TreKing treking...@gmail.com wrote:
 On Wed, Dec 22, 2010 at 11:02 PM, Mingchung jaw...@gmail.com wrote:
  My question is, an item has been already added to a ListView, can I still
  update the UI?

 Yes - you'll want to create a custom Adapter that overrides the getView()
 method and update the view there.

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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


[android-developers] How to update one of views(setText, setImage) in item already added on ListView

2010-12-23 Thread Mingchung
Hi, all

* I have a ListView that using my layout document, to simplest, it
goes  like this ...
!-- itemraw.xml --
LinearLayout id=ll_parent orient=vertical
  TextView id=tv_1 text=hello_1/
  TextView id=tv_2 text=hello_2 /
  TextView id=tv_3 text=hello_3 /
/ LinearLayout

* then I populate the items to the ListView...
ListView lv = (ListView)findViewById(R.id.mylv);
ArrayAdapterString aa = new ArrayAdapterString(this,
R.layout.itemraw, R.id.tv_1, m_MyStringArray);
lv.setAdapter(aa);

* OK, the item is really populated like I think. Now I'd like to do
setText() to one of the TextView of one of ListView item...
LinearLayout ll = (LinearLayout)aa.getView(0, null, null);
TextView tv = (TextView)ll.findViewById(R.id.tv_3);
tv.setText(HAHAHAHAHA);

* Just like the program code, i set 3rd TextView with text HAHAHAHA
of first item, but nothing happened.

* My question is, an item has been already added to a ListView, can I
still update the UI?

-- 
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