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

实现代码:
<?xml version="1.0" encoding="utf-8"?>
<layout>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns: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"/>
<ImageView
android: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"/>
<TextView
android: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"/>
<TextView
android: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.AppCompatButton
android: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.AppCompatButton
android: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_change
override 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)
}
}


![[附源码]计算机毕业设计在线影院系统Springboot程序](https://img-blog.csdnimg.cn/d7382327a98a48d49068c649ea5bdb77.png)







![[附源码]计算机毕业设计JAVA校园求职与招聘系统](https://img-blog.csdnimg.cn/dead6759e4024606b7e2251afc49f73c.png)








