While I still haven't exactly found a way to just change the style of a view during runtime (i.e. my progress bar to horizontal).. I worked around this by modifying the view creations in IconifiedTextView code. Instead of creating new (Default) Text and Image views in IconifiedTextView, I pull in a layout from a precreated xml file using LayoutInflator...
- Code: Select all
View row = new View(context);
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
row = inflater.inflate(R.layout.item, null);
TextView title = (TextView) row.findViewById(R.id.txtTitle);
ImageView icon = (ImageView) row.findViewById(R.id.imgStatus);
ProgressBar progbar = (ProgressBar) row.findViewById(R.id.ProgressBar01);
Does that make sense? This may be overdoing it, but at least it works for me. Now I get the benefit of getting to see and modify the look of my rows ahead of time, in an XML layout form,, and get my horizontal progress bar.
I would still like to know if there is a way (even if it involves LayoutInflator) to change the style of a view, i.e. set runtime generated views layout/theme to a precreated xml layout... something like:
I know that you can use setTheme() in an activity to change the theme of that activity, but does this apply to views as well?