自定义告警弹窗
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.example.defenseapplication.personal
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.bumptech.glide.Glide
|
||||
import com.example.defenseapplication.R
|
||||
import com.example.defenseapplication.databinding.PersonalProfileActivityBinding
|
||||
|
||||
class PersonalProfileActivity : AppCompatActivity() {
|
||||
private lateinit var binding: PersonalProfileActivityBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
binding = PersonalProfileActivityBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(binding.main) { v, insets ->
|
||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
}
|
||||
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
binding.ivBack.setOnClickListener { finish() }
|
||||
|
||||
// 默认展示数据(后续可接你的用户信息接口/数据库)
|
||||
Glide.with(this)
|
||||
.load(R.mipmap.ic_launcher_round)
|
||||
.circleCrop()
|
||||
.into(binding.ivAvatar)
|
||||
|
||||
binding.tvNickname.text = "这里是我的昵称"
|
||||
binding.tvPhone.text = "13589898989"
|
||||
|
||||
// 点击行可跳转到“修改昵称/修改手机号”等页面
|
||||
//binding.itemAvatar.setOnClickListener { /* TODO */ }
|
||||
//binding.itemNickname.setOnClickListener { /* TODO */ }
|
||||
//binding.itemPhone.setOnClickListener { /* TODO */ }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user