Selaa lähdekoodia

小米手机特殊处理

weizhengliang 2 vuotta sitten
vanhempi
commit
92668d4196

+ 9 - 4
home/src/main/code/com/wdkl/ncs/android/component/home/activity/NewEventListActivity.kt

@@ -1,6 +1,7 @@
 package com.wdkl.ncs.android.component.home.activity
 
 import android.content.Context
+import android.os.Build
 import android.os.Vibrator
 import android.util.Log
 import android.view.View
@@ -78,8 +79,10 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter, ActivityEventLi
 
     override fun onWindowFocusChanged(hasFocus: Boolean) {
         super.onWindowFocusChanged(hasFocus)
-        if (!Constants.oldEvent) {
-            window.decorView.systemUiVisibility = screen_flags
+        if ("Redmi".equals(Build.BRAND)) {
+            if (!Constants.oldEvent) {
+                window.decorView.systemUiVisibility = screen_flags
+            }
         }
     }
 
@@ -89,8 +92,10 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter, ActivityEventLi
 
     override fun onResume() {
         super.onResume()
-        if (!Constants.oldEvent) {
-            window.decorView.systemUiVisibility = screen_flags
+        if ("Redmi".equals(Build.BRAND)) {
+            if (!Constants.oldEvent) {
+                window.decorView.systemUiVisibility = screen_flags
+            }
         }
         WdKeepAliveService.mNewEventListActive = true
         renderData(Constants.eventList)

+ 7 - 2
home/src/main/code/com/wdkl/ncs/android/component/home/activity/WatchHome2Activity.kt

@@ -107,7 +107,10 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
 
     override fun onWindowFocusChanged(hasFocus: Boolean) {
         super.onWindowFocusChanged(hasFocus)
-        window.decorView.systemUiVisibility = screen_flags
+        if ("Redmi".equals(Build.BRAND)) {
+            //红米手机
+            window.decorView.systemUiVisibility = screen_flags
+        }
     }
 
     //初始化
@@ -679,7 +682,9 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
 
     override fun onResume() {
         super.onResume()
-        window.decorView.systemUiVisibility = screen_flags
+        if ("Redmi".equals(Build.BRAND)) {
+            window.decorView.systemUiVisibility = screen_flags
+        }
 
         //主界面恢复时检查tcp连接状态
         Log.d(TAG, "Watch home activity resumed...")