Ok so can you please explain me how to do a view like this : ---------------------- *NameMovie* 1h20min 11:00am | 2:00pm | *4:00pm* | 8:00pm | 10:00pm ---------------------
---------------------- Text(in bold) SubText(in gray) Text1 (in gray) Text2 (in gray) Text3 (in bold) Text4 (normal) --------------------- I won't use viewHolder because my CustomView doesn't inherites from LinearLayout, I don't any xml file. I'm using a class that inherites from View. Considerating that I don't know in advance how many Texts in gra, same thing for Text in bold and Text normal. AND I have to take care to cariage returns . I first use this model : <LinearLayout align:'vertical' > <TextView id="movieName"/> <TextView id="timeMovie"/> <TextView id="showtimes"/> </LinearLayout> And with the view holder pattern it works but I have low performance for the generation of the string : 11:00am | 2:00pm | *4:00pm* | 8:00pm | 10:00pm because I need to use a HTML paint So after talking with lots of people I decided to write my own View inheriting from View. The problem is : according to time of day, the view will show : 11:00am | 2:00pm | *4:00pm* | 8:00pm | 10:00pm and after 11:00am | 2:00pm | 4:00pm | *8:00pm* | 10:00pm etc. And according to the couple movie / cinema, I don't have the same number of showtimes so I can't say that I will use 4 textView for the showtimes because it will be wrong for the next movie to print. Or maybe I don't have understand how to use the ViewHolderPattern... In my Adapter, I directly use the viewObjects. How can i use the viewHolderPattern if my view inherites from view and don't have any view element in it ? regards Le mardi 3 juillet 2012 13:20:55 UTC+2, Mark Murphy (a Commons Guy) a écrit : > > On Tue, Jul 3, 2012 at 7:16 AM, jean-francois garreau > <jean.francois.garr...@gmail.com> wrote: > > I already saw that presentation and I can't use the ViewHolder pattern > > because i need a customView. > > That makes absolutely no sense whatsoever. > > - TextView inherits from View > - ImageView inherits from View > - CheckableTextView inherits from View > - your custom View subclass inherits from View > > And: > > - TextView works just fine with the ViewHolder pattern > - ImageView works just fine with the ViewHolder pattern > - CheckableTextView works just fine with the ViewHolder pattern > > Hence, I am fairly comfortable that for any well-written custom View > subclass, the ViewHolder pattern can apply. There should be nothing > magic about your particular subclass of View compared to any other. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 3.7 Available! > Le mardi 3 juillet 2012 13:20:55 UTC+2, Mark Murphy (a Commons Guy) a écrit : > > On Tue, Jul 3, 2012 at 7:16 AM, jean-francois garreau > <jean.francois.garr...@gmail.com> wrote: > > I already saw that presentation and I can't use the ViewHolder pattern > > because i need a customView. > > That makes absolutely no sense whatsoever. > > - TextView inherits from View > - ImageView inherits from View > - CheckableTextView inherits from View > - your custom View subclass inherits from View > > And: > > - TextView works just fine with the ViewHolder pattern > - ImageView works just fine with the ViewHolder pattern > - CheckableTextView works just fine with the ViewHolder pattern > > Hence, I am fairly comfortable that for any well-written custom View > subclass, the ViewHolder pattern can apply. There should be nothing > magic about your particular subclass of View compared to any other. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 3.7 Available! > -- 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