Added executor info and change some description text in ConfigActivity, activity_config

This commit is contained in:
2023-01-13 23:57:52 +08:00
parent 0fd1a33533
commit 2e9761f01a
2 changed files with 26 additions and 4 deletions

View File

@@ -40,6 +40,7 @@ import com.fankes.tsbattery.ui.activity.MainActivity
import com.fankes.tsbattery.ui.activity.base.BaseActivity
import com.fankes.tsbattery.utils.factory.*
import com.fankes.tsbattery.utils.tool.GithubReleaseTool
import com.highcapable.yukihookapi.YukiHookAPI
import kotlin.system.exitProcess
class ConfigActivity : BaseActivity<ActivityConfigBinding>() {
@@ -77,13 +78,14 @@ class ConfigActivity : BaseActivity<ActivityConfigBinding>() {
binding.activeModeIcon.isVisible = HookEntry.isHookClientSupport
binding.inactiveModeIcon.isGone = HookEntry.isHookClientSupport
binding.unsupportItem.isGone = HookEntry.isHookClientSupport
binding.executorInfoText.text = "${YukiHookAPI.Status.Executor.name} API ${YukiHookAPI.Status.Executor.apiLevel}"
/** 刷新当前模式文本 */
fun refreshCurrentModeText() {
binding.currentModeText.text = when {
ConfigData.isDisableAllHook -> "模块已停用"
packageName == PackageName.WECHAT -> "仅限基础省电模式"
ConfigData.isEnableQQTimProtectMode -> "已启用保守模式"
else -> "已启用完全模式"
packageName == PackageName.WECHAT -> "基础省电模式"
ConfigData.isEnableQQTimProtectMode -> "保守模式"
else -> "完全模式"
}
}
refreshCurrentModeText()

View File

@@ -204,7 +204,7 @@
android:layout_height="wrap_content"
android:alpha="0.85"
android:singleLine="true"
android:text="检测到未适配的版本"
android:text="未适配"
android:textColor="@color/colorTextGray"
android:textSize="12sp" />
@@ -227,6 +227,26 @@
android:singleLine="true"
android:textColor="@color/colorTextGray"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:alpha="0.85"
android:singleLine="true"
android:text="|"
android:textColor="@color/colorTextGray"
android:textSize="12sp" />
<TextView
android:id="@+id/executor_info_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:alpha="0.85"
android:singleLine="true"
android:textColor="@color/colorTextGray"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>