Issue
I have an InsetDrawable
defined, and I would just like to be able to adjust the value of the inset at runtime, without re-assigning another drawable.
Is this possible?, or is the only way is to re-create the InsetDrawable?
Solution
It is not possible, because the API for that is not public. I had the same problem as you did, but in my case I had to animate the insets, so recreating the drawable was a quite costly option.
In the end I copied the source code of InsetDrawable, and added a method for changing the inset.
You can check it out here. Use the method setInsets()
for changing the insets.
Answered By - Daniel Zolnai
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.