本文整理汇总了Java中com.prolificinteractive.parallaxpager.ParallaxContainer类的典型用法代码示例。如果您正苦于以下问题:Java ParallaxContainer类的具体用法?Java ParallaxContainer怎么用?Java ParallaxContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParallaxContainer类属于com.prolificinteractive.parallaxpager包,在下文中一共展示了ParallaxContainer类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.prolificinteractive.parallaxpager.ParallaxContainer; //导入依赖的package包/类
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_parallax, container, false);
// find the parallax container
ParallaxContainer parallaxContainer =
(ParallaxContainer) view.findViewById(R.id.parallax_container);
// specify whether pager will loop
parallaxContainer.setLooping(true);
// wrap the inflater and inflate children with custom attributes
parallaxContainer.setupChildren(inflater,
R.layout.parallax_view_1,
R.layout.parallax_view_2,
R.layout.parallax_view_3,
R.layout.parallax_view_4);
// optionally set a ViewPager.OnPageChangeListener
parallaxContainer.setOnPageChangeListener(this);
view.findViewById(R.id.btn_new_frag).setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
getFragmentManager().beginTransaction()
.replace(R.id.content, new Fragment())
.addToBackStack("test")
.commit();
}
});
// Earth ImageView has `override_visibility` set to `true` so we need to manually manage visibility
mEarthImageView = (ImageView) view.findViewById(R.id.imageview_earth);
return view;
}