本文整理汇总了Java中com.github.ksoichiro.android.observablescrollview.ObservableScrollView类的典型用法代码示例。如果您正苦于以下问题:Java ObservableScrollView类的具体用法?Java ObservableScrollView怎么用?Java ObservableScrollView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ObservableScrollView类属于com.github.ksoichiro.android.observablescrollview包,在下文中一共展示了ObservableScrollView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stickyheaderwebview);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
mHeaderView = findViewById(R.id.header);
ViewCompat.setElevation(mHeaderView, getResources().getDimension(R.dimen.toolbar_elevation));
mToolbarView = findViewById(R.id.toolbar);
mScrollView = (ObservableScrollView) findViewById(R.id.scroll);
mScrollView.setScrollViewCallbacks(mScrollViewScrollCallbacks);
ObservableWebView mWebView = (ObservableWebView) findViewById(R.id.web);
mWebView.setScrollViewCallbacks(mWebViewScrollCallbacks);
mWebView.loadUrl("file:///android_asset/lipsum.html");
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:19,代码来源:StickyHeaderWebViewActivity.java
示例2: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_handletouchscrollview);
ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll);
scrollView.setScrollViewCallbacks(this);
int[] ids = new int[]{R.id.button1, R.id.button2, R.id.button3};
for (int i = 0; i < ids.length; i++) {
final int number = i + 1;
findViewById(ids[i]).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
click(number);
}
});
}
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:20,代码来源:HandleTouchScrollViewActivity.java
示例3: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_parallaxtoolbarscrollview);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
mImageView = findViewById(R.id.image);
mToolbarView = findViewById(R.id.toolbar);
mToolbarView.setBackgroundColor(ScrollUtils.getColorWithAlpha(0, getResources().getColor(R.color.primary)));
mScrollView = (ObservableScrollView) findViewById(R.id.scroll);
mScrollView.setScrollViewCallbacks(this);
mParallaxImageHeight = getResources().getDimensionPixelSize(R.dimen.parallax_image_height);
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:17,代码来源:ParallaxToolbarScrollViewActivity.java
示例4: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scrollview, container, false);
final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
Activity parentActivity = getActivity();
if (parentActivity instanceof ObservableScrollViewCallbacks) {
// Scroll to the specified offset after layout
Bundle args = getArguments();
if (args != null && args.containsKey(ARG_SCROLL_Y)) {
final int scrollY = args.getInt(ARG_SCROLL_Y, 0);
ScrollUtils.addOnGlobalLayoutListener(scrollView, new Runnable() {
@Override
public void run() {
scrollView.scrollTo(0, scrollY);
}
});
}
scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
return view;
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:23,代码来源:ViewPagerTabScrollViewFragment.java
示例5: bindViews
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
private void bindViews() {
scrollView = (ObservableScrollView) findViewById(R.id.sv);
title_bg = findViewById(R.id.title_bg);
iv_photo = (CircularImageView) findViewById(R.id.iv_photo);
material_menu = (MaterialMenuView) findViewById(R.id.material_menu);
tv_nickname = (TextView) findViewById(R.id.tv_nickname);
iv_gender = (ImageView) findViewById(R.id.iv_gender);
iv_home_bg = (ImageView) findViewById(R.id.iv_home_bg);
album = findViewById(R.id.album);
data = findViewById(R.id.data);
tv_id = (TextView) findViewById(R.id.tv_id);
et_city = (TextView) findViewById(R.id.et_city);
et_phone = (TextView) findViewById(R.id.et_phone);
topView = findViewById(R.id.topView);
iv_camera = findViewById(R.id.iv_camera);
ll_album = (ViewGroup) findViewById(R.id.ll_album);
ll_label = (ViewGroup) findViewById(R.id.ll_label);
bt_eidt = findViewById(R.id.bt_eidt);
add = View.inflate(context, R.layout.item_album, null);
add_pic = (ImageView) add.findViewById(R.id.iv_pic);
}
示例6: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.screen_details);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mImageView = findViewById(R.id.image);
mToolbarView = findViewById(R.id.toolbar);
mToolbarView.setBackgroundColor(ScrollUtils.getColorWithAlpha(0, getResources().getColor(R.color.theme_dialer_primary)));
mScrollView = (ObservableScrollView) findViewById(R.id.scroll);
mScrollView.setScrollViewCallbacks(this);
mParallaxImageHeight = getResources().getDimensionPixelSize(R.dimen.drawer_menu_width);
}
示例7: registerScrollView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
public void registerScrollView(final ObservableScrollView scrollView) {
scrolls.add(scrollView);
if (scrollView.getParent() != null && scrollView.getParent().getParent() != null && scrollView.getParent().getParent() instanceof ViewGroup)
scrollView.setTouchInterceptionViewGroup((ViewGroup) scrollView.getParent().getParent());
scrollView.setScrollViewCallbacks(new ObservableScrollViewCallbacks() {
@Override
public void onScrollChanged(int i, boolean b, boolean b1) {
onScroll(scrollView, i);
}
@Override
public void onDownMotionEvent() {
}
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
}
});
}
示例8: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.observable_scroll_view_activity_toolbarcontrolwebview);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
mHeaderView = findViewById(R.id.header);
ViewCompat.setElevation(mHeaderView, getResources().getDimension(R.dimen.toolbar_elevation));
mToolbarView = findViewById(R.id.toolbar);
mScrollView = (ObservableScrollView) findViewById(R.id.scroll);
mScrollView.setScrollViewCallbacks(mScrollViewScrollCallbacks);
ObservableWebView mWebView = (ObservableWebView) findViewById(R.id.web);
mWebView.setScrollViewCallbacks(mWebViewScrollCallbacks);
mWebView.loadUrl("file:///android_asset/lipsum.html");
}
示例9: adjustToolbarForScrollViews
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
private void adjustToolbarForScrollViews(ScrollState scrollState, View view) {
int toolbarHeight = mToolbarView.getHeight();
final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
if (scrollView == null) {
return;
}
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();
}
}
}
示例10: propagateToolbarStateForScrollView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
private void propagateToolbarStateForScrollView(boolean isShown, View view, int toolbarHeight) {
ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
if (scrollView == null) {
return;
}
if (isShown) {
// Scroll up
if (0 < scrollView.getCurrentScrollY()) {
scrollView.scrollTo(0, 0);
}
} else {
// Scroll down (to hide padding)
if (scrollView.getCurrentScrollY() < toolbarHeight) {
scrollView.scrollTo(0, toolbarHeight);
}
}
}
示例11: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.observable_scroll_view_activity_parallaxtoolbarscrollview);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
mImageView = findViewById(R.id.image);
mToolbarView = findViewById(R.id.toolbar);
setBackgroundAlpha(mToolbarView, 0, getResources().getColor(R.color.primary));
ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll);
scrollView.setScrollViewCallbacks(this);
mParallaxImageHeight = getResources().getDimensionPixelSize(R.dimen.parallax_image_height);
}
示例12: onViewCreated
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mScrollView = (ObservableScrollView) view.findViewById(R.id.scrollView);
fans = (TextView) view.findViewById(R.id.fans);
agree = (TextView) view.findViewById(R.id.agree);
thanks = (TextView) view.findViewById(R.id.thanks);
signature = (TextView) view.findViewById(R.id.signature);
city = (TextView) view.findViewById(R.id.city);
MaterialViewPagerHelper.registerScrollView(getActivity(), mScrollView, null);
new LoadUserInfo().execute();
}
示例13: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_actionbarcontrolscrollview);
ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll);
scrollView.setScrollViewCallbacks(this);
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:9,代码来源:ActionBarControlScrollViewActivity.java
示例14: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scrollview_noheader, container, false);
final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
Fragment parentFragment = getParentFragment();
ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
if (viewGroup != null) {
scrollView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
if (parentFragment instanceof ObservableScrollViewCallbacks) {
scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
}
}
return view;
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:16,代码来源:ViewPagerTabFragmentScrollViewFragment.java
示例15: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scrollview_noheader, container, false);
final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
Activity parentActivity = getActivity();
scrollView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
if (parentActivity instanceof ObservableScrollViewCallbacks) {
scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
return view;
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:13,代码来源:ViewPagerTab2ScrollViewFragment.java