Android中如何实现TeaScreenPopupWindow多类型筛选弹框功能
发表于:2024-09-23 作者:千家信息网编辑
千家信息网最后更新 2024年09月23日,这篇文章主要介绍了Android中如何实现TeaScreenPopupWindow多类型筛选弹框功能,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一
千家信息网最后更新 2024年09月23日Android中如何实现TeaScreenPopupWindow多类型筛选弹框功能
这篇文章主要介绍了Android中如何实现TeaScreenPopupWindow多类型筛选弹框功能,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
引入module
allprojects { repositories { google() jcenter() maven { url 'https://www.jitpack.io' } }}implementation 'com.github.YangsBryant:TeaScreenPopupWindow:1.0.2'
主要代码
public class MainActivity extends AppCompatActivity { @BindView(R.id.button) Button button; @BindView(R.id.button2) Button button2; private ScreenPopWindow screenPopWindow; private ListdictList = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind( this ); initParam(); initView(); } private void initView() { button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { screenPopWindow = new ScreenPopWindow(MainActivity.this, dictList); //默认单选,因为共用的一个bean,这里调用reset重置下数据 screenPopWindow.reset().build(); screenPopWindow.showAsDropDown(button); screenPopWindow.setOnConfirmClickListener(new ScreenPop_Window.OnConfirmClickListener() { @Override public void onConfirmClick(List list) { StringBuilder str = new StringBuilder(); for (int i=0;i list) { StringBuilder str = new StringBuilder(); for (int i=0;i childrenList = new ArrayList<>(); for (String aBrand : brand) { FiltrateBean.Children cd = new FiltrateBean.Children(); cd.setValue(aBrand); childrenList.add(cd); } fb1.setChildren(childrenList); FiltrateBean fb2 = new FiltrateBean(); fb2.setTypeName("类型"); List childrenList2 = new ArrayList<>(); for (String aType : type) { FiltrateBean.Children cd = new FiltrateBean.Children(); cd.setValue(aType); childrenList2.add(cd); } fb2.setChildren(childrenList2); dictList.add(fb1); dictList.add(fb2); }}
TeaScreenPopupWindow属性大全
方法 | 属性 |
setTopView(Boolean bl, int color) | 设置顶部分割线是否显示,以及颜色。默认true,#f3f3f3 |
setBottomView(Boolean bl, int color) | 设置底部分割线是否显示,以及颜色。默认true,#f3f3f3 |
setConfirm(String text, int size, int textColor, int color) | 设置确定按钮的文字,字体大小,字体颜色,背景颜色。默认"确定",14,#ffffff,#0aa666 |
setReset(String text, int size, int textColor, int color) | 设置重置按钮的文字,字体大小,字体颜色,背景颜色。默认"重置",#000000,#ffffff |
setAlpha(int mAlpha) | 设置阴影层的透明度 默认是0.5f |
setTitleColor(int color) | 设置title的字体颜色,默认#000000 |
setTitleSize(int size) | 设置title的字体大小,默认14 |
setRadius(int radius) | 设置item圆角大小,默认12 |
setStrokeWidth(int width) | 设置item边框粗细,默认2 |
setStrokeColor(int color) | 设置item边框颜色,默认#0aa666 |
setBoxWidth(int width) | 设置item宽度,默认是200dp |
setBoxHeight(int height) | 设置item高度,默认是WRAP_CONTENT |
setChecked(String color) | 设置item选中时的颜色,默认#0aa666 |
setEnabled(String color) | 设置item未选中时的颜色,默认#000000 |
setBoxSize(int size) | 设置item字体大小,默认13 |
setSingle(boolean bl) | 设置是否开启单选,默认单选 |
reset() | 显示控件时数据重置 |
build() | 参数设置完毕,一定要build一下 |
感谢你能够认真阅读完这篇文章,希望小编分享的"Android中如何实现TeaScreenPopupWindow多类型筛选弹框功能"这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!
颜色
字体
大小
篇文章
数据
功能
多类型
分割线
属性
按钮
文字
背景
边框
中时
花花公子
T恤
代码
价值
公子
兴趣
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
深圳楼控管理软件开发费用
无法连接宝塔云端服务器
什么是网络安全的目标
原神4个服务器
积石山县网络安全宣传周活动
网络安全讲座 离退休干部
ef操作数据库回滚
湛江bim软件开发工程
数据库定义一个int型变量
福州乐天网络技术有限公司中标
数据库更新先查询后更新
携程网络安全运营官
服务器安全身份认证smtp
数据库不良依赖
春坤网络技术服务部
万全r350服务器 说明书
中国十大网络安全趋势
数据库创建表删除约束
安徽时间频率同步服务器
云桌面服务器配置
特斯拉北京软件开发如何
ctf网络安全大赛挪威
数据库按小时查询返回到前端
在软件开发项目中的成长
网络安全无处不在
游戏软件开发老板
国内电脑用国外的服务器
电影在线选座软件开发
强化国家网络安全防御能力
端口的扫描与预防网络安全实践