# 签名-com.hand.wfive-常规包 **Repository Path**: regular-package/sign-hand-wfive ## Basic Information - **Project Name**: 签名-com.hand.wfive-常规包 - **Description**: 签名常规包,快转常 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-16 - **Last Updated**: 2024-12-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 具体代码基本可参考 com.multi.type.rcd (语音备忘录) com.runduo.psimage(手机ps软件) # FuncSwitchUtils * 功能开关工具类(后续增加所有的开关都配置在该工具类里) * vip开关:后台开关(if_need_vip)开启,直接vip阻拦后台开关关闭,免费使用一次功能 * 其它开关:以后台返参为准 ```kotlin /**判断是否进行vip阻拦,true:不阻拦 false:阻拦*/ FuncSwitchUtils.canUse(FuncSwitchUtils.funcEdit) /**再功能使用完之后需要更新使用次数*/ FuncSwitchUtils.addUseCount(FuncSwitchUtils.funcEdit) /**例如:其它XX开关,添加如下方法*/ fun isOpenXXSwitch(): Boolean { return switchSetData?.XX == true } ``` # EventBus * EventBusBean :重载了几个方法,能满足大多数场景的事件 * EventTagConfig :tag配置文件 (值需要保证唯一) ```kotlin /**事件发布*/ EventBus.getDefault().post(EventBusBean(EventTagConfig.TAG_TEST_SUCCESS)) /**事件订阅*/ @Subscribe(threadMode = ThreadMode.MAIN) fun doEvent(event: EventBusBean) { when (event.tag) { EventTagConfig.TAG_TEST_SUCCESS -> { //doSomething } } } ``` # SpanUtils * 富文本工具类 ```kotlin val sp = SpanUtils() .append("").setForegroundColor(color) .append(it.content) .appendLine() sp.create() ``` # BasePopWindow * PopupWindow 基类 * 用法可参考 com.multi.type.rcd(语音备忘录:DatePopupWindow) # CommonListPopupWindow * 通用列表PopupWindow ```kotlin private fun initFileType(textView: TextView, list: List, filterTitle: String, event: (CommonModel) -> Unit) { val popupWindow = CommonListPopupWindow(mContext, list) popupWindow.showAsDropDown(viewFilter) popupWindow.setItemClickListener(object : CommonListPopupWindow.ItemClickListener { override fun onItemClick( popupWindow: CommonListPopupWindow?, adapter: BaseQuickAdapter<*, *>, view: View, position: Int, ) { val bean = adapter.getItem(position) as CommonModel if (bean.id == 0) { textView.text = filterTitle event(bean) return } textView.text = bean.title event(bean) } }) } ``` # KtCommonDialog * 通用提示弹窗,以下两种样式 > MsgDialog ```kotlin MsgDialog(mContext, "是否退出该页面,当前已录制的音频不会保存哦?") { if (it == 1) { mRealtimeRecognizeText.cancelAudioRecognize() } }.show() ``` > CommonTipsDialog ```kotlin CommonTipsDialog.showDialog(mContext, title = "提示", content = "该图片未保存,确认退出?\n(图片生成后仅会保留24小时)", leftText = "退出", rightText = "继续保存", rightTextColor = R.color.colorPrimary, listener = object : CommonTipsDialog.TipListener { override fun doRightEvent(dialog: CommonTipsDialog) { dialog.dismiss() } override fun doLeftEvent(dialog: CommonTipsDialog) { super.doLeftEvent(dialog) finish() } }) ``` # BaseBottomSheetDialog * 底部弹窗基类 * 用法可参考 com.multi.type.rcd(语音备忘录:ModifySpokesmanDialog FileFuncDialog) # GridSpaceItemDecoration * recyclerView 宫格分割线 ```kotlin recyclerView.layoutManager = GridLayoutManager(mContext, 4) recyclerView.addItemDecoration(GridSpaceItemDecoration(4, 15, 10)) ``` # ListItemDecoration * recyclerView 水平分割线 ```kotlin recyclerView.addItemDecoration(ListItemDecoration(mContent)) ``` # MaxLimitRecyclerView * 可设置最大高宽的自定义RecyclerView