i have set margin using RecyclerView.ItemDecoration class and it's working in English properly but when i changed my language to Arabic its not working i have using support for left and right support in menifest file.
Here is my class
public class ProductMarginSetting extends RecyclerView.ItemDecoration {
@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
if (parent.getChildAdapterPosition(view) == parent.getAdapter().getItemCount() - 1) {
outRect.right = 24; /* set your margin here */
}
if (parent.getChildAdapterPosition(view) == 0) {
outRect.left = 24; /* set your margin here */
}
}
}
Arabic version (not working) , English version (working)
Thanks