Use XML-defined styles in a hierarchy
I define a style like this:
<style name="AvatarSimpleDraweeViewProperties">
<item name="packageName:actualImageScaleType">centerCrop</item>
<item name="packageName:placeholderImage">@drawable/user_avatar_default</item>
<item name="packageName:placeholderImageScaleType">centerCrop</item>
<item name="packageName:failureImage">@drawable/user_avatar_default</item>
<item name="packageName:failureImageScaleType">centerCrop</item>
<item name="packageName:viewAspectRatio">1</item>
<item name="packageName:roundAsCircle">true</item>
</style>
Can I create a GenericDraweeHierarchy instance with the values inflated from this xml?
Hi, you can't inflate only the hierarchy at the moment, but you can inflate GenericDraweeView. If you just need the hierarchy, you could make a pull request that extracts GenericDraweeHierarchy inflation logic out of GenericDraweeView (preferably to a separate file, GenericDraweeHierarchyInflator or similar). I wanted to do that since long time ago, but there was always something else.
You can use GenericDraweeHierarchyInflater.inflateHierarchy(Context context, AttributeSet attrs) or GenericDraweeHierarchyInflater.inflateBuilder(Context context, AttributeSet attrs)` to get a hierarchy or a builder.