From 1a751ad4fb119b32d92ce750fe4069c96e8c0443 Mon Sep 17 00:00:00 2001 From: xiaowusky Date: Fri, 20 Oct 2023 16:49:57 +0800 Subject: [PATCH] =?UTF-8?q?desc:=E9=95=BF=E6=8C=89=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E9=94=AE=E5=85=B3=E6=9C=BA=EF=BC=8C=E9=95=BF=E6=8C=89=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E8=B0=83=E6=95=B4=E9=9F=B3=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yinuo/safetywatcher/watcher/App.kt | 7 ++++--- .../yinuo/safetywatcher/watcher/base/BaseActivity.kt | 4 ++-- .../safetywatcher/watcher/utils/PlatformUtils.kt | 11 +++++++++++ .../yinuo/safetywatcher/watcher/utils/VolumeUtil.java | 3 +-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/yinuo/safetywatcher/watcher/App.kt b/app/src/main/java/com/yinuo/safetywatcher/watcher/App.kt index ac37ad0..1fcb49e 100644 --- a/app/src/main/java/com/yinuo/safetywatcher/watcher/App.kt +++ b/app/src/main/java/com/yinuo/safetywatcher/watcher/App.kt @@ -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() { diff --git a/app/src/main/java/com/yinuo/safetywatcher/watcher/base/BaseActivity.kt b/app/src/main/java/com/yinuo/safetywatcher/watcher/base/BaseActivity.kt index bcd7ba2..88040fd 100644 --- a/app/src/main/java/com/yinuo/safetywatcher/watcher/base/BaseActivity.kt +++ b/app/src/main/java/com/yinuo/safetywatcher/watcher/base/BaseActivity.kt @@ -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) { diff --git a/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/PlatformUtils.kt b/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/PlatformUtils.kt index 1301a9a..c3ab4be 100644 --- a/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/PlatformUtils.kt +++ b/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/PlatformUtils.kt @@ -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() + } } \ No newline at end of file diff --git a/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/VolumeUtil.java b/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/VolumeUtil.java index e704d0b..1fcc774 100644 --- a/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/VolumeUtil.java +++ b/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/VolumeUtil.java @@ -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(){