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 72165e9b3e..8b9c39fce9 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 aabd56c0f1..dc58e98d8c 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/drawable/ic_combo.xml b/app/src/main/res/drawable/ic_combo.xml new file mode 100644 index 0000000000..3f3647f097 --- /dev/null +++ b/app/src/main/res/drawable/ic_combo.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_insight.xml b/app/src/main/res/drawable/ic_insight.xml new file mode 100644 index 0000000000..63ffcb1ea5 --- /dev/null +++ b/app/src/main/res/drawable/ic_insight.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/combopump_fragment.xml b/app/src/main/res/layout/combopump_fragment.xml index aae34c4db0..b96625fee5 100644 --- a/app/src/main/res/layout/combopump_fragment.xml +++ b/app/src/main/res/layout/combopump_fragment.xml @@ -471,6 +471,13 @@ android:layout_marginTop="5dp" android:background="@color/listdelimiter" /> + + 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"> + + + +