切换家庭,消息列表

This commit is contained in:
2026-04-30 09:04:52 +08:00
parent 5c3193379a
commit 6da478f36d
8 changed files with 36 additions and 4 deletions

View File

@@ -19,6 +19,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.DefenseApplication">
<activity
android:name=".home.AddDeviceActivity"
android:exported="false" />
<activity
android:name=".personal.PersonalProfileActivity"
android:exported="false" />

View File

@@ -0,0 +1,21 @@
package com.example.defenseapplication.home
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.example.defenseapplication.R
class AddDeviceActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(R.layout.add_device_activity)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
}
}

View File

@@ -23,7 +23,7 @@ class PersonalFragment : Fragment() {
): View {
_binding = PersonalFragmentBinding.inflate(inflater, container, false)
Glide.with(this)
.load(R.mipmap.ic_launcher_round)
.load(R.drawable.img)
.circleCrop()
.into(binding.ivAvatar)
binding.headerLayout.setOnClickListener {

View File

@@ -30,9 +30,8 @@ class PersonalProfileActivity : AppCompatActivity() {
private fun initView() {
binding.ivBack.setOnClickListener { finish() }
// 默认展示数据(后续可接你的用户信息接口/数据库)
Glide.with(this)
.load(R.mipmap.ic_launcher_round)
.load(R.drawable.img)
.circleCrop()
.into(binding.ivAvatar)

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".home.AddDeviceActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -65,7 +65,6 @@
android:id="@+id/ivDetail"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="@drawable/bg_detail_border"
android:padding="5dp"
android:src="@drawable/right_back"
app:layout_constraintBottom_toBottomOf="parent"