@Override public void onScrollDown() { if (mScrollView.canScrollDown() && mScrollView.canScrollUp() && mScrollView.getScrollY() > mToolbarHeight) { showToolbar(false); showFooter(false); } }
@Override public void onScrollCompleted() { if (!mScrollView.canScrollDown()) { showToolbar(true); showFooter(true); } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.reader_fragment_post_detail, container, false); mScrollView = (WPScrollView) view.findViewById(R.id.scroll_view_reader); mScrollView.setScrollDirectionListener(this); mLayoutFooter = (ViewGroup) view.findViewById(R.id.layout_post_detail_footer); mLikingUsersView = (ReaderLikingUsersView) view.findViewById(R.id.layout_liking_users_view); mLikingUsersDivider = view.findViewById(R.id.layout_liking_users_divider); // setup the ReaderWebView mReaderWebView = (ReaderWebView) view.findViewById(R.id.reader_webview); mReaderWebView.setCustomViewListener(this); mReaderWebView.setUrlClickListener(this); mReaderWebView.setPageFinishedListener(this); // hide footer and scrollView until the post is loaded mLayoutFooter.setVisibility(View.INVISIBLE); mScrollView.setVisibility(View.INVISIBLE); return view; }