android - change drawable shape parameter programmatically -


i m looking make ring loading effect , have change dashwidth value.

i want programmatically.

<?xml version="1.0" encoding="utf-8"?> <shape   xmlns:android="http://schemas.android.com/apk/res/android"   android:shape="oval">    <stroke     android:width="3dp"     android:color="#8fffffff"      android:dashwidth="304dp"     android:dashgap="500dp"/>    <size      android:width="100dp"     android:height="100dp"/> </shape> 

as psink sad it's possible access dashgap , dashwidth attribute stroke. used setstroke method on background object after casting gradientdrawable

gradientdrawable background = (gradientdrawable)backgroundcontainer.getbackground(); background.setstroke(3, color.white, 50, 500); 

Comments