Compare commits

...

8 Commits

Author SHA1 Message Date
d30c025874 注释解释 2026-06-12 17:20:31 +08:00
78d2d2cd79 下载视频 2026-06-11 15:25:06 +08:00
9eb47345fe 修改包名 2026-06-11 14:25:09 +08:00
57188d27cc 视频下载功能 2026-06-11 11:53:52 +08:00
e40403f7db 视频删除功能 2026-06-11 09:45:31 +08:00
09fdb75644 全屏直播自定义功能按钮 2026-06-10 16:01:24 +08:00
0f07736d1e 全屏视频自定义 2026-06-10 11:20:35 +08:00
e7331f64f4 扫一扫打开相册 2026-06-09 16:43:24 +08:00
166 changed files with 880 additions and 507 deletions

View File

@@ -13,6 +13,17 @@
</DropdownSelection> </DropdownSelection>
<DialogSelection /> <DialogSelection />
</SelectionState> </SelectionState>
<SelectionState runConfigName="AlarmLogActivity">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2026-05-18T09:18:19.023586Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=80bece4" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates> </selectionStates>
</component> </component>
</project> </project>

View File

@@ -3,7 +3,7 @@ plugins {
} }
android { android {
namespace = "com.example.defenseapplication" namespace = "com.ckkj.defense_device"
compileSdk { compileSdk {
version = release(36) { version = release(36) {
minorApiLevel = 1 minorApiLevel = 1
@@ -11,9 +11,9 @@ android {
} }
defaultConfig { defaultConfig {
applicationId = "com.example.defenseapplication" applicationId = "com.ckkj.defense_device"
minSdk = 24 minSdk = 24
targetSdk = 36 targetSdk = 30
versionCode = 1 versionCode = 1
versionName = "1.0" versionName = "1.0"
@@ -103,6 +103,8 @@ dependencies {
implementation("com.contrarywind:Android-PickerView:4.1.9") implementation("com.contrarywind:Android-PickerView:4.1.9")
// GSYVideoPlayer // GSYVideoPlayer
implementation("io.github.carguo:gsyvideoplayer:13.0.0") implementation("io.github.carguo:gsyvideoplayer:13.0.0")
//下载
implementation("io.github.chiclaim:downloader:1.0.2")
} }

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication package com.ckkj.defense_device
import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4

View File

@@ -1,14 +1,9 @@
package com.example.defenseapplication package com.ckkj.defense_device
import android.app.Application import android.app.Application
import android.content.Context import android.content.Context
import bean.LoginBean
import com.blankj.utilcode.util.Utils import com.blankj.utilcode.util.Utils
import com.example.defenseapplication.bean.BaseInfo import com.ckkj.defense_device.utils.LanguageUtil
import com.example.defenseapplication.utils.ApiConfig
import com.example.defenseapplication.utils.LanguageUtil
import com.example.defenseapplication.utils.UserinfoUtil
import com.google.gson.Gson
class MyApplication : Application() { class MyApplication : Application() {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@@ -6,7 +6,7 @@ import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
data class Device( data class Device(
val name: String, val name: String,

View File

@@ -1,11 +1,10 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.graphics.Color import android.graphics.Color
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.databinding.ItemAddLinkedUserBinding
import com.example.defenseapplication.databinding.ItemAddLinkedUserBinding
data class UserItem(val name: String, val phone: String, val userId: String = "") data class UserItem(val name: String, val phone: String, val userId: String = "")

View File

@@ -1,10 +1,10 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.bean.DeviceAlarmBean import com.ckkj.defense_device.bean.DeviceAlarmBean
import com.example.defenseapplication.databinding.ItemAlarmLogBinding import com.ckkj.defense_device.databinding.ItemAlarmLogBinding
class AlarmLogAdapter( class AlarmLogAdapter(
private val items: List<DeviceAlarmBean>, private val items: List<DeviceAlarmBean>,

View File

@@ -1,11 +1,11 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.example.defenseapplication.bean.DeviceAlarmBean import com.ckkj.defense_device.bean.DeviceAlarmBean
import com.example.defenseapplication.databinding.ItemAlarmLogHorizontalBinding import com.ckkj.defense_device.databinding.ItemAlarmLogHorizontalBinding
class AlarmLogHorizontalAdapter( class AlarmLogHorizontalAdapter(
private val items: List<DeviceAlarmBean>, private val items: List<DeviceAlarmBean>,

View File

@@ -1,10 +1,10 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.ItemDeviceBinding import com.ckkj.defense_device.databinding.ItemDeviceBinding
data class DeviceUi( data class DeviceUi(
val name: String, val name: String,

View File

@@ -1,12 +1,12 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.bean.FamilyBean import com.ckkj.defense_device.bean.FamilyBean
import com.example.defenseapplication.databinding.ItemFamilyBinding import com.ckkj.defense_device.databinding.ItemFamilyBinding
class FamilyAdapter( class FamilyAdapter(
private val onItemClick: (String) -> Unit private val onItemClick: (String) -> Unit

View File

@@ -1,12 +1,12 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.ItemSwitchFamilyBinding import com.ckkj.defense_device.databinding.ItemSwitchFamilyBinding
import com.example.defenseapplication.model.FamilyItem import com.ckkj.defense_device.model.FamilyItem
class FamilySwitchAdapter( class FamilySwitchAdapter(
private var familyList: List<FamilyItem>, private var familyList: List<FamilyItem>,

View File

@@ -1,11 +1,10 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.ItemLinkedUserBinding import com.ckkj.defense_device.databinding.ItemLinkedUserBinding
data class LinkedUser( data class LinkedUser(
val userId: String, val userId: String,

View File

@@ -1,11 +1,11 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.databinding.ItemMessageGroupTitleBinding import com.ckkj.defense_device.databinding.ItemMessageGroupTitleBinding
import com.example.defenseapplication.databinding.ItemMessageNoticeBinding import com.ckkj.defense_device.databinding.ItemMessageNoticeBinding
sealed class MessageListItem { sealed class MessageListItem {
data class Header(val title: String) : MessageListItem() data class Header(val title: String) : MessageListItem()

View File

@@ -1,9 +1,9 @@
package com.example.defenseapplication.adapter package com.ckkj.defense_device.adapter
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.databinding.ItemWifiBinding import com.ckkj.defense_device.databinding.ItemWifiBinding
class WifiListAdapter( class WifiListAdapter(
wifiList: List<String>, wifiList: List<String>,

View File

@@ -1,10 +1,10 @@
package com.example.defenseapplication.base package com.ckkj.defense_device.base
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.utils.ActivityManager import com.ckkj.defense_device.utils.ActivityManager
import com.example.defenseapplication.utils.LanguageUtil import com.ckkj.defense_device.utils.LanguageUtil
open class BaseActivity : AppCompatActivity() { open class BaseActivity : AppCompatActivity() {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class AddDeviceBean( data class AddDeviceBean(
val deviceEm: String? = null,//设备型号 val deviceEm: String? = null,//设备型号

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class AddDeviceUserRequest( data class AddDeviceUserRequest(
val deviceId: String, val deviceId: String,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
/** /**
* 统一返回数据基类根据你的后端实际字段调整 * 统一返回数据基类根据你的后端实际字段调整

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
class DeleteBean { class DeleteBean {
var deviceId: String? = null var deviceId: String? = null

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class DeleteDeviceUserRequest( data class DeleteDeviceUserRequest(
val userId: String, val userId: String,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
import android.os.Parcel import android.os.Parcel
import android.os.Parcelable import android.os.Parcelable

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class DeviceAlarmResponse( data class DeviceAlarmResponse(
val total: Int, val total: Int,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class DeviceBean( data class DeviceBean(
val alertAudio: String? = null,//告警播放 val alertAudio: String? = null,//告警播放

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class DeviceUserBean( data class DeviceUserBean(
val createDept: Int ? = null, //创建部门 val createDept: Int ? = null, //创建部门

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class FamilyBean( data class FamilyBean(
val id: String, val id: String,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class FamilyMembersBean( data class FamilyMembersBean(
val id: String? = null, // ID val id: String? = null, // ID

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class GetCodeBean<T> ( data class GetCodeBean<T> (
val code:Int, val code:Int,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
import android.os.Parcel import android.os.Parcel
import android.os.Parcelable import android.os.Parcelable

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class MessageListResponse( data class MessageListResponse(
val total: Int, val total: Int,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class ObtainInviterInformationBean( data class ObtainInviterInformationBean(
val nickName: String? = null, val nickName: String? = null,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class ObtainInviterInformationRequest( data class ObtainInviterInformationRequest(
val childId: String val childId: String

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class SwitchFamilyRequest( data class SwitchFamilyRequest(
val clientId: String, val clientId: String,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class UpdatePassword( data class UpdatePassword(
val oldPassword: String, val oldPassword: String,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class UpdateUserInfo( data class UpdateUserInfo(
val userId: String?=null, val userId: String?=null,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class UploadResponse( data class UploadResponse(
val code: Int, val code: Int,

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
import java.io.Serializable import java.io.Serializable

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.bean package com.ckkj.defense_device.bean
data class VerifyOptionPasswordRequest( data class VerifyOptionPasswordRequest(
val optionPassword: String val optionPassword: String

View File

@@ -1,7 +1,6 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.Manifest import android.Manifest
import android.app.Activity
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.os.Build import android.os.Build
@@ -14,10 +13,10 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.AddDeviceAdapter import com.ckkj.defense_device.adapter.AddDeviceAdapter
import com.example.defenseapplication.adapter.Device import com.ckkj.defense_device.adapter.Device
import com.example.defenseapplication.databinding.AddDeviceActivityBinding import com.ckkj.defense_device.databinding.AddDeviceActivityBinding
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import com.maning.mlkitscanner.scan.MNScanManager import com.maning.mlkitscanner.scan.MNScanManager
import com.maning.mlkitscanner.scan.callback.act.MNScanCallback import com.maning.mlkitscanner.scan.callback.act.MNScanCallback

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.Manifest import android.Manifest
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
@@ -23,10 +23,10 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat import androidx.core.app.ActivityCompat
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.WifiListAdapter import com.ckkj.defense_device.adapter.WifiListAdapter
import com.example.defenseapplication.databinding.AddFamilyActivityBinding import com.ckkj.defense_device.databinding.AddFamilyActivityBinding
import com.example.defenseapplication.databinding.DialogWifiListBinding import com.ckkj.defense_device.databinding.DialogWifiListBinding
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
//选择Wi-Fi //选择Wi-Fi
class AddFamilyActivity : AppCompatActivity() { class AddFamilyActivity : AppCompatActivity() {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.content.Intent import android.content.Intent
import android.graphics.drawable.AnimationDrawable import android.graphics.drawable.AnimationDrawable
@@ -6,14 +6,9 @@ import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.view.View import android.view.View
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat import com.ckkj.defense_device.R
import androidx.core.view.WindowInsetsCompat import com.ckkj.defense_device.databinding.ConnectDeviceActivityBinding
import com.example.defenseapplication.R
import com.example.defenseapplication.databinding.AddDeviceActivityBinding
import com.example.defenseapplication.databinding.ConnectDeviceActivityBinding
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
//连接设备 //连接设备
class ConnectDeviceActivity : AppCompatActivity() { class ConnectDeviceActivity : AppCompatActivity() {

View File

@@ -1,15 +1,10 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.base.BaseActivity import com.ckkj.defense_device.base.BaseActivity
import com.example.defenseapplication.databinding.HomeActivityBinding import com.ckkj.defense_device.databinding.HomeActivityBinding
import com.example.defenseapplication.databinding.HomeMenuFragmentBinding
import com.gyf.immersionbar.ImmersionBar
class HomeActivity : BaseActivity() { class HomeActivity : BaseActivity() {
// ViewBinding 核心对象 // ViewBinding 核心对象

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.Manifest import android.Manifest
import android.app.Activity import android.app.Activity
@@ -21,23 +21,23 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.DeviceAdapter import com.ckkj.defense_device.adapter.DeviceAdapter
import com.example.defenseapplication.adapter.DeviceUi import com.ckkj.defense_device.adapter.DeviceUi
import com.example.defenseapplication.adapter.FamilyAdapter import com.ckkj.defense_device.adapter.FamilyAdapter
import com.example.defenseapplication.bean.DeviceBean import com.ckkj.defense_device.bean.DeviceBean
import com.example.defenseapplication.bean.FamilyBean import com.ckkj.defense_device.bean.FamilyBean
import com.example.defenseapplication.bean.SwitchFamilyRequest import com.ckkj.defense_device.bean.SwitchFamilyRequest
import com.example.defenseapplication.databinding.HomeMenuFragmentBinding import com.ckkj.defense_device.databinding.HomeMenuFragmentBinding
import com.example.defenseapplication.liveVideo.LiveVideoActivity import com.ckkj.defense_device.liveVideo.LiveVideoActivity
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.DeviceUpdateEvent import com.ckkj.defense_device.utils.DeviceUpdateEvent
import com.example.defenseapplication.utils.FamilySwitchEvent import com.ckkj.defense_device.utils.FamilySwitchEvent
import com.example.defenseapplication.utils.MessageStatusManager import com.ckkj.defense_device.utils.MessageStatusManager
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.utils.UserinfoUtil import com.ckkj.defense_device.utils.UserinfoUtil
import com.example.defenseapplication.view.DefenseDialogs import com.ckkj.defense_device.view.DefenseDialogs
import com.example.defenseapplication.view.showDefenseDialog import com.ckkj.defense_device.view.showDefenseDialog
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import com.maning.mlkitscanner.scan.MNScanManager import com.maning.mlkitscanner.scan.MNScanManager
import com.maning.mlkitscanner.scan.callback.act.MNScanCallback import com.maning.mlkitscanner.scan.callback.act.MNScanCallback

View File

@@ -1,15 +1,15 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.adapter.MessageListAdapter import com.ckkj.defense_device.adapter.MessageListAdapter
import com.example.defenseapplication.adapter.MessageListItem import com.ckkj.defense_device.adapter.MessageListItem
import com.example.defenseapplication.databinding.MessageActivityBinding import com.ckkj.defense_device.databinding.MessageActivityBinding
import com.example.defenseapplication.utils.MessageStatusManager import com.ckkj.defense_device.utils.MessageStatusManager
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -24,7 +24,7 @@ class MessageActivity : AppCompatActivity() {
private val pageSize = 10 private val pageSize = 10
private var isLoading = false private var isLoading = false
private var hasMoreData = true private var hasMoreData = true
private val allMessages = mutableListOf<com.example.defenseapplication.bean.MessageBean>() private val allMessages = mutableListOf<com.ckkj.defense_device.bean.MessageBean>()
private var lastLoadedCount = 0 private var lastLoadedCount = 0
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@@ -160,7 +160,7 @@ class MessageActivity : AppCompatActivity() {
binding.tvNoMoreData.visibility = View.GONE binding.tvNoMoreData.visibility = View.GONE
} }
private fun convertToMessageListItems(messages: List<com.example.defenseapplication.bean.MessageBean>): List<MessageListItem> { private fun convertToMessageListItems(messages: List<com.ckkj.defense_device.bean.MessageBean>): List<MessageListItem> {
val items = mutableListOf<MessageListItem>() val items = mutableListOf<MessageListItem>()
val groupedMessages = messages.groupBy { extractDate(it.createTime ?: "") } val groupedMessages = messages.groupBy { extractDate(it.createTime ?: "") }
groupedMessages.forEach { (date, messageList) -> groupedMessages.forEach { (date, messageList) ->

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
@@ -9,21 +9,20 @@ import android.view.ViewGroup
import android.widget.Toast import android.widget.Toast
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.RequestOptions
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.bean.UserInfoBean import com.ckkj.defense_device.bean.UserInfoBean
import com.example.defenseapplication.databinding.PersonalFragmentBinding import com.ckkj.defense_device.databinding.PersonalFragmentBinding
import com.example.defenseapplication.liveVideo.LinkedUserActivity import com.ckkj.defense_device.liveVideo.LinkedUserActivity
import com.example.defenseapplication.personal.FaceManagementActivity import com.ckkj.defense_device.personal.FaceManagementActivity
import com.example.defenseapplication.personal.PasswordManagementActivity import com.ckkj.defense_device.personal.PasswordManagementActivity
import com.example.defenseapplication.personal.PersonalProfileActivity import com.ckkj.defense_device.personal.PersonalProfileActivity
import com.example.defenseapplication.utils.AppLanguage import com.ckkj.defense_device.utils.AppLanguage
import com.example.defenseapplication.utils.LanguageUtil import com.ckkj.defense_device.utils.LanguageUtil
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.utils.UserinfoUtil import com.ckkj.defense_device.utils.UserinfoUtil
import com.example.defenseapplication.utils.ActivityManager import com.ckkj.defense_device.utils.ActivityManager
import com.example.defenseapplication.view.FamilySwitchDialog import com.ckkj.defense_device.view.FamilySwitchDialog
import com.example.defenseapplication.view.LanguageDialog import com.ckkj.defense_device.view.LanguageDialog
import com.example.defenseapplication.home.HomeActivity
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -107,7 +106,7 @@ class PersonalFragment : Fragment() {
withContext(Dispatchers.Main) { withContext(Dispatchers.Main) {
if (response.code == 200) { if (response.code == 200) {
UserinfoUtil.clearUserInfo() UserinfoUtil.clearUserInfo()
val intent = Intent(requireContext(), com.example.defenseapplication.login.LoginActivity::class.java) val intent = Intent(requireContext(), com.ckkj.defense_device.login.LoginActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
startActivity(intent) startActivity(intent)
requireActivity().finish() requireActivity().finish()

View File

@@ -1,14 +1,13 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.bean.AddDeviceBean import com.ckkj.defense_device.bean.AddDeviceBean
import com.example.defenseapplication.bean.DeviceBean import com.ckkj.defense_device.databinding.SetNameActivityBinding
import com.example.defenseapplication.databinding.SetNameActivityBinding import com.ckkj.defense_device.liveVideo.LiveVideoActivity
import com.example.defenseapplication.liveVideo.LiveVideoActivity import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,14 +1,15 @@
package com.example.defenseapplication.home package com.ckkj.defense_device.home
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.databinding.ActivityStartBinding import com.ckkj.defense_device.databinding.ActivityStartBinding
import com.example.defenseapplication.login.LoginActivity import com.ckkj.defense_device.login.LoginActivity
import com.example.defenseapplication.utils.ApiConfig import com.ckkj.defense_device.utils.ApiConfig
import com.example.defenseapplication.utils.UserinfoUtil import com.ckkj.defense_device.utils.UserinfoUtil
import com.gyf.immersionbar.ImmersionBar
class StartActivity : AppCompatActivity() { class StartActivity : AppCompatActivity() {
private lateinit var binding: ActivityStartBinding private lateinit var binding: ActivityStartBinding
@@ -17,6 +18,10 @@ class StartActivity : AppCompatActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
binding = ActivityStartBinding.inflate(layoutInflater) binding = ActivityStartBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
ImmersionBar.with(this)
.statusBarDarkFont(true)
.titleBar(null)
.init()
// 延迟2秒后再判断登录状态 // 延迟2秒后再判断登录状态
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.os.Bundle import android.os.Bundle
import android.text.Editable import android.text.Editable
@@ -7,15 +7,15 @@ import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.AddLinkedUserAdapter import com.ckkj.defense_device.adapter.AddLinkedUserAdapter
import com.example.defenseapplication.adapter.UserItem import com.ckkj.defense_device.adapter.UserItem
import com.example.defenseapplication.bean.AddDeviceUserRequest import com.ckkj.defense_device.bean.AddDeviceUserRequest
import com.example.defenseapplication.bean.FamilyMembersBean import com.ckkj.defense_device.bean.FamilyMembersBean
import com.example.defenseapplication.databinding.AddLinkedUserActivityBinding import com.ckkj.defense_device.databinding.AddLinkedUserActivityBinding
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.DeviceUserUpdateEvent import com.ckkj.defense_device.utils.DeviceUserUpdateEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch

View File

@@ -1,9 +1,11 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.content.Context import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.media.AudioManager import android.media.AudioManager
import android.media.MediaScannerConnection
import android.os.Bundle import android.os.Bundle
import android.os.Environment
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.widget.Toast import android.widget.Toast
@@ -11,22 +13,28 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.AlarmLogAdapter import com.ckkj.defense_device.adapter.AlarmLogAdapter
import com.example.defenseapplication.bean.DeviceAlarmBean import com.ckkj.defense_device.bean.DeviceAlarmBean
import com.example.defenseapplication.databinding.AlarmLogActivityBinding import com.ckkj.defense_device.databinding.AlarmLogActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
import com.shuyu.gsyvideoplayer.utils.OrientationUtils import com.shuyu.gsyvideoplayer.utils.OrientationUtils
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
import com.bigkoo.pickerview.builder.TimePickerBuilder import com.bigkoo.pickerview.builder.TimePickerBuilder
import com.bigkoo.pickerview.listener.OnTimeSelectListener import com.bigkoo.pickerview.listener.OnTimeSelectListener
import com.example.defenseapplication.view.MyGSYVideoPlayer import com.ckkj.defense_device.view.CustomDialogFragment
import com.shuyu.gsyvideoplayer.GSYVideoManager import com.ckkj.defense_device.view.LoadingDialog
import com.ckkj.defense_device.view.MyGSYVideoPlayer
import com.ckkj.defense_device.view.showDefenseDialog
import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.File
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
import android.net.Uri
import com.chiclaim.android.downloader.DownloadRequest
import com.chiclaim.android.downloader.DownloadListener
//告警记录 //告警记录
class AlarmLogActivity : AppCompatActivity() { class AlarmLogActivity : AppCompatActivity() {
@@ -42,12 +50,16 @@ class AlarmLogActivity : AppCompatActivity() {
private var isMute = false private var isMute = false
private lateinit var audioManager: AudioManager private lateinit var audioManager: AudioManager
private var isRightMenuVisible = false private var currentAlarmItem: DeviceAlarmBean? = null
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
binding = AlarmLogActivityBinding.inflate(layoutInflater) binding = AlarmLogActivityBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
ImmersionBar.with(this)
.statusBarDarkFont(true)
.titleBar(null)
.init()
audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager
deviceId = intent.getStringExtra("device_id") deviceId = intent.getStringExtra("device_id")
@@ -132,8 +144,10 @@ class AlarmLogActivity : AppCompatActivity() {
} }
private fun initRecyclerView() { private fun initRecyclerView() {
adapter = AlarmLogAdapter(alarmList) { item -> adapter = AlarmLogAdapter(alarmList) { item ->
currentAlarmItem = item
if (!item.video.isNullOrEmpty()) { if (!item.video.isNullOrEmpty()) {
Toast.makeText(this, "该告警记录有视频", Toast.LENGTH_SHORT).show() binding.exoPlayContextId.setUp(item.video, true, item.categoryName)
binding.exoPlayContextId.startPlayLogic()
} else { } else {
Toast.makeText(this, "该告警记录没有视频", Toast.LENGTH_SHORT).show() Toast.makeText(this, "该告警记录没有视频", Toast.LENGTH_SHORT).show()
} }
@@ -165,6 +179,7 @@ class AlarmLogActivity : AppCompatActivity() {
originalAlarmList.clear() originalAlarmList.clear()
originalAlarmList.addAll(newData) originalAlarmList.addAll(newData)
filterAlarmListByDate(calendar) filterAlarmListByDate(calendar)
currentAlarmItem = alarmList.firstOrNull()
Log.d("AlarmLogActivity", "已获取 ${newData.size} 条数据") Log.d("AlarmLogActivity", "已获取 ${newData.size} 条数据")
} catch (e: Exception) { } catch (e: Exception) {
@@ -202,8 +217,10 @@ class AlarmLogActivity : AppCompatActivity() {
if (alarmList.isEmpty()) { if (alarmList.isEmpty()) {
showEmptyView() showEmptyView()
currentAlarmItem = null
} else { } else {
hideEmptyView() hideEmptyView()
currentAlarmItem = alarmList.firstOrNull()
} }
} }
@@ -220,10 +237,45 @@ class AlarmLogActivity : AppCompatActivity() {
} }
binding.ivDownload.setOnClickListener { binding.ivDownload.setOnClickListener {
Toast.makeText(this,"下载视频",Toast.LENGTH_SHORT).show()
// val item = currentAlarmItem
//
// if (item?.video.isNullOrEmpty()) {
// Toast.makeText(
// this,
// "没有可下载的视频",
// Toast.LENGTH_SHORT
// ).show()
// return@setOnClickListener
// }
showConfirmDialog(
getString(R.string.tip),
getString(R.string.download_alarm_video_confirm)
) {
//downloadVideo(item!!.video)
downloadVideo(
"https://media.w3.org/2010/05/sintel/trailer.mp4"
)
Toast.makeText(
this,
getString(R.string.download_start),
Toast.LENGTH_SHORT
).show()
}
} }
binding.ivDelete.setOnClickListener { binding.ivDelete.setOnClickListener {
val item = currentAlarmItem
if (item == null) {
Toast.makeText(this, "没有可删除的告警记录", Toast.LENGTH_SHORT).show()
return@setOnClickListener
}
showConfirmDialog(getString(R.string.tip), getString(R.string.delete_alarm_video_confirm)) {
val loadingDialog = LoadingDialog(this).setMessage("删除中...").apply { show() }
deleteAlarmItem(item.id, loadingDialog)
}
} }
binding.ivMute.setOnClickListener { binding.ivMute.setOnClickListener {
isMute = !isMute isMute = !isMute
@@ -272,6 +324,102 @@ class AlarmLogActivity : AppCompatActivity() {
binding.exoPlayContextId.onVideoResume() binding.exoPlayContextId.onVideoResume()
} }
private fun showConfirmDialog(title: String, message: String, onConfirm: () -> Unit) {
val config = CustomDialogFragment.Config(
title = title,
message = message,
positiveText = getString(R.string.confirm),
negativeText = getString(R.string.cancel)
)
showDefenseDialog(config, onPositiveClick = { onConfirm() })
}
private fun downloadVideo(url: String) {
val dir = File(
Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_MOVIES
),
"AlarmVideo"
)
if (!dir.exists()) {
dir.mkdirs()
}
val targetFile = File(
dir,
"${System.currentTimeMillis()}.mp4"
)
val request = DownloadRequest(
this,
url
)
.setDestinationUri(Uri.fromFile(targetFile))
.setNotificationTitle("${"视频名称"}:视频下载")
.registerListener(object : DownloadListener {
override fun onDownloadStart() {
Log.d("DOWNLOAD", "开始下载")
}
override fun onProgressUpdate(percent: Int) {
Log.d("DOWNLOAD", "进度:$percent%")
}
override fun onDownloadComplete(uri: Uri) {
MediaScannerConnection.scanFile(
this@AlarmLogActivity,
arrayOf(targetFile.absolutePath),
arrayOf("video/mp4"),
null
)
runOnUiThread {
ToastUtils.showSuccess(
this@AlarmLogActivity,
"下载成功"
)
}
}
override fun onDownloadFailed(e: Throwable) {
runOnUiThread {
ToastUtils.showError(
this@AlarmLogActivity,
"下载失败:${e.message}"
)
}
}
})
request.startDownload()
}
private fun deleteAlarmItem(id: String, loadingDialog: LoadingDialog) {
lifecycleScope.launch {
try {
val response = RetrofitNetwork.getNetworkService().deleteMessage(id)
if (response.code == 200) {
Toast.makeText(this@AlarmLogActivity, getString(R.string.delete_success), Toast.LENGTH_SHORT).show()
originalAlarmList.removeAll { it.id == id }
alarmList.removeAll { it.id == id }
adapter?.notifyDataSetChanged()
currentAlarmItem = alarmList.firstOrNull()
if (alarmList.isEmpty()) {
showEmptyView()
}
} else {
Toast.makeText(this@AlarmLogActivity, response.msg, Toast.LENGTH_SHORT).show()
}
} catch (e: Exception) {
Toast.makeText(this@AlarmLogActivity, "删除失败: ${e.message}", Toast.LENGTH_SHORT).show()
} finally {
loadingDialog.dismiss()
}
}
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
@@ -8,12 +8,12 @@ import java.util.Calendar
import android.os.Bundle import android.os.Bundle
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.AutoModeActivityBinding import com.ckkj.defense_device.databinding.AutoModeActivityBinding
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.DeviceUpdateEvent import com.ckkj.defense_device.utils.DeviceUpdateEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.view.AutoModeNoticeDialog import com.ckkj.defense_device.view.AutoModeNoticeDialog
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -173,7 +173,7 @@ class AutoModeActivity : AppCompatActivity() {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
try { try {
val deviceBean = com.example.defenseapplication.bean.DeviceBean( val deviceBean = com.ckkj.defense_device.bean.DeviceBean(
id = deviceId, id = deviceId,
workMode = selectedMode, workMode = selectedMode,
startTime = startTime, startTime = startTime,

View File

@@ -1,12 +1,11 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.os.Bundle import android.os.Bundle
import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.databinding.DeviceInfoActivityBinding import com.ckkj.defense_device.databinding.DeviceInfoActivityBinding
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -55,7 +54,7 @@ class DeviceInfoActivity : AppCompatActivity() {
} }
} }
private fun updateDeviceInfo(device: com.example.defenseapplication.bean.DeviceBean) { private fun updateDeviceInfo(device: com.ckkj.defense_device.bean.DeviceBean) {
binding.tvDeviceModelValue.text = device.deviceNo.toString() binding.tvDeviceModelValue.text = device.deviceNo.toString()
binding.tvDeviceNoValue.text = device.deviceSn.toString() binding.tvDeviceNoValue.text = device.deviceSn.toString()
binding.tvFwVersionValue.text = device.fwVer.toString() binding.tvFwVersionValue.text = device.fwVer.toString()

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
@@ -11,22 +11,21 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.LinkedUser import com.ckkj.defense_device.adapter.LinkedUser
import com.example.defenseapplication.adapter.LinkedUserAdapter import com.ckkj.defense_device.adapter.LinkedUserAdapter
import com.example.defenseapplication.bean.DeleteDeviceUserRequest import com.ckkj.defense_device.bean.DeleteDeviceUserRequest
import com.example.defenseapplication.bean.DeviceUserBean import com.ckkj.defense_device.bean.DeviceUserBean
import com.example.defenseapplication.bean.FamilyMembersBean import com.ckkj.defense_device.bean.FamilyMembersBean
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest import com.ckkj.defense_device.bean.VerifyOptionPasswordRequest
import com.example.defenseapplication.databinding.LinkedUserActivityBinding import com.ckkj.defense_device.databinding.LinkedUserActivityBinding
import com.example.defenseapplication.personal.PasswordInputDialog import com.ckkj.defense_device.personal.PasswordInputDialog
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.DeviceUserUpdateEvent import com.ckkj.defense_device.utils.DeviceUserUpdateEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.view.CustomDialogFragmentText import com.ckkj.defense_device.view.CustomDialogFragmentText
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import com.yanzhenjie.recyclerview.SwipeMenuItem import com.yanzhenjie.recyclerview.SwipeMenuItem
import com.yanzhenjie.recyclerview.SwipeRecyclerView
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -339,7 +338,7 @@ class LinkedUserActivity : AppCompatActivity() {
binding.fabAdd.setOnClickListener { binding.fabAdd.setOnClickListener {
if (checkUserLimit()) { if (checkUserLimit()) {
val intent = Intent(this, com.example.defenseapplication.personal.InvitationCodeActivity::class.java) val intent = Intent(this, com.ckkj.defense_device.personal.InvitationCodeActivity::class.java)
startActivity(intent) startActivity(intent)
} }
} }

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.content.Intent import android.content.Intent
import android.content.res.Configuration import android.content.res.Configuration
@@ -9,13 +9,13 @@ import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.AlarmLogHorizontalAdapter import com.ckkj.defense_device.adapter.AlarmLogHorizontalAdapter
import com.example.defenseapplication.base.BaseActivity import com.ckkj.defense_device.base.BaseActivity
import com.example.defenseapplication.bean.DeviceAlarmBean import com.ckkj.defense_device.bean.DeviceAlarmBean
import com.example.defenseapplication.databinding.LiveVideoActivityBinding import com.ckkj.defense_device.databinding.LiveVideoActivityBinding
import com.example.defenseapplication.utils.ActivityManager import com.ckkj.defense_device.utils.ActivityManager
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
@@ -184,7 +184,7 @@ class LiveVideoActivity : BaseActivity() {
private fun initListener() { private fun initListener() {
binding.btnBack.setOnClickListener { binding.btnBack.setOnClickListener {
ActivityManager.finishExceptHome() ActivityManager.finishExceptHome()
val intent = Intent(this, com.example.defenseapplication.home.HomeActivity::class.java) val intent = Intent(this, com.ckkj.defense_device.home.HomeActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP
startActivity(intent) startActivity(intent)
finish() finish()
@@ -200,9 +200,9 @@ class LiveVideoActivity : BaseActivity() {
isLightOn = !isLightOn isLightOn = !isLightOn
if (isLightOn) { if (isLightOn) {
binding.ivLight.setImageResource(com.example.defenseapplication.R.mipmap.light_on_open) binding.ivLight.setImageResource(com.ckkj.defense_device.R.mipmap.light_on_open)
} else { } else {
binding.ivLight.setImageResource(com.example.defenseapplication.R.mipmap.light_on) binding.ivLight.setImageResource(com.ckkj.defense_device.R.mipmap.light_on)
} }
} }

View File

@@ -1,19 +1,19 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.widget.Toast import android.widget.Toast
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.base.BaseActivity import com.ckkj.defense_device.base.BaseActivity
import com.example.defenseapplication.databinding.SettingsActivityBinding import com.ckkj.defense_device.databinding.SettingsActivityBinding
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.view.CustomDialogFragmentText import com.ckkj.defense_device.view.CustomDialogFragmentText
import com.example.defenseapplication.view.RecognitionModeDialog import com.ckkj.defense_device.view.RecognitionModeDialog
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest import com.ckkj.defense_device.bean.VerifyOptionPasswordRequest
import com.example.defenseapplication.personal.PasswordInputDialog import com.ckkj.defense_device.personal.PasswordInputDialog
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -183,7 +183,7 @@ class SettingsActivity : BaseActivity() {
binding.tvRelatedUsers.text = "$count" binding.tvRelatedUsers.text = "$count"
} }
private fun updateDeviceInfo(device: com.example.defenseapplication.bean.DeviceBean) { private fun updateDeviceInfo(device: com.ckkj.defense_device.bean.DeviceBean) {
binding.tvDeviceName.text = device.deviceName ?: "未设置" binding.tvDeviceName.text = device.deviceName ?: "未设置"
binding.tvWifiName.text = device.wifiName ?: "未设置" binding.tvWifiName.text = device.wifiName ?: "未设置"
@@ -236,7 +236,7 @@ class SettingsActivity : BaseActivity() {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
try { try {
val deviceBean = com.example.defenseapplication.bean.DeviceBean( val deviceBean = com.ckkj.defense_device.bean.DeviceBean(
id = deviceId, id = deviceId,
deviceName = name, deviceName = name,
) )
@@ -273,7 +273,7 @@ class SettingsActivity : BaseActivity() {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
try { try {
val deviceBean = com.example.defenseapplication.bean.DeviceBean( val deviceBean = com.ckkj.defense_device.bean.DeviceBean(
id = deviceId, id = deviceId,
patternPerception = patternPerception, patternPerception = patternPerception,
) )
@@ -305,13 +305,13 @@ class SettingsActivity : BaseActivity() {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
try { try {
val deleteBean = com.example.defenseapplication.bean.DeleteBean() val deleteBean = com.ckkj.defense_device.bean.DeleteBean()
deleteBean.deviceId = deviceId deleteBean.deviceId = deviceId
val response = RetrofitNetwork.getNetworkService().deleteDevice(deleteBean) val response = RetrofitNetwork.getNetworkService().deleteDevice(deleteBean)
withContext(Dispatchers.Main) { withContext(Dispatchers.Main) {
if (response.code == 200) { if (response.code == 200) {
Toast.makeText(this@SettingsActivity, "解绑成功", Toast.LENGTH_SHORT).show() Toast.makeText(this@SettingsActivity, "解绑成功", Toast.LENGTH_SHORT).show()
val intent = Intent(this@SettingsActivity, com.example.defenseapplication.home.HomeActivity::class.java) val intent = Intent(this@SettingsActivity, com.ckkj.defense_device.home.HomeActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK
startActivity(intent) startActivity(intent)
finish() finish()

View File

@@ -1,17 +1,17 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.os.Bundle import android.os.Bundle
import android.widget.ImageView import android.widget.ImageView
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.bean.DeviceBean import com.ckkj.defense_device.bean.DeviceBean
import com.example.defenseapplication.databinding.StrikePositionActivityBinding import com.ckkj.defense_device.databinding.StrikePositionActivityBinding
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.view.CustomDialogFragment import com.ckkj.defense_device.view.CustomDialogFragment
import com.example.defenseapplication.view.showDefenseDialog import com.ckkj.defense_device.view.showDefenseDialog
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@@ -45,7 +45,7 @@ class StrikePositionActivity : AppCompatActivity() {
private var selectedZone: Zone = Zone.CHEST private var selectedZone: Zone = Zone.CHEST
// Touch tracking for ImageView (captured in onTouch, used in ACTION_UP for click detection) // ImageView 的触控追踪(在 onTouch 中捕获ACTION_UP 用于点击检测)
private var lastTouchX = 0f private var lastTouchX = 0f
private var lastTouchY = 0f private var lastTouchY = 0f
@@ -67,7 +67,7 @@ class StrikePositionActivity : AppCompatActivity() {
binding.ivBack.setOnClickListener { finish() } binding.ivBack.setOnClickListener { finish() }
binding.btnSubmit.setOnClickListener { showConfirmDialog() } binding.btnSubmit.setOnClickListener { showConfirmDialog() }
// Use OnTouchListener to track touch coordinates // 使用 OnTouchListen 来跟踪触摸坐标
binding.ivHumanBody.setOnTouchListener { _, event -> binding.ivHumanBody.setOnTouchListener { _, event ->
lastTouchX = event.x lastTouchX = event.x
lastTouchY = event.y lastTouchY = event.y
@@ -77,7 +77,7 @@ class StrikePositionActivity : AppCompatActivity() {
false false
} }
// OnClick fires on ACTION_UP; coordinates captured from lastTouchX/Y // OnClick 对ACTION_UP开火;坐标来自lastTouchXY
binding.ivHumanBody.setOnClickListener { binding.ivHumanBody.setOnClickListener {
val imageView = it as ImageView val imageView = it as ImageView
val (nx, ny) = resolveTapLocation(lastTouchX, lastTouchY, imageView) val (nx, ny) = resolveTapLocation(lastTouchX, lastTouchY, imageView)
@@ -100,10 +100,12 @@ class StrikePositionActivity : AppCompatActivity() {
} }
/** /**
* Converts a screen coordinate (from onTouch) into a normalised [0..1] offset * 这段代码将触摸坐标转换为图片内部的归一化位置
* inside the drawable, accounting for: *
* - ImageView scaling (scaleType="fitCenter" adds letterboxing) * 1. 计算图片等比缩放后的实际尺寸
* - Letterbox / pillarbox margins when image aspect view aspect * 2. 计算letterbox/pillarbox的偏移量
* 3. 将触摸点限制在图片有效区域内
* 4. 返回相对于图片的归一化坐标(0-1范围)
*/ */
private fun resolveTapLocation(rawX: Float, rawY: Float, imageView: ImageView): Pair<Float, Float> { private fun resolveTapLocation(rawX: Float, rawY: Float, imageView: ImageView): Pair<Float, Float> {
val drawable = imageView.drawable ?: return Pair(0f, 0f) val drawable = imageView.drawable ?: return Pair(0f, 0f)
@@ -114,22 +116,22 @@ class StrikePositionActivity : AppCompatActivity() {
val intrinsicWidth = drawable.intrinsicWidth.toFloat() val intrinsicWidth = drawable.intrinsicWidth.toFloat()
val intrinsicHeight = drawable.intrinsicHeight.toFloat() val intrinsicHeight = drawable.intrinsicHeight.toFloat()
// scale: the uniform factor the image is scaled by to fit the view // 比例:图像被缩放以适应视图的均匀因子
val scale = min(ivWidth / intrinsicWidth, ivHeight / intrinsicHeight) val scale = min(ivWidth / intrinsicWidth, ivHeight / intrinsicHeight)
// Physical pixel size of the drawable after scaling // 缩放后绘制的物理像素大小
val drawnW = intrinsicWidth * scale val drawnW = intrinsicWidth * scale
val drawnH = intrinsicHeight * scale val drawnH = intrinsicHeight * scale
// Letterbox offsets (top / left) when aspect ratios differ // 当宽高比不同时,信箱偏移(左上角)
val drawableLeft = (ivWidth - drawnW) / 2f val drawableLeft = (ivWidth - drawnW) / 2f
val drawableTop = (ivHeight - drawnH) / 2f val drawableTop = (ivHeight - drawnH) / 2f
// Clamp touch to the actual drawable area // 夹紧触地接触实际可绘制区域
val clampedX = max(drawableLeft, min(rawX, drawableLeft + drawnW)) val clampedX = max(drawableLeft, min(rawX, drawableLeft + drawnW))
val clampedY = max(drawableTop, min(rawY, drawableTop + drawnH)) val clampedY = max(drawableTop, min(rawY, drawableTop + drawnH))
// Normalised offset [0..1] within the drawable // 可绘制物内的归一化偏移 [0..1]
val normalizedX = (clampedX - drawableLeft) / drawnW val normalizedX = (clampedX - drawableLeft) / drawnW
val normalizedY = (clampedY - drawableTop) / drawnH val normalizedY = (clampedY - drawableTop) / drawnH
@@ -137,14 +139,11 @@ class StrikePositionActivity : AppCompatActivity() {
} }
/** /**
* Zones are divided by: * 这段代码根据归一化坐标确定触摸区域
* - Horizontal boundary at ny = 0.5 top = HEAD, bottom = shoulders
* - Vertical boundary 1 at nx = 1/3 left = LEFT_SHOULDER
* - Vertical boundary 2 at nx = 2/3 right = RIGHT_SHOULDER, middle = CHEST
* *
* If the touch falls within ±tolerance of any boundary line, the nearest * 1. 将图片分为头部左肩胸部右肩四个区域
* zone centre (Euclidean distance in normalised space) is used to avoid * 2. 边界附近±0.04范围内使用最近区域中心避免误判
* arbitrary assignments at boundary pixels. * 3. 上半部分为头部下半部分按1/3和2/3垂直线划分
*/ */
private fun zoneForLocation(nx: Float, ny: Float): Zone { private fun zoneForLocation(nx: Float, ny: Float): Zone {
val hBoundary = 0.5f val hBoundary = 0.5f
@@ -168,7 +167,14 @@ class StrikePositionActivity : AppCompatActivity() {
} }
} }
/** Returns the Zone whose normalised centre is closest (Euclidean) to (nx, ny). */ /**
* 这段代码找到距离触摸点最近的区域
*
* 1. 遍历所有Zone计算与触摸点的欧氏距离平方
* 2. 返回距离最小的Zone作为结果
* 3. 若无匹配则默认返回CHEST
* */
private fun nearestZone(nx: Float, ny: Float): Zone { private fun nearestZone(nx: Float, ny: Float): Zone {
return Zone.values().minByOrNull { zone -> return Zone.values().minByOrNull { zone ->
val dx = nx - zone.normalizedX val dx = nx - zone.normalizedX
@@ -178,12 +184,12 @@ class StrikePositionActivity : AppCompatActivity() {
} }
/** /**
* Positions the marker (ivStrikeMarker) at the zone's centre, clamped so the 这段代码更新标记位置到区域中心
* marker never goes out of the ivHumanBody bounds.
* 1. 根据Zone的归一化坐标计算目标位置
* Because the marker is a child of ivHumanBody and starts at its center 2. 限制标记不超出图片边界Y仅限制上限
* (layout_gravity="center"), we compute the offset from that center point 3. 相对于ImageView中心计算偏移量并应用
* and apply it via translationX/Y so the marker's layout bounds stay intact. 4. 支持动画或即时移动两种方式
*/ */
private fun updateMarkerPosition(zone: Zone, animated: Boolean) { private fun updateMarkerPosition(zone: Zone, animated: Boolean) {
if (humanBodyWidth <= 0 || humanBodyHeight <= 0) return if (humanBodyWidth <= 0 || humanBodyHeight <= 0) return
@@ -198,9 +204,7 @@ class StrikePositionActivity : AppCompatActivity() {
val rawX = humanBodyWidth * zone.normalizedX val rawX = humanBodyWidth * zone.normalizedX
val rawY = humanBodyHeight * zone.normalizedY val rawY = humanBodyHeight * zone.normalizedY
// Clamp X so the marker never extends beyond the drawable edges. //用X夹住使标记永远不会超出可绘制的边缘。Y钳只有一个上界——在归一化Y=0处的HEAD可以一直达到顶端平移Y可以为负
// Y clamp only has an upper bound — HEAD at normalizedY=0 is allowed to go
// all the way to the top (translationY can be negative).
val clampedX = min(max(rawX, halfMarkerW), humanBodyWidth - halfMarkerW) val clampedX = min(max(rawX, halfMarkerW), humanBodyWidth - halfMarkerW)
val clampedY = min(rawY, humanBodyHeight - halfMarkerH) val clampedY = min(rawY, humanBodyHeight - halfMarkerH)

View File

@@ -1,20 +1,19 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.bean.DeleteDeviceUserRequest import com.ckkj.defense_device.bean.DeleteDeviceUserRequest
import com.example.defenseapplication.bean.ObtainInviterInformationRequest import com.ckkj.defense_device.bean.ObtainInviterInformationRequest
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest import com.ckkj.defense_device.bean.VerifyOptionPasswordRequest
import com.example.defenseapplication.personal.PasswordInputDialog import com.ckkj.defense_device.personal.PasswordInputDialog
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.DeviceUserUpdateEvent import com.ckkj.defense_device.utils.DeviceUserUpdateEvent
import com.example.defenseapplication.databinding.UserDetailsActivityBinding import com.ckkj.defense_device.databinding.UserDetailsActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.view.CustomDialogFragmentText import com.ckkj.defense_device.view.CustomDialogFragmentText
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -73,7 +72,7 @@ class UserDetailsActivity : AppCompatActivity() {
} }
} }
private fun updateUI(data: com.example.defenseapplication.bean.ObtainInviterInformationBean) { private fun updateUI(data: com.ckkj.defense_device.bean.ObtainInviterInformationBean) {
binding.tvContactName.text = data.nickName ?: "未知用户" binding.tvContactName.text = data.nickName ?: "未知用户"
binding.tvPhone.text = data.phonenumber ?: "" binding.tvPhone.text = data.phonenumber ?: ""
binding.tvIdCard.text = data.idCard ?: "" binding.tvIdCard.text = data.idCard ?: ""

View File

@@ -1,15 +1,15 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.bean.DeviceBean import com.ckkj.defense_device.bean.DeviceBean
import com.example.defenseapplication.databinding.VoiceSettingsActivityBinding import com.ckkj.defense_device.databinding.VoiceSettingsActivityBinding
import com.example.defenseapplication.utils.ApiService import com.ckkj.defense_device.utils.ApiService
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
@@ -6,10 +6,10 @@ import android.os.Bundle
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.widget.doAfterTextChanged import androidx.core.widget.doAfterTextChanged
import com.example.defenseapplication.bean.DeviceBean import com.ckkj.defense_device.bean.DeviceBean
import com.example.defenseapplication.databinding.WarningVoiceContentActivityBinding import com.ckkj.defense_device.databinding.WarningVoiceContentActivityBinding
import com.example.defenseapplication.utils.ApiService import com.ckkj.defense_device.utils.ApiService
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,16 +1,15 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.os.Bundle import android.os.Bundle
import android.widget.Toast import android.widget.Toast
import androidx.activity.enableEdgeToEdge import com.ckkj.defense_device.R
import com.example.defenseapplication.R import com.ckkj.defense_device.base.BaseActivity
import com.example.defenseapplication.base.BaseActivity import com.ckkj.defense_device.bean.DeviceBean
import com.example.defenseapplication.bean.DeviceBean import com.ckkj.defense_device.databinding.WaterGunSettingsActivityBinding
import com.example.defenseapplication.databinding.WaterGunSettingsActivityBinding import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.view.ContainerSelectDialog
import com.example.defenseapplication.view.ContainerSelectDialog import com.ckkj.defense_device.view.CustomDialogFragmentText
import com.example.defenseapplication.view.CustomDialogFragmentText
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.liveVideo package com.ckkj.defense_device.liveVideo
import android.Manifest import android.Manifest
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
@@ -18,13 +18,13 @@ import android.widget.PopupWindow
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat import androidx.core.app.ActivityCompat
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.WifiListAdapter import com.ckkj.defense_device.adapter.WifiListAdapter
import com.example.defenseapplication.bean.DeviceBean import com.ckkj.defense_device.bean.DeviceBean
import com.example.defenseapplication.databinding.DialogWifiListBinding import com.ckkj.defense_device.databinding.DialogWifiListBinding
import com.example.defenseapplication.databinding.WifiManagementActivityBinding import com.ckkj.defense_device.databinding.WifiManagementActivityBinding
import com.example.defenseapplication.utils.DeviceIdEvent import com.ckkj.defense_device.utils.DeviceIdEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,14 +1,9 @@
package com.example.defenseapplication.login package com.ckkj.defense_device.login
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat import com.ckkj.defense_device.databinding.FaceLoginActivityBinding
import androidx.core.view.WindowInsetsCompat
import com.example.defenseapplication.R
import com.example.defenseapplication.databinding.FaceLoginActivityBinding
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
//人脸识别 //人脸识别
class FaceLoginActivity : AppCompatActivity() { class FaceLoginActivity : AppCompatActivity() {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.login package com.ckkj.defense_device.login
import android.Manifest import android.Manifest
import android.content.pm.PackageManager import android.content.pm.PackageManager
@@ -13,8 +13,8 @@ import androidx.camera.core.Preview
import androidx.camera.lifecycle.ProcessCameraProvider import androidx.camera.lifecycle.ProcessCameraProvider
import androidx.core.app.ActivityCompat import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.example.defenseapplication.databinding.FaceVerificationActivityBinding import com.ckkj.defense_device.databinding.FaceVerificationActivityBinding
import com.example.defenseapplication.view.FaceAnalyzer import com.ckkj.defense_device.view.FaceAnalyzer
import com.google.mlkit.vision.face.FaceDetection import com.google.mlkit.vision.face.FaceDetection
import com.google.mlkit.vision.face.FaceDetectorOptions import com.google.mlkit.vision.face.FaceDetectorOptions
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.login package com.ckkj.defense_device.login
import android.graphics.Color import android.graphics.Color
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
@@ -7,9 +7,9 @@ import android.os.CountDownTimer
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import bean.ForgotRequest import bean.ForgotRequest
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.ForgetPasswordActivityBinding import com.ckkj.defense_device.databinding.ForgetPasswordActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.google.firebase.crashlytics.buildtools.reloc.org.apache.http.util.TextUtils import com.google.firebase.crashlytics.buildtools.reloc.org.apache.http.util.TextUtils
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.login package com.ckkj.defense_device.login
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
@@ -11,11 +11,11 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet import androidx.constraintlayout.widget.ConstraintSet
import bean.LoginRequest import bean.LoginRequest
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.ActivityLoginBinding import com.ckkj.defense_device.databinding.ActivityLoginBinding
import com.example.defenseapplication.home.HomeActivity import com.ckkj.defense_device.home.HomeActivity
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.utils.UserinfoUtil import com.ckkj.defense_device.utils.UserinfoUtil
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.login package com.ckkj.defense_device.login
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
@@ -8,9 +8,9 @@ import android.os.CountDownTimer
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import bean.RegisterRequest import bean.RegisterRequest
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.RegisterActivityBinding import com.ckkj.defense_device.databinding.RegisterActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,15 +1,11 @@
package com.example.defenseapplication.login package com.ckkj.defense_device.login
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.os.CountDownTimer import android.os.CountDownTimer
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat import com.ckkj.defense_device.databinding.RegisterSuccessActivityBinding
import androidx.core.view.WindowInsetsCompat import com.ckkj.defense_device.home.HomeActivity
import com.example.defenseapplication.R
import com.example.defenseapplication.databinding.RegisterSuccessActivityBinding
import com.example.defenseapplication.home.HomeActivity
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
//注册成功界面 //注册成功界面
class RegisterSuccessActivity : AppCompatActivity() { class RegisterSuccessActivity : AppCompatActivity() {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.model package com.ckkj.defense_device.model
data class FamilyItem( data class FamilyItem(
val id: String, val id: String,

View File

@@ -1,12 +1,12 @@
package com.example.defenseapplication.personal package com.ckkj.defense_device.personal
import android.os.Bundle import android.os.Bundle
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.bean.UpdatePassword import com.ckkj.defense_device.bean.UpdatePassword
import com.example.defenseapplication.databinding.ChangePasswordActivityBinding import com.ckkj.defense_device.databinding.ChangePasswordActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,10 +1,10 @@
package com.example.defenseapplication.personal package com.ckkj.defense_device.personal
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.databinding.FaceManagementActivityBinding import com.ckkj.defense_device.databinding.FaceManagementActivityBinding
import com.example.defenseapplication.login.FaceLoginActivity import com.ckkj.defense_device.login.FaceLoginActivity
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
//人脸管理页面 //人脸管理页面

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.personal package com.ckkj.defense_device.personal
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager import android.content.pm.PackageManager
@@ -13,11 +13,11 @@ import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest import com.ckkj.defense_device.bean.VerifyOptionPasswordRequest
import com.example.defenseapplication.databinding.DialogExpireTimeBinding import com.ckkj.defense_device.databinding.DialogExpireTimeBinding
import com.example.defenseapplication.databinding.InvitationCodeActivityBinding import com.ckkj.defense_device.databinding.InvitationCodeActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.google.zxing.BarcodeFormat import com.google.zxing.BarcodeFormat
import com.google.zxing.EncodeHintType import com.google.zxing.EncodeHintType
import com.google.zxing.qrcode.QRCodeWriter import com.google.zxing.qrcode.QRCodeWriter

View File

@@ -1,14 +1,9 @@
package com.example.defenseapplication.personal package com.ckkj.defense_device.personal
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat import com.ckkj.defense_device.databinding.LoginPasswordActivityBinding
import androidx.core.view.WindowInsetsCompat
import com.example.defenseapplication.R
import com.example.defenseapplication.databinding.LoginPasswordActivityBinding
import com.example.defenseapplication.databinding.PasswordManagementActivityBinding
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
//登录密码 //登录密码

View File

@@ -1,16 +1,16 @@
package com.example.defenseapplication.personal package com.ckkj.defense_device.personal
import android.os.Bundle import android.os.Bundle
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.bean.UpdateUserInfo import com.ckkj.defense_device.bean.UpdateUserInfo
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest import com.ckkj.defense_device.bean.VerifyOptionPasswordRequest
import com.example.defenseapplication.databinding.OperationPasswordActivityBinding import com.ckkj.defense_device.databinding.OperationPasswordActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.view.CustomDialogFragment import com.ckkj.defense_device.view.CustomDialogFragment
import com.example.defenseapplication.view.LoadingDialog import com.ckkj.defense_device.view.LoadingDialog
import com.example.defenseapplication.view.showDefenseDialog import com.ckkj.defense_device.view.showDefenseDialog
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,9 +1,9 @@
package com.example.defenseapplication.personal package com.ckkj.defense_device.personal
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.example.defenseapplication.databinding.PasswordManagementActivityBinding import com.ckkj.defense_device.databinding.PasswordManagementActivityBinding
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
//密码管理 //密码管理
class PasswordManagementActivity : AppCompatActivity() { class PasswordManagementActivity : AppCompatActivity() {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.personal package com.ckkj.defense_device.personal
import android.Manifest import android.Manifest
import android.content.ContentResolver import android.content.ContentResolver
@@ -11,24 +11,21 @@ import android.os.Environment
import android.provider.MediaStore import android.provider.MediaStore
import android.util.Log import android.util.Log
import android.widget.Toast import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider import androidx.core.content.FileProvider
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.RequestOptions
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.bean.UpdateUserInfo import com.ckkj.defense_device.bean.UpdateUserInfo
import com.example.defenseapplication.bean.UserInfoBean import com.ckkj.defense_device.bean.UserInfoBean
import com.example.defenseapplication.databinding.PersonalProfileActivityBinding import com.ckkj.defense_device.databinding.PersonalProfileActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.view.AvatarSelectDialog import com.ckkj.defense_device.view.AvatarSelectDialog
import com.example.defenseapplication.view.CustomDialogFragmentText import com.ckkj.defense_device.view.CustomDialogFragmentText
import com.example.defenseapplication.view.LoadingDialog import com.ckkj.defense_device.view.LoadingDialog
import com.example.defenseapplication.view.PhoneModifyDialogFragment import com.ckkj.defense_device.view.PhoneModifyDialogFragment
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,13 +1,13 @@
package com.example.defenseapplication.personal package com.ckkj.defense_device.personal
import android.os.Bundle import android.os.Bundle
import android.os.CountDownTimer import android.os.CountDownTimer
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import bean.ForgotRequest import bean.ForgotRequest
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.RetrievePasswordActivityBinding import com.ckkj.defense_device.databinding.RetrievePasswordActivityBinding
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
import android.app.Activity import android.app.Activity
import java.lang.ref.WeakReference import java.lang.ref.WeakReference

View File

@@ -1,8 +1,8 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.util.Log import android.util.Log
import com.example.defenseapplication.bean.BaseInfo import com.ckkj.defense_device.bean.BaseInfo
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.JsonParser import com.google.gson.JsonParser
import okhttp3.Interceptor import okhttp3.Interceptor

View File

@@ -1,32 +1,32 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
import android.R
import bean.ForgotRequest import bean.ForgotRequest
import com.example.defenseapplication.bean.DeviceBean import com.ckkj.defense_device.bean.DeviceBean
import com.example.defenseapplication.bean.DeviceUserBean import com.ckkj.defense_device.bean.DeviceUserBean
import com.example.defenseapplication.bean.FamilyBean import com.ckkj.defense_device.bean.FamilyBean
import com.example.defenseapplication.bean.GetCodeBean import com.ckkj.defense_device.bean.GetCodeBean
import bean.LoginBean import bean.LoginBean
import bean.LoginRequest import bean.LoginRequest
import bean.RegisterRequest import bean.RegisterRequest
import com.example.defenseapplication.bean.AddDeviceBean import com.ckkj.defense_device.bean.AddDeviceBean
import com.example.defenseapplication.bean.AddDeviceUserRequest import com.ckkj.defense_device.bean.AddDeviceUserRequest
import com.example.defenseapplication.bean.DeleteBean import com.ckkj.defense_device.bean.DeleteBean
import com.example.defenseapplication.bean.DeleteDeviceUserRequest import com.ckkj.defense_device.bean.DeleteDeviceUserRequest
import com.example.defenseapplication.bean.DeviceAlarmResponse import com.ckkj.defense_device.bean.DeviceAlarmResponse
import com.example.defenseapplication.bean.FamilyMembersBean import com.ckkj.defense_device.bean.FamilyMembersBean
import com.example.defenseapplication.bean.MessageBean import com.ckkj.defense_device.bean.MessageBean
import com.example.defenseapplication.bean.MessageListResponse import com.ckkj.defense_device.bean.MessageListResponse
import com.example.defenseapplication.bean.ObtainInviterInformationBean import com.ckkj.defense_device.bean.ObtainInviterInformationBean
import com.example.defenseapplication.bean.ObtainInviterInformationRequest import com.ckkj.defense_device.bean.ObtainInviterInformationRequest
import com.example.defenseapplication.bean.SwitchFamilyRequest import com.ckkj.defense_device.bean.SwitchFamilyRequest
import com.example.defenseapplication.bean.UpdatePassword import com.ckkj.defense_device.bean.UpdatePassword
import com.example.defenseapplication.bean.UpdateUserInfo import com.ckkj.defense_device.bean.UpdateUserInfo
import com.example.defenseapplication.bean.UploadResponse import com.ckkj.defense_device.bean.UploadResponse
import com.example.defenseapplication.bean.UserInfoBean import com.ckkj.defense_device.bean.UserInfoBean
import com.example.defenseapplication.bean.VerifyOptionPasswordRequest import com.ckkj.defense_device.bean.VerifyOptionPasswordRequest
import okhttp3.MultipartBody import okhttp3.MultipartBody
import retrofit2.http.Body import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET import retrofit2.http.GET
import retrofit2.http.Multipart import retrofit2.http.Multipart
import retrofit2.http.POST import retrofit2.http.POST
@@ -236,8 +236,15 @@ interface ApiService {
/** /**
* 查看告警消息 * 查看告警消息
*/ */
//@GET("/app/appMessageInfo/{id}") @GET("/app/appMessageInfo/{id}")
//suspend fun getMessageInfo(@retrofit2.http.Path("id") id: String): GetCodeBean<MessageBean> suspend fun getMessageInfo(@retrofit2.http.Path("id") id: String): GetCodeBean<MessageBean>
/**
* 删除告警消息
*/
@DELETE("/app/deleteMessage/{id}")
suspend fun deleteMessage(@retrofit2.http.Path("id") id: String): GetCodeBean<Any>
/** /**

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
object DeviceIdEvent { object DeviceIdEvent {
private val listeners = mutableListOf<DeviceIdListener>() private val listeners = mutableListOf<DeviceIdListener>()

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
object DeviceUpdateEvent { object DeviceUpdateEvent {
private val listeners = mutableListOf<DeviceUpdateListener>() private val listeners = mutableListOf<DeviceUpdateListener>()

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
object DeviceUserUpdateEvent { object DeviceUserUpdateEvent {
private val listeners = mutableListOf<DeviceUserUpdateListener>() private val listeners = mutableListOf<DeviceUserUpdateListener>()

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
object FamilySwitchEvent { object FamilySwitchEvent {
private val listeners = mutableListOf<FamilySwitchListener>() private val listeners = mutableListOf<FamilySwitchListener>()

View File

@@ -1,6 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
import android.content.Context
/** /**
* HTTP 请求头的语言值管理统一由 LanguageUtil 提供 * HTTP 请求头的语言值管理统一由 LanguageUtil 提供

View File

@@ -1,8 +1,6 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
import android.content.Context import android.content.Context
import android.content.SharedPreferences
import android.content.res.Configuration
import android.os.Build import android.os.Build
import android.os.LocaleList import android.os.LocaleList
import java.util.Locale import java.util.Locale

View File

@@ -1,7 +1,7 @@
package com.smart.data.repository package com.smart.data.repository
import com.example.defenseapplication.utils.ApiService import com.ckkj.defense_device.utils.ApiService
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
class MainRepository(val apiService: ApiService = RetrofitNetwork.getNetworkService()) { class MainRepository(val apiService: ApiService = RetrofitNetwork.getNetworkService()) {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
object MessageStatusManager { object MessageStatusManager {
private var unreadCount = 0 private var unreadCount = 0

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
import com.google.gson.Gson import com.google.gson.Gson
import okhttp3.OkHttpClient import okhttp3.OkHttpClient

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.utils package com.ckkj.defense_device.utils
import bean.LoginBean import bean.LoginBean
import com.blankj.utilcode.util.SPUtils import com.blankj.utilcode.util.SPUtils

View File

@@ -1,12 +1,12 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import android.view.Gravity import android.view.Gravity
import android.view.WindowManager import android.view.WindowManager
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.DialogAutoModeNoticeBinding import com.ckkj.defense_device.databinding.DialogAutoModeNoticeBinding
import java.util.Calendar import java.util.Calendar
class AutoModeNoticeDialog(context: Context) : Dialog(context) { class AutoModeNoticeDialog(context: Context) : Dialog(context) {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
@@ -6,10 +6,8 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager import android.view.WindowManager
import com.example.defenseapplication.R import com.ckkj.defense_device.databinding.DialogAvatarSelectBinding
import com.example.defenseapplication.databinding.DialogAvatarSelectBinding
class AvatarSelectDialog(context: Context) { class AvatarSelectDialog(context: Context) {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
@@ -6,10 +6,9 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager import android.view.WindowManager
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.DialogContainerSelectBinding import com.ckkj.defense_device.databinding.DialogContainerSelectBinding
class ContainerSelectDialog(context: Context) { class ContainerSelectDialog(context: Context) {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.app.Dialog import android.app.Dialog
import android.content.DialogInterface import android.content.DialogInterface
@@ -9,8 +9,8 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.WindowManager import android.view.WindowManager
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.databinding.DialogCustomBinding import com.ckkj.defense_device.databinding.DialogCustomBinding
class CustomDialogFragmentText : DialogFragment() { class CustomDialogFragmentText : DialogFragment() {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.app.Dialog import android.app.Dialog
import android.os.Bundle import android.os.Bundle
@@ -14,7 +14,7 @@ import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import com.example.defenseapplication.R import com.ckkj.defense_device.R
class CustomDialogFragment : androidx.fragment.app.DialogFragment() { class CustomDialogFragment : androidx.fragment.app.DialogFragment() {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.content.Context import android.content.Context
import android.graphics.* import android.graphics.*

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
@@ -10,14 +10,14 @@ import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.adapter.FamilySwitchAdapter import com.ckkj.defense_device.adapter.FamilySwitchAdapter
import com.example.defenseapplication.bean.FamilyBean import com.ckkj.defense_device.bean.FamilyBean
import com.example.defenseapplication.bean.SwitchFamilyRequest import com.ckkj.defense_device.bean.SwitchFamilyRequest
import com.example.defenseapplication.model.FamilyItem import com.ckkj.defense_device.model.FamilyItem
import com.example.defenseapplication.utils.FamilySwitchEvent import com.ckkj.defense_device.utils.FamilySwitchEvent
import com.example.defenseapplication.utils.RetrofitNetwork import com.ckkj.defense_device.utils.RetrofitNetwork
import com.example.defenseapplication.utils.UserinfoUtil import com.ckkj.defense_device.utils.UserinfoUtil
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
@@ -8,9 +8,9 @@ import android.view.Window
import android.view.WindowManager import android.view.WindowManager
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import com.example.defenseapplication.R import com.ckkj.defense_device.R
import com.example.defenseapplication.utils.AppLanguage import com.ckkj.defense_device.utils.AppLanguage
import com.example.defenseapplication.utils.LanguageUtil import com.ckkj.defense_device.utils.LanguageUtil
/** /**
* 语言选择对话框 * 语言选择对话框

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
@@ -7,7 +7,7 @@ import android.graphics.drawable.ColorDrawable
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.WindowManager import android.view.WindowManager
import com.example.defenseapplication.databinding.DialogLoadingBinding import com.ckkj.defense_device.databinding.DialogLoadingBinding
class LoadingDialog(context: Context) { class LoadingDialog(context: Context) {

View File

@@ -1,4 +1,4 @@
package com.example.defenseapplication.view package com.ckkj.defense_device.view
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet

View File

@@ -0,0 +1,85 @@
package com.ckkj.defense_device.view
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import com.ckkj.defense_device.R
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer
class MyGSYVideoPlayerLive @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : StandardGSYVideoPlayer(context, attrs) {
override fun init(context: Context) {
super.init(context)
startButton.visibility = View.GONE
}
override fun updateStartImage() {
startButton.visibility = View.GONE
}
override fun startWindowFullscreen(
context: Context?,
actionBar: Boolean,
statusBar: Boolean
): GSYBaseVideoPlayer {
val player = super.startWindowFullscreen(
context,
actionBar,
statusBar
) as MyGSYVideoPlayerLive
// 隐藏GSY自带UI
//player.backButton.visibility = View.GONE
player.titleTextView.visibility = View.GONE
player.startButton.visibility = View.GONE
player.fullscreenButton.visibility = View.GONE
player.findViewById<View>(
com.shuyu.gsyvideoplayer.R.id.current
)?.visibility = View.GONE
player.findViewById<View>(
com.shuyu.gsyvideoplayer.R.id.total
)?.visibility = View.GONE
player.findViewById<View>(
com.shuyu.gsyvideoplayer.R.id.progress
)?.visibility = View.GONE
player.findViewById<View>(
com.shuyu.gsyvideoplayer.R.id.layout_bottom
)?.visibility = View.GONE
player.findViewById<View>(
com.shuyu.gsyvideoplayer.R.id.layout_top
)?.visibility = View.GONE
// 加载你的全屏覆盖层
val overlay = LayoutInflater.from(context)
.inflate(
R.layout.layout_my_player,
player,
false
)
player.addView(overlay)
// 找按钮
overlay.findViewById<View>(R.id.btnAi)
?.setOnClickListener {
}
overlay.findViewById<View>(R.id.btnCapture)
?.setOnClickListener {
}
return player
}
}

Some files were not shown because too many files have changed in this diff Show More