MCPcopy Create free account
hub / github.com/M66B/FairEmail / onDraw

Method onDraw

app/src/main/java/eu/faircode/email/FragmentRules.java:139–154  ·  view source on GitHub ↗
(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state)

Source from the content-addressed store, hash-verified

137
138 DividerItemDecoration groupDecorator = new DividerItemDecoration(getContext(), llm.getOrientation()) {
139 @Override
140 public void onDraw(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
141 int count = parent.getChildCount();
142 for (int i = 0; i < count; i++) {
143 View view = parent.getChildAt(i);
144 int pos = parent.getChildAdapterPosition(view);
145
146 View header = getView(view, parent, pos);
147 if (header != null) {
148 canvas.save();
149 canvas.translate(0, parent.getChildAt(i).getTop() - header.getMeasuredHeight());
150 header.draw(canvas);
151 canvas.restore();
152 }
153 }
154 }
155
156 @Override
157 public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {

Callers

nothing calls this directly

Calls 4

getViewMethod · 0.95
drawMethod · 0.65
saveMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected