| | |
| | | package com.example.firstapp.activity |
| | | |
| | | import android.app.AlertDialog |
| | | import android.content.Intent |
| | | import android.graphics.Color |
| | | import android.os.Bundle |
| | | import android.util.TypedValue |
| | |
| | | import androidx.cardview.widget.CardView |
| | | import androidx.constraintlayout.widget.ConstraintLayout |
| | | import androidx.constraintlayout.widget.ConstraintSet |
| | | import androidx.core.content.ContentProviderCompat.requireContext |
| | | import androidx.core.content.ContextCompat |
| | | import androidx.lifecycle.Observer |
| | | import androidx.lifecycle.lifecycleScope |
| | |
| | | |
| | | // 勾选协议点击事件 |
| | | handlePrototalClick() |
| | | |
| | | // VIP会员服务协议 |
| | | handleVipProtocolClick() |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | private fun loadUserInfo() { |
| | | // 获取Fragment实例 |
| | | val memberInfoCardFragment = supportFragmentManager.findFragmentById(R.id.memberInfoCardFragment) as MemberInfoCardFragment? |
| | | |
| | | |
| | | |
| | | lifecycleScope.launch { |
| | | try { |
| | | // 从本地获取保存的手机号 |
| | |
| | | |
| | | } |
| | | |
| | | // VIP会员服务协议 |
| | | private fun handleVipProtocolClick(){ |
| | | |
| | | binding.protocolVip.setOnClickListener{ |
| | | startContentActivity("privacy_policy", "VIP会员服务协议") |
| | | } |
| | | |
| | | } |
| | | |
| | | private fun startContentActivity(type: String, title: String) { |
| | | val intent = Intent(this, ContentDetailActivity::class.java).apply { |
| | | putExtra(ContentDetailActivity.EXTRA_CONTENT_TYPE, type) |
| | | putExtra(ContentDetailActivity.EXTRA_TITLE, title) |
| | | } |
| | | startActivity(intent) |
| | | } |
| | | |
| | | } |