# FabulousFilter **Repository Path**: chinasoft4_ohos/FabulousFilter ## Basic Information - **Project Name**: FabulousFilter - **Description**: 一个实现了底部弹窗且可向上滑动全屏的筛选面板,同时让FloatingActionButton与底部弹出的dialog的动画更轻易的实现 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2021-07-20 - **Last Updated**: 2024-05-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FabulousFilter ## 项目介绍 * 项目名称:FabulousFilter * 所属系列:openharmony的第三方组件适配移植 * 功能:一个实现了底部弹窗且可向上滑动全屏的筛选面板,同时让FloatingActionButton与底部弹出的dialog的动画更轻易的实现 * 项目移植状态:主功能完成 * 调用差异:无 * 开发版本:sdk6,DevEco Studio 2.2 Beta1 * 基线版本:master分支 ## 效果演示 ![](gif/fab.gif) ## 安装教程 1.在项目根目录下的build.gradle文件中, ``` allprojects { repositories { maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' } } } ``` 2.在entry模块的build.gradle文件中, ``` dependencies { implementation('com.gitee.chinasoft_ohos:fabulousfilter:1.0.0') } ``` 在sdk6,DevEco Studio 2.2 Beta1下项目可直接运行。 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 ## 使用说明 1、创建一个Dialog继承自AahFabBottomSheetDialog ``` public class MySampleFabDialog extends AahFabBottomSheetDialog { private Context context; /** * MySampleFabDialog * * @param context */ public MySampleFabDialog(Context context) { super(context); this.context = context; initView(); } private void initView() { Component contentView = LayoutScatter.getInstance(context).parse( ResourceTable.Layout_dialog_my_sample, null, false); Component btnClose = contentView.findComponentById(ResourceTable.Id_btn_close); btnClose.setClickedListener(new Component.ClickedListener() { @Override public void onClick(Component component) { closeFilter("closed"); } }); Component rlContent = contentView.findComponentById(ResourceTable.Id_rl_content); Component llButtons = contentView.findComponentById(ResourceTable.Id_ll_buttons); setViewgroupStatic(llButtons); // optional; layout to stick at bottom on slide setViewMain(rlContent); // necessary; main bottomsheet view // params to set setAnimationDuration(Constants.SIX_HUNDERED_NUM_CONSTANT); // optional; default 500ms setPeekHeight(Constants.THREE_HUNDERED_NUM_CONSTANT); // optional; default 300dp //setViewPager(vp_types); //optional; if you use viewpager that has scrollview setMainContentView(contentView); // necessary; call at end before super } } ``` 2、给该dialog创建一个布局,根布局使用 AahFilterView ```