mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-06 03:50:23 +02:00
Move many help texts to dialogs
This commit is contained in:
parent
3da677877f
commit
cfddc164e8
52 changed files with 675 additions and 298 deletions
|
@ -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)
|
||||||
|
}
|
|
@ -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
|
* 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
|
* 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.actions.UpdateNetworkTimeVerificationAction
|
||||||
import io.timelimit.android.sync.network.UpdatePrimaryDeviceRequestType
|
import io.timelimit.android.sync.network.UpdatePrimaryDeviceRequestType
|
||||||
import io.timelimit.android.ui.MainActivity
|
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.ActivityViewModel
|
||||||
import io.timelimit.android.ui.main.AuthenticationFab
|
import io.timelimit.android.ui.main.AuthenticationFab
|
||||||
import io.timelimit.android.ui.main.getActivityViewModel
|
import io.timelimit.android.ui.main.getActivityViewModel
|
||||||
|
@ -223,6 +224,13 @@ class LockFragment : Fragment() {
|
||||||
})
|
})
|
||||||
|
|
||||||
// bind adding extra time controls
|
// 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 ->
|
logic.fullVersion.shouldProvideFullVersionFunctions.observe(this, Observer { hasFullVersion ->
|
||||||
binding.extraTimeBtnOk.setOnClickListener {
|
binding.extraTimeBtnOk.setOnClickListener {
|
||||||
binding.extraTimeSelection.clearNumberPickerFocus()
|
binding.extraTimeSelection.clearNumberPickerFocus()
|
||||||
|
@ -285,8 +293,6 @@ class LockFragment : Fragment() {
|
||||||
activity = activity!!,
|
activity = activity!!,
|
||||||
hasFullVersion = hasFullVersion == true
|
hasFullVersion = hasFullVersion == true
|
||||||
)
|
)
|
||||||
|
|
||||||
binding.manageDisableTimeLimits.userName = child.name
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
package io.timelimit.android.ui.manage.category.settings
|
package io.timelimit.android.ui.manage.category.settings
|
||||||
|
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
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.ignoreUnchanged
|
||||||
import io.timelimit.android.livedata.map
|
import io.timelimit.android.livedata.map
|
||||||
import io.timelimit.android.sync.actions.UpdateCategoryBatteryLimit
|
import io.timelimit.android.sync.actions.UpdateCategoryBatteryLimit
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
|
|
||||||
object CategoryBatteryLimitView {
|
object CategoryBatteryLimitView {
|
||||||
|
@ -34,8 +36,16 @@ object CategoryBatteryLimitView {
|
||||||
lifecycleOwner: LifecycleOwner,
|
lifecycleOwner: LifecycleOwner,
|
||||||
category: LiveData<Category?>,
|
category: LiveData<Category?>,
|
||||||
auth: ActivityViewModel,
|
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 {
|
binding.seekbarCharging.setOnSeekBarChangeListener(object: SeekBar.OnSeekBarChangeListener {
|
||||||
override fun onStartTrackingTouch(p0: SeekBar?) = Unit
|
override fun onStartTrackingTouch(p0: SeekBar?) = Unit
|
||||||
override fun onStopTrackingTouch(p0: SeekBar?) = Unit
|
override fun onStopTrackingTouch(p0: SeekBar?) = Unit
|
||||||
|
|
|
@ -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
|
package io.timelimit.android.ui.manage.category.settings
|
||||||
|
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.Category
|
import io.timelimit.android.data.model.Category
|
||||||
import io.timelimit.android.databinding.CategoryNotificationFilterBinding
|
import io.timelimit.android.databinding.CategoryNotificationFilterBinding
|
||||||
import io.timelimit.android.livedata.mergeLiveData
|
import io.timelimit.android.livedata.mergeLiveData
|
||||||
import io.timelimit.android.sync.actions.UpdateCategoryBlockAllNotificationsAction
|
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.main.ActivityViewModel
|
||||||
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
|
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
|
||||||
|
|
||||||
|
@ -19,6 +36,13 @@ object CategoryNotificationFilter {
|
||||||
lifecycleOwner: LifecycleOwner,
|
lifecycleOwner: LifecycleOwner,
|
||||||
fragmentManager: FragmentManager
|
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
|
val premium = auth.logic.fullVersion.shouldProvideFullVersionFunctions
|
||||||
|
|
||||||
mergeLiveData(categoryLive, premium).observe(lifecycleOwner, Observer { (category, hasPremium) ->
|
mergeLiveData(categoryLive, premium).observe(lifecycleOwner, Observer { (category, hasPremium) ->
|
||||||
|
|
|
@ -28,6 +28,7 @@ import io.timelimit.android.databinding.FragmentCategorySettingsBinding
|
||||||
import io.timelimit.android.logic.AppLogic
|
import io.timelimit.android.logic.AppLogic
|
||||||
import io.timelimit.android.logic.DefaultAppLogic
|
import io.timelimit.android.logic.DefaultAppLogic
|
||||||
import io.timelimit.android.sync.actions.SetCategoryExtraTimeAction
|
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.ActivityViewModel
|
||||||
import io.timelimit.android.ui.main.getActivityViewModel
|
import io.timelimit.android.ui.main.getActivityViewModel
|
||||||
import io.timelimit.android.ui.manage.category.ManageCategoryFragmentArgs
|
import io.timelimit.android.ui.manage.category.ManageCategoryFragmentArgs
|
||||||
|
@ -58,7 +59,8 @@ class CategorySettingsFragment : Fragment() {
|
||||||
categoryId = params.categoryId,
|
categoryId = params.categoryId,
|
||||||
childId = params.childId,
|
childId = params.childId,
|
||||||
database = appLogic.database,
|
database = appLogic.database,
|
||||||
auth = auth
|
auth = auth,
|
||||||
|
fragmentManager = fragmentManager!!
|
||||||
)
|
)
|
||||||
|
|
||||||
CategoryBatteryLimitView.bind(
|
CategoryBatteryLimitView.bind(
|
||||||
|
@ -66,7 +68,8 @@ class CategorySettingsFragment : Fragment() {
|
||||||
lifecycleOwner = this,
|
lifecycleOwner = this,
|
||||||
category = categoryEntry,
|
category = categoryEntry,
|
||||||
auth = auth,
|
auth = auth,
|
||||||
categoryId = params.categoryId
|
categoryId = params.categoryId,
|
||||||
|
fragmentManager = fragmentManager!!
|
||||||
)
|
)
|
||||||
|
|
||||||
ParentCategoryView.bind(
|
ParentCategoryView.bind(
|
||||||
|
@ -91,12 +94,20 @@ class CategorySettingsFragment : Fragment() {
|
||||||
view = binding.timeWarnings,
|
view = binding.timeWarnings,
|
||||||
auth = auth,
|
auth = auth,
|
||||||
categoryLive = categoryEntry,
|
categoryLive = categoryEntry,
|
||||||
lifecycleOwner = this
|
lifecycleOwner = this,
|
||||||
|
fragmentManager = fragmentManager!!
|
||||||
)
|
)
|
||||||
|
|
||||||
binding.btnDeleteCategory.setOnClickListener { deleteCategory() }
|
binding.btnDeleteCategory.setOnClickListener { deleteCategory() }
|
||||||
binding.editCategoryTitleGo.setOnClickListener { renameCategory() }
|
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 {
|
categoryEntry.observe(this, Observer {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
val roundedCurrentTimeInMillis = (it.extraTimeInMillis / (1000 * 60)) * (1000 * 60)
|
val roundedCurrentTimeInMillis = (it.extraTimeInMillis / (1000 * 60)) * (1000 * 60)
|
||||||
|
|
|
@ -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
|
package io.timelimit.android.ui.manage.category.settings
|
||||||
|
|
||||||
import android.widget.CheckBox
|
import android.widget.CheckBox
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.Category
|
import io.timelimit.android.data.model.Category
|
||||||
import io.timelimit.android.data.model.CategoryTimeWarnings
|
import io.timelimit.android.data.model.CategoryTimeWarnings
|
||||||
import io.timelimit.android.databinding.CategoryTimeWarningsViewBinding
|
import io.timelimit.android.databinding.CategoryTimeWarningsViewBinding
|
||||||
import io.timelimit.android.sync.actions.UpdateCategoryTimeWarningsAction
|
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.ui.main.ActivityViewModel
|
||||||
import io.timelimit.android.util.TimeTextUtil
|
import io.timelimit.android.util.TimeTextUtil
|
||||||
|
|
||||||
|
@ -16,8 +34,16 @@ object CategoryTimeWarningView {
|
||||||
view: CategoryTimeWarningsViewBinding,
|
view: CategoryTimeWarningsViewBinding,
|
||||||
lifecycleOwner: LifecycleOwner,
|
lifecycleOwner: LifecycleOwner,
|
||||||
categoryLive: LiveData<Category?>,
|
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()
|
view.linearLayout.removeAllViews()
|
||||||
|
|
||||||
val durationToCheckbox = mutableMapOf<Long, CheckBox>()
|
val durationToCheckbox = mutableMapOf<Long, CheckBox>()
|
||||||
|
|
|
@ -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
|
* 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
|
* 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
|
package io.timelimit.android.ui.manage.category.settings
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.Database
|
import io.timelimit.android.data.Database
|
||||||
import io.timelimit.android.databinding.ManageCategoryForUnassignedAppsBinding
|
import io.timelimit.android.databinding.ManageCategoryForUnassignedAppsBinding
|
||||||
import io.timelimit.android.livedata.ignoreUnchanged
|
import io.timelimit.android.livedata.ignoreUnchanged
|
||||||
import io.timelimit.android.livedata.map
|
import io.timelimit.android.livedata.map
|
||||||
import io.timelimit.android.sync.actions.SetCategoryForUnassignedApps
|
import io.timelimit.android.sync.actions.SetCategoryForUnassignedApps
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
|
|
||||||
object ManageCategoryForUnassignedApps {
|
object ManageCategoryForUnassignedApps {
|
||||||
|
@ -31,8 +34,16 @@ object ManageCategoryForUnassignedApps {
|
||||||
childId: String,
|
childId: String,
|
||||||
auth: ActivityViewModel,
|
auth: ActivityViewModel,
|
||||||
database: Database,
|
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 userEntry = database.user().getUserByIdLive(childId)
|
||||||
val isCurrentlyChosen = userEntry.map { it?.categoryForNotAssignedApps == categoryId }.ignoreUnchanged()
|
val isCurrentlyChosen = userEntry.map { it?.categoryForNotAssignedApps == categoryId }.ignoreUnchanged()
|
||||||
|
|
||||||
|
|
|
@ -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
|
* 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
|
* 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.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.Database
|
import io.timelimit.android.data.Database
|
||||||
import io.timelimit.android.databinding.ManageParentCategoryBinding
|
import io.timelimit.android.databinding.ManageParentCategoryBinding
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
|
|
||||||
object ParentCategoryView {
|
object ParentCategoryView {
|
||||||
|
@ -32,6 +34,13 @@ object ParentCategoryView {
|
||||||
database: Database,
|
database: Database,
|
||||||
fragmentManager: FragmentManager
|
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 ->
|
database.category().getCategoriesByChildId(childId).observe(lifecycleOwner, Observer { categories ->
|
||||||
val ownCategory = categories.find { it.id == categoryId }
|
val ownCategory = categories.find { it.id == categoryId }
|
||||||
val parentCategory = categories.find { it.id == ownCategory?.parentCategoryId }
|
val parentCategory = categories.find { it.id == ownCategory?.parentCategoryId }
|
||||||
|
|
|
@ -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
|
* 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
|
* 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.fragment.app.Fragment
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.User
|
import io.timelimit.android.data.model.User
|
||||||
import io.timelimit.android.databinding.FragmentManageChildAdvancedBinding
|
import io.timelimit.android.databinding.FragmentManageChildAdvancedBinding
|
||||||
import io.timelimit.android.livedata.liveDataFromFunction
|
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.AppLogic
|
||||||
import io.timelimit.android.logic.DefaultAppLogic
|
import io.timelimit.android.logic.DefaultAppLogic
|
||||||
import io.timelimit.android.sync.actions.UpdateCategoryTemporarilyBlockedAction
|
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.ActivityViewModel
|
||||||
import io.timelimit.android.ui.main.getActivityViewModel
|
import io.timelimit.android.ui.main.getActivityViewModel
|
||||||
import io.timelimit.android.ui.manage.child.ManageChildFragmentArgs
|
import io.timelimit.android.ui.manage.child.ManageChildFragmentArgs
|
||||||
|
@ -61,6 +63,13 @@ class ManageChildAdvancedFragment : Fragment() {
|
||||||
run {
|
run {
|
||||||
// blocked categories
|
// 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)
|
val categoriesLive = logic.database.category().getCategoriesByChildId(params.childId)
|
||||||
|
|
||||||
mergeLiveData(categoriesLive, logic.fullVersion.shouldProvideFullVersionFunctions).observe(this, Observer {
|
mergeLiveData(categoriesLive, logic.fullVersion.shouldProvideFullVersionFunctions).observe(this, Observer {
|
||||||
|
@ -117,8 +126,6 @@ class ManageChildAdvancedFragment : Fragment() {
|
||||||
activity = activity!!,
|
activity = activity!!,
|
||||||
hasFullVersion = hasFullVersion == true
|
hasFullVersion = hasFullVersion == true
|
||||||
)
|
)
|
||||||
|
|
||||||
binding.disableTimeLimits.userName = child.name
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -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
|
* 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
|
* 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.content.Context
|
||||||
import android.text.format.DateUtils
|
import android.text.format.DateUtils
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.User
|
import io.timelimit.android.data.model.User
|
||||||
import io.timelimit.android.data.model.UserType
|
import io.timelimit.android.data.model.UserType
|
||||||
import io.timelimit.android.date.DateInTimezone
|
import io.timelimit.android.date.DateInTimezone
|
||||||
import io.timelimit.android.logic.DefaultAppLogic
|
import io.timelimit.android.logic.DefaultAppLogic
|
||||||
import io.timelimit.android.logic.RealTime
|
import io.timelimit.android.logic.RealTime
|
||||||
import io.timelimit.android.sync.actions.SetUserDisableLimitsUntilAction
|
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.main.getActivityViewModel
|
||||||
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
|
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
|
||||||
import io.timelimit.android.ui.view.ManageDisableTimelimitsViewHandlers
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
* 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
|
* 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.LifecycleOwner
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.User
|
import io.timelimit.android.data.model.User
|
||||||
import io.timelimit.android.databinding.ManageChildPasswordBinding
|
import io.timelimit.android.databinding.ManageChildPasswordBinding
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
|
|
||||||
object ManageChildPassword {
|
object ManageChildPassword {
|
||||||
|
@ -32,6 +34,13 @@ object ManageChildPassword {
|
||||||
auth: ActivityViewModel,
|
auth: ActivityViewModel,
|
||||||
fragmentManager: FragmentManager
|
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 {
|
childEntry.observe(lifecycleOwner, Observer {
|
||||||
view.hasPassword = it?.password?.isNotEmpty() ?: false
|
view.hasPassword = it?.password?.isNotEmpty() ?: false
|
||||||
})
|
})
|
||||||
|
|
|
@ -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
|
* 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
|
* 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.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.databinding.PrimaryDeviceViewBinding
|
import io.timelimit.android.databinding.PrimaryDeviceViewBinding
|
||||||
import io.timelimit.android.livedata.mergeLiveData
|
import io.timelimit.android.livedata.mergeLiveData
|
||||||
import io.timelimit.android.logic.AppLogic
|
import io.timelimit.android.logic.AppLogic
|
||||||
import io.timelimit.android.sync.actions.SetRelaxPrimaryDeviceAction
|
import io.timelimit.android.sync.actions.SetRelaxPrimaryDeviceAction
|
||||||
import io.timelimit.android.sync.network.UpdatePrimaryDeviceRequestType
|
import io.timelimit.android.sync.network.UpdatePrimaryDeviceRequestType
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
|
|
||||||
object PrimaryDeviceView {
|
object PrimaryDeviceView {
|
||||||
|
@ -34,6 +36,13 @@ object PrimaryDeviceView {
|
||||||
lifecycleOwner: LifecycleOwner,
|
lifecycleOwner: LifecycleOwner,
|
||||||
auth: ActivityViewModel
|
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 userEntry = logic.database.user().getUserByIdLive(childId)
|
||||||
val ownDeviceId = logic.deviceId
|
val ownDeviceId = logic.deviceId
|
||||||
val ownDeviceUser = logic.deviceUserId
|
val ownDeviceUser = logic.deviceUserId
|
||||||
|
|
|
@ -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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -93,7 +93,8 @@ class ManageDeviceAdvancedFragment : Fragment(), FragmentWithCustomTitle {
|
||||||
view = binding.manageBackgroundSync,
|
view = binding.manageBackgroundSync,
|
||||||
isThisDevice = isThisDevice,
|
isThisDevice = isThisDevice,
|
||||||
lifecycleOwner = this,
|
lifecycleOwner = this,
|
||||||
activityViewModel = auth
|
activityViewModel = auth,
|
||||||
|
fragmentManager = fragmentManager!!
|
||||||
)
|
)
|
||||||
|
|
||||||
binding.handlers = object: ManageDeviceAdvancedFragmentHandlers {
|
binding.handlers = object: ManageDeviceAdvancedFragmentHandlers {
|
||||||
|
|
|
@ -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
|
* 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
|
* 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
|
package io.timelimit.android.ui.manage.device.manage.advanced
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.async.Threads
|
import io.timelimit.android.async.Threads
|
||||||
import io.timelimit.android.databinding.ManageDeviceBackgroundSyncViewBinding
|
import io.timelimit.android.databinding.ManageDeviceBackgroundSyncViewBinding
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
import io.timelimit.android.work.PeriodicSyncInBackgroundWorker
|
import io.timelimit.android.work.PeriodicSyncInBackgroundWorker
|
||||||
|
|
||||||
|
@ -28,8 +31,16 @@ object ManageDeviceBackgroundSync {
|
||||||
view: ManageDeviceBackgroundSyncViewBinding,
|
view: ManageDeviceBackgroundSyncViewBinding,
|
||||||
isThisDevice: LiveData<Boolean>,
|
isThisDevice: LiveData<Boolean>,
|
||||||
lifecycleOwner: LifecycleOwner,
|
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 })
|
isThisDevice.observe(lifecycleOwner, Observer { view.isThisDevice = it })
|
||||||
activityViewModel.logic.fullVersion.isLocalMode.observe(lifecycleOwner, Observer { view.isUsingLocalMode = it })
|
activityViewModel.logic.fullVersion.isLocalMode.observe(lifecycleOwner, Observer { view.isUsingLocalMode = it })
|
||||||
|
|
||||||
|
|
|
@ -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
|
* 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
|
* 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.livedata.switchMap
|
||||||
import io.timelimit.android.sync.actions.SignOutAtDeviceAction
|
import io.timelimit.android.sync.actions.SignOutAtDeviceAction
|
||||||
import io.timelimit.android.sync.actions.apply.ApplyActionUtil
|
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.main.ActivityViewModel
|
||||||
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
|
import io.timelimit.android.ui.payment.RequiresPurchaseDialogFragment
|
||||||
import io.timelimit.android.util.TimeTextUtil
|
import io.timelimit.android.util.TimeTextUtil
|
||||||
|
@ -44,6 +45,13 @@ object ManageDeviceDefaultUser {
|
||||||
) {
|
) {
|
||||||
val context = view.root.context
|
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 ->
|
device.switchMap { deviceEntry ->
|
||||||
users.map { users ->
|
users.map { users ->
|
||||||
deviceEntry to users.find { it.id == deviceEntry?.defaultUser }
|
deviceEntry to users.find { it.id == deviceEntry?.defaultUser }
|
||||||
|
|
|
@ -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
|
package io.timelimit.android.ui.manage.device.manage.feature
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.Device
|
import io.timelimit.android.data.model.Device
|
||||||
import io.timelimit.android.databinding.ManageDeviceActivityLevelBlockingBinding
|
import io.timelimit.android.databinding.ManageDeviceActivityLevelBlockingBinding
|
||||||
import io.timelimit.android.sync.actions.UpdateEnableActivityLevelBlocking
|
import io.timelimit.android.sync.actions.UpdateEnableActivityLevelBlocking
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
|
|
||||||
object ManageDeviceActivityLevelBlocking {
|
object ManageDeviceActivityLevelBlocking {
|
||||||
|
@ -13,8 +31,16 @@ object ManageDeviceActivityLevelBlocking {
|
||||||
view: ManageDeviceActivityLevelBlockingBinding,
|
view: ManageDeviceActivityLevelBlockingBinding,
|
||||||
auth: ActivityViewModel,
|
auth: ActivityViewModel,
|
||||||
deviceEntry: LiveData<Device?>,
|
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 ->
|
deviceEntry.observe(lifecycleOwner, Observer { device ->
|
||||||
val enable = device?.enableActivityLevelBlocking ?: false
|
val enable = device?.enableActivityLevelBlocking ?: false
|
||||||
|
|
||||||
|
|
|
@ -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
|
* 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
|
* 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.R
|
||||||
import io.timelimit.android.data.model.Device
|
import io.timelimit.android.data.model.Device
|
||||||
import io.timelimit.android.data.model.NetworkTime
|
import io.timelimit.android.data.model.NetworkTime
|
||||||
|
import io.timelimit.android.databinding.HelpDialogFragmentBinding
|
||||||
import io.timelimit.android.databinding.ManageDeviceFeaturesFragmentBinding
|
import io.timelimit.android.databinding.ManageDeviceFeaturesFragmentBinding
|
||||||
import io.timelimit.android.livedata.liveDataFromValue
|
import io.timelimit.android.livedata.liveDataFromValue
|
||||||
import io.timelimit.android.livedata.map
|
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.DefaultAppLogic
|
||||||
import io.timelimit.android.logic.RealTime
|
import io.timelimit.android.logic.RealTime
|
||||||
import io.timelimit.android.sync.actions.UpdateNetworkTimeVerificationAction
|
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.ActivityViewModel
|
||||||
import io.timelimit.android.ui.main.ActivityViewModelHolder
|
import io.timelimit.android.ui.main.ActivityViewModelHolder
|
||||||
import io.timelimit.android.ui.main.AuthenticationFab
|
import io.timelimit.android.ui.main.AuthenticationFab
|
||||||
|
@ -114,6 +116,13 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
|
||||||
override fun showAuthenticationScreen() {
|
override fun showAuthenticationScreen() {
|
||||||
activity.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
|
// network time status
|
||||||
|
@ -135,7 +144,8 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
|
||||||
view = binding.deviceRebootManipulation,
|
view = binding.deviceRebootManipulation,
|
||||||
lifecycleOwner = this,
|
lifecycleOwner = this,
|
||||||
deviceEntry = deviceEntry,
|
deviceEntry = deviceEntry,
|
||||||
auth = auth
|
auth = auth,
|
||||||
|
fragmentManager = fragmentManager!!
|
||||||
)
|
)
|
||||||
|
|
||||||
// activity level blocking
|
// activity level blocking
|
||||||
|
@ -143,7 +153,8 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
|
||||||
view = binding.activityLevelBlocking,
|
view = binding.activityLevelBlocking,
|
||||||
auth = auth,
|
auth = auth,
|
||||||
deviceEntry = deviceEntry,
|
deviceEntry = deviceEntry,
|
||||||
lifecycleOwner = this
|
lifecycleOwner = this,
|
||||||
|
fragmentManager = fragmentManager!!
|
||||||
)
|
)
|
||||||
|
|
||||||
// send connected
|
// send connected
|
||||||
|
@ -151,7 +162,8 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
|
||||||
binding = binding.sendDeviceConnected,
|
binding = binding.sendDeviceConnected,
|
||||||
deviceEntry = deviceEntry,
|
deviceEntry = deviceEntry,
|
||||||
auth = auth,
|
auth = auth,
|
||||||
lifecycleOwner = this
|
lifecycleOwner = this,
|
||||||
|
fragmentManager = fragmentManager!!
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,4 +176,5 @@ class ManageDeviceFeaturesFragment : Fragment(), FragmentWithCustomTitle {
|
||||||
interface ManageDeviceFeaturesFragmentHandlers {
|
interface ManageDeviceFeaturesFragmentHandlers {
|
||||||
fun changeNetworkTimeVerification(newValue: NetworkTime)
|
fun changeNetworkTimeVerification(newValue: NetworkTime)
|
||||||
fun showAuthenticationScreen()
|
fun showAuthenticationScreen()
|
||||||
|
fun showNetworkTimeHelp()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* 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
|
* 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
|
package io.timelimit.android.ui.manage.device.manage.feature
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.Device
|
import io.timelimit.android.data.model.Device
|
||||||
import io.timelimit.android.databinding.ManageDeviceRebootManipulationViewBinding
|
import io.timelimit.android.databinding.ManageDeviceRebootManipulationViewBinding
|
||||||
import io.timelimit.android.sync.actions.SetConsiderRebootManipulationAction
|
import io.timelimit.android.sync.actions.SetConsiderRebootManipulationAction
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
|
|
||||||
object ManageDeviceRebootManipulationView {
|
object ManageDeviceRebootManipulationView {
|
||||||
|
@ -28,8 +31,16 @@ object ManageDeviceRebootManipulationView {
|
||||||
view: ManageDeviceRebootManipulationViewBinding,
|
view: ManageDeviceRebootManipulationViewBinding,
|
||||||
deviceEntry: LiveData<Device?>,
|
deviceEntry: LiveData<Device?>,
|
||||||
lifecycleOwner: LifecycleOwner,
|
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 ->
|
deviceEntry.observe(lifecycleOwner, Observer { device ->
|
||||||
val checked = device?.considerRebootManipulation ?: false
|
val checked = device?.considerRebootManipulation ?: false
|
||||||
|
|
||||||
|
|
|
@ -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
|
* 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
|
* 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
|
package io.timelimit.android.ui.manage.device.manage.feature
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.Device
|
import io.timelimit.android.data.model.Device
|
||||||
import io.timelimit.android.livedata.mergeLiveData
|
import io.timelimit.android.livedata.mergeLiveData
|
||||||
import io.timelimit.android.sync.actions.SetSendDeviceConnected
|
import io.timelimit.android.sync.actions.SetSendDeviceConnected
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.main.ActivityViewModel
|
import io.timelimit.android.ui.main.ActivityViewModel
|
||||||
|
|
||||||
object ManageSendDeviceConnected {
|
object ManageSendDeviceConnected {
|
||||||
|
@ -28,10 +31,18 @@ object ManageSendDeviceConnected {
|
||||||
binding: io.timelimit.android.databinding.ManageSendDeviceConnectedBinding,
|
binding: io.timelimit.android.databinding.ManageSendDeviceConnectedBinding,
|
||||||
auth: ActivityViewModel,
|
auth: ActivityViewModel,
|
||||||
deviceEntry: LiveData<Device?>,
|
deviceEntry: LiveData<Device?>,
|
||||||
lifecycleOwner: LifecycleOwner
|
lifecycleOwner: LifecycleOwner,
|
||||||
|
fragmentManager: FragmentManager
|
||||||
) {
|
) {
|
||||||
val ownDeviceIdLive = auth.logic.deviceId
|
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) ->
|
mergeLiveData(ownDeviceIdLive, deviceEntry).observe(lifecycleOwner, Observer { (ownDeviceId, device) ->
|
||||||
binding.isThisDevice = ownDeviceId == device?.id && device?.id != null
|
binding.isThisDevice = ownDeviceId == device?.id && device?.id != null
|
||||||
})
|
})
|
||||||
|
|
|
@ -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
|
* 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
|
* 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 androidx.navigation.Navigation
|
||||||
import io.timelimit.android.R
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.Device
|
import io.timelimit.android.data.model.Device
|
||||||
|
import io.timelimit.android.data.model.UserType
|
||||||
import io.timelimit.android.databinding.ManageDevicePermissionsFragmentBinding
|
import io.timelimit.android.databinding.ManageDevicePermissionsFragmentBinding
|
||||||
import io.timelimit.android.integration.platform.NewPermissionStatus
|
import io.timelimit.android.integration.platform.NewPermissionStatus
|
||||||
import io.timelimit.android.integration.platform.ProtectionLevel
|
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.livedata.map
|
||||||
import io.timelimit.android.logic.AppLogic
|
import io.timelimit.android.logic.AppLogic
|
||||||
import io.timelimit.android.logic.DefaultAppLogic
|
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.ActivityViewModel
|
||||||
import io.timelimit.android.ui.main.ActivityViewModelHolder
|
import io.timelimit.android.ui.main.ActivityViewModelHolder
|
||||||
import io.timelimit.android.ui.main.AuthenticationFab
|
import io.timelimit.android.ui.main.AuthenticationFab
|
||||||
|
@ -102,6 +104,10 @@ class ManageDevicePermissionsFragment : Fragment(), FragmentWithCustomTitle {
|
||||||
doesSupportAuth = liveDataFromValue(true)
|
doesSupportAuth = liveDataFromValue(true)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
auth.authenticatedUser.map { it?.second?.type == UserType.Parent }.observe(this, Observer {
|
||||||
|
binding.isUserSignedIn = it
|
||||||
|
})
|
||||||
|
|
||||||
// handlers
|
// handlers
|
||||||
binding.handlers = object: ManageDevicePermissionsFragmentHandlers {
|
binding.handlers = object: ManageDevicePermissionsFragmentHandlers {
|
||||||
override fun openUsageStatsSettings() {
|
override fun openUsageStatsSettings() {
|
||||||
|
@ -189,6 +195,34 @@ class ManageDevicePermissionsFragment : Fragment(), FragmentWithCustomTitle {
|
||||||
override fun showAuthenticationScreen() {
|
override fun showAuthenticationScreen() {
|
||||||
activity.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
|
// is this device
|
||||||
|
@ -233,4 +267,8 @@ interface ManageDevicePermissionsFragmentHandlers {
|
||||||
fun openAccessibilitySettings()
|
fun openAccessibilitySettings()
|
||||||
fun manageDeviceAdmin()
|
fun manageDeviceAdmin()
|
||||||
fun showAuthenticationScreen()
|
fun showAuthenticationScreen()
|
||||||
|
fun helpUsageStatsAccess()
|
||||||
|
fun helpNotificationAccess()
|
||||||
|
fun helpDrawOverOtherApps()
|
||||||
|
fun helpAccesibility()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* 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
|
* 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.integration.platform.android.AdminReceiver
|
||||||
import io.timelimit.android.logic.AppLogic
|
import io.timelimit.android.logic.AppLogic
|
||||||
import io.timelimit.android.logic.DefaultAppLogic
|
import io.timelimit.android.logic.DefaultAppLogic
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
import io.timelimit.android.ui.manage.device.manage.permission.InformAboutDeviceOwnerDialogFragment
|
import io.timelimit.android.ui.manage.device.manage.permission.InformAboutDeviceOwnerDialogFragment
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,6 +133,34 @@ class SetupDevicePermissionsFragment : Fragment() {
|
||||||
R.id.setupDevicePermissionsFragment
|
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()
|
refreshStatus()
|
||||||
|
@ -163,4 +192,8 @@ interface SetupDevicePermissionsHandlers {
|
||||||
fun openDrawOverOtherAppsScreen()
|
fun openDrawOverOtherAppsScreen()
|
||||||
fun openAccessibilitySettings()
|
fun openAccessibilitySettings()
|
||||||
fun gotoNextStep()
|
fun gotoNextStep()
|
||||||
|
fun helpUsageStatsAccess()
|
||||||
|
fun helpNotificationAccess()
|
||||||
|
fun helpDrawOverOtherApps()
|
||||||
|
fun helpAccesibility()
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,8 @@ class SetupLocalModeFragment : Fragment() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetupNetworkTimeVerification.prepareHelpButton(binding.networkTimeVerification, fragmentManager!!)
|
||||||
|
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -15,9 +15,11 @@
|
||||||
*/
|
*/
|
||||||
package io.timelimit.android.ui.setup
|
package io.timelimit.android.ui.setup
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentManager
|
||||||
import io.timelimit.android.R
|
import io.timelimit.android.R
|
||||||
import io.timelimit.android.data.model.NetworkTime
|
import io.timelimit.android.data.model.NetworkTime
|
||||||
import io.timelimit.android.databinding.SetupNetworkTimeVerificationBinding
|
import io.timelimit.android.databinding.SetupNetworkTimeVerificationBinding
|
||||||
|
import io.timelimit.android.ui.help.HelpDialogFragment
|
||||||
|
|
||||||
object SetupNetworkTimeVerification {
|
object SetupNetworkTimeVerification {
|
||||||
fun readSelection(view: SetupNetworkTimeVerificationBinding) = when (view.networkTimeVerificationRadioGroup.checkedRadioButtonId) {
|
fun readSelection(view: SetupNetworkTimeVerificationBinding) = when (view.networkTimeVerificationRadioGroup.checkedRadioButtonId) {
|
||||||
|
@ -26,4 +28,13 @@ object SetupNetworkTimeVerification {
|
||||||
R.id.network_time_verification_enabled -> NetworkTime.Enabled
|
R.id.network_time_verification_enabled -> NetworkTime.Enabled
|
||||||
else -> throw IllegalStateException()
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -291,7 +291,8 @@ class SetupDeviceFragment : Fragment() {
|
||||||
view = binding.backgroundSync,
|
view = binding.backgroundSync,
|
||||||
isThisDevice = liveDataFromValue(true),
|
isThisDevice = liveDataFromValue(true),
|
||||||
lifecycleOwner = this,
|
lifecycleOwner = this,
|
||||||
activityViewModel = activity.getActivityViewModel()
|
activityViewModel = activity.getActivityViewModel(),
|
||||||
|
fragmentManager = fragmentManager!!
|
||||||
)
|
)
|
||||||
|
|
||||||
binding.confirmBtn.setOnClickListener {
|
binding.confirmBtn.setOnClickListener {
|
||||||
|
@ -306,6 +307,8 @@ class SetupDeviceFragment : Fragment() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetupNetworkTimeVerification.prepareHelpButton(binding.networkTimeVerification, fragmentManager!!)
|
||||||
|
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* 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
|
* 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
|
_, _, value -> binding.handlers = value
|
||||||
}
|
}
|
||||||
|
|
||||||
var userName: String? by Delegates.observable(null as String?) {
|
init {
|
||||||
_, _, value -> binding.userName = value
|
binding.titleView.setOnClickListener { handlers?.showDisableTimeLimitsHelp() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,4 +56,5 @@ interface ManageDisableTimelimitsViewHandlers {
|
||||||
fun disableTimeLimitsForDuration(duration: Long)
|
fun disableTimeLimitsForDuration(duration: Long)
|
||||||
fun disableTimeLimitsForToday()
|
fun disableTimeLimitsForToday()
|
||||||
fun enableTimeLimits()
|
fun enableTimeLimits()
|
||||||
|
fun showDisableTimeLimitsHelp()
|
||||||
}
|
}
|
|
@ -39,17 +39,14 @@
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
android:text="@string/category_settings_battery_limit_title"
|
android:text="@string/category_settings_battery_limit_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
android:text="@{@string/category_settings_battery_limit_charging(minLevelCharging)}"
|
android:text="@{@string/category_settings_battery_limit_charging(minLevelCharging)}"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -26,17 +26,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/category_notification_filter_title"
|
android:text="@string/category_notification_filter_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<CheckBox
|
||||||
android:id="@+id/checkbox"
|
android:id="@+id/checkbox"
|
||||||
android:text="@string/category_notifications_filter_checkbox"
|
android:text="@string/category_notifications_filter_checkbox"
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
|
@ -12,17 +26,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
android:text="@string/time_warning_title"
|
android:text="@string/time_warning_title"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:id="@+id/linear_layout"
|
android:id="@+id/linear_layout"
|
||||||
|
|
|
@ -39,17 +39,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<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:text="@string/category_settings_extra_time_title"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<io.timelimit.android.ui.view.SelectTimeSpanView
|
||||||
android:id="@+id/extra_time_selection"
|
android:id="@+id/extra_time_selection"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -51,17 +51,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<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:text="@string/manage_child_block_temporarily_title"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<LinearLayout
|
||||||
android:id="@+id/blocked_categories_checkbox_container"
|
android:id="@+id/blocked_categories_checkbox_container"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
|
|
@ -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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -65,9 +65,6 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:onClick="@{() -> handlers.openUsageStatsSettings()}"
|
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="@{usageStatsAccess != RuntimePermissionStatus.NotRequired}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -78,18 +75,17 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:onClick="@{() -> handlers.helpUsageStatsAccess()}"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_permissions_usagestats_title"
|
android:text="@string/manage_device_permissions_usagestats_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:paddingTop="8dp"
|
||||||
android:text="@string/manage_device_permissions_usagestats_text"
|
android:gravity="center_horizontal"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -98,6 +94,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -106,6 +104,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -113,19 +113,19 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:visibility="@{usageStatsAccess != RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
android:background="?selectableItemBackground"
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:layout_gravity="end"
|
||||||
android:layout_width="match_parent"
|
android:onClick="@{() -> handlers.openUsageStatsSettings()}"
|
||||||
|
android:enabled="@{usageStatsAccess != RuntimePermissionStatus.NotRequired}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:onClick="@{() -> handlers.manageDeviceAdmin()}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -169,19 +169,18 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:background="?selectableItemBackground"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:layout_width="match_parent"
|
android:layout_gravity="end"
|
||||||
|
android:onClick="@{() -> handlers.manageDeviceAdmin()}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:onClick="@{() -> handlers.openNotificationAccessSettings()}"
|
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="@{notificationAccessPermission != NewPermissionStatus.NotSupported}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -192,18 +191,17 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:onClick="@{() -> handlers.helpNotificationAccess()}"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_permission_notification_access_title"
|
android:text="@string/manage_device_permission_notification_access_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:paddingTop="8dp"
|
||||||
android:text="@string/manage_device_permission_notification_access_text"
|
android:gravity="center_horizontal"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:visibility="@{notificationAccessPermission == NewPermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{notificationAccessPermission == NewPermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -212,6 +210,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -220,6 +220,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotSupported ? View.VISIBLE : View.GONE}"
|
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotSupported ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -227,20 +229,19 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:visibility="@{notificationAccessPermission != NewPermissionStatus.NotSupported ? View.VISIBLE : View.GONE}"
|
android:background="?selectableItemBackground"
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:layout_gravity="end"
|
||||||
android:layout_width="match_parent"
|
android:onClick="@{() -> handlers.openNotificationAccessSettings()}"
|
||||||
|
android:enabled="@{notificationAccessPermission != NewPermissionStatus.NotSupported}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:onClick="@{() -> handlers.openDrawOverOtherAppsScreen()}"
|
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="@{usageStatsAccess != RuntimePermissionStatus.NotRequired}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -251,18 +252,17 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:onClick="@{() -> handlers.helpDrawOverOtherApps()}"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_permissions_overlay_title"
|
android:text="@string/manage_device_permissions_overlay_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:paddingTop="8dp"
|
||||||
android:text="@string/manage_device_permissions_overlay_text"
|
android:gravity="center_horizontal"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:visibility="@{overlayPermission == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{overlayPermission == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -271,6 +271,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -279,6 +281,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -286,21 +290,19 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:visibility="@{overlayPermission != RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
android:background="?selectableItemBackground"
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:layout_gravity="end"
|
||||||
android:layout_width="match_parent"
|
android:onClick="@{() -> handlers.openDrawOverOtherAppsScreen()}"
|
||||||
|
android:enabled="@{overlayPermission != RuntimePermissionStatus.NotRequired}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:onClick="@{() -> handlers.openAccessibilitySettings()}"
|
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -311,18 +313,17 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:onClick="@{() -> handlers.helpAccesibility()}"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_permission_accessibility_title"
|
android:text="@string/manage_device_permission_accessibility_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:paddingTop="8dp"
|
||||||
android:text="@string/manage_device_permission_accessibility_text"
|
android:gravity="center_horizontal"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:visibility="@{accessibilityServiceEnabled == true ? View.VISIBLE : View.GONE}"
|
android:visibility="@{accessibilityServiceEnabled == true ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -331,6 +332,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{accessibilityServiceEnabled == false ? View.VISIBLE : View.GONE}"
|
android:visibility="@{accessibilityServiceEnabled == false ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -338,10 +341,12 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:background="?selectableItemBackground"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:layout_width="match_parent"
|
android:layout_gravity="end"
|
||||||
|
android:onClick="@{() -> handlers.openAccessibilitySettings()}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
50
app/src/main/res/layout/help_dialog_fragment.xml
Normal file
50
app/src/main/res/layout/help_dialog_fragment.xml
Normal 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>
|
|
@ -380,17 +380,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<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:text="@string/lock_extratime_title"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<io.timelimit.android.ui.view.SelectTimeSpanView
|
||||||
android:id="@+id/extra_time_selection"
|
android:id="@+id/extra_time_selection"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -34,17 +34,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_category_for_unassigned_apps_title"
|
android:text="@string/manage_category_for_unassigned_apps_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<TextView
|
||||||
tools:text="@string/manage_category_for_unassigned_apps_status_enabled"
|
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}"
|
android:text="@{isThisCategoryUsed ? @string/manage_category_for_unassigned_apps_status_enabled : @string/manage_category_for_unassigned_apps_status_disabled}"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -34,17 +34,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_child_password_title"
|
android:text="@string/manage_child_password_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
tools:text="@string/manage_child_password_status_no"
|
tools:text="@string/manage_child_password_status_no"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -26,17 +26,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_activity_level_blocking_title"
|
android:text="@string/manage_device_activity_level_blocking_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<CheckBox
|
||||||
android:text="@string/manage_device_activity_level_blocking_checkbox"
|
android:text="@string/manage_device_activity_level_blocking_checkbox"
|
||||||
android:id="@+id/checkbox"
|
android:id="@+id/checkbox"
|
||||||
|
|
|
@ -41,17 +41,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<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:text="@string/device_background_sync_title"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<CheckBox
|
||||||
android:visibility="@{isThisDevice ? View.VISIBLE : View.GONE}"
|
android:visibility="@{isThisDevice ? View.VISIBLE : View.GONE}"
|
||||||
android:enabled="@{!isUsingLocalMode}"
|
android:enabled="@{!isUsingLocalMode}"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -56,17 +56,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_default_user_title"
|
android:text="@string/manage_device_default_user_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<TextView
|
||||||
android:visibility="@{hasDefaultUser ? View.VISIBLE : View.GONE}"
|
android:visibility="@{hasDefaultUser ? View.VISIBLE : View.GONE}"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
|
|
@ -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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -56,17 +56,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
|
android:onClick="@{() -> handlers.showNetworkTimeHelp()}"
|
||||||
android:text="@string/manage_device_network_time_verification_title"
|
android:text="@string/manage_device_network_time_verification_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<RadioGroup
|
||||||
android:id="@+id/network_time_verification_radio_group"
|
android:id="@+id/network_time_verification_radio_group"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -46,6 +46,10 @@
|
||||||
name="handlers"
|
name="handlers"
|
||||||
type="io.timelimit.android.ui.manage.device.manage.permission.ManageDevicePermissionsFragmentHandlers" />
|
type="io.timelimit.android.ui.manage.device.manage.permission.ManageDevicePermissionsFragmentHandlers" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="isUserSignedIn"
|
||||||
|
type="boolean" />
|
||||||
|
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
<import type="io.timelimit.android.data.model.NetworkTime" />
|
<import type="io.timelimit.android.data.model.NetworkTime" />
|
||||||
<import type="io.timelimit.android.integration.platform.RuntimePermissionStatus" />
|
<import type="io.timelimit.android.integration.platform.RuntimePermissionStatus" />
|
||||||
|
@ -68,9 +72,6 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="@{safeUnbox(isThisDevice)}"
|
|
||||||
android:onClick="@{() -> handlers.manageDeviceAdmin()}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -114,11 +115,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:visibility="@{safeUnbox(isThisDevice) ? View.VISIBLE : View.GONE}"
|
android:background="?selectableItemBackground"
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:layout_gravity="end"
|
||||||
android:layout_width="match_parent"
|
android:enabled="@{safeUnbox(isThisDevice)}"
|
||||||
|
android:onClick="@{() -> handlers.manageDeviceAdmin()}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -132,9 +135,6 @@
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:onClick="@{() -> handlers.openUsageStatsSettings()}"
|
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="@{safeUnbox(isThisDevice) && (usageStatsAccess != RuntimePermissionStatus.NotRequired)}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -145,18 +145,17 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:onClick="@{() -> handlers.helpUsageStatsAccess()}"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_permissions_usagestats_title"
|
android:text="@string/manage_device_permissions_usagestats_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:paddingTop="8dp"
|
||||||
android:text="@string/manage_device_permissions_usagestats_text"
|
android:gravity="center_horizontal"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -165,6 +164,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -173,6 +174,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
android:visibility="@{usageStatsAccess == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -180,11 +183,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:visibility="@{(( usageStatsAccess != RuntimePermissionStatus.NotRequired) && (safeUnbox(isThisDevice))) ? View.VISIBLE : View.GONE}"
|
android:background="?selectableItemBackground"
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:layout_gravity="end"
|
||||||
android:layout_width="match_parent"
|
android:onClick="@{() -> handlers.openUsageStatsSettings()}"
|
||||||
|
android:enabled="@{safeUnbox(isThisDevice) && (usageStatsAccess != RuntimePermissionStatus.NotRequired)}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -198,9 +203,6 @@
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:onClick="@{() -> handlers.openNotificationAccessSettings()}"
|
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="@{safeUnbox(isThisDevice) && (notificationAccessPermission != NewPermissionStatus.NotSupported)}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -211,18 +213,17 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:onClick="@{() -> handlers.helpNotificationAccess()}"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_permission_notification_access_title"
|
android:text="@string/manage_device_permission_notification_access_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:paddingTop="8dp"
|
||||||
android:text="@string/manage_device_permission_notification_access_text"
|
android:gravity="center_horizontal"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:visibility="@{notificationAccessPermission == NewPermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{notificationAccessPermission == NewPermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -231,6 +232,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -239,6 +242,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotSupported ? View.VISIBLE : View.GONE}"
|
android:visibility="@{notificationAccessPermission == NewPermissionStatus.NotSupported ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -246,11 +251,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:visibility="@{(( notificationAccessPermission != NewPermissionStatus.NotSupported) && (safeUnbox(isThisDevice))) ? View.VISIBLE : View.GONE}"
|
android:background="?selectableItemBackground"
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:layout_gravity="end"
|
||||||
android:layout_width="match_parent"
|
android:onClick="@{() -> handlers.openNotificationAccessSettings()}"
|
||||||
|
android:enabled="@{safeUnbox(isThisDevice) && (notificationAccessPermission != NewPermissionStatus.NotSupported)}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -264,9 +271,6 @@
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:onClick="@{() -> handlers.openDrawOverOtherAppsScreen()}"
|
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="@{safeUnbox(isThisDevice) && (overlayPermission != RuntimePermissionStatus.NotRequired)}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -277,18 +281,17 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:onClick="@{() -> handlers.helpDrawOverOtherApps()}"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_permissions_overlay_title"
|
android:text="@string/manage_device_permissions_overlay_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:paddingTop="8dp"
|
||||||
android:text="@string/manage_device_permissions_overlay_text"
|
android:gravity="center_horizontal"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:visibility="@{overlayPermission == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{overlayPermission == RuntimePermissionStatus.Granted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -297,6 +300,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotGranted ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -305,6 +310,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
android:visibility="@{overlayPermission == RuntimePermissionStatus.NotRequired ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -312,11 +319,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:visibility="@{(( overlayPermission != RuntimePermissionStatus.NotRequired) && (safeUnbox(isThisDevice))) ? View.VISIBLE : View.GONE}"
|
android:background="?selectableItemBackground"
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:layout_gravity="end"
|
||||||
android:layout_width="match_parent"
|
android:onClick="@{() -> handlers.openDrawOverOtherAppsScreen()}"
|
||||||
|
android:enabled="@{safeUnbox(isThisDevice) && (overlayPermission != RuntimePermissionStatus.NotRequired)}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -330,9 +339,6 @@
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:onClick="@{() -> handlers.openAccessibilitySettings()}"
|
|
||||||
android:foreground="?selectableItemBackground"
|
|
||||||
android:clickable="@{safeUnbox(isThisDevice)}"
|
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@ -343,18 +349,17 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
|
android:onClick="@{() -> handlers.helpAccesibility()}"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_permission_accessibility_title"
|
android:text="@string/manage_device_permission_accessibility_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:paddingTop="8dp"
|
||||||
android:text="@string/manage_device_permission_accessibility_text"
|
android:gravity="center_horizontal"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:visibility="@{accessibilityServiceEnabled == true ? View.VISIBLE : View.GONE}"
|
android:visibility="@{accessibilityServiceEnabled == true ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/green"
|
android:textColor="@color/green"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -363,6 +368,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:visibility="@{accessibilityServiceEnabled == false ? View.VISIBLE : View.GONE}"
|
android:visibility="@{accessibilityServiceEnabled == false ? View.VISIBLE : View.GONE}"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textAppearance="?android:textAppearanceMedium"
|
android:textAppearance="?android:textAppearanceMedium"
|
||||||
|
@ -370,12 +377,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<Button
|
||||||
<TextView
|
android:background="?selectableItemBackground"
|
||||||
android:visibility="@{safeUnbox(isThisDevice) ? View.VISIBLE : View.GONE}"
|
android:text="@string/manage_device_permission_btn_modify"
|
||||||
android:text="@string/manage_device_permission_tap_top_open_settings"
|
android:layout_gravity="end"
|
||||||
android:textAppearance="?android:textAppearanceSmall"
|
android:onClick="@{() -> handlers.openAccessibilitySettings()}"
|
||||||
android:layout_width="match_parent"
|
android:enabled="@{safeUnbox(isThisDevice)}"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -388,6 +396,11 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:visibility="@{isUserSignedIn ? View.GONE : View.VISIBLE}"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="76dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|
|
@ -27,17 +27,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_reboot_manipulation_title"
|
android:text="@string/manage_device_reboot_manipulation_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<CheckBox
|
||||||
android:id="@+id/checkbox"
|
android:id="@+id/checkbox"
|
||||||
android:text="@string/manage_device_reboot_manipulation_checkbox"
|
android:text="@string/manage_device_reboot_manipulation_checkbox"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -41,18 +41,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<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:text="@string/category_settings_parent_category_title"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<TextView
|
||||||
android:visibility="@{isParentCategory ? View.VISIBLE : View.GONE}"
|
android:visibility="@{isParentCategory ? View.VISIBLE : View.GONE}"
|
||||||
android:text="@string/category_settings_parent_category_already_used_as_parent"
|
android:text="@string/category_settings_parent_category_already_used_as_parent"
|
||||||
|
|
|
@ -39,17 +39,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<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:text="@string/manage_send_device_connected_title"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<CheckBox
|
||||||
android:enabled="@{isThisDevice && isConnectedMode}"
|
android:enabled="@{isThisDevice && isConnectedMode}"
|
||||||
android:id="@+id/checkbox"
|
android:id="@+id/checkbox"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -45,17 +45,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/primary_device_title"
|
android:text="@string/primary_device_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<CheckBox
|
||||||
android:enabled="@{status != PrimaryDeviceStatus.LocalMode}"
|
android:enabled="@{status != PrimaryDeviceStatus.LocalMode}"
|
||||||
android:text="@string/primary_device_checkbox_relax"
|
android:text="@string/primary_device_checkbox_relax"
|
||||||
|
|
|
@ -26,17 +26,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/title_view"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:drawableEnd="@drawable/ic_info_outline_black_24dp"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:text="@string/manage_device_network_time_verification_title"
|
android:text="@string/manage_device_network_time_verification_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<RadioGroup
|
||||||
android:checkedButton="@+id/network_time_verification_disabled"
|
android:checkedButton="@+id/network_time_verification_disabled"
|
||||||
android:id="@+id/network_time_verification_radio_group"
|
android:id="@+id/network_time_verification_radio_group"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -22,10 +22,6 @@
|
||||||
name="disabledUntilString"
|
name="disabledUntilString"
|
||||||
type="String" />
|
type="String" />
|
||||||
|
|
||||||
<variable
|
|
||||||
name="userName"
|
|
||||||
type="String" />
|
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="handlers"
|
name="handlers"
|
||||||
type="io.timelimit.android.ui.view.ManageDisableTimelimitsViewHandlers" />
|
type="io.timelimit.android.ui.view.ManageDisableTimelimitsViewHandlers" />
|
||||||
|
@ -45,18 +41,14 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<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:text="@string/manage_disable_time_limits_title"
|
||||||
android:textAppearance="?android:textAppearanceLarge"
|
android:textAppearance="?android:textAppearanceLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
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
|
<TextView
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:visibility="@{TextUtils.isEmpty(disabledUntilString) ? View.GONE : View.VISIBLE}"
|
android:visibility="@{TextUtils.isEmpty(disabledUntilString) ? View.GONE : View.VISIBLE}"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<string name="time_warning_title">Zeitwarnung</string>
|
<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>
|
<string name="time_warning_not_title">Zeitwarnung für %s</string>
|
||||||
</resources>
|
</resources>
|
|
@ -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_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_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_title">Downgrade</string>
|
||||||
<string name="manage_device_downgrade_text">Auf diesem Gerät wurde eine neuere Version von TimeLimit durch eine ältere ersetzt</string>
|
<string name="manage_device_downgrade_text">Auf diesem Gerät wurde eine neuere Version von TimeLimit durch eine ältere ersetzt</string>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<string name="manage_disable_time_limits_title">Zeitbegrenzungen deaktivieren</string>
|
<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_info_enabled">Zeitbegrenzungen sind deaktiviert bis %s</string>
|
||||||
|
|
||||||
<string name="manage_disable_time_limits_btn_enable">Zeitbegrenzungen wieder aktivieren</string>
|
<string name="manage_disable_time_limits_btn_enable">Zeitbegrenzungen wieder aktivieren</string>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<string name="time_warning_title">Time warnings</string>
|
<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>
|
<string name="time_warning_not_title">Time warning for %s</string>
|
||||||
</resources>
|
</resources>
|
|
@ -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_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_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_title">Downgrade</string>
|
||||||
<string name="manage_device_downgrade_text">On this device, a newer version of TimeLimit was replaced by an older one</string>
|
<string name="manage_device_downgrade_text">On this device, a newer version of TimeLimit was replaced by an older one</string>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation version 3 of the License.
|
the Free Software Foundation version 3 of the License.
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<string name="manage_disable_time_limits_title">Disable time limits</string>
|
<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_info_enabled">Time limits are disabled until %s</string>
|
||||||
|
|
||||||
<string name="manage_disable_time_limits_btn_enable">Enable time limits again</string>
|
<string name="manage_disable_time_limits_btn_enable">Enable time limits again</string>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue