TwoPanels-管理俩个页面间切换的控件.zip

时间:2022-10-13 21:39:23
【文件属性】:

文件名称:TwoPanels-管理俩个页面间切换的控件.zip

文件大小:2.46MB

文件格式:ZIP

更新时间:2022-10-13 21:39:23

开源项目

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.隐藏左页面


【文件预览】:
TwoPanels-master
----README.md(4KB)
----TwoPanelsExample()
--------.project(819B)
--------project.properties(611B)
--------LICENSE.txt(11KB)
--------src()
--------AndroidManifest.xml(941B)
--------res()
--------.settings()
--------image.gif(1.84MB)
--------.classpath(466B)
--------proguard-project.txt(781B)
--------bin()
----LibraryTwoPanels()
--------.project(819B)
--------project.properties(584B)
--------LICENSE.txt(11KB)
--------src()
--------AndroidManifest.xml(277B)
--------res()
--------.settings()
--------libs()
--------.classpath(531B)
--------proguard-project.txt(781B)
--------bin()

网友评论