diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt index 3badb56824..09bbf3c04d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt @@ -5,12 +5,9 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.CheckBox -import android.widget.ImageButton -import android.widget.LinearLayout -import android.widget.RadioButton -import android.widget.TextView +import android.widget.* import androidx.annotation.StringRes +import androidx.core.content.ContextCompat import dagger.android.support.DaggerFragment import info.nightscout.androidaps.Config import info.nightscout.androidaps.R @@ -129,6 +126,7 @@ class ConfigBuilderFragment : DaggerFragment() { val baseView: LinearLayout = fragment.layoutInflater.inflate(R.layout.configbuilder_single_plugin, null) as LinearLayout private val enabledExclusive: RadioButton private val enabledInclusive: CheckBox + private val pluginIcon: ImageView private val pluginName: TextView private val pluginDescription: TextView private val pluginPreferences: ImageButton @@ -137,6 +135,7 @@ class ConfigBuilderFragment : DaggerFragment() { init { enabledExclusive = baseView.findViewById(R.id.plugin_enabled_exclusive) enabledInclusive = baseView.findViewById(R.id.plugin_enabled_inclusive) + pluginIcon = baseView.findViewById(R.id.plugin_icon) pluginName = baseView.findViewById(R.id.plugin_name) pluginDescription = baseView.findViewById(R.id.plugin_description) pluginPreferences = baseView.findViewById(R.id.plugin_preferences) @@ -175,6 +174,12 @@ class ConfigBuilderFragment : DaggerFragment() { enabledInclusive.isChecked = plugin.isEnabled(pluginType) enabledInclusive.isEnabled = !plugin.pluginDescription.alwaysEnabled enabledExclusive.isEnabled = !plugin.pluginDescription.alwaysEnabled + if(plugin.menuIcon != -1) { + pluginIcon.visibility = View.VISIBLE + pluginIcon.setImageDrawable(context?.let { ContextCompat.getDrawable(it, plugin.menuIcon) }) + } else { + pluginIcon.visibility = View.GONE + } pluginName.text = plugin.name if (plugin.description == null) pluginDescription.visibility = View.GONE diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 82ba382519..50f8de4955 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -147,6 +147,7 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr super(new PluginDescription() .mainType(PluginType.PUMP) .fragmentClass(ComboFragment.class.getName()) + .pluginIcon(R.drawable.ic_combo) .pluginName(R.string.combopump) .shortName(R.string.combopump_shortname) .description(R.string.description_pump_combo), diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 033a65e38d..6153d4756f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -219,6 +219,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements PumpInterface, DateUtil dateUtil ) { super(new PluginDescription() + .pluginIcon(R.drawable.ic_insight) .pluginName(R.string.insight_local) .shortName(R.string.insightpump_shortname) .mainType(PluginType.PUMP) diff --git a/app/src/main/res/layout/configbuilder_single_plugin.xml b/app/src/main/res/layout/configbuilder_single_plugin.xml index 587fbce2af..4e78d990db 100644 --- a/app/src/main/res/layout/configbuilder_single_plugin.xml +++ b/app/src/main/res/layout/configbuilder_single_plugin.xml @@ -29,6 +29,11 @@ android:layout_weight="1" android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index 6650d1c913..3b9e98cbe8 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -85,6 +85,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump super(new PluginDescription() .mainType(PluginType.PUMP) .fragmentClass(DanaFragment.class.getName()) + .pluginIcon(R.drawable.ic_dana_rs) .pluginName(R.string.danarspump) .shortName(R.string.danarpump_shortname) .preferencesId(R.xml.pref_danar) diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index cc20b91d22..7d4cf7c21c 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -63,6 +63,7 @@ class DanaRSPlugin @Inject constructor( ) : PumpPluginBase(PluginDescription() .mainType(PluginType.PUMP) .fragmentClass(info.nightscout.androidaps.dana.DanaFragment::class.java.name) + .pluginIcon(R.drawable.ic_dana_rs) .pluginName(R.string.danarspump) .shortName(R.string.danarspump_shortname) .preferencesId(R.xml.pref_danars) diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java index 2f9b88d5c9..d25d9ecbce 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java @@ -146,6 +146,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter super(new PluginDescription() // .mainType(PluginType.PUMP) // .fragmentClass(MedtronicFragment.class.getName()) // + .pluginIcon(R.drawable.ic_medtronic_veo) .pluginName(R.string.medtronic_name) // .shortName(R.string.medtronic_name_short) // .preferencesId(R.xml.pref_medtronic) diff --git a/medtronic/src/main/res/drawable/ic_medtronic_veo.xml b/medtronic/src/main/res/drawable/ic_medtronic_veo.xml new file mode 100644 index 0000000000..8aa31beff1 --- /dev/null +++ b/medtronic/src/main/res/drawable/ic_medtronic_veo.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index c7b92f7181..b2e3e6a34a 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -185,6 +185,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface, super(new PluginDescription() // .mainType(PluginType.PUMP) // .fragmentClass(OmnipodOverviewFragment.class.getName()) // + .pluginIcon(R.drawable.ic_pod) .pluginName(R.string.omnipod_name) // .shortName(R.string.omnipod_name_short) // .preferencesId(R.xml.pref_omnipod) //