android - GradientDrawable change angle programmatically -


i have following xml gradientdrawable. how can change angle programmatically?

<shape xmlns:android="http://schemas.android.com/apk/res/android">     <gradient android:type="linear"         android:angle="45"         android:startcolor="#ff0000"         android:endcolor="#00ff00" /> </shape> 

gradientdrawable has method called: .setorientation(gradientdrawable.orientation orientation), can change orientation of gradient this. need inflate xml gradientdrawable.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -