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

mod: 优化判断是否往上滑动 #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xymelon
Copy link

@xymelon xymelon commented Mar 29, 2017

@jeasonlzy 我改了下HeaderScrollHelper isTop的判定,你验证下?

@xymelon
Copy link
Author

xymelon commented Mar 29, 2017

统一使用这个判定

/**
     * 判断当前view是否往上滑动
     *
     * @param view
     * @return
     */
    private boolean canViewScrollUp(View view) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            if (view instanceof AbsListView) {
                final AbsListView absListView = (AbsListView) view;
                return absListView.getChildCount() > 0
                        && (absListView.getFirstVisiblePosition() > 0 ||
                        absListView.getChildAt(0).getTop() < absListView.getPaddingTop());
            } else {
                return ViewCompat.canScrollVertically(view, -1) || view.getScrollY() > 0;
            }
        } else {
            return ViewCompat.canScrollVertically(view, -1);
        }
    }

@wanghainan
Copy link

PagerSlidingTabStrip,三个title怎么让他们默认居中啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants