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

Kotlin高仿微信-项目实践58篇,点击查看详情

效果图:

实现代码:

<?xml version="1.0" encoding="utf-8"?>
<layout><androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@drawable/wc_base_bg"><include layout="@layout/wc_base_top_title"/><ImageViewandroid:id="@+id/small_change_icon"app:layout_constraintStart_toStartOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintTop_toBottomOf="@+id/base_top_root_layout"android:layout_marginTop="40dp"android:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@drawable/wc_small_change_icon"/><TextViewandroid:id="@+id/small_change_tip"app:layout_constraintStart_toStartOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintTop_toBottomOf="@+id/small_change_icon"android:layout_marginTop="30dp"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="我的零钱"android:textSize="24sp"/><TextViewandroid:id="@+id/small_change_balance"app:layout_constraintStart_toStartOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintTop_toBottomOf="@+id/small_change_tip"android:layout_marginTop="12dp"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text=""android:textSize="40sp"android:textStyle="bold"android:textColor="@color/black"/><androidx.appcompat.widget.AppCompatButtonandroid:id="@+id/small_change_recharge"app:layout_constraintStart_toStartOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintBottom_toTopOf="@+id/small_change_withdrawal"android:layout_marginBottom="20dp"android:layout_width="220dp"android:layout_height="wrap_content"android:background="@drawable/wc_base_green_selector"android:paddingVertical="14dp"android:text="充值"android:textColor="@color/white"android:textSize="20sp"/><androidx.appcompat.widget.AppCompatButtonandroid:id="@+id/small_change_withdrawal"app:layout_constraintStart_toStartOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintBottom_toBottomOf="parent"android:layout_marginTop="20dp"android:layout_marginBottom="40dp"android:layout_width="220dp"android:layout_height="wrap_content"android:background="@drawable/wc_base_gray_selector"android:paddingVertical="14dp"android:text="提现"android:textColor="#008B00"android:textSize="20sp"/></androidx.constraintlayout.widget.ConstraintLayout>
</layout>
/*** Author : wangning* Email : maoning20080809@163.com* Date : 2022/5/20 21:16* Description : 我的零钱*/
class SmallChangeFragment : BaseDataBindingFragment<WcSmallChangeBinding>() {private val userViewModel : UserViewModel by viewModels()override fun getLayoutRes() = R.layout.wc_small_changeoverride fun onViewCreated(view: View, savedInstanceState: Bundle?) {super.onViewCreated(view, savedInstanceState)super.builder().setTitleContent(R.string.wc_base_top_small_change)//先判断是否已经注册if(!EventBus.getDefault().isRegistered(this)){EventBus.getDefault().register(this)}small_change_recharge.setOnClickListener {Navigation.findNavController(it).navigate(R.id.action_rechange)}var account = DataStoreUtils.getAccount()userViewModel.getUserLocal(account)userViewModel.userBeanLocal.observe(viewLifecycleOwner){TagUtils.d("2 SmallChangeFragment 主页 balance  =  ${it.balance}");small_change_balance.text = CommonUtils.Base.getFormatBalanceUnit(it.balance)}}@Subscribe(threadMode = ThreadMode.MAIN)fun onMessageCallback(rechargeBalanceBean: RechargeBalanceBean) {TagUtils.d(" EventBus 返回的值:${rechargeBalanceBean.balance}");small_change_balance.text =CommonUtils.Base.getFormatBalanceUnit( rechargeBalanceBean.balance)}override fun onDestroy() {super.onDestroy()EventBus.getDefault().unregister(this)}}

Kotlin高仿微信-第32篇-支付-我的零钱相关推荐

  1. Kotlin高仿微信-第34篇-支付-向商家付款(二维码)

     Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...

  2. Kotlin高仿微信-第35篇-支付-二维码收款(二维码)

      Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫. ...

  3. Kotlin高仿微信-第11篇-单聊-语音

     Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...

  4. Kotlin高仿微信-第23篇-个人信息-二维码名片

     Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...

  5. Kotlin高仿微信-第14篇-单聊-视频通话

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

  6. Kotlin高仿微信-第20篇-个人信息

     Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...

  7. Kotlin高仿微信-第6篇-主页-我的

     Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...

  8. Kotlin高仿微信-第58篇-开通VIP

      Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫. ...

  9. Kotlin高仿微信-第26篇-朋友圈-选择图片、小视频对话框

     Kotlin高仿微信-项目实践58篇详细讲解了各个功能点,包括:注册.登录.主页.单聊(文本.表情.语音.图片.小视频.视频通话.语音通话.红包.转账).群聊.个人信息.朋友圈.支付服务.扫一扫.搜 ...

最新文章

  1. ASP.NET MVC:利用ASP.NET MVC4的IBundleTransform集成LESS
  2. [COCI2015]COCI
  3. 现代密码学5.2--域扩张:Merkle-Damgard Transform
  4. numpy实现神经网络代码(mnist手写体识别)
  5. SQLite关于时间段查询的sql
  6. Android apk签名方法
  7. css3-6 表格如何设置样式和定位样式是什么
  8. mysql中逗号前的字符串_MySql逗号拼接字符串查询的两种方法
  9. LeetCode 1665. 完成所有任务的最少初始能量(贪心)
  10. rgb 灰色_金属+RGB+无线,我要买爆这款海盗船VIRTUOSO鉴赏家游戏耳机
  11. JavaScript循环及练习
  12. 在linux系统下安装jdk
  13. 目标检测——Anchor-Based算法的学习笔记
  14. java让程序暂停几秒_影响JAVA系统性能的微观指标
  15. 51单片机流水灯方法大全
  16. 计算机怎么显示正确,电脑显示器怎么正确设置
  17. oracle 导入攻略,oracle10g下expdp自动导出并上传全攻略
  18. RK3288 Android5.1 隐藏 蓝牙网络共享与移动网络设置项
  19. The multi-part request contained parameter data (excluding uploaded files)
  20. 计算机软件片段截取,只想要视频的一部分内容?教你截取其中片段的方法

热门文章

  1. css 使用伪类在div底部画一条线
  2. R:ggplot2分类别绘图的三种方式以及分组绘图的二种方式
  3. java 定时清理 逻辑删除 数据
  4. 8.Tableau之树形图
  5. 语音识别智能家居控制设计
  6. android从入门到精通pdf 明日科技
  7. GitHub 消息邮件通知太烦人?收下这份指南!
  8. DNS服务器未响应解决方案
  9. 单/多因素协方差分析
  10. 用matlab编写逢七必过游戏规则,数字图像处理及应用(MATLAB)第4章