Hi,
First of all - than you for such a great tool!!!
Please help! How can I change default colors of profile (avatar) placeholder image?
Thanks.
Where is the drawable for this placeholder anyway?
@oleynikd you can change it by defining a different placeholder
inside the DrawerImageLoader
https://github.com/mikepenz/MaterialDrawer/blob/develop/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerImageLoader.java#L82
This is how you define the ImageLoader
https://github.com/mikepenz/MaterialDrawer#load-images-via-url
And that's where the placeholder icon is coming from by default:
https://github.com/mikepenz/MaterialDrawer/blob/769cbfdc233c4835f8403a4c94002166d4e7f8c0/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L93
Thank you a lot!!!
Sample code for tweaking the placeholder colors:
DrawerImageLoader.init(new AbstractDrawerImageLoader() {
@Override
public Drawable placeholder(Context ctx, String tag) {
return new IconicsDrawable(ctx, MaterialDrawerFont.Icon.mdf_person).colorRes(android.R.color.white).backgroundColorRes(R.color.primary).sizeDp(56).paddingDp(16);
}
});
Most helpful comment
@oleynikd you can change it by defining a different
placeholder
inside theDrawerImageLoader
https://github.com/mikepenz/MaterialDrawer/blob/develop/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerImageLoader.java#L82
This is how you define the
ImageLoader
https://github.com/mikepenz/MaterialDrawer#load-images-via-url
And that's where the placeholder icon is coming from by default:
https://github.com/mikepenz/MaterialDrawer/blob/769cbfdc233c4835f8403a4c94002166d4e7f8c0/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L93