0

Most apps that maintain active state in a menu listView also provide a small imageView visual in addition to color change.

How would you do this?

Would it be a part of the state_activated=true selector somehow, or should it be done programatcally in Java and perhaps in the ListAdapter?.

In the image below, you see on the Youtube app, the acte state has BOTH Background image change AND the visual indicator. (Red Line)

enter image description here

TheLettuceMaster
  • 15,594
  • 48
  • 153
  • 259
  • 1
    See this [ANDROID LISTVIEW : HIGHLIGHT SELECTED ITEM](http://www.michenux.net/android-listview-highlight-selected-item-387.html) – AwadKab Mar 19 '13 at 22:08
  • @AwadKab Yes, this discussed setting colors for Active State (which I already do), but I want an image in the row to be also set visible if active, but invisible rest of time. – TheLettuceMaster Mar 19 '13 at 22:13
  • You can change imageview visibility by code `v.setVisibility(View.INVISIBLE);` and `setVisibility(View.VISIBLE);` – AwadKab Mar 19 '13 at 22:33
  • I think I need something like this, `if (activestate==position) { // make visible } else { // make invisible }`. Seems like this would go in `getView()` method in `adapter`. Not sure how to implement. – TheLettuceMaster Mar 19 '13 at 22:38
  • 1
    You can do that by make `9 patch` image and use it as background when the row activate. – AwadKab Mar 19 '13 at 23:13
  • @AwadKab Your comment helped me get it working. Make that the answer an I'll mark you right. – TheLettuceMaster Mar 22 '13 at 00:27

1 Answers1

1

You can do that by make 9 patch image and use it as background when the row activate.

AwadKab
  • 3,054
  • 2
  • 17
  • 17