本文整理汇总了Java中com.github.ksoichiro.android.observablescrollview.Scrollable.getCurrentScrollY方法的典型用法代码示例。如果您正苦于以下问题:Java Scrollable.getCurrentScrollY方法的具体用法?Java Scrollable.getCurrentScrollY怎么用?Java Scrollable.getCurrentScrollY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.ksoichiro.android.observablescrollview.Scrollable
的用法示例。
在下文中一共展示了Scrollable.getCurrentScrollY方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: adjustToolbar
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void adjustToolbar(ScrollState scrollState) {
int toolbarHeight = mToolbarView.getHeight();
final Scrollable scrollable = getCurrentScrollable();
if (scrollable == null) {
return;
}
int scrollY = scrollable.getCurrentScrollY();
if (scrollState == ScrollState.DOWN) {
showToolbar();
} else if (scrollState == ScrollState.UP) {
if (toolbarHeight <= scrollY) {
hideToolbar();
} else {
showToolbar();
}
} else if (!toolbarIsShown() && !toolbarIsHidden()) {
// Toolbar is moving but doesn't know which to move:
// you can change this to hideToolbar()
showToolbar();
}
}
示例2: adjustToolbar
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void adjustToolbar(ScrollState scrollState) {
View toolbarView = getActivity().findViewById(R.id.toolbar);
int toolbarHeight = toolbarView.getHeight();
final Scrollable scrollable = getCurrentScrollable();
if (scrollable == null) {
return;
}
int scrollY = scrollable.getCurrentScrollY();
if (scrollState == ScrollState.DOWN) {
showToolbar();
} else if (scrollState == ScrollState.UP) {
if (toolbarHeight <= scrollY) {
hideToolbar();
} else {
showToolbar();
}
} else if (!toolbarIsShown() && !toolbarIsHidden()) {
// Toolbar is moving but doesn't know which to move:
// you can change this to hideToolbar()
showToolbar();
}
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:23,代码来源:ViewPagerTabFragmentParentFragment.java
示例3: propagateToolbarState
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void propagateToolbarState(boolean isShown, View view, int toolbarHeight) {
Scrollable scrollView = (Scrollable) view.findViewById(R.id.scroll);
if (scrollView == null) {
return;
}
if (isShown) {
// Scroll up
if (0 < scrollView.getCurrentScrollY()) {
scrollView.scrollVerticallyTo(0);
}
} else {
// Scroll down (to hide padding)
if (scrollView.getCurrentScrollY() < toolbarHeight) {
scrollView.scrollVerticallyTo(toolbarHeight);
}
}
}
示例4: adjustToolbar
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
public void adjustToolbar(ScrollState scrollState, View view) {
int toolbarHeight = mToolbar.getHeight();
final Scrollable scrollView = (Scrollable) view.findViewById(R.id.yelo_board_list);
if (scrollView == null) {
return;
}
mView = view;
if (scrollState == ScrollState.UP) {
if (toolbarHeight < scrollView.getCurrentScrollY()) {
hideToolbar();
} else if (scrollView.getCurrentScrollY() < toolbarHeight) {
showToolbar();
}
} else if (scrollState == ScrollState.DOWN) {
if (toolbarHeight < scrollView.getCurrentScrollY()) {
showToolbar();
}
}
}
示例5: propagateToolbarState
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void propagateToolbarState(boolean isShown, View view, int toolbarHeight) {
Scrollable scrollView = (Scrollable) view.findViewById(R.id.yelo_board_list);
if (scrollView == null) {
return;
}
if (isShown) {
// Scroll up
if (0 < scrollView.getCurrentScrollY()) {
scrollView.scrollVerticallyTo(0);
}
} else {
// Scroll down (to hide padding)
if (scrollView.getCurrentScrollY() < toolbarHeight) {
scrollView.scrollVerticallyTo(toolbarHeight);
}
}
}
示例6: propagateToolbarState
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void propagateToolbarState(boolean isShown, View view, int toolbarHeight) {
Scrollable scrollView = (Scrollable) view.findViewById(R.id.scroll);
if (scrollView == null) {
return;
}
if (isShown) {
// Scroll up
if (0 < scrollView.getCurrentScrollY()) {
scrollView.scrollVerticallyTo(0);
}
} else {
// Scroll down (to hide padding)
if (scrollView.getCurrentScrollY() < toolbarHeight) {
scrollView.scrollVerticallyTo(toolbarHeight);
}
}
}
示例7: adjustToolbar
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void adjustToolbar(ScrollState scrollState) {
int toolbarHeight = mToolbarView.getHeight();
final Scrollable scrollable = getCurrentScrollable();
if (scrollable == null) {
return;
}
int scrollY = scrollable.getCurrentScrollY();
if (scrollState == ScrollState.DOWN) {
showToolbar();
} else if (scrollState == ScrollState.UP) {
if (toolbarHeight <= scrollY) {
hideToolbar();
} else {
hideToolbar();
}
} else if (!toolbarIsShown() && !toolbarIsHidden()) {
hideToolbar();
}
}
示例8: adjustToolbar
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void adjustToolbar(ScrollState scrollState) {
int toolbarHeight = mToolbarView.getHeight();
final Scrollable scrollable = getCurrentScrollable();
if (scrollable == null) {
return;
}
int scrollY = scrollable.getCurrentScrollY();
if (scrollState == ScrollState.DOWN) {
showToolbar();
fabpanel.show(true);
} else if (scrollState == ScrollState.UP) {
if (toolbarHeight <= scrollY) {
hideToolbar();
} else {
if (!passed) {
hideToolbar();
}
}
fabpanel.hide(true);
} else if (!toolbarIsShown() && !toolbarIsHidden()) {
hideToolbar();
fabpanel.hide(true);
}
}
示例9: adjustScrollableView
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void adjustScrollableView(ScrollState scrollState) {
if (!adjustEnable) {
return;
}
final Scrollable scrollable = scrollView;
if (scrollable == null) {
return;
}
int scrollY = scrollable.getCurrentScrollY();
if (scrollState == ScrollState.DOWN) {
//此處為往上滑到一半的動作
scrollToFull();
} else if (scrollState == ScrollState.UP) {
if (scrollViewCanScrollHeight <= scrollY) {
scrollToFull();
} else {
scrollToDefault();
}
//hideAdFrame();
} else if (!scrollViewOnDefault() && !scrollViewOnFull()) {
// Toolbar is moving but doesn't know which to move:
// you can change this to hideToolbar()
scrollToDefault();
}
//Config.loge("LogoBarIs Hidden:" + adFrameIsHidden());
}
示例10: adjustToolbar
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void adjustToolbar(ScrollState scrollState, View view) {
int toolbarHeight = mToolbarView.getHeight();
final Scrollable scrollView = (Scrollable) view.findViewById(R.id.scroll);
if (scrollView == null) {
return;
}
int scrollY = scrollView.getCurrentScrollY();
if (scrollState == ScrollState.DOWN) {
showToolbar();
} else if (scrollState == ScrollState.UP) {
if (toolbarHeight <= scrollY) {
hideToolbar();
} else {
showToolbar();
}
} else {
// Even if onScrollChanged occurs without scrollY changing, toolbar should be adjusted
if (toolbarIsShown() || toolbarIsHidden()) {
// Toolbar is completely moved, so just keep its state
// and propagate it to other pages
propagateToolbarState(toolbarIsShown());
} else {
// Toolbar is moving but doesn't know which to move:
// you can change this to hideToolbar()
showToolbar();
}
}
}
示例11: adjustToolbar
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void adjustToolbar(ScrollState scrollState, View view) {
int toolbarHeight = mToolbar.getHeight();
final Scrollable scrollView = (Scrollable) view.findViewById(R.id.scroll);
if (scrollView == null) {
return;
}
int scrollY = scrollView.getCurrentScrollY();
if (scrollState == ScrollState.DOWN) {
showToolbar();
} else if (scrollState == ScrollState.UP) {
if (toolbarHeight <= scrollY) {
hideToolbar();
} else {
showToolbar();
}
} else {
// Even if onScrollChanged occurs without scrollY changing, toolbar should be adjusted
if (toolbarIsShown() || toolbarIsHidden()) {
// Toolbar is completely moved, so just keep its state
// and propagate it to other pages
propagateToolbarState(toolbarIsShown());
} else {
// Toolbar is moving but doesn't know which to move:
// you can change this to hideToolbar()
showToolbar();
}
}
}
示例12: setToolbarOnPageChange
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
private void setToolbarOnPageChange() {
final Scrollable scrollView = getCurrentScrollable();
final int currentScrollY = scrollView.getCurrentScrollY();
final int toolbarHeight = toolbar.getHeight();
scrollView.scrollVerticallyTo(currentScrollY);
Log.d(TAG, "toolbarHeight: " + toolbarHeight + "currentScrollY: " + currentScrollY);
if (currentScrollY < toolbarHeight) // if you want the toolbar to show when the list show first 1 item
showToolbar();
// if (currentScrollY < toolbarHeight && toolbarIsHidden())// if you want the list to always goes up to stick with tab
// scrollView.scrollVerticallyTo(toolbarHeight);
}