mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 09:49:25 +02:00
Allow shorter default user timeout
This commit is contained in:
parent
ba01d1eed6
commit
c37e2e5d1c
2 changed files with 10 additions and 1 deletions
|
@ -81,7 +81,13 @@ object ManageDeviceDefaultUser {
|
|||
view.defaultUserSwitchText = if (defaultUserTimeout == 0)
|
||||
context.getString(R.string.manage_device_default_user_timeout_off)
|
||||
else
|
||||
context.getString(R.string.manage_device_default_user_timeout_on, TimeTextUtil.time(defaultUserTimeout, context))
|
||||
context.getString(
|
||||
R.string.manage_device_default_user_timeout_on,
|
||||
if (defaultUserTimeout < 1000 * 60)
|
||||
TimeTextUtil.seconds(defaultUserTimeout / 1000, context)
|
||||
else
|
||||
TimeTextUtil.time(defaultUserTimeout, context)
|
||||
)
|
||||
})
|
||||
|
||||
auth.logic.fullVersion.shouldProvideFullVersionFunctions.observe(lifecycleOwner, Observer { fullVersion ->
|
||||
|
|
|
@ -41,6 +41,7 @@ class SetDeviceDefaultUserTimeoutDialogFragment: BottomSheetDialogFragment() {
|
|||
private const val DIALOG_TAG = "sddutdf"
|
||||
private val OPTIONS = listOf(
|
||||
0,
|
||||
1000 * 5,
|
||||
1000 * 60,
|
||||
1000 * 60 * 5,
|
||||
1000 * 60 * 15,
|
||||
|
@ -97,6 +98,8 @@ class SetDeviceDefaultUserTimeoutDialogFragment: BottomSheetDialogFragment() {
|
|||
buildRow().let { row ->
|
||||
row.text = if (option == 0)
|
||||
getString(R.string.manage_device_default_user_timeout_dialog_disable)
|
||||
else if (option < 1000 * 60)
|
||||
TimeTextUtil.seconds(option / 1000, context!!)
|
||||
else
|
||||
TimeTextUtil.time(option, context!!)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue