android - Performance impact of generating Content Descriptions for TextViews -
i have lot of dynamically generated textviews (being fed list array adapter), , each of text contains summary of lot of small information. in effort improve ui, used styling when displaying information, so:
(4 votes) ☬ [tag1] [java] [regex] ☬ 2 min ago ☬ author ☬ 245 points
this line constructed using stringbuilder. line (let's say) looks nice, not friendly accessibility tools such "google talk back". reads so: "four votes unknown character bracket tag 1 close bracket..."
so fix that, i'm generating string , set content description, so:
asked "author", has "245" reputation points, received "4 votes" since "two minutes ago", these tags: "tag1", "java", "regex".
this line generated using stringbuilder, doubles run-time.
i'm asking:
is doubling run-time? worth it? small percentage of people need accessibility tools, looks i'm sacrificing else's cpu cycles.
if indeed has negative impact on performance, how can improve it? there way detect whether "talk back" used? android smart enough detect itself, , ignore setcontentdescription()
line?
i don't think worth worrying unless app has performance issues. do, can turn on or off based on if accessibility settings turned on. can check enables accessibility apps in secure settings.
Comments
Post a Comment