Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cd3d8dc
start to implement sticky header behavior
AlexNi245 Aug 11, 2019
a184345
first implementation of sticky header logic.
AlexNi245 Aug 14, 2019
13e7aff
increase height of header element and set backgroundcolor to white
AlexNi245 Aug 14, 2019
792a6b9
finish implementation of sticky header implementation. This feature w…
AlexNi245 Aug 17, 2019
b4764f7
remove unnecessary files
AlexNi245 Aug 17, 2019
c41dd38
optimize imports
AlexNi245 Aug 17, 2019
a26a895
apply changes to java doc
AlexNi245 Aug 17, 2019
7a30070
remove unnecessary TAG field and replace nested if statement with && …
AlexNi245 Aug 18, 2019
9012f43
set visibility from ActivityViewHeaderHolder back to protected
AlexNi245 Aug 18, 2019
b61f9e0
format ActivityListAdapter
AlexNi245 Aug 18, 2019
4ea9667
unit test for isHeader(int pos)
AlexNi245 Aug 19, 2019
0ac5a8b
add static import for com.owncloud.android.lib.resources.activities.m…
AlexNi245 Aug 19, 2019
cdd5d38
add getHeaderPositionForItem unit test
AlexNi245 Aug 19, 2019
6ffa9d0
remove duplicate entry of setContentView
AlexNi245 Aug 19, 2019
52a7ffe
add license text
AlexNi245 Aug 19, 2019
f4e964e
change class name of ActivityListItemDecoration to StickyHeaderItemDe…
AlexNi245 Aug 19, 2019
1dd2a5a
change naming of Canvas c to Canvas canvas
AlexNi245 Aug 19, 2019
5a3db5e
replace do while loop in getHeaderPositionForItem with while loop
AlexNi245 Aug 19, 2019
fa11565
fixed issue Avoid reassigning parameters such as 'itemPosition'
AlexNi245 Aug 19, 2019
9624019
activity header has now the same font size as a activity element
AlexNi245 Aug 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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>
  • Loading branch information
AlexNi245 authored and AndyScherzinger committed Aug 20, 2019
commit 1dd2a5a71cd985e014d03d390b6b12f3fb553a32
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public StickyHeaderItemDecoration(StickyHeaderAdapter stickyHeaderAdapter) {
}

@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) {
Expand All @@ -62,25 +62,25 @@ public void onDrawOver(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull
}

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) {
Expand Down