ProfileFragment disable spinner for invalid profile
This commit is contained in:
parent
b2c12d233c
commit
284dc19bd1
2 changed files with 3 additions and 3 deletions
|
@ -104,9 +104,7 @@ class ConfigBuilderFragment : DaggerFragment() {
|
||||||
@Synchronized
|
@Synchronized
|
||||||
private fun updateGUI() {
|
private fun updateGUI() {
|
||||||
binding.categories.removeAllViews()
|
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())
|
if (config.APS || config.PUMPCONTROL || buildHelper.isEngineeringMode())
|
||||||
createViewsForPlugins(R.string.configbuilder_insulin, R.string.configbuilder_insulin_description, PluginType.INSULIN, activePlugin.getSpecificPluginsVisibleInList(PluginType.INSULIN))
|
createViewsForPlugins(R.string.configbuilder_insulin, R.string.configbuilder_insulin_description, PluginType.INSULIN, activePlugin.getSpecificPluginsVisibleInList(PluginType.INSULIN))
|
||||||
if (!config.NSCLIENT) {
|
if (!config.NSCLIENT) {
|
||||||
|
|
|
@ -266,6 +266,7 @@ class LocalProfileFragment : DaggerFragment() {
|
||||||
val isEdited = localProfilePlugin.isEdited
|
val isEdited = localProfilePlugin.isEdited
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
this.view?.setBackgroundColor(rh.gc(R.color.ok_background))
|
this.view?.setBackgroundColor(rh.gc(R.color.ok_background))
|
||||||
|
binding.spinner.isEnabled = true
|
||||||
|
|
||||||
if (isEdited) {
|
if (isEdited) {
|
||||||
//edited profile -> save first
|
//edited profile -> save first
|
||||||
|
@ -277,6 +278,7 @@ class LocalProfileFragment : DaggerFragment() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.view?.setBackgroundColor(rh.gc(R.color.error_background))
|
this.view?.setBackgroundColor(rh.gc(R.color.error_background))
|
||||||
|
binding.spinner.isEnabled = false
|
||||||
binding.profileswitch.visibility = View.GONE
|
binding.profileswitch.visibility = View.GONE
|
||||||
binding.save.visibility = View.GONE //don't save an invalid profile
|
binding.save.visibility = View.GONE //don't save an invalid profile
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue