| | |
| | | import android.widget.Toast |
| | | import androidx.activity.result.contract.ActivityResultContracts |
| | | import androidx.appcompat.app.AppCompatActivity |
| | | import androidx.core.content.ContextCompat |
| | | import androidx.fragment.app.Fragment |
| | | import androidx.lifecycle.lifecycleScope |
| | | import androidx.navigation.fragment.findNavController |
| | |
| | | } |
| | | |
| | | // 头像点击老的处理逻辑 |
| | | // binding.layoutUserInfo.setOnClickListener { |
| | | // val intent = Intent(requireContext(), EditProfileActivity::class.java).apply { |
| | | // putExtra("nickname", binding.tvNickname.text.toString()) |
| | | // putExtra("avatar_url", binding.ivAvatar.toString()) |
| | | // } |
| | | // editProfileLauncher.launch(intent) |
| | | // } |
| | | |
| | | binding.layoutUserInfo.setOnClickListener { |
| | | currentUserInfo?.let { user -> |
| | | val intent = Intent(requireContext(), EditProfileActivity::class.java).apply { |
| | |
| | | if (userInfo.showed) { |
| | | binding.ivVip.visibility = View.VISIBLE |
| | | binding.cardVip.visibility = View.VISIBLE |
| | | binding.tvVipExpire.text = "${userInfo.passTime} 到期" |
| | | binding.tvVipExpire.text = "${userInfo.overTime} 到期" |
| | | } else { |
| | | //非会员信息 |
| | | binding.btnRenew.text = "立即开通" |
| | | binding.linearVipContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.gray)) |
| | | binding.cardVip.visibility = View.GONE |
| | | } |
| | | } |