Re: [android-developers] Custom view in gallery

2010-11-22 Thread TreKing
On Thu, Nov 18, 2010 at 12:59 AM, Shalini coolcool.shal...@gmail.comwrote:

 i want a custom view which will contain one textview and one imageview ,in
 a gallery as an item.


OK.


  can anyone send me the code for that?


No one is going to do your work for you, sorry.


  Please tell me how to do this.


Read the documentation and look at the samples. This is basic Android stuff.
Show your work if you get stuff or need help with specifics.

-
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

Re: [android-developers] Custom View as Gallery Item

2010-10-06 Thread Kumar Bibek
Sure, create a custom view, and use that, else, you can create the custom
view in the getView method of the adapter.

On Wed, Oct 6, 2010 at 6:21 PM, kavitha b kkavith...@gmail.com wrote:

 Hi All,

 As i see in Gallery example in APIDemos,it is possible to add Image
 listView or textviews as Gallery items.

 But my requirement is,I need to add both textview and Image combined as a
 single item in Gallery.

 All examples are showing either imageview adapter or text view adapter as
 Gallery items.

 But I want to add Custom View as Gallery Item.

 Any way to do this?

 Please help.

 Thanks
 kavitha

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

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

Re: [android-developers] Custom View as Gallery Item

2010-10-06 Thread kavitha b
yes,I tried that using inflater.

But it is not working.No views are shown in gallery then.

Any example with that?

On Wed, Oct 6, 2010 at 6:23 PM, Kumar Bibek coomar@gmail.com wrote:

 Sure, create a custom view, and use that, else, you can create the custom
 view in the getView method of the adapter.

 On Wed, Oct 6, 2010 at 6:21 PM, kavitha b kkavith...@gmail.com wrote:

 Hi All,

 As i see in Gallery example in APIDemos,it is possible to add Image
 listView or textviews as Gallery items.

 But my requirement is,I need to add both textview and Image combined as a
 single item in Gallery.

 All examples are showing either imageview adapter or text view adapter as
 Gallery items.

 But I want to add Custom View as Gallery Item.

 Any way to do this?

 Please help.

 Thanks
 kavitha

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




 --
 Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com

  --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Custom View as Gallery Item

2010-10-06 Thread Kumar Bibek
That should work.

Media media = medias.get(index);
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.media_adapter, null,
true);
}
ImageView img = (ImageView)
convertView.findViewById(R.id.mediaImage);
img.setImageBitmap(media.getBmp());
img.setLayoutParams(new LayoutParams(53, 53));

Something like this. I am not sure why isn't it working. Maybe, it is being
diaplyed, but you have to adjust the layout a bit.

On Wed, Oct 6, 2010 at 6:31 PM, kavitha b kkavith...@gmail.com wrote:

 yes,I tried that using inflater.

 But it is not working.No views are shown in gallery then.

 Any example with that?


 On Wed, Oct 6, 2010 at 6:23 PM, Kumar Bibek coomar@gmail.com wrote:

 Sure, create a custom view, and use that, else, you can create the custom
 view in the getView method of the adapter.

 On Wed, Oct 6, 2010 at 6:21 PM, kavitha b kkavith...@gmail.com wrote:

 Hi All,

 As i see in Gallery example in APIDemos,it is possible to add Image
 listView or textviews as Gallery items.

 But my requirement is,I need to add both textview and Image combined as a
 single item in Gallery.

 All examples are showing either imageview adapter or text view adapter as
 Gallery items.

 But I want to add Custom View as Gallery Item.

 Any way to do this?

 Please help.

 Thanks
 kavitha

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




 --
 Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com

  --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

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