change naming of Canvas c to Canvas canvas

Signed-off-by: alex <alex.plutta@googlemail.com>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
alex 2019-08-19 20:03:09 +02:00 committed by Andy Scherzinger
parent f4e964e46e
commit 1dd2a5a71c
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -40,8 +40,8 @@ public class StickyHeaderItemDecoration extends RecyclerView.ItemDecoration {
}
@Override
public void onDrawOver(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
super.onDrawOver(c, parent, state);
public void onDrawOver(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
super.onDrawOver(canvas, parent, state);
View topChild = parent.getChildAt(0);
if (topChild == null) {
@ -62,25 +62,25 @@ public class StickyHeaderItemDecoration extends RecyclerView.ItemDecoration {
}
if (adapter.isHeader(parent.getChildAdapterPosition(childInContact))) {
moveHeader(c, currentHeader, childInContact);
moveHeader(canvas, currentHeader, childInContact);
return;
}
drawHeader(c, currentHeader);
drawHeader(canvas, currentHeader);
}
private void drawHeader(Canvas c, View header) {
c.save();
c.translate(0, 0);
header.draw(c);
c.restore();
private void drawHeader(Canvas canvas, View header) {
canvas.save();
canvas.translate(0, 0);
header.draw(canvas);
canvas.restore();
}
private void moveHeader(Canvas c, View currentHeader, View nextHeader) {
c.save();
c.translate(0, nextHeader.getTop() - currentHeader.getHeight());
currentHeader.draw(c);
c.restore();
private void moveHeader(Canvas canvas, View currentHeader, View nextHeader) {
canvas.save();
canvas.translate(0, nextHeader.getTop() - currentHeader.getHeight());
currentHeader.draw(canvas);
canvas.restore();
}
private View getChildInContact(RecyclerView parent, int contactPoint) {