设置
This commit is contained in:
@@ -44,9 +44,9 @@ dependencies {
|
||||
implementation(libs.material)
|
||||
implementation(libs.androidx.activity)
|
||||
implementation(libs.androidx.constraintlayout)
|
||||
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
||||
implementation(libs.firebase.crashlytics.buildtools)
|
||||
implementation(libs.androidx.ui.test)
|
||||
implementation(libs.androidx.recyclerview)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
@@ -86,4 +86,6 @@ dependencies {
|
||||
implementation("com.geyifeng.immersionbar:immersionbar:3.2.2")
|
||||
// kotlin扩展(可选)
|
||||
implementation("com.geyifeng.immersionbar:immersionbar-ktx:3.2.2")
|
||||
implementation("com.wdullaer:materialdatetimepicker:4.2.3") // 经典稳定
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.example.defenseapplication.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.defenseapplication.databinding.ItemAlarmLogBinding
|
||||
|
||||
class AlarmLogAdapter(private val items: List<String>) : RecyclerView.Adapter<AlarmLogAdapter.ViewHolder>() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val binding = ItemAlarmLogBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
parent,
|
||||
false
|
||||
)
|
||||
return ViewHolder(binding)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = items.size
|
||||
|
||||
class ViewHolder(private val binding: ItemAlarmLogBinding) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(item: String) {
|
||||
val parts = item.split(" - ")
|
||||
binding.tvTitle.text = parts.firstOrNull()
|
||||
binding.tvTime.text = parts.getOrNull(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,21 @@
|
||||
package com.example.defenseapplication.liveVideo
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.os.LocaleList
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.example.defenseapplication.R
|
||||
import com.example.defenseapplication.adapter.AlarmLogAdapter
|
||||
import com.example.defenseapplication.databinding.AlarmLogActivityBinding
|
||||
import com.gyf.immersionbar.ImmersionBar
|
||||
import com.google.android.material.datepicker.MaterialDatePicker
|
||||
import java.util.*
|
||||
|
||||
class AlarmLogActivity : AppCompatActivity() {
|
||||
private lateinit var binding: AlarmLogActivityBinding
|
||||
private lateinit var calendar: Calendar
|
||||
private var adapter: AlarmLogAdapter? = null
|
||||
private val alarmList = mutableListOf<String>()
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -18,12 +25,57 @@ class AlarmLogActivity : AppCompatActivity() {
|
||||
.statusBarDarkFont(true)
|
||||
.titleBar(binding.topBar)
|
||||
.init()
|
||||
|
||||
calendar = Calendar.getInstance()
|
||||
updateDateDisplay()
|
||||
initRecyclerView()
|
||||
loadAlarmList()
|
||||
initListener()
|
||||
}
|
||||
|
||||
private fun initRecyclerView() {
|
||||
adapter = AlarmLogAdapter(alarmList)
|
||||
binding.alarmListRecyclerView.layoutManager = LinearLayoutManager(this)
|
||||
binding.alarmListRecyclerView.adapter = adapter
|
||||
}
|
||||
|
||||
private fun loadAlarmList() {
|
||||
alarmList.clear()
|
||||
alarmList.add("入侵告警 - 10:30")
|
||||
alarmList.add("入侵告警 - 09:15")
|
||||
alarmList.add("入侵告警 - 08:45")
|
||||
alarmList.add("入侵告警 - 07:20")
|
||||
alarmList.add("入侵告警 - 06:50")
|
||||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
private fun updateDateDisplay() {
|
||||
val month = calendar.get(Calendar.MONTH) + 1
|
||||
val day = calendar.get(Calendar.DAY_OF_MONTH)
|
||||
binding.tvDate.text = "${month}月${day}日"
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
binding.btnBack.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
binding.expandImg.setOnClickListener {
|
||||
showDatePicker()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDatePicker() {
|
||||
val datePicker = android.app.DatePickerDialog(
|
||||
this,
|
||||
{ _, year, month, dayOfMonth ->
|
||||
calendar.set(year, month, dayOfMonth)
|
||||
updateDateDisplay()
|
||||
loadAlarmList()
|
||||
},
|
||||
calendar.get(Calendar.YEAR),
|
||||
calendar.get(Calendar.MONTH),
|
||||
calendar.get(Calendar.DAY_OF_MONTH)
|
||||
)
|
||||
datePicker.show()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ class LiveVideoActivity : AppCompatActivity(), SurfaceHolder.Callback {
|
||||
|
||||
if (isVoiceEnabled) {
|
||||
mediaPlayer?.setVolume(1.0f, 1.0f)
|
||||
binding.ivVoice.setImageResource(com.example.defenseapplication.R.drawable.voice_open)
|
||||
binding.ivVoice.setImageResource(com.example.defenseapplication.R.drawable.voice_on_open)
|
||||
Toast.makeText(this, "声音已开启", Toast.LENGTH_SHORT).show()
|
||||
} else {
|
||||
mediaPlayer?.setVolume(0.0f, 0.0f)
|
||||
@@ -335,14 +335,14 @@ class LiveVideoActivity : AppCompatActivity(), SurfaceHolder.Callback {
|
||||
binding.consoleBar.visibility = View.VISIBLE
|
||||
|
||||
// 麦克风切换成开启状态
|
||||
binding.ivVoice.setImageResource(com.example.defenseapplication.R.drawable.voice_open)
|
||||
binding.ivVoice.setImageResource(com.example.defenseapplication.R.drawable.voice_on_open)
|
||||
isVoiceEnabled = true
|
||||
|
||||
// 启动语音录制
|
||||
startVoiceRecording()
|
||||
|
||||
// 启动麦克风脉冲动画
|
||||
startMicPulseAnimation()
|
||||
//startMicPulseAnimation()
|
||||
|
||||
Toast.makeText(this, "开始控制模式", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
@@ -367,22 +367,22 @@ class LiveVideoActivity : AppCompatActivity(), SurfaceHolder.Callback {
|
||||
|
||||
Toast.makeText(this, "停止控制模式", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
private fun startMicPulseAnimation() {
|
||||
micPulseAnimation = ScaleAnimation(
|
||||
1.0f, 1.3f,
|
||||
1.0f, 1.3f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f
|
||||
).apply {
|
||||
duration = 500
|
||||
repeatCount = Animation.INFINITE
|
||||
repeatMode = Animation.REVERSE
|
||||
interpolator = LinearInterpolator()
|
||||
}
|
||||
binding.ivVoice.startAnimation(micPulseAnimation)
|
||||
}
|
||||
|
||||
|
||||
// private fun startMicPulseAnimation() {
|
||||
// micPulseAnimation = ScaleAnimation(
|
||||
// 1.0f, 1.3f,
|
||||
// 1.0f, 1.3f,
|
||||
// Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
// Animation.RELATIVE_TO_SELF, 0.5f
|
||||
// ).apply {
|
||||
// duration = 500
|
||||
// repeatCount = Animation.INFINITE
|
||||
// repeatMode = Animation.REVERSE
|
||||
// interpolator = LinearInterpolator()
|
||||
// }
|
||||
// binding.ivVoice.startAnimation(micPulseAnimation)
|
||||
// }
|
||||
|
||||
private fun stopMicPulseAnimation() {
|
||||
micPulseAnimation?.let {
|
||||
binding.ivVoice.clearAnimation()
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.example.defenseapplication.liveVideo
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.example.defenseapplication.databinding.SettingsActivityBinding
|
||||
import com.example.defenseapplication.view.CustomDialogFragmentText
|
||||
import com.example.defenseapplication.view.RecognitionModeDialog
|
||||
import com.gyf.immersionbar.ImmersionBar
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
@@ -21,5 +23,37 @@ class SettingsActivity : AppCompatActivity() {
|
||||
binding.ivBack.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
binding.itemRecognitionMode.setOnClickListener {
|
||||
val dialog = RecognitionModeDialog(this)
|
||||
dialog.setOnConfirmListener { mode ->
|
||||
binding.tvRecognitionMode.text = mode
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
binding.itemDeviceName.setOnClickListener {
|
||||
val dialog = CustomDialogFragmentText()
|
||||
.setTitle("设备名称")
|
||||
.setInputHint("请输入设备名称")
|
||||
.setInputText(binding.tvDeviceName.text.toString())
|
||||
dialog.setOnConfirmListener { name ->
|
||||
binding.tvDeviceName.text = name
|
||||
}
|
||||
dialog.show(supportFragmentManager, "CustomDialogFragment")
|
||||
}
|
||||
|
||||
binding.itemUnbindDevice.setOnClickListener {
|
||||
val dialog = CustomDialogFragmentText()
|
||||
.setTitle("提示")
|
||||
.setMessage("确定解除该设备的绑定?")
|
||||
.setNegativeText("取消")
|
||||
.setPositiveText("确定")
|
||||
.setShowInput(false)
|
||||
dialog.setOnConfirmListener {
|
||||
finish()
|
||||
}
|
||||
dialog.show(supportFragmentManager, "CustomDialogFragment")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.example.defenseapplication.view
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.example.defenseapplication.R
|
||||
import com.example.defenseapplication.databinding.DialogCustomBinding
|
||||
|
||||
class CustomDialogFragmentText : DialogFragment() {
|
||||
|
||||
private lateinit var binding: DialogCustomBinding
|
||||
private var title: String = ""
|
||||
private var message: String = ""
|
||||
private var inputHint: String = ""
|
||||
private var inputText: String = ""
|
||||
private var negativeText: String = "取消"
|
||||
private var positiveText: String = "确定"
|
||||
private var showInput: Boolean = true
|
||||
private var onConfirmListener: ((String) -> Unit)? = null
|
||||
|
||||
fun setTitle(title: String): CustomDialogFragmentText {
|
||||
this.title = title
|
||||
return this
|
||||
}
|
||||
|
||||
fun setMessage(message: String): CustomDialogFragmentText {
|
||||
this.message = message
|
||||
return this
|
||||
}
|
||||
|
||||
fun setInputHint(hint: String): CustomDialogFragmentText {
|
||||
this.inputHint = hint
|
||||
return this
|
||||
}
|
||||
|
||||
fun setInputText(text: String): CustomDialogFragmentText {
|
||||
this.inputText = text
|
||||
return this
|
||||
}
|
||||
|
||||
fun setNegativeText(text: String): CustomDialogFragmentText {
|
||||
this.negativeText = text
|
||||
return this
|
||||
}
|
||||
|
||||
fun setPositiveText(text: String): CustomDialogFragmentText {
|
||||
this.positiveText = text
|
||||
return this
|
||||
}
|
||||
|
||||
fun setShowInput(show: Boolean): CustomDialogFragmentText {
|
||||
this.showInput = show
|
||||
return this
|
||||
}
|
||||
|
||||
fun setOnConfirmListener(listener: (String) -> Unit) {
|
||||
this.onConfirmListener = listener
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = super.onCreateDialog(savedInstanceState)
|
||||
dialog.window?.let {
|
||||
val params = it.attributes
|
||||
params.gravity = Gravity.CENTER
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
it.attributes = params
|
||||
it.setBackgroundDrawableResource(R.drawable.round_bg)
|
||||
}
|
||||
return dialog
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
binding = DialogCustomBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
binding.tvTitle.text = title
|
||||
binding.tvMessage.text = message
|
||||
binding.etInput.hint = inputHint
|
||||
binding.etInput.setText(inputText)
|
||||
binding.btnNegative.text = negativeText
|
||||
binding.btnPositive.text = positiveText
|
||||
|
||||
binding.etInput.visibility = if (showInput) View.VISIBLE else View.GONE
|
||||
|
||||
binding.btnNegative.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.btnPositive.setOnClickListener {
|
||||
val inputText = binding.etInput.text.toString()
|
||||
onConfirmListener?.invoke(inputText)
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
super.onDismiss(dialog)
|
||||
onConfirmListener = null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.example.defenseapplication.view
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import android.widget.LinearLayout
|
||||
import com.example.defenseapplication.R
|
||||
import com.example.defenseapplication.databinding.DialogRecognitionModeBinding
|
||||
|
||||
class RecognitionModeDialog(context: Context) : Dialog(context) {
|
||||
|
||||
private lateinit var binding: DialogRecognitionModeBinding
|
||||
private var selectedMode: String = ""
|
||||
private var onConfirmListener: ((String) -> Unit)? = null
|
||||
|
||||
fun setOnConfirmListener(listener: (String) -> Unit) {
|
||||
this.onConfirmListener = listener
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = DialogRecognitionModeBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
val window = window
|
||||
window?.let {
|
||||
val params = it.attributes
|
||||
params.gravity = Gravity.BOTTOM
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
it.attributes = params
|
||||
it.setBackgroundDrawableResource(R.drawable.round_bg)
|
||||
}
|
||||
|
||||
binding.tvCancel.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.itemBluetooth.setOnClickListener {
|
||||
selectedMode = "蓝牙识别"
|
||||
updateSelectedBackground(binding.itemBluetooth)
|
||||
}
|
||||
|
||||
binding.itemBluetoothFace.setOnClickListener {
|
||||
selectedMode = "蓝牙+人脸识别"
|
||||
updateSelectedBackground(binding.itemBluetoothFace)
|
||||
}
|
||||
|
||||
binding.tvConfirm.setOnClickListener {
|
||||
if (selectedMode.isNotEmpty()) {
|
||||
onConfirmListener?.invoke(selectedMode)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateSelectedBackground(selectedItem: LinearLayout) {
|
||||
binding.itemBluetooth.setBackgroundColor(
|
||||
if (selectedItem == binding.itemBluetooth) {
|
||||
context.resources.getColor(R.color.bg_gray)
|
||||
} else {
|
||||
context.resources.getColor(R.color.white)
|
||||
}
|
||||
)
|
||||
binding.itemBluetoothFace.setBackgroundColor(
|
||||
if (selectedItem == binding.itemBluetoothFace) {
|
||||
context.resources.getColor(R.color.bg_gray)
|
||||
} else {
|
||||
context.resources.getColor(R.color.white)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
12
app/src/main/res/anim/mic_pulse.xml
Normal file
12
app/src/main/res/anim/mic_pulse.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<scale xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="1000"
|
||||
android:fromXScale="1.0"
|
||||
android:fromYScale="1.0"
|
||||
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:repeatCount="infinite"
|
||||
android:repeatMode="reverse"
|
||||
android:toXScale="1.3"
|
||||
android:toYScale="1.3" />
|
||||
9
app/src/main/res/drawable/bg_bottom_sheet_rounded.xml
Normal file
9
app/src/main/res/drawable/bg_bottom_sheet_rounded.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners
|
||||
android:topLeftRadius="24dp"
|
||||
android:topRightRadius="24dp" />
|
||||
<padding
|
||||
android:bottom="8dp" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/setting_gray_bg.xml
Normal file
6
app/src/main/res/drawable/setting_gray_bg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/setting_gray"/>
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
BIN
app/src/main/res/drawable/voice_on_open.gif
Normal file
BIN
app/src/main/res/drawable/voice_on_open.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -3,10 +3,9 @@
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F5F6F6"
|
||||
android:background="#F9F9F9"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 顶部导航栏 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/topBar"
|
||||
android:layout_width="match_parent"
|
||||
@@ -38,120 +37,119 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 视频播放区域 -->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="280dp"-->
|
||||
<!-- android:background="#000000">-->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="280dp"
|
||||
android:background="#000000">
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:scaleType="centerCrop"-->
|
||||
<!-- android:src="@drawable/img" />-->
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/img" />
|
||||
|
||||
<!-- <!– 功能按钮 –>-->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:orientation="vertical">-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="top|end"-->
|
||||
<!-- android:padding="16dp">-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="top|end"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="vertical">-->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="40dp"-->
|
||||
<!-- android:layout_height="40dp"-->
|
||||
<!-- android:layout_marginBottom="8dp"-->
|
||||
<!-- android:src="@drawable/download" />-->
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:src="@drawable/download" />
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="40dp"-->
|
||||
<!-- android:layout_height="40dp"-->
|
||||
<!-- android:layout_marginBottom="8dp" />-->
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:src="@drawable/mute"/>
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="40dp"-->
|
||||
<!-- android:layout_height="40dp"-->
|
||||
<!-- android:layout_marginBottom="8dp"-->
|
||||
<!-- android:src="@drawable/delete" />-->
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:src="@drawable/delete" />
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="40dp"-->
|
||||
<!-- android:layout_height="40dp" />-->
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/mute"/>
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="bottom|end"-->
|
||||
<!-- android:padding="16dp">-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="bottom|end"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="40dp"-->
|
||||
<!-- android:layout_height="40dp"-->
|
||||
<!-- android:src="@drawable/full_screen" />-->
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/full_screen" />
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <!– 播放控制栏 –>-->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:background="#000000"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:padding="8dp">-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="#000000"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/ivPlay"-->
|
||||
<!-- android:layout_width="32dp"-->
|
||||
<!-- android:layout_height="32dp"-->
|
||||
<!-- android:src="@drawable/play" />-->
|
||||
<ImageView
|
||||
android:id="@+id/ivPlay"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/start" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="8dp"-->
|
||||
<!-- android:text="01:05"-->
|
||||
<!-- android:textColor="#FFFFFF"-->
|
||||
<!-- android:textSize="14sp" />-->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:text="01:05"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- <SeekBar-->
|
||||
<!-- android:id="@+id/seekBar"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:layout_marginLeft="8dp"-->
|
||||
<!-- android:layout_marginRight="8dp"-->
|
||||
<!-- android:progress="20" />-->
|
||||
<SeekBar
|
||||
android:id="@+id/seekBar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:progress="20" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="05:05"-->
|
||||
<!-- android:textColor="#FFFFFF"-->
|
||||
<!-- android:textSize="14sp" />-->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="05:05"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- </LinearLayout-->>-->
|
||||
</FrameLayout>
|
||||
|
||||
<!-- 日期选择区域 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
@@ -166,6 +164,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="10月11日"
|
||||
@@ -173,192 +172,20 @@
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/expandImg"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp" />
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/expand" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 告警列表 -->
|
||||
<LinearLayout
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/alarmListRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
<!-- 告警项1 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:background="#F5F6F6"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="入侵告警"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="10:35"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="#000000"
|
||||
android:padding="2dp"
|
||||
android:text="60s"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 告警项2 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="#F5F6F6"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="入侵告警"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="09:35"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="#000000"
|
||||
android:padding="2dp"
|
||||
android:text="60s"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 告警项3 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="#F5F6F6"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="入侵告警"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="08:35"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/img" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="#000000"
|
||||
android:padding="2dp"
|
||||
android:text="60s"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -39,16 +39,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:background="@drawable/textinput_white_bg"
|
||||
android:background="@drawable/setting_gray_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入"
|
||||
android:inputType="numberDecimal"
|
||||
android:inputType="text"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone" />
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
@@ -70,7 +69,7 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
@@ -86,7 +85,7 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/green"
|
||||
android:textSize="18sp"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
93
app/src/main/res/layout/dialog_recognition_mode.xml
Normal file
93
app/src/main/res/layout/dialog_recognition_mode.xml
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/round_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="取消"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="确认"
|
||||
android:textColor="@color/green"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/dialog_view" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxHeight="300dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/item_bluetooth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="蓝牙识别"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/dialog_view" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/item_bluetooth_face"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="蓝牙+人脸识别"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dp"
|
||||
android:background="@color/face" />
|
||||
</LinearLayout>
|
||||
39
app/src/main/res/layout/item_alarm_log.xml
Normal file
39
app/src/main/res/layout/item_alarm_log.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#333333" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#999999" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/img"
|
||||
android:id="@+id/iv_thumbnail"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="50dp"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -131,6 +131,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRecognitionMode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="蓝牙+人脸"
|
||||
@@ -227,6 +228,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDeviceName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="智能防御机A1"
|
||||
|
||||
@@ -14,5 +14,7 @@
|
||||
<color name="dialog_view">#E7E7E7 </color>
|
||||
<color name="message_bg">#F9F9F9 </color>
|
||||
<color name="blue">#03A9F4</color>
|
||||
<color name="bg_gray">#F7F7F7</color>
|
||||
<color name="setting_gray">#F3F3F3</color>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user