多页面切换头部缩放控件

仿bilibili视频信息多页面切换控件
支持各种高度自定义

演示GIF

demo下载地址

TwoPanels是管理俩个页面切换控件,俩个页面间既可以水平排列也可垂直排列。俩个页面都是Fragment,中间有个slider,负责控制俩个页面切换。通常他把左页面或垂直排列的上页面都叫左(left)页面, 把右页面或垂直排列的下页面都叫右(right)页面。项目地址:https://github.com/DesarrolloAntonio/TwoPanels 效果图:如何使用让你的Activity继承自TwoPanelsBaseActivitypublic class MainActivity extends TwoPanelsBaseActivity {2. 设置左、右页面以及设置参数setBaseOrientation(LinearLayout.HORIZONTAL);//设置俩个页面的排列方式,水平还是垂直 MyRightFragment mRightFragment = new MyRightFragment();//右页面,这个Fragment你需要自定义 MyLeftFragment mLeftFragment = new MyLeftFragment(); getFragmentManager().beginTransaction().add(R.id.right, mRightFragment).commit();//将页面的Fragment绑定到控件上 getFragmentManager().beginTransaction().add(R.id.left, mLeftFragment).commit();方法使用方法名说明setSlidersDrawables(int verticalDrawable, int horizontalDrawable)Set de drawables for the slider in horizontal and vertical like this example: setSlidersDrawables(R.drawable.slider_vertical, R.drawable.slider_horizontal)设置slider(左、右页面中间部分的)的图标,分为垂直的和水平的图标setSliderSize(int size)设置slider的宽度switchSliderVisitility();以动画方式切换setBaseOrientation(int orientation)Set the orientation of the panels with the values LinearLayout.VERTICAL or LinearLayout.HORIZONTAL, default is LinearLayout.HORIZONTAL.设置排列方式,水平的还是垂直的slideFragmentsToRight()Slide the fragments to the right with an animation.隐藏掉右页面或下页面,相当于点击俩次右箭头slideFragmentsToLeft()Slide the fragments to the left with an animation隐藏掉左页面或上页面,相当于点击俩次左箭头.showTwoFragments()Show two panels in the screen.让俩个页面都显示,一般是调用了hideRight()、hideLeft后让俩个页面同时显示hideRight()Hide the right panel and show the left panel in full screen.隐藏右页面hideLeft()Hide the left panel and show the right panel in full screen.隐藏左页面
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值