damontecres / StashAppAndroidTV

Android TV App for Stash
GNU Affero General Public License v3.0
62 stars 5 forks source link

Performance improvement to use single Spannable TextView for icons on cards #298

Closed damontecres closed 1 month ago

damontecres commented 1 month ago

This refactors the icon row on cards to switch all icons (except O-Counter icon & text) to a single TextView using a SpannableString to set the icon font when needed.

This will help performance in two ways: 1) much fewer views to inflate/layout and 2) fewer re-layouts since the views don't need to be hidden/shown

My non-scientific estimate loading a ten row main page is ~30% faster, so this seems pretty significant!

damontecres commented 1 month ago

After some further testing, 30% speed up is probably on the upper end and the average is more like 10-15% which is still significant.