Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PtrFrameLayout.java #212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions ptr-lib/src/in/srain/cube/views/ptr/PtrFrameLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ protected void onLayout(boolean flag, int i, int j, int k, int l) {
}

private void layoutChildren() {
int offsetX = mPtrIndicator.getCurrentPosY();
int offsetY = mPtrIndicator.getCurrentPosY();
int paddingLeft = getPaddingLeft();
int paddingTop = getPaddingTop();

if (mHeaderView != null) {
MarginLayoutParams lp = (MarginLayoutParams) mHeaderView.getLayoutParams();
final int left = paddingLeft + lp.leftMargin;
final int top = paddingTop + lp.topMargin + offsetX - mHeaderHeight;
final int top = paddingTop + lp.topMargin + offsetY - mHeaderHeight;
final int right = left + mHeaderView.getMeasuredWidth();
final int bottom = top + mHeaderView.getMeasuredHeight();
mHeaderView.layout(left, top, right, bottom);
Expand All @@ -247,11 +247,11 @@ private void layoutChildren() {
}
if (mContent != null) {
if (isPinContent()) {
offsetX = 0;
offsetY = 0;
}
MarginLayoutParams lp = (MarginLayoutParams) mContent.getLayoutParams();
final int left = paddingLeft + lp.leftMargin;
final int top = paddingTop + lp.topMargin + offsetX;
final int top = paddingTop + lp.topMargin + offsetY;
final int right = left + mContent.getMeasuredWidth();
final int bottom = top + mContent.getMeasuredHeight();
if (DEBUG && DEBUG_LAYOUT) {
Expand Down