Add page finishing function when over scrolled to SessionDetailActivity #359
Conversation
Cool |
Interesting implementation |
|
||
|
||
@BindingMethods({ | ||
@BindingMethod(type = OverScrollLayout.class, attribute = "onOverScroll", method = "setOverScrollListener") |
konifar
Feb 18, 2017
Contributor
🆒
Sorry to be late review |
Thank you for your review!! |
@Override | ||
public void onStopNestedScroll(View target) { | ||
super.onStopNestedScroll(target); | ||
if (Math.abs(getY()) > overScrollThreshold && overScrollListener != null) { |
jmatsu
Feb 20, 2017
Member
overScrollListener != null
should be checked first.
Could you please swap?
overScrollListener != null
should be checked first.
Could you please swap?
chibatching
Feb 20, 2017
Author
Contributor
Oh, I see. I'd like to make another PR to fix it.
Oh, I see. I'd like to make another PR to fix it.
|
||
private int overScrollThreshold; | ||
|
||
private PointF originalLocation = new PointF(); |
jmatsu
Feb 20, 2017
Member
Rect
is better, I think. Then, Rect#getHeight can be used instead of originalHeight.
Rect
is better, I think. Then, Rect#getHeight can be used instead of originalHeight.
}) | ||
public class OverScrollLayout extends CoordinatorLayout { | ||
|
||
private static final float OVER_SCROLL_THRESHOLD = 0.20f; |
jmatsu
Feb 20, 2017
Member
This variable is a scale or ratio to calculate threshold?
Can you add any suitable suffix?
This variable is a scale or ratio to calculate threshold?
Can you add any suitable suffix?
@@ -157,6 +157,10 @@ public void onClickFab(@SuppressWarnings("unused") View view) { | |||
} | |||
} | |||
|
|||
public void onOverScroll() { | |||
callback.onOverScroll(); |
jmatsu
Feb 20, 2017
Member
should check null or not.
should check null or not.
} | ||
|
||
private boolean isAppBarExpanded(@NonNull AppBarLayout appBarLayout) { | ||
return appBarLayout.getHeight() == appBarLayout.getBottom(); |
jmatsu
Feb 20, 2017
•
Member
Does this really work?
View#getHeight() is calculated by View#getBottom() - View#getTop().
Can isAppBarExpanded and View#getTop() == zero be used equally?
Does this really work?
View#getHeight() is calculated by View#getBottom() - View#getTop().
Can isAppBarExpanded and View#getTop() == zero be used equally?
chibatching
Feb 20, 2017
Author
Contributor
View#getHeight() is calculated by View#getBottom() - View#getTop()
I didn't know this, it may be able to replaced with View#getTop() == zero.
Thanks!
View#getHeight() is calculated by View#getBottom() - View#getTop()
I didn't know this, it may be able to replaced with View#getTop() == zero.
Thanks!
Oops, I didn't notice this PR was merged |
I'd like to make another PR to fix your comment! |
@jmatsu Thanks for great review |
Issue
Overview (Required)
Links
Screenshot