android - How can I set progress bar color accent programmatically? -


i'm creating progressdialog compatible appcompat. color accent not applied in created progressbar.

link source of progressdialogcompat: https://github.com/krystian71115/androidhelperlibrary/blob/master/src/com/krystian71115/android/app/progressdialogcompat.java#l160

the result:

progressdialog bug

in screenshot can see progress bar in main layout applied correctly. when create programmatically doesn't work.

second screenshot after close dialog:

second screenshot

the coloraccent working correctly not working when create progress bar programmaticaly.

oncreate method:

@override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);     progressdialogcompat dialog = new progressdialogcompat(this);     dialog.settitle("loading");     dialog.setmessage("loading data...");     dialog.setprogressstyle(progressdialogcompat.style_horizontal);     dialog.setprogress(150);     dialog.setmax(300);     dialog.show(); } 

how can create progressbar horizontal coloraccent?

style:

<style name="apptheme" parent="theme.appcompat.light">    <item name="coloraccent">@color/red</item> </style> 

i'm using appcompat.

i'm testing on api 22 (emulator).


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -