本文整理汇总了Java中com.github.ksoichiro.android.observablescrollview.Scrollable.scrollVerticallyTo方法的典型用法代码示例。如果您正苦于以下问题:Java Scrollable.scrollVerticallyTo方法的具体用法?Java Scrollable.scrollVerticallyTo怎么用?Java Scrollable.scrollVerticallyTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.ksoichiro.android.observablescrollview.Scrollable
的用法示例。
在下文中一共展示了Scrollable.scrollVerticallyTo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
}
示例2: 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);
}
}
}
示例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: setScrollY
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
public void setScrollY(int scrollY, int threshold) {
View view = getView();
if (view == null) {
return;
}
Scrollable scrollView = (Scrollable) view.findViewById(R.id.scroll);
if (scrollView == null) {
return;
}
scrollView.scrollVerticallyTo(scrollY);
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:12,代码来源:FlexibleSpaceWithImageBaseFragment.java
示例5: updateFlexibleSpace
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
@Override
protected void updateFlexibleSpace(int scrollY) {
// Sometimes scrollable.getCurrentScrollY() and the real scrollY has different values.
// As a workaround, we should call scrollVerticallyTo() to make sure that they match.
Scrollable s = getScrollable();
s.scrollVerticallyTo(scrollY);
// If scrollable.getCurrentScrollY() and the real scrollY has the same values,
// calling scrollVerticallyTo() won't invoke scroll (or onScrollChanged()), so we call it here.
// Calling this twice is not a problem as long as updateFlexibleSpace(int, View) has idempotence.
updateFlexibleSpace(scrollY, getView());
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:13,代码来源:FlexibleSpaceWithImageScrollViewFragment.java
示例6: updateFlexibleSpace
import com.github.ksoichiro.android.observablescrollview.Scrollable; //导入方法依赖的package包/类
@Override
public void updateFlexibleSpace(int scrollY) {
// Sometimes scrollable.getCurrentScrollY() and the real scrollY has different values.
// As a workaround, we should call scrollVerticallyTo() to make sure that they match.
Scrollable s = getScrollable();
s.scrollVerticallyTo(scrollY);
// If scrollable.getCurrentScrollY() and the real scrollY has the same values,
// calling scrollVerticallyTo() won't invoke scroll (or onScrollChanged()), so we call it here.
// Calling this twice is not a problem as long as updateFlexibleSpace(int, View) has idempotence.
updateFlexibleSpace(scrollY, getView());
}
示例7: 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);
}