本文整理汇总了Java中com.github.ksoichiro.android.observablescrollview.ObservableScrollView.setScrollViewCallbacks方法的典型用法代码示例。如果您正苦于以下问题:Java ObservableScrollView.setScrollViewCallbacks方法的具体用法?Java ObservableScrollView.setScrollViewCallbacks怎么用?Java ObservableScrollView.setScrollViewCallbacks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.ksoichiro.android.observablescrollview.ObservableScrollView
的用法示例。
在下文中一共展示了ObservableScrollView.setScrollViewCallbacks方法的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: 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);
}
示例6: 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");
}
示例7: 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);
}
示例8: 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
示例9: 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
示例10: 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
示例11: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stickyheaderscrollview);
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(this);
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:15,代码来源:StickyHeaderScrollViewActivity.java
示例12: 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);
}
});
}
// TouchInterceptionViewGroup should be a parent view other than ViewPager.
// This is a workaround for the issue #117:
// https://github.com/ksoichiro/Android-ObservableScrollView/issues/117
scrollView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.root));
scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
return view;
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:29,代码来源:ViewPagerTabScrollViewFragment.java
示例13: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_flexiblespacetoolbarscrollview);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
ActionBar ab = getSupportActionBar();
if (ab != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
mFlexibleSpaceView = findViewById(R.id.flexible_space);
mTitleView = (TextView) findViewById(R.id.title);
mTitleView.setText(getTitle());
setTitle(null);
mToolbarView = findViewById(R.id.toolbar);
final ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll);
scrollView.setScrollViewCallbacks(this);
mFlexibleSpaceHeight = getResources().getDimensionPixelSize(R.dimen.flexible_space_height);
int flexibleSpaceAndToolbarHeight = mFlexibleSpaceHeight + getActionBarSize();
findViewById(R.id.body).setPadding(0, flexibleSpaceAndToolbarHeight, 0, 0);
mFlexibleSpaceView.getLayoutParams().height = flexibleSpaceAndToolbarHeight;
ScrollUtils.addOnGlobalLayoutListener(mTitleView, new Runnable() {
@Override
public void run() {
updateFlexibleSpaceText(scrollView.getCurrentScrollY());
}
});
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:34,代码来源:FlexibleSpaceToolbarScrollViewActivity.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_flexiblespacewithimagescrollview, container, false);
final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
// TouchInterceptionViewGroup should be a parent view other than ViewPager.
// This is a workaround for the issue #117:
// https://github.com/ksoichiro/Android-ObservableScrollView/issues/117
scrollView.setTouchInterceptionViewGroup((ViewGroup) view.findViewById(R.id.fragment_root));
// 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);
}
});
updateFlexibleSpace(scrollY, view);
} else {
updateFlexibleSpace(0, view);
}
scrollView.setScrollViewCallbacks(this);
return view;
}
开发者ID:LeMinhAn,项目名称:AndroidObservableScrollView-master,代码行数:30,代码来源:FlexibleSpaceWithImageScrollViewFragment.java
示例15: onCreate
import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_flexiblespacetoolbarscrollview);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mFlexibleSpaceView = findViewById(R.id.flexible_space);
mTitleView = (TextView) findViewById(R.id.title);
mTitleView.setText(getTitle());
setTitle(null);
mToolbarView = findViewById(R.id.toolbar);
final ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll);
scrollView.setScrollViewCallbacks(this);
mFlexibleSpaceHeight = getResources().getDimensionPixelSize(R.dimen.flexible_space_height);
int flexibleSpaceAndToolbarHeight = mFlexibleSpaceHeight + getActionBarSize();
findViewById(R.id.body).setPadding(0, flexibleSpaceAndToolbarHeight, 0, 0);
mFlexibleSpaceView.getLayoutParams().height = flexibleSpaceAndToolbarHeight;
ScrollUtils.addOnGlobalLayoutListener(mTitleView, new Runnable() {
@Override
public void run() {
updateFlexibleSpaceText(scrollView.getCurrentScrollY());
}
});
}
开发者ID:brucetoo,项目名称:Android-ObservableScrollView,代码行数:31,代码来源:FlexibleSpaceToolbarScrollViewActivity.java