ProfileFragment disable spinner for invalid profile

This commit is contained in:
Milos Kozak 2021-11-18 19:57:12 +01:00
parent b2c12d233c
commit 284dc19bd1
2 changed files with 3 additions and 3 deletions

View file

@ -104,9 +104,7 @@ class ConfigBuilderFragment : DaggerFragment() {
@Synchronized
private fun updateGUI() {
binding.categories.removeAllViews()
if (!config.NSCLIENT) {
createViewsForPlugins(R.string.configbuilder_profile, R.string.configbuilder_profile_description, PluginType.PROFILE, activePlugin.getSpecificPluginsVisibleInList(PluginType.PROFILE))
}
createViewsForPlugins(R.string.configbuilder_profile, R.string.configbuilder_profile_description, PluginType.PROFILE, activePlugin.getSpecificPluginsVisibleInList(PluginType.PROFILE))
if (config.APS || config.PUMPCONTROL || buildHelper.isEngineeringMode())
createViewsForPlugins(R.string.configbuilder_insulin, R.string.configbuilder_insulin_description, PluginType.INSULIN, activePlugin.getSpecificPluginsVisibleInList(PluginType.INSULIN))
if (!config.NSCLIENT) {

View file

@ -266,6 +266,7 @@ class LocalProfileFragment : DaggerFragment() {
val isEdited = localProfilePlugin.isEdited
if (isValid) {
this.view?.setBackgroundColor(rh.gc(R.color.ok_background))
binding.spinner.isEnabled = true
if (isEdited) {
//edited profile -> save first
@ -277,6 +278,7 @@ class LocalProfileFragment : DaggerFragment() {
}
} else {
this.view?.setBackgroundColor(rh.gc(R.color.error_background))
binding.spinner.isEnabled = false
binding.profileswitch.visibility = View.GONE
binding.save.visibility = View.GONE //don't save an invalid profile
}