content: package com.alphawallet.app.ui.widget.divider;
  
  import android.content.Context;
  import android.graphics.Canvas;
  import android.graphics.drawable.Drawable;
  import android.view.View;
  
  import androidx.annotation.NonNull;
  import androidx.core.content.ContextCompat;
  import androidx.recyclerview.widget.RecyclerView;
  
  import com.alphawallet.app.R;
  
  public class ListDivider extends RecyclerView.ItemDecoration {
      private final Drawable mDivider;
  
      public ListDivider(Context context) {
          mDivider = ContextCompat.getDrawable(context, R.drawable.line_divider);
      }
  
      @Override
      public void onDrawOver(@NonNull Canvas c, RecyclerView parent, @NonNull RecyclerView.State state) {
          int left = parent.getPaddingLeft();
          int right = parent.getWidth() - parent.getPaddingRight();
  
          int childCount = parent.getChildCount();
          for (int i = 0; i < childCount; i++) {
              View child = parent.getChildAt(i);
  
              RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
  
              int top = child.getBottom() + params.bottomMargin;
              int bottom = top + mDivider.getIntrinsicHeight();
  
              mDivider.setBounds(left, top, right, bottom);
              mDivider.draw(c);
          }
      }
  }
  