use of com.github.ksoichiro.android.observablescrollview.ObservableScrollView in project UltimateAndroid by cymcsg.
the class ActionBarControlScrollViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.observable_scroll_view_activity_actionbarcontrolscrollview);
ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll);
scrollView.setScrollViewCallbacks(this);
}
use of com.github.ksoichiro.android.observablescrollview.ObservableScrollView in project UltimateAndroid by cymcsg.
the class ParallaxToolbarScrollViewActivity method onCreate.
@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);
}
use of com.github.ksoichiro.android.observablescrollview.ObservableScrollView in project Android-ObservableScrollView by ksoichiro.
the class ViewPagerTabScrollViewFragment method onCreateView.
@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;
}
use of com.github.ksoichiro.android.observablescrollview.ObservableScrollView in project Android-ObservableScrollView by ksoichiro.
the class ActionBarControlScrollViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_actionbarcontrolscrollview);
ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll);
scrollView.setScrollViewCallbacks(this);
}
use of com.github.ksoichiro.android.observablescrollview.ObservableScrollView in project Android-ObservableScrollView by ksoichiro.
the class FlexibleSpaceWithImageScrollViewFragment method onCreateView.
@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;
}
Aggregations