desc:长按确定键关机,长按左右键调整音量

main
xiaowusky 2 years ago
parent f45d78748e
commit 1a751ad4fb

@ -41,9 +41,10 @@ class App : CommonApplication() {
private fun ipConfig() {
// LztekUtil.getLztek()
// ?.setEthIpAddress(CAMERA_IP, CAMERA_NETMASK, CAMERA_GATEWAY, CAMERA_DNS)
PlatformUtils.setEthIpAddress(CAMERA_IP, CAMERA_NETMASK, CAMERA_GATEWAY, CAMERA_DNS)
PlatformUtils.hideNavigation()
PlatformUtils.hideStatusBar()
// PlatformUtils.setEthIpAddress(CAMERA_IP, CAMERA_NETMASK, CAMERA_GATEWAY, CAMERA_DNS)
// PlatformUtils.hideNavigation()
// PlatformUtils.hideStatusBar()
PlatformUtils.config(this)
}
private fun tryFixDbData() {

@ -40,7 +40,7 @@ abstract class BaseActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
setViewFactory()
super.onCreate(savedInstanceState)
super.onCreate(null)
setContentView(baseBinding.root)
initSound()
setChildContent()
@ -207,7 +207,7 @@ abstract class BaseActivity : AppCompatActivity() {
}
var mediaVolume = baseBinding.sbSound.progress
if (KeyEvent.KEYCODE_DPAD_LEFT == keyCode) mediaVolume-- else mediaVolume++
baseBinding.sbSound.progress = mediaVolume++
baseBinding.sbSound.progress = mediaVolume
return true
}
} else if (keyCode == KeyEvent.KEYCODE_ENTER) {

@ -1,7 +1,12 @@
package com.yinuo.safetywatcher.watcher.utils
import android.content.Context
import android.content.Intent
import com.common.commonlib.CommonApplication
import com.yinuo.safetywatcher.watcher.constant.CAMERA_DNS
import com.yinuo.safetywatcher.watcher.constant.CAMERA_GATEWAY
import com.yinuo.safetywatcher.watcher.constant.CAMERA_IP
import com.yinuo.safetywatcher.watcher.constant.CAMERA_NETMASK
import java.text.SimpleDateFormat
import java.util.Locale
@ -65,4 +70,10 @@ object PlatformUtils {
intent.putExtra("confirm", true)
CommonApplication.getContext()?.sendBroadcast(intent)
}
fun config(context: Context){
PlatformUtils.setEthIpAddress(CAMERA_IP, CAMERA_NETMASK, CAMERA_GATEWAY, CAMERA_DNS)
PlatformUtils.hideNavigation()
PlatformUtils.hideStatusBar()
}
}

@ -67,8 +67,7 @@ public class VolumeUtil {
LogUtils.w("setMediaVolume volume =" + volume);
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, //音量类型
volume,
AudioManager.FLAG_PLAY_SOUND
| AudioManager.FLAG_SHOW_UI);
AudioManager.FLAG_PLAY_SOUND);
}
public void setMediaVolumeDown(){

Loading…
Cancel
Save