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


Java Scrollable.getCurrentScrollY方法代码示例

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

示例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);
        }
    }
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:18,代码来源:ViewPagerTabActivity.java

示例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();
        }
    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:22,代码来源:HomeScreenFragment.java

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

    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:19,代码来源:HomeScreenFragment.java

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

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

示例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);
	}
}
 
开发者ID:alefesouza,项目名称:schoolapp,代码行数:25,代码来源:MainActivity.java

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

示例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();
        }
    }
}
 
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:29,代码来源:ViewPagerTabActivity.java

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

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


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


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