DropDownLayout
介绍:
一个类似与美团,百度糯米爱奇艺等条件筛选布局 。基于FrameLayout实现的条件筛选器。在xml布局文件中完全自定义布局(可以自定义内容页,在fragment中控制弹出菜单view)
运行效果:
使用说明:
<org.net.sunger.widget.DropDownLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/dropdown"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:showIn="@layout/activity_main">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
></android.support.v7.widget.RecyclerView>
</RelativeLayout>
<org.net.sunger.widget.MaskView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#88838685" />
<org.net.sunger.widget.MenuLayout
android:id="@+id/menuLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"></org.net.sunger.widget.MenuLayout>
</org.net.sunger.widget.DropDownLayout>
java code
MenuLayout menuLayout = (MenuLayout) findViewById(R.id.menuLayout);
DropDownLayout dropDownLayout = (DropDownLayout) findViewById(R.id.dropdown);
List<Fragment> fragments = new ArrayList<>();
fragments.add(new FragmentFloor());
fragments.add(new FragmentCategory());
fragments.add(new FragmentSort());
//you can set the anim by youself
//menuLayout.setAnimationIn(R.anim.an);
//menuLayout.setAnimationOut(R.anim.out);
menuLayout.setFragmentManager(getSupportFragmentManager());
menuLayout.bindFragments(fragments);
// dropDownLayout.closeMenu();
// dropDownLayout.showMenuAt(position);
已下载
0