修复:蓝牙服务未开启时提示语 (#483)

This commit is contained in:
王嘉睿 2024-06-11 11:07:55 +08:00 committed by GitHub
parent 9c03e30e5d
commit 9e28c2922c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 3 deletions

View File

@ -614,9 +614,9 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding?>(), View.OnClickL
if (!initViewsFinished) return
Log.d(TAG, "restartBluetoothService, action: $action")
val serviceIntent = Intent(requireContext(), BluetoothScanService::class.java)
//如果定位功能已启用,但是系统定位功能不可用,则关闭定位功能
//如果蓝牙功能已启用,但是系统蓝牙功能不可用,则关闭蓝牙功能
if (SettingUtils.enableBluetooth && (!BluetoothUtils.isBluetoothEnabled() || !BluetoothUtils.hasBluetoothCapability(App.context))) {
XToastUtils.error(getString(R.string.toast_location_not_enabled))
XToastUtils.error(getString(R.string.toast_bluetooth_not_enabled))
SettingUtils.enableBluetooth = false
binding!!.sbEnableBluetooth.isChecked = false
binding!!.layoutBluetoothSetting.visibility = View.GONE
@ -1421,4 +1421,4 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding?>(), View.OnClickL
}
}
}

View File

@ -1109,6 +1109,7 @@
<string name="chat_id">Chat ID</string>
<string name="receive_id">Receive ID</string>
<string name="toast_location_not_enabled">Location is not enabled, Please go to system settings and activate it.</string>
<string name="toast_bluetooth_not_enabled">Bluetooth is not enabled, Please go to system settings and activate it.</string>
<string name="task_condition_check_again">Recheck when delaying execution.</string>
<string name="task_condition_check_again_tips">When used as a triggering condition, recheck during delayed action execution.</string>

View File

@ -1110,6 +1110,7 @@
<string name="chat_id">Chat ID</string>
<string name="receive_id">消息接收者ID</string>
<string name="toast_location_not_enabled">位置服务未开启,请先前往系统设置中开启!</string>
<string name="toast_bluetooth_not_enabled">蓝牙服务未开启,请先前往系统设置中开启!</string>
<string name="task_condition_check_again">延迟执行时再次校验</string>
<string name="task_condition_check_again_tips">作为触发条件时,在延迟执行动作时再次校验是否满足</string>

View File

@ -1110,6 +1110,7 @@
<string name="chat_id">Chat ID</string>
<string name="receive_id">訊息接收者ID</string>
<string name="toast_location_not_enabled">定位服務未開啟,請先前往系統設置中開啟!</string>
<string name="toast_bluetooth_not_enabled">藍牙服務未開啟,請先前往系統設置中開啟!</string>
<string name="task_condition_check_again">延遲執行時再次校驗</string>
<string name="task_condition_check_again_tips">作為觸發條件時,在延遲執行動作時再次校驗是否滿足</string>