-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 優化應用性能和體驗細節。 - Optimize application performance and experience details.
- Loading branch information
Showing
13 changed files
with
139 additions
and
29 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
app/android/app/src/main/kotlin/com/iHTCboy/iPomodoro/DeviceUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.iHTCboy.iPomodoro | ||
import android.os.Build | ||
import java.lang.reflect.Method | ||
|
||
object DeviceUtils { | ||
//emuiApiLevel>0 即华为系统 | ||
//判断是否是华为系统 官网提供 | ||
val isEMUI: Boolean | ||
get() { | ||
//emuiApiLevel>0 即华为系统 | ||
var emuiApiLevel: Int = 0 | ||
try { | ||
val cls = Class.forName("android.os.SystemProperties") | ||
val method: Method = cls.getDeclaredMethod("get", *arrayOf<Class<*>>(String::class.java)) | ||
emuiApiLevel = (method.invoke(cls, arrayOf<Any>("ro.build.hw_emui_api_level")) as String).toInt() | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
} | ||
return emuiApiLevel > 0 | ||
}//这个字符串可以自己定义,例如判断华为就填写huawei,魅族就填写meizu | ||
|
||
//判官是否是小米系统 官网提供 | ||
val isMIUI: Boolean | ||
get() { | ||
val manufacturer: String = Build.MANUFACTURER | ||
//这个字符串可以自己定义,例如判断华为就填写huawei,魅族就填写meizu | ||
if ("xiaomi".equals(manufacturer, ignoreCase = true)) { | ||
return true | ||
} | ||
return false | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters