Super setAdapter new RateableWrapper getContext

 

 

We simply subclass and override so we can wrap the supplied in our own .

Visually, the results are similar to the , albeit without top‑rated words appearing in all caps (see Figure 9‑5).

Figure 9‑5. The RateListViewDemo sample application

The difference is in reusability. We could package in its own JAR and plop it into any Android project where we need it. So while is somewhat complicated to write, we have to write it only once, and the rest of the application code is blissfully simple.

Of course, this could use some more features, such as programmatically changing states (updating both the and the actual itself), allowing other application logic to be invoked when a state is toggled (via some sort of callback), etc.

 

 








Дата добавления: 2015-05-16; просмотров: 733;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.003 сек.