Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册、登录、主页、单聊(文本、表情、语音、图片、小视频、视频通话、语音通话、红包、转账)、群聊、个人信息、朋友圈、支付服务、扫一扫、搜索好友、添加好友、开通VIP等众多功能。
Kotlin高仿微信-项目实践58篇,点击查看详情
效果图:

实现代码:
**
* 开通vip确认框
*/
private fun showVipConfirmDialog(month: Int, vipBean: VipBean){
if(month < 1 || vipBean == null){
ToastUtils.makeText(R.string.wc_vip_confirm_show_error)
return
}
getFocus(true)
var view = LayoutInflater.from(requireContext()).inflate(R.layout.wc_vip_confirm_view, null)
var width = DisplayUtils.getScreenWidth() - BaseUtils.getDimension(R.dimen.distance_40) * 2
val popupWindow = PopupWindow(view, width, ViewGroup.LayoutParams.WRAP_CONTENT)
popupWindow.isOutsideTouchable = false //点击弹窗外部是否取消弹窗
//弹窗出现外部为阴影
val attributes: WindowManager.LayoutParams = requireActivity().window.getAttributes()
attributes.alpha = 0.5f
requireActivity().window.setAttributes(attributes)
//弹窗取消监听 取消之后恢复阴影
popupWindow.setOnDismissListener {
val attributes: WindowManager.LayoutParams = requireActivity().window.getAttributes()
attributes.alpha = 1f
requireActivity().window.setAttributes(attributes)
getFocus(false)
}
popupWindow.showAtLocation(vip_recyclerview, Gravity.CENTER, 0, 0)
var accountTextView = view.findViewById<TextView>(R.id.vip_confirm_account)
var nameTextView = view.findViewById<TextView>(R.id.vip_confirm_name)
var monthTextView = view.findViewById<TextView>(R.id.vip_confirm_month)
accountTextView.text = BaseUtils.getString(R.string.wc_vip_manager_user_account, vipBean.userAccount)
nameTextView.text = BaseUtils.getString(R.string.wc_vip_manager_user_name, vipBean.userName)
monthTextView.text = BaseUtils.getString(R.string.wc_vip_confirm_month, "${month}")
view.findViewById<TextView>(R.id.vip_confirm_cancel).setOnClickListener {
popupWindow.dismiss()
}
view.findViewById<TextView>(R.id.vip_confirm_ok).setOnClickListener {
popupWindow.dismiss()
vipManagerViewModel.updateVip(vipBean.userAccount, vipBean.operatorAccount, month)
}
}
/**
* vip会员续费
*/
fun updateVip(userAccount : String, operatorAccount : String, month : Int){
if(TextUtils.isEmpty(userAccount)
||TextUtils.isEmpty(operatorAccount)
|| month < 1){
isSuccessLiveData.postValue(false)
return
}
CoroutineScope(Dispatchers.IO).launch {
var result = VipManagerRepository.updateVip(userAccount, operatorAccount, month)
isSuccessLiveData.postValue(result.isSuccess)
}
}
![[附源码]计算机毕业设计springboot疫情网课管理系统](https://img-blog.csdnimg.cn/458e320ecaa74e25a4b16bdb628dfeb9.png)

![[附源码]计算机毕业设计新能源汽车租赁Springboot程序](https://img-blog.csdnimg.cn/32c62320d659469a8e34d59a6735e6ab.png)
![[附源码]计算机毕业设计疫情物资管理系统Springboot程序](https://img-blog.csdnimg.cn/942d2056c9c84b64b64edd2df98b29e6.png)






![[附源码]JAVA毕业设计交通事故档案管理系统(系统+LW)](https://img-blog.csdnimg.cn/1227fdaab3fc4fcd9263c20cf931acd1.png)








