Move many help texts to dialogs

This commit is contained in:
Jonas Lochmann 2020-01-20 00:00:00 +00:00
parent 3da677877f
commit cfddc164e8
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36
52 changed files with 675 additions and 298 deletions

View file

@ -0,0 +1,51 @@
/*
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package io.timelimit.android.ui.help
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.FragmentManager
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import io.timelimit.android.databinding.HelpDialogFragmentBinding
import io.timelimit.android.extensions.showSafe
class HelpDialogFragment: BottomSheetDialogFragment() {
companion object {
private const val DIALOG_TAG = "HelpDialogFragment"
private const val EXTRA_TITLE = "title"
private const val EXTRA_TEXT = "text"
fun newInstance(title: Int, text: Int) = HelpDialogFragment().apply {
arguments = Bundle().apply {
putInt(EXTRA_TITLE, title)
putInt(EXTRA_TEXT, text)
}
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val binding = HelpDialogFragmentBinding.inflate(inflater, container, false)
binding.title = getString(arguments!!.getInt(EXTRA_TITLE))
binding.text = getString(arguments!!.getInt(EXTRA_TEXT))
return binding.root
}
fun show(fragmentManager: FragmentManager) = showSafe(fragmentManager, DIALOG_TAG)
}

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,6 +42,7 @@ import io.timelimit.android.sync.actions.UpdateCategoryTemporarilyBlockedAction
import io.timelimit.android.sync.actions.UpdateNetworkTimeVerificationAction
import io.timelimit.android.sync.network.UpdatePrimaryDeviceRequestType
import io.timelimit.android.ui.MainActivity
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.ui.main.AuthenticationFab
import io.timelimit.android.ui.main.getActivityViewModel
@ -223,6 +224,13 @@ class LockFragment : Fragment() {
})
// bind adding extra time controls
binding.extraTimeTitle.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.lock_extratime_title,
text = R.string.lock_extratime_text
).show(fragmentManager!!)
}
logic.fullVersion.shouldProvideFullVersionFunctions.observe(this, Observer { hasFullVersion ->
binding.extraTimeBtnOk.setOnClickListener {
binding.extraTimeSelection.clearNumberPickerFocus()
@ -285,8 +293,6 @@ class LockFragment : Fragment() {
activity = activity!!,
hasFullVersion = hasFullVersion == true
)
binding.manageDisableTimeLimits.userName = child.name
}
})

View file

@ -16,6 +16,7 @@
package io.timelimit.android.ui.manage.category.settings
import android.widget.SeekBar
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
@ -26,6 +27,7 @@ import io.timelimit.android.databinding.CategoryBatteryLimitViewBinding
import io.timelimit.android.livedata.ignoreUnchanged
import io.timelimit.android.livedata.map
import io.timelimit.android.sync.actions.UpdateCategoryBatteryLimit
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
object CategoryBatteryLimitView {
@ -34,8 +36,16 @@ object CategoryBatteryLimitView {
lifecycleOwner: LifecycleOwner,
category: LiveData<Category?>,
auth: ActivityViewModel,
categoryId: String
categoryId: String,
fragmentManager: FragmentManager
) {
binding.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.category_settings_battery_limit_title,
text = R.string.category_settings_battery_limit_description
).show(fragmentManager)
}
binding.seekbarCharging.setOnSeekBarChangeListener(object: SeekBar.OnSeekBarChangeListener {
override fun onStartTrackingTouch(p0: SeekBar?) = Unit
override fun onStopTrackingTouch(p0: SeekBar?) = Unit

View file

@ -1,13 +1,30 @@
/*
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package io.timelimit.android.ui.manage.category.settings
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.model.Category
import io.timelimit.android.databinding.CategoryNotificationFilterBinding
import io.timelimit.android.livedata.mergeLiveData
import io.timelimit.android.sync.actions.UpdateCategoryBlockAllNotificationsAction
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
@ -19,6 +36,13 @@ object CategoryNotificationFilter {
lifecycleOwner: LifecycleOwner,
fragmentManager: FragmentManager
) {
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.category_notification_filter_title,
text = R.string.category_notification_filter_text
).show(fragmentManager)
}
val premium = auth.logic.fullVersion.shouldProvideFullVersionFunctions
mergeLiveData(categoryLive, premium).observe(lifecycleOwner, Observer { (category, hasPremium) ->

View file

@ -28,6 +28,7 @@ import io.timelimit.android.databinding.FragmentCategorySettingsBinding
import io.timelimit.android.logic.AppLogic
import io.timelimit.android.logic.DefaultAppLogic
import io.timelimit.android.sync.actions.SetCategoryExtraTimeAction
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.ui.main.getActivityViewModel
import io.timelimit.android.ui.manage.category.ManageCategoryFragmentArgs
@ -58,7 +59,8 @@ class CategorySettingsFragment : Fragment() {
categoryId = params.categoryId,
childId = params.childId,
database = appLogic.database,
auth = auth
auth = auth,
fragmentManager = fragmentManager!!
)
CategoryBatteryLimitView.bind(
@ -66,7 +68,8 @@ class CategorySettingsFragment : Fragment() {
lifecycleOwner = this,
category = categoryEntry,
auth = auth,
categoryId = params.categoryId
categoryId = params.categoryId,
fragmentManager = fragmentManager!!
)
ParentCategoryView.bind(
@ -91,12 +94,20 @@ class CategorySettingsFragment : Fragment() {
view = binding.timeWarnings,
auth = auth,
categoryLive = categoryEntry,
lifecycleOwner = this
lifecycleOwner = this,
fragmentManager = fragmentManager!!
)
binding.btnDeleteCategory.setOnClickListener { deleteCategory() }
binding.editCategoryTitleGo.setOnClickListener { renameCategory() }
binding.extraTimeTitle.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.category_settings_extra_time_title,
text = R.string.category_settings_extra_time_info
).show(fragmentManager!!)
}
categoryEntry.observe(this, Observer {
if (it != null) {
val roundedCurrentTimeInMillis = (it.extraTimeInMillis / (1000 * 60)) * (1000 * 60)

View file

@ -1,13 +1,31 @@
/*
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package io.timelimit.android.ui.manage.category.settings
import android.widget.CheckBox
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.model.Category
import io.timelimit.android.data.model.CategoryTimeWarnings
import io.timelimit.android.databinding.CategoryTimeWarningsViewBinding
import io.timelimit.android.sync.actions.UpdateCategoryTimeWarningsAction
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.util.TimeTextUtil
@ -16,8 +34,16 @@ object CategoryTimeWarningView {
view: CategoryTimeWarningsViewBinding,
lifecycleOwner: LifecycleOwner,
categoryLive: LiveData<Category?>,
auth: ActivityViewModel
auth: ActivityViewModel,
fragmentManager: FragmentManager
) {
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.time_warning_title,
text = R.string.time_warning_desc
).show(fragmentManager)
}
view.linearLayout.removeAllViews()
val durationToCheckbox = mutableMapOf<Long, CheckBox>()

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,13 +15,16 @@
*/
package io.timelimit.android.ui.manage.category.settings
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.Database
import io.timelimit.android.databinding.ManageCategoryForUnassignedAppsBinding
import io.timelimit.android.livedata.ignoreUnchanged
import io.timelimit.android.livedata.map
import io.timelimit.android.sync.actions.SetCategoryForUnassignedApps
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
object ManageCategoryForUnassignedApps {
@ -31,8 +34,16 @@ object ManageCategoryForUnassignedApps {
childId: String,
auth: ActivityViewModel,
database: Database,
lifecycleOwner: LifecycleOwner
lifecycleOwner: LifecycleOwner,
fragmentManager: FragmentManager
) {
binding.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.manage_category_for_unassigned_apps_title,
text = R.string.manage_category_for_unassigned_apps_intro
).show(fragmentManager)
}
val userEntry = database.user().getUserByIdLive(childId)
val isCurrentlyChosen = userEntry.map { it?.categoryForNotAssignedApps == categoryId }.ignoreUnchanged()

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,8 +18,10 @@ package io.timelimit.android.ui.manage.category.settings
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.Database
import io.timelimit.android.databinding.ManageParentCategoryBinding
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
object ParentCategoryView {
@ -32,6 +34,13 @@ object ParentCategoryView {
database: Database,
fragmentManager: FragmentManager
) {
binding.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.category_settings_parent_category_title,
text = R.string.category_settings_parent_category_intro
).show(fragmentManager)
}
database.category().getCategoriesByChildId(childId).observe(lifecycleOwner, Observer { categories ->
val ownCategory = categories.find { it.id == categoryId }
val parentCategory = categories.find { it.id == ownCategory?.parentCategoryId }

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -23,6 +23,7 @@ import android.widget.CheckBox
import androidx.fragment.app.Fragment
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.model.User
import io.timelimit.android.databinding.FragmentManageChildAdvancedBinding
import io.timelimit.android.livedata.liveDataFromFunction
@ -31,6 +32,7 @@ import io.timelimit.android.livedata.mergeLiveData
import io.timelimit.android.logic.AppLogic
import io.timelimit.android.logic.DefaultAppLogic
import io.timelimit.android.sync.actions.UpdateCategoryTemporarilyBlockedAction
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.ui.main.getActivityViewModel
import io.timelimit.android.ui.manage.child.ManageChildFragmentArgs
@ -61,6 +63,13 @@ class ManageChildAdvancedFragment : Fragment() {
run {
// blocked categories
binding.blockTemporarilyTitle.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.manage_child_block_temporarily_title,
text = R.string.manage_child_block_temporarily_text
).show(fragmentManager!!)
}
val categoriesLive = logic.database.category().getCategoriesByChildId(params.childId)
mergeLiveData(categoriesLive, logic.fullVersion.shouldProvideFullVersionFunctions).observe(this, Observer {
@ -117,8 +126,6 @@ class ManageChildAdvancedFragment : Fragment() {
activity = activity!!,
hasFullVersion = hasFullVersion == true
)
binding.disableTimeLimits.userName = child.name
}
})

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,12 +18,14 @@ package io.timelimit.android.ui.manage.child.advanced.managedisabletimelimits
import android.content.Context
import android.text.format.DateUtils
import androidx.fragment.app.FragmentActivity
import io.timelimit.android.R
import io.timelimit.android.data.model.User
import io.timelimit.android.data.model.UserType
import io.timelimit.android.date.DateInTimezone
import io.timelimit.android.logic.DefaultAppLogic
import io.timelimit.android.logic.RealTime
import io.timelimit.android.sync.actions.SetUserDisableLimitsUntilAction
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.getActivityViewModel
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
import io.timelimit.android.ui.view.ManageDisableTimelimitsViewHandlers
@ -106,6 +108,13 @@ object ManageDisableTimelimitsViewHelper {
)
)
}
override fun showDisableTimeLimitsHelp() {
HelpDialogFragment.newInstance(
title = R.string.manage_disable_time_limits_title,
text = R.string.manage_disable_time_limits_text
).show(activity.supportFragmentManager)
}
}
}

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,8 +19,10 @@ import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.model.User
import io.timelimit.android.databinding.ManageChildPasswordBinding
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
object ManageChildPassword {
@ -32,6 +34,13 @@ object ManageChildPassword {
auth: ActivityViewModel,
fragmentManager: FragmentManager
) {
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.manage_child_password_title,
text = R.string.manage_child_password_info
).show(fragmentManager)
}
childEntry.observe(lifecycleOwner, Observer {
view.hasPassword = it?.password?.isNotEmpty() ?: false
})

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,11 +18,13 @@ package io.timelimit.android.ui.manage.child.primarydevice
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.databinding.PrimaryDeviceViewBinding
import io.timelimit.android.livedata.mergeLiveData
import io.timelimit.android.logic.AppLogic
import io.timelimit.android.sync.actions.SetRelaxPrimaryDeviceAction
import io.timelimit.android.sync.network.UpdatePrimaryDeviceRequestType
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
object PrimaryDeviceView {
@ -34,6 +36,13 @@ object PrimaryDeviceView {
lifecycleOwner: LifecycleOwner,
auth: ActivityViewModel
) {
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.primary_device_title,
text = R.string.primary_device_description
).show(fragmentManager)
}
val userEntry = logic.database.user().getUserByIdLive(childId)
val ownDeviceId = logic.deviceId
val ownDeviceUser = logic.deviceUserId

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -93,7 +93,8 @@ class ManageDeviceAdvancedFragment : Fragment(), FragmentWithCustomTitle {
view = binding.manageBackgroundSync,
isThisDevice = isThisDevice,
lifecycleOwner = this,
activityViewModel = auth
activityViewModel = auth,
fragmentManager = fragmentManager!!
)
binding.handlers = object: ManageDeviceAdvancedFragmentHandlers {

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,11 +15,14 @@
*/
package io.timelimit.android.ui.manage.device.manage.advanced
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.async.Threads
import io.timelimit.android.databinding.ManageDeviceBackgroundSyncViewBinding
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.work.PeriodicSyncInBackgroundWorker
@ -28,8 +31,16 @@ object ManageDeviceBackgroundSync {
view: ManageDeviceBackgroundSyncViewBinding,
isThisDevice: LiveData<Boolean>,
lifecycleOwner: LifecycleOwner,
activityViewModel: ActivityViewModel
activityViewModel: ActivityViewModel,
fragmentManager: FragmentManager
) {
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.device_background_sync_title,
text = R.string.device_background_sync_text
).show(fragmentManager)
}
isThisDevice.observe(lifecycleOwner, Observer { view.isThisDevice = it })
activityViewModel.logic.fullVersion.isLocalMode.observe(lifecycleOwner, Observer { view.isUsingLocalMode = it })

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -28,6 +28,7 @@ import io.timelimit.android.livedata.map
import io.timelimit.android.livedata.switchMap
import io.timelimit.android.sync.actions.SignOutAtDeviceAction
import io.timelimit.android.sync.actions.apply.ApplyActionUtil
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
import io.timelimit.android.util.TimeTextUtil
@ -44,6 +45,13 @@ object ManageDeviceDefaultUser {
) {
val context = view.root.context
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.manage_device_default_user_title,
text = R.string.manage_device_default_user_info
).show(fragmentManager)
}
device.switchMap { deviceEntry ->
users.map { users ->
deviceEntry to users.find { it.id == deviceEntry?.defaultUser }

View file

@ -1,11 +1,29 @@
/*
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package io.timelimit.android.ui.manage.device.manage.feature
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.model.Device
import io.timelimit.android.databinding.ManageDeviceActivityLevelBlockingBinding
import io.timelimit.android.sync.actions.UpdateEnableActivityLevelBlocking
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
object ManageDeviceActivityLevelBlocking {
@ -13,8 +31,16 @@ object ManageDeviceActivityLevelBlocking {
view: ManageDeviceActivityLevelBlockingBinding,
auth: ActivityViewModel,
deviceEntry: LiveData<Device?>,
lifecycleOwner: LifecycleOwner
lifecycleOwner: LifecycleOwner,
fragmentManager: FragmentManager
) {
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.manage_device_activity_level_blocking_title,
text = R.string.manage_device_activity_level_blocking_text
).show(fragmentManager)
}
deviceEntry.observe(lifecycleOwner, Observer { device ->
val enable = device?.enableActivityLevelBlocking ?: false

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -28,6 +28,7 @@ import androidx.navigation.Navigation
import io.timelimit.android.R
import io.timelimit.android.data.model.Device
import io.timelimit.android.data.model.NetworkTime
import io.timelimit.android.databinding.HelpDialogFragmentBinding
import io.timelimit.android.databinding.ManageDeviceFeaturesFragmentBinding
import io.timelimit.android.livedata.liveDataFromValue
import io.timelimit.android.livedata.map
@ -35,6 +36,7 @@ import io.timelimit.android.logic.AppLogic
import io.timelimit.android.logic.DefaultAppLogic
import io.timelimit.android.logic.RealTime
import io.timelimit.android.sync.actions.UpdateNetworkTimeVerificationAction
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.ui.main.ActivityViewModelHolder
import io.timelimit.android.ui.main.AuthenticationFab
@ -114,6 +116,13 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
override fun showAuthenticationScreen() {
activity.showAuthenticationScreen()
}
override fun showNetworkTimeHelp() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_network_time_verification_title,
text = R.string.manage_device_network_time_verification_description
).show(fragmentManager!!)
}
}
// network time status
@ -135,7 +144,8 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
view = binding.deviceRebootManipulation,
lifecycleOwner = this,
deviceEntry = deviceEntry,
auth = auth
auth = auth,
fragmentManager = fragmentManager!!
)
// activity level blocking
@ -143,7 +153,8 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
view = binding.activityLevelBlocking,
auth = auth,
deviceEntry = deviceEntry,
lifecycleOwner = this
lifecycleOwner = this,
fragmentManager = fragmentManager!!
)
// send connected
@ -151,7 +162,8 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
binding = binding.sendDeviceConnected,
deviceEntry = deviceEntry,
auth = auth,
lifecycleOwner = this
lifecycleOwner = this,
fragmentManager = fragmentManager!!
)
@ -164,4 +176,5 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
interface ManageDeviceFeaturesFragmentHandlers {
fun changeNetworkTimeVerification(newValue: NetworkTime)
fun showAuthenticationScreen()
fun showNetworkTimeHelp()
}

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,12 +15,15 @@
*/
package io.timelimit.android.ui.manage.device.manage.feature
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.model.Device
import io.timelimit.android.databinding.ManageDeviceRebootManipulationViewBinding
import io.timelimit.android.sync.actions.SetConsiderRebootManipulationAction
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
object ManageDeviceRebootManipulationView {
@ -28,8 +31,16 @@ object ManageDeviceRebootManipulationView {
view: ManageDeviceRebootManipulationViewBinding,
deviceEntry: LiveData<Device?>,
lifecycleOwner: LifecycleOwner,
auth: ActivityViewModel
auth: ActivityViewModel,
fragmentManager: FragmentManager
) {
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.manage_device_reboot_manipulation_title,
text = R.string.manage_device_reboot_manipulation_text
).show(fragmentManager)
}
deviceEntry.observe(lifecycleOwner, Observer { device ->
val checked = device?.considerRebootManipulation ?: false

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,12 +15,15 @@
*/
package io.timelimit.android.ui.manage.device.manage.feature
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import io.timelimit.android.R
import io.timelimit.android.data.model.Device
import io.timelimit.android.livedata.mergeLiveData
import io.timelimit.android.sync.actions.SetSendDeviceConnected
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
object ManageSendDeviceConnected {
@ -28,10 +31,18 @@ object ManageSendDeviceConnected {
binding: io.timelimit.android.databinding.ManageSendDeviceConnectedBinding,
auth: ActivityViewModel,
deviceEntry: LiveData<Device?>,
lifecycleOwner: LifecycleOwner
lifecycleOwner: LifecycleOwner,
fragmentManager: FragmentManager
) {
val ownDeviceIdLive = auth.logic.deviceId
binding.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.manage_send_device_connected_title,
text = R.string.manage_send_device_connected_info
).show(fragmentManager)
}
mergeLiveData(ownDeviceIdLive, deviceEntry).observe(lifecycleOwner, Observer { (ownDeviceId, device) ->
binding.isThisDevice = ownDeviceId == device?.id && device?.id != null
})

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -33,6 +33,7 @@ import androidx.lifecycle.Observer
import androidx.navigation.Navigation
import io.timelimit.android.R
import io.timelimit.android.data.model.Device
import io.timelimit.android.data.model.UserType
import io.timelimit.android.databinding.ManageDevicePermissionsFragmentBinding
import io.timelimit.android.integration.platform.NewPermissionStatus
import io.timelimit.android.integration.platform.ProtectionLevel
@ -43,6 +44,7 @@ import io.timelimit.android.livedata.liveDataFromValue
import io.timelimit.android.livedata.map
import io.timelimit.android.logic.AppLogic
import io.timelimit.android.logic.DefaultAppLogic
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.ui.main.ActivityViewModelHolder
import io.timelimit.android.ui.main.AuthenticationFab
@ -102,6 +104,10 @@ class ManageDevicePermissionsFragment : Fragment(), FragmentWithCustomTitle {
doesSupportAuth = liveDataFromValue(true)
)
auth.authenticatedUser.map { it?.second?.type == UserType.Parent }.observe(this, Observer {
binding.isUserSignedIn = it
})
// handlers
binding.handlers = object: ManageDevicePermissionsFragmentHandlers {
override fun openUsageStatsSettings() {
@ -189,6 +195,34 @@ class ManageDevicePermissionsFragment : Fragment(), FragmentWithCustomTitle {
override fun showAuthenticationScreen() {
activity.showAuthenticationScreen()
}
override fun helpUsageStatsAccess() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_permissions_usagestats_title,
text = R.string.manage_device_permissions_usagestats_text
).show(fragmentManager!!)
}
override fun helpNotificationAccess() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_permission_notification_access_title,
text = R.string.manage_device_permission_notification_access_text
).show(fragmentManager!!)
}
override fun helpDrawOverOtherApps() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_permissions_overlay_title,
text = R.string.manage_device_permissions_overlay_text
).show(fragmentManager!!)
}
override fun helpAccesibility() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_permission_accessibility_title,
text = R.string.manage_device_permission_accessibility_text
).show(fragmentManager!!)
}
}
// is this device
@ -233,4 +267,8 @@ interface ManageDevicePermissionsFragmentHandlers {
fun openAccessibilitySettings()
fun manageDeviceAdmin()
fun showAuthenticationScreen()
fun helpUsageStatsAccess()
fun helpNotificationAccess()
fun helpDrawOverOtherApps()
fun helpAccesibility()
}

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -35,6 +35,7 @@ import io.timelimit.android.integration.platform.ProtectionLevel
import io.timelimit.android.integration.platform.android.AdminReceiver
import io.timelimit.android.logic.AppLogic
import io.timelimit.android.logic.DefaultAppLogic
import io.timelimit.android.ui.help.HelpDialogFragment
import io.timelimit.android.ui.manage.device.manage.permission.InformAboutDeviceOwnerDialogFragment
@ -132,6 +133,34 @@ class SetupDevicePermissionsFragment : Fragment() {
R.id.setupDevicePermissionsFragment
)
}
override fun helpUsageStatsAccess() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_permissions_usagestats_title,
text = R.string.manage_device_permissions_usagestats_text
).show(fragmentManager!!)
}
override fun helpNotificationAccess() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_permission_notification_access_title,
text = R.string.manage_device_permission_notification_access_text
).show(fragmentManager!!)
}
override fun helpDrawOverOtherApps() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_permissions_overlay_title,
text = R.string.manage_device_permissions_overlay_text
).show(fragmentManager!!)
}
override fun helpAccesibility() {
HelpDialogFragment.newInstance(
title = R.string.manage_device_permission_accessibility_title,
text = R.string.manage_device_permission_accessibility_text
).show(fragmentManager!!)
}
}
refreshStatus()
@ -163,4 +192,8 @@ interface SetupDevicePermissionsHandlers {
fun openDrawOverOtherAppsScreen()
fun openAccessibilitySettings()
fun gotoNextStep()
fun helpUsageStatsAccess()
fun helpNotificationAccess()
fun helpDrawOverOtherApps()
fun helpAccesibility()
}

View file

@ -74,6 +74,8 @@ class SetupLocalModeFragment : Fragment() {
)
}
SetupNetworkTimeVerification.prepareHelpButton(binding.networkTimeVerification, fragmentManager!!)
return binding.root
}
}

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,9 +15,11 @@
*/
package io.timelimit.android.ui.setup
import androidx.fragment.app.FragmentManager
import io.timelimit.android.R
import io.timelimit.android.data.model.NetworkTime
import io.timelimit.android.databinding.SetupNetworkTimeVerificationBinding
import io.timelimit.android.ui.help.HelpDialogFragment
object SetupNetworkTimeVerification {
fun readSelection(view: SetupNetworkTimeVerificationBinding) = when (view.networkTimeVerificationRadioGroup.checkedRadioButtonId) {
@ -26,4 +28,13 @@ object SetupNetworkTimeVerification {
R.id.network_time_verification_enabled -> NetworkTime.Enabled
else -> throw IllegalStateException()
}
fun prepareHelpButton(view: SetupNetworkTimeVerificationBinding, fragmentManager: FragmentManager) {
view.titleView.setOnClickListener {
HelpDialogFragment.newInstance(
title = R.string.manage_device_network_time_verification_title,
text = R.string.manage_device_network_time_verification_description
).show(fragmentManager)
}
}
}

View file

@ -291,7 +291,8 @@ class SetupDeviceFragment : Fragment() {
view = binding.backgroundSync,
isThisDevice = liveDataFromValue(true),
lifecycleOwner = this,
activityViewModel = activity.getActivityViewModel()
activityViewModel = activity.getActivityViewModel(),
fragmentManager = fragmentManager!!
)
binding.confirmBtn.setOnClickListener {
@ -306,6 +307,8 @@ class SetupDeviceFragment : Fragment() {
)
}
SetupNetworkTimeVerification.prepareHelpButton(binding.networkTimeVerification, fragmentManager!!)
return binding.root
}
}

View file

@ -1,5 +1,5 @@
/*
* TimeLimit Copyright <C> 2019 Jonas Lochmann
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -45,8 +45,8 @@ class ManageDisableTimelimitsView(context: Context, attributeSet: AttributeSet):
_, _, value -> binding.handlers = value
}
var userName: String? by Delegates.observable(null as String?) {
_, _, value -> binding.userName = value
init {
binding.titleView.setOnClickListener { handlers?.showDisableTimeLimitsHelp() }
}
}
@ -56,4 +56,5 @@ interface ManageDisableTimelimitsViewHandlers {
fun disableTimeLimitsForDuration(duration: Long)
fun disableTimeLimitsForToday()
fun enableTimeLimits()
fun showDisableTimeLimitsHelp()
}

View file

@ -39,17 +39,14 @@
android:padding="8dp">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:text="@string/category_settings_battery_limit_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/category_settings_battery_limit_description"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@{@string/category_settings_battery_limit_charging(minLevelCharging)}"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -26,17 +26,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/category_notification_filter_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/category_notification_filter_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/checkbox"
android:text="@string/category_notifications_filter_checkbox"

View file

@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.cardview.widget.CardView
@ -12,17 +26,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:background="?selectableItemBackground"
android:text="@string/time_warning_title"
android:textAppearance="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="@string/time_warning_desc"
android:textAppearance="?android:textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="vertical"
android:id="@+id/linear_layout"

View file

@ -39,17 +39,14 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:id="@+id/extra_time_title"
android:text="@string/category_settings_extra_time_title"
android:textAppearance="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/category_settings_extra_time_info"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<io.timelimit.android.ui.view.SelectTimeSpanView
android:id="@+id/extra_time_selection"
android:layout_width="match_parent"

View file

@ -51,17 +51,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/block_temporarily_title"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:text="@string/manage_child_block_temporarily_title"
android:textAppearance="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_child_block_temporarily_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/blocked_categories_checkbox_container"
android:orientation="vertical"

View file

@ -1,5 +1,5 @@
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -65,9 +65,6 @@
android:layout_height="wrap_content" />
<androidx.cardview.widget.CardView
android:onClick="@{() -> handlers.openUsageStatsSettings()}"
android:foreground="?selectableItemBackground"
android:clickable="@{usageStatsAccess != RuntimePermissionStatus.NotRequired}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -78,18 +75,17 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:onClick="@{() -> handlers.helpUsageStatsAccess()}"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_permissions_usagestats_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_permissions_usagestats_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -98,6 +94,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -106,6 +104,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -113,19 +113,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{usageStatsAccess != RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.openUsageStatsSettings()}"
android:enabled="@{usageStatsAccess != RuntimePermissionStatus.NotRequired}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:foreground="?selectableItemBackground"
android:onClick="@{() -> handlers.manageDeviceAdmin()}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -169,19 +169,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.manageDeviceAdmin()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:onClick="@{() -> handlers.openNotificationAccessSettings()}"
android:foreground="?selectableItemBackground"
android:clickable="@{notificationAccessPermission != NewPermissionStatus.NotSupported}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -192,18 +191,17 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:onClick="@{() -> handlers.helpNotificationAccess()}"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_permission_notification_access_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_permission_notification_access_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{notificationAccessPermission == NewPermissionStatus.Granted ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -212,6 +210,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -220,6 +220,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotSupported ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -227,20 +229,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{notificationAccessPermission != NewPermissionStatus.NotSupported ? View.VISIBLE : View.GONE}"
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.openNotificationAccessSettings()}"
android:enabled="@{notificationAccessPermission != NewPermissionStatus.NotSupported}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:onClick="@{() -> handlers.openDrawOverOtherAppsScreen()}"
android:foreground="?selectableItemBackground"
android:clickable="@{usageStatsAccess != RuntimePermissionStatus.NotRequired}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -251,18 +252,17 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:onClick="@{() -> handlers.helpDrawOverOtherApps()}"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_permissions_overlay_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_permissions_overlay_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{overlayPermission == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -271,6 +271,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -279,6 +281,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -286,21 +290,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{overlayPermission != RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.openDrawOverOtherAppsScreen()}"
android:enabled="@{overlayPermission != RuntimePermissionStatus.NotRequired}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:onClick="@{() -> handlers.openAccessibilitySettings()}"
android:foreground="?selectableItemBackground"
android:clickable="true"
android:focusable="true"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -311,18 +313,17 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:onClick="@{() -> handlers.helpAccesibility()}"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_permission_accessibility_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_permission_accessibility_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{accessibilityServiceEnabled == true ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -331,6 +332,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{accessibilityServiceEnabled == false ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -338,10 +341,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.openAccessibilitySettings()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

View file

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="title"
type="String" />
<variable
name="text"
type="String" />
</data>
<LinearLayout
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:textAppearance="?android:textAppearanceLarge"
tools:text="@string/category_settings_extra_time_title"
android:text="@{title}"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
tools:text="@string/category_settings_extra_time_info"
android:text="@{text}"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</layout>

View file

@ -380,17 +380,14 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:id="@+id/extra_time_title"
android:text="@string/lock_extratime_title"
android:textAppearance="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="@string/lock_extratime_text"
android:textAppearance="?android:textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<io.timelimit.android.ui.view.SelectTimeSpanView
android:id="@+id/extra_time_selection"
android:layout_width="match_parent"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -34,17 +34,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_category_for_unassigned_apps_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="@string/manage_category_for_unassigned_apps_intro"
android:textAppearance="?android:textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
tools:text="@string/manage_category_for_unassigned_apps_status_enabled"
android:text="@{isThisCategoryUsed ? @string/manage_category_for_unassigned_apps_status_enabled : @string/manage_category_for_unassigned_apps_status_disabled}"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -34,17 +34,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_child_password_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_child_password_info"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
tools:text="@string/manage_child_password_status_no"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -26,17 +26,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_activity_level_blocking_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_activity_level_blocking_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:text="@string/manage_device_activity_level_blocking_checkbox"
android:id="@+id/checkbox"

View file

@ -41,17 +41,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:text="@string/device_background_sync_title"
android:textAppearance="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="@string/device_background_sync_text"
android:textAppearance="?android:textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:visibility="@{isThisDevice ? View.VISIBLE : View.GONE}"
android:enabled="@{!isUsingLocalMode}"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -56,17 +56,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:background="?selectableItemBackground"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_default_user_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_default_user_info"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{hasDefaultUser ? View.VISIBLE : View.GONE}"
android:textAppearance="?android:textAppearanceMedium"

View file

@ -1,5 +1,5 @@
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -56,17 +56,14 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="?android:textAppearanceLarge"
android:onClick="@{() -> handlers.showNetworkTimeHelp()}"
android:text="@string/manage_device_network_time_verification_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_network_time_verification_description"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/network_time_verification_radio_group"
android:layout_width="match_parent"

View file

@ -1,5 +1,5 @@
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -46,6 +46,10 @@
name="handlers"
type="io.timelimit.android.ui.manage.device.manage.permission.ManageDevicePermissionsFragmentHandlers" />
<variable
name="isUserSignedIn"
type="boolean" />
<import type="android.view.View" />
<import type="io.timelimit.android.data.model.NetworkTime" />
<import type="io.timelimit.android.integration.platform.RuntimePermissionStatus" />
@ -68,9 +72,6 @@
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:foreground="?selectableItemBackground"
android:clickable="@{safeUnbox(isThisDevice)}"
android:onClick="@{() -> handlers.manageDeviceAdmin()}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -114,11 +115,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{safeUnbox(isThisDevice) ? View.VISIBLE : View.GONE}"
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:enabled="@{safeUnbox(isThisDevice)}"
android:onClick="@{() -> handlers.manageDeviceAdmin()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
@ -132,9 +135,6 @@
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:onClick="@{() -> handlers.openUsageStatsSettings()}"
android:foreground="?selectableItemBackground"
android:clickable="@{safeUnbox(isThisDevice) &amp;&amp; (usageStatsAccess != RuntimePermissionStatus.NotRequired)}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -145,18 +145,17 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:onClick="@{() -> handlers.helpUsageStatsAccess()}"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_permissions_usagestats_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_permissions_usagestats_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -165,6 +164,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -173,6 +174,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -180,11 +183,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{(( usageStatsAccess != RuntimePermissionStatus.NotRequired) &amp;&amp; (safeUnbox(isThisDevice))) ? View.VISIBLE : View.GONE}"
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.openUsageStatsSettings()}"
android:enabled="@{safeUnbox(isThisDevice) &amp;&amp; (usageStatsAccess != RuntimePermissionStatus.NotRequired)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
@ -198,9 +203,6 @@
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:onClick="@{() -> handlers.openNotificationAccessSettings()}"
android:foreground="?selectableItemBackground"
android:clickable="@{safeUnbox(isThisDevice) &amp;&amp; (notificationAccessPermission != NewPermissionStatus.NotSupported)}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -211,18 +213,17 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:onClick="@{() -> handlers.helpNotificationAccess()}"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_permission_notification_access_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_permission_notification_access_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{notificationAccessPermission == NewPermissionStatus.Granted ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -231,6 +232,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -239,6 +242,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotSupported ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -246,11 +251,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{(( notificationAccessPermission != NewPermissionStatus.NotSupported) &amp;&amp; (safeUnbox(isThisDevice))) ? View.VISIBLE : View.GONE}"
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.openNotificationAccessSettings()}"
android:enabled="@{safeUnbox(isThisDevice) &amp;&amp; (notificationAccessPermission != NewPermissionStatus.NotSupported)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
@ -264,9 +271,6 @@
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:onClick="@{() -> handlers.openDrawOverOtherAppsScreen()}"
android:foreground="?selectableItemBackground"
android:clickable="@{safeUnbox(isThisDevice) &amp;&amp; (overlayPermission != RuntimePermissionStatus.NotRequired)}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -277,18 +281,17 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:onClick="@{() -> handlers.helpDrawOverOtherApps()}"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_permissions_overlay_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_permissions_overlay_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{overlayPermission == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -297,6 +300,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -305,6 +310,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -312,11 +319,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{(( overlayPermission != RuntimePermissionStatus.NotRequired) &amp;&amp; (safeUnbox(isThisDevice))) ? View.VISIBLE : View.GONE}"
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.openDrawOverOtherAppsScreen()}"
android:enabled="@{safeUnbox(isThisDevice) &amp;&amp; (overlayPermission != RuntimePermissionStatus.NotRequired)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
@ -330,9 +339,6 @@
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:onClick="@{() -> handlers.openAccessibilitySettings()}"
android:foreground="?selectableItemBackground"
android:clickable="@{safeUnbox(isThisDevice)}"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -343,18 +349,17 @@
android:layout_height="wrap_content">
<TextView
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:onClick="@{() -> handlers.helpAccesibility()}"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_permission_accessibility_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_permission_accessibility_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{accessibilityServiceEnabled == true ? View.VISIBLE : View.GONE}"
android:textColor="@color/green"
android:textAppearance="?android:textAppearanceMedium"
@ -363,6 +368,8 @@
android:layout_height="wrap_content" />
<TextView
android:paddingTop="8dp"
android:gravity="center_horizontal"
android:visibility="@{accessibilityServiceEnabled == false ? View.VISIBLE : View.GONE}"
android:textColor="@color/red"
android:textAppearance="?android:textAppearanceMedium"
@ -370,12 +377,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{safeUnbox(isThisDevice) ? View.VISIBLE : View.GONE}"
android:text="@string/manage_device_permission_tap_top_open_settings"
android:textAppearance="?android:textAppearanceSmall"
android:layout_width="match_parent"
<Button
android:background="?selectableItemBackground"
android:text="@string/manage_device_permission_btn_modify"
android:layout_gravity="end"
android:onClick="@{() -> handlers.openAccessibilitySettings()}"
android:enabled="@{safeUnbox(isThisDevice)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
@ -388,6 +396,11 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
<View
android:visibility="@{isUserSignedIn ? View.GONE : View.VISIBLE}"
android:layout_width="match_parent"
android:layout_height="76dp" />
</LinearLayout>
</ScrollView>

View file

@ -27,17 +27,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_reboot_manipulation_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_reboot_manipulation_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/checkbox"
android:text="@string/manage_device_reboot_manipulation_checkbox"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -41,18 +41,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:background="?selectableItemBackground"
android:text="@string/category_settings_parent_category_title"
android:textAppearance="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="@string/category_settings_parent_category_intro"
android:textAppearance="?android:textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:visibility="@{isParentCategory ? View.VISIBLE : View.GONE}"
android:text="@string/category_settings_parent_category_already_used_as_parent"

View file

@ -39,17 +39,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:text="@string/manage_send_device_connected_title"
android:textAppearance="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_send_device_connected_info"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:enabled="@{isThisDevice &amp;&amp; isConnectedMode}"
android:id="@+id/checkbox"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -45,17 +45,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/primary_device_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/primary_device_description"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:enabled="@{status != PrimaryDeviceStatus.LocalMode}"
android:text="@string/primary_device_checkbox_relax"

View file

@ -26,17 +26,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/manage_device_network_time_verification_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/manage_device_network_time_verification_description"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:checkedButton="@+id/network_time_verification_disabled"
android:id="@+id/network_time_verification_radio_group"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -22,10 +22,6 @@
name="disabledUntilString"
type="String" />
<variable
name="userName"
type="String" />
<variable
name="handlers"
type="io.timelimit.android.ui.view.ManageDisableTimelimitsViewHandlers" />
@ -45,18 +41,14 @@
android:layout_height="wrap_content">
<TextView
android:id="@+id/title_view"
android:background="?selectableItemBackground"
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
android:text="@string/manage_disable_time_limits_title"
android:textAppearance="?android:textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
tools:text="@string/manage_disable_time_limits_text"
android:text="@{@string/manage_disable_time_limits_text(userName)}"
android:textAppearance="?android:textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:textStyle="bold"
android:visibility="@{TextUtils.isEmpty(disabledUntilString) ? View.GONE : View.VISIBLE}"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -15,7 +15,7 @@
-->
<resources>
<string name="time_warning_title">Zeitwarnung</string>
<string name="time_warning_desc">Wenn weniger Zeit als unten ausgewählt übrig ist, dann wird eine Benachrichtigung angezeigt</string>
<string name="time_warning_desc">Wenn weniger Zeit als ausgewählt übrig ist, dann wird eine Benachrichtigung angezeigt</string>
<string name="time_warning_not_title">Zeitwarnung für %s</string>
</resources>

View file

@ -107,6 +107,8 @@
<string name="manage_device_permission_status_not_required">Die Berechtigung wird aufgrund der alten Android-Version nicht benötigt</string>
<string name="manage_device_permission_status_not_supported">Diese Funktion wird von diesem Gerät nicht unterstützt</string>
<string name="manage_device_permission_btn_modify">Ändern</string>
<string name="manage_device_downgrade_title">Downgrade</string>
<string name="manage_device_downgrade_text">Auf diesem Gerät wurde eine neuere Version von TimeLimit durch eine ältere ersetzt</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -15,7 +15,7 @@
-->
<resources>
<string name="manage_disable_time_limits_title">Zeitbegrenzungen deaktivieren</string>
<string name="manage_disable_time_limits_text">Alle Zeitbegrenzungen und Sperrzeiten für %s werden aufgehoben</string>
<string name="manage_disable_time_limits_text">Hiermit können alle Zeitbegrenzungen und Sperrzeiten aufgehoben werden</string>
<string name="manage_disable_time_limits_info_enabled">Zeitbegrenzungen sind deaktiviert bis %s</string>
<string name="manage_disable_time_limits_btn_enable">Zeitbegrenzungen wieder aktivieren</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -15,7 +15,7 @@
-->
<resources>
<string name="time_warning_title">Time warnings</string>
<string name="time_warning_desc">If there is less time remaining than checked below, then a notification will be shown</string>
<string name="time_warning_desc">If there is less time remaining than checked, then a notification will be shown</string>
<string name="time_warning_not_title">Time warning for %s</string>
</resources>

View file

@ -105,6 +105,8 @@
<string name="manage_device_permission_status_not_required">The permission is not needed due to the old Android version</string>
<string name="manage_device_permission_status_not_supported">This feature is not supported by this device</string>
<string name="manage_device_permission_btn_modify">Modify</string>
<string name="manage_device_downgrade_title">Downgrade</string>
<string name="manage_device_downgrade_text">On this device, a newer version of TimeLimit was replaced by an older one</string>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
TimeLimit Copyright <C> 2019 Jonas Lochmann
TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
@ -15,7 +15,7 @@
-->
<resources>
<string name="manage_disable_time_limits_title">Disable time limits</string>
<string name="manage_disable_time_limits_text">All time limits and blocked time areas for %s are disabled</string>
<string name="manage_disable_time_limits_text">Using this, all time limits and blocked time areas can be disabled</string>
<string name="manage_disable_time_limits_info_enabled">Time limits are disabled until %s</string>
<string name="manage_disable_time_limits_btn_enable">Enable time limits again</string>