[charter]
[滴声音修改、UI修改、魔方(och)迁移]
This commit is contained in:
yangyakun
2023-10-10 18:03:34 +08:00
parent 1c87683ec2
commit 52aa46cda8
36 changed files with 61 additions and 61 deletions

View File

@@ -0,0 +1,59 @@
package com.magic.mogo.och.charter.view
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.magic.mogo.och.charter.R
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.och.common.module.manager.DriverMoFangFunctionManager
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorManager
import com.mogo.och.common.module.utils.SoundPoolHelper
import kotlinx.android.synthetic.main.driver_mofang_function_view.view.*
/**
* @author: wangmingjun
* @date: 2023/4/20
*/
class DriverMoFangFunctionView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : ConstraintLayout(context, attrs) {
init {
LayoutInflater.from(context).inflate(R.layout.driver_mofang_function_view,this,true)
initClickEvent()
}
private fun initClickEvent() {
moderateIv.onClick {
DriverMoFangFunctionManager.driverMoFangFunctionManager.sendAcc(true,-1.0)
}
brakeStopIv.onClick {
DriverMoFangFunctionManager.driverMoFangFunctionManager.sendAcc(true,-2.0)
}
resetIv.onClick {
DriverMoFangFunctionManager.driverMoFangFunctionManager.reset()
}
whistleIv.onClick {
DriverMoFangFunctionManager.driverMoFangFunctionManager.sendOperatorSetHornByDriver()
}
whistleIv.setOnLongClickListener {
DriverMoFangFunctionManager.driverMoFangFunctionManager.sendOperatorSetHornByDriver()
true
}
openDoorIv.onClick {
LightAirconditionDoorManager.go2OpenDoor(true)
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(ActivityUtils.getActivityByContext(context), R.raw.m1_voice_di)
}
closeDoorIv.onClick {
LightAirconditionDoorManager.go2OpenDoor(false)
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(ActivityUtils.getActivityByContext(context), R.raw.m1_voice_di)
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/charter_brake_stop" android:state_pressed="true" />
<item android:drawable="@drawable/charter_brake_stop" android:state_focused="true" />
<item android:drawable="@drawable/charter_brake_stop_un" />
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/charter_close_door_selected" android:state_pressed="true" />
<item android:drawable="@drawable/charter_close_door_selected" android:state_focused="true" />
<item android:drawable="@drawable/charter_close_door_normal" />
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/charter_moderate" android:state_pressed="true" />
<item android:drawable="@drawable/charter_moderate" android:state_focused="true" />
<item android:drawable="@drawable/charter_moderate_un" />
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/charter_open_door_selected" android:state_pressed="true" />
<item android:drawable="@drawable/charter_open_door_selected" android:state_focused="true" />
<item android:drawable="@drawable/charter_open_door_normal" />
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/charter_reset" android:state_pressed="true" />
<item android:drawable="@drawable/charter_reset" android:state_focused="true" />
<item android:drawable="@drawable/charter_reset_un" />
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/charter_whistle" android:state_pressed="true" />
<item android:drawable="@drawable/charter_whistle" android:state_focused="true" />
<item android:drawable="@drawable/charter_whistle_un" />
</selector>

View File

@@ -13,7 +13,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!--魔方控制+开关门-->
<com.mogo.och.common.module.wigets.DriverMoFangFunctionView
<com.magic.mogo.och.charter.view.DriverMoFangFunctionView
android:layout_width="1116dp"
android:layout_height="@dimen/dp_278"
android:layout_marginTop="@dimen/dp_32"

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="1116dp"
android:layout_height="@dimen/dp_278"
android:background="@drawable/driver_mofang_function_bg">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/moderateIv"
android:layout_width="@dimen/dp_164"
android:layout_height="@dimen/dp_164"
android:layout_marginLeft="@dimen/dp_67"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/charter_moderate_selector"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/brakeStopIv"
android:layout_width="@dimen/dp_164"
android:layout_height="@dimen/dp_164"
app:layout_constraintLeft_toRightOf="@+id/moderateIv"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/charter_brake_stop_selector"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/resetIv"
android:layout_width="@dimen/dp_164"
android:layout_height="@dimen/dp_164"
app:layout_constraintLeft_toRightOf="@+id/brakeStopIv"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/charter_reset_selector"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/whistleIv"
android:layout_width="@dimen/dp_164"
android:layout_height="@dimen/dp_164"
app:layout_constraintLeft_toRightOf="@+id/resetIv"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/charter_whistle_selector"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/closeDoorIv"
android:layout_width="@dimen/dp_164"
android:layout_height="@dimen/dp_164"
app:layout_constraintLeft_toRightOf="@+id/whistleIv"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/charter_close_door_selector"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/openDoorIv"
android:layout_width="@dimen/dp_164"
android:layout_height="@dimen/dp_164"
app:layout_constraintLeft_toRightOf="@+id/closeDoorIv"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/charter_open_door_selector"/>
</androidx.constraintlayout.widget.ConstraintLayout>