Creating semi-transparent list items - possible?

by mastix mc » Tue, 09 Jun 2009 01:19:22 GMT


Sponsored Links
 Hey guys,

I a newb when it comes to android but I quite a professional in
Java, though. :)

I planning a little demo app to learn all about android api
Ie already created a ListActivity which has a specific background.
What I would like to have now, is that the list items have a
transparency (like having an opacity of 75-80%) so that the background
shines through a little.

Could you guys tell me whether that possible?

Thank you very much in advance
mastix

--~--~---------~--~----~------------~-------~--~----~



Creating semi-transparent list items - possible?

by Mark Murphy » Tue, 09 Jun 2009 01:52:53 GMT


 


Yes, though you will need to specify your own custom row layout that has
the transparency you seek.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android Development Wiki:  http://wiki.andmob.org 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Creating semi-transparent list items - possible?

by mastix mc » Tue, 09 Jun 2009 02:14:09 GMT


 Hi Mark,

thanks for that hint. :)

Do you have a demo/example/documentation that shows me what I have to
do?

Sascha





--~--~---------~--~----~------------~-------~--~----~



Creating semi-transparent list items - possible?

by Mark Murphy » Tue, 09 Jun 2009 02:19:31 GMT


 


Well, you only asked if it was possible, not how to actually *do* it... ;-)


1. Create a layout for your rows. Make sure your containers
(LinearLayout, etc.) have android:background set with an appropriate
transparency (e.g., "#80FF0000" is red with 50% transparency).

2. Specify that layout when you create your adapter. This could be as
simply as providing the layout ID in the adapter constructor, all the
way to implementing getView() (or newView()/bindView() for
CursorAdapter), depending on what you want to do with your rows.

For the getView() scenario, visit:

 http://wiki.andmob.org/samplecode 

where you will find links to the half-dozen or so blog posts I made
under the Fancy ListViews series.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android App Developer Books:  http://commonsware.com/books.html 

--~--~---------~--~----~------------~-------~--~----~



Creating semi-transparent list items - possible?

by mastix mc » Tue, 09 Jun 2009 03:32:07 GMT


 Hi Mark,

I haven't tried it yet, but I guess I can say that you're my hero! :)

thank you very much!

Thanks,

Sascha





--~--~---------~--~----~------------~-------~--~----~



Creating semi-transparent list items - possible?

by ayush » Tue, 09 Jun 2009 12:18:17 GMT


 if you want a traditional dialog-box look, then another option would
be to implement the built in Dialog Theme on your Activity containing
the ListView. also, you can override the standard Dialog Theme and
make changes to the background colour, fonts etc.
theres a short-and-sweet example on how to do this in the Android
Documentation under the section on User Interfaces => Applying Styles
and Themes. apart from the Dialog Theme you also have a Translucent
Theme. however, based on discussion forums, it seems that the
Translucent Theme cant be overridden and customized.







--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. JJIL Issue

Hey guys,

I'm having some issues with JJIL, simply put i am currently trying to
implement the code on a virtual device to i am puling the image i want to
edit from a file, my problem is this;

JJIL wants as input a complex32 image, however i don't see a method in the
JJIL library or in java to convert an image (of whatever type ) to
complex32.
I know that the image type that android captures from the camera is in the
format of bitmap so i will encounter the error again when i attempt to run
the application on the device.
Any help would be greatly appreciated.

Thanks
--
Danny

--

2. Accessing google calendar through Android using the given protocol

I request the developers to please look into this problem. Am I
sending the request correctly?
Thank you.




-- 

3. Ada yang tau cara hapus Apps Bawaan ROM? MAGIC 32A Eclair 2.1 [MADE BY ME]

4. List adapter: failing to recycle views = lots of memory allocated?

5. List adapter: failing to recycle views = lots of memory allocated?

6. Learn the latest phone from Nokia n86 pictures and Features

7. What is the best way to schedule an event that will wake up the phone if it goes into sleep mode?