当前位置: 首页>>代码示例>>Java>>正文


Java Scrollable.scrollVerticallyTo方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:18,代码来源:ViewPagerTabActivity.java

示例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);
        }

    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:19,代码来源:HomeScreenFragment.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);
		}
	}
}
 
开发者ID:fython,项目名称:ExpressHelper,代码行数:18,代码来源:MainActivity.java

示例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());
}
 
开发者ID:DuongNTdev,项目名称:StudyMovie,代码行数:13,代码来源:FlexibleSpaceWithImageScrollViewFragment.java

示例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);


    }
 
开发者ID:murielK,项目名称:AndroidWPTemplate,代码行数:14,代码来源:FeedsActivity.java


注:本文中的com.github.ksoichiro.android.observablescrollview.Scrollable.scrollVerticallyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。