Closed HosseinArabbeigi closed 6 years ago
If you want to change the look of an item you have to implement your own CustomDrawerItem
see the FAQ or see the sample for more details
yes i done this by extending AbstractDrawerItem but still has padding
Can you post a screenshot please?
yes of course
CustomItem :
CustomItem layout
add to drawer :
CPIView component does not have any padding or margin, i used a simple imageview too, and still has margin
hi penz did you check my code? is there any thing wrong with that? i will send you result of code
as you see there is right and left distance near the yellow banner :
Can you please use the layout inspector of Android Studio and see where the margin/padding is applied. Perhaps it happens in your item
Please report back. :) Close for the time being
Hi @mikepenz! I have the same question and I have checked with the Layout Inspector and It's applied in material_drawer_sticky_footer, it sets startMargin and endMargin in -2147483648
there is padding applied for API 17 for compat reasons, the other padding should be applied for the items https://github.com/mikepenz/MaterialDrawer/blob/develop/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L397
I did DrawerUIUtils.setDrawerVerticalPadding(drawerMenu.getStickyFooter(), 0);
but it didn't work.
It looks like this
My custom DrawerItem is
public class FooterDrawerItem extends AbstractDrawerItem<FooterDrawerItem, FooterDrawerItem.ViewHolder> {
@Override
public int getLayoutRes() {
return R.layout.drawer_footer;
}
@Override
public int getType() {
return 0;
}
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private TextView txv;
public ViewHolder(View itemView) {
super(itemView);
itemView.setPadding(0,0,0,0);
itemView.setBackgroundColor(Color.TRANSPARENT);
txv = itemView.findViewById(R.id.txv);
txv.setPadding(0,0,0,0);
}
}
}
Hi there tanks for amazing library i cant remove the left and right padding or margin on sticky footer
android version : 6 library version : 5.9.4