Android design practice - switch view -


I'm new to Android Dev, in fact, I'm a web developer and the question is similar to html + css classes.

In my application I have a simple list view, with custom line view. For the line of different states I need to change the many hair elements of the rows of color, background color, visibility of many elements.

For the course, I can do this in my CustomArrayAdapter's code. But it looks like a dirty move.

How can I do this "beautiful"? What is the Android API, similar to the classes in HTML?

  public view GetView (Int conditions, Kantiwuwuwu, View Group parent) {// ... int Aitms_kod = Marsi.atiaitmskount (); String item_count_label = ""; If (0 more lie; item_code) {item_count_label = String.valueOf (items_count); } And {item_count_label = ""; } CountTextView.setText (item_count_label); Return line view; }   

  & lt; TextView android: id = "@ + id / label" android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" android: text = "item labeled" Android: Focus = "false" Android: TextSize = "L8dp" Android : TextIsSelectable = "true" & gt; & Lt; / TextView & gt; & Lt; TextView android: id = "@ + id / benefit" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" android: text = "" Android: TextSize = "L2dp" Android: textcolor = "# 00aa00" Android: Leaut_vet = "1" Android: layout_margin lift = "15px" & gt; & Lt; / TextView & gt; & Lt; TextView android: id = "@ + id / number" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" android: text = "6" Android: textSize = "18dp" & gt; & Lt; / TextView & gt; Typ "itemprop =" text "> 

will usually override you

and your ListView is a separate line item "type" is (N type, say), and getItemViewType () overridden to return a value from 0 Return number (N - 1). In the getView () you can call getItemViewType (position) and list add the appropriate line layout and whatever you need The value given is to exceed the given value.

I suggest you watch this video:

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -