package com.renrenliao.im.ui.activity

import androidx.lifecycle.lifecycleScope
import com.renrenliao.im.R
import com.renrenliao.im.base.BaseActivity
import com.renrenliao.im.model.repository.LocalDataSource
import kotlinx.android.synthetic.main.activity_accountsafe.*
import kotlinx.coroutines.flow.collect

/**
 **@ClassName AccountSafaActivity
 **@Description
 **@Author gan
 **@Date 2022/6/20 11:52
 **/
class AccountSafeActivity:BaseActivity() {

    override fun getLayoutResId(): Int = R.layout.activity_accountsafe

    override fun initView() {
        tool_bar.setOnBackListener { onBackPressed() }

        tv_appName.text = getString(R.string.app_name)

    }

    override fun initData() {

        lifecycleScope.launchWhenResumed {
            LocalDataSource.readOnlyUserFlow.collect {
                tv_account.text = it.chatid
                tv_name.text = it.nickname

            }
        }
    }
}