package info.nightscout.androidaps.tile import android.content.res.Resources import info.nightscout.androidaps.R import info.nightscout.androidaps.interaction.actions.BolusActivity import info.nightscout.androidaps.interaction.actions.TreatmentActivity import info.nightscout.androidaps.interaction.actions.ECarbActivity import info.nightscout.androidaps.interaction.actions.TempTargetActivity import info.nightscout.androidaps.interaction.actions.WizardActivity object ActionSource : StaticTileSource(), TileSource { override val preferencePrefix = "tile_action_" override fun getActions(resources: Resources): List { return listOf( StaticAction( settingName = "wizard", buttonText = resources.getString(R.string.menu_wizard_short), iconRes = R.drawable.ic_calculator_green, activityClass = WizardActivity::class.java.name, ), StaticAction( settingName = "treatment", buttonText = resources.getString(R.string.menu_treatment_short), iconRes = R.drawable.ic_bolus_carbs, activityClass = TreatmentActivity::class.java.name, ), StaticAction( settingName = "bolus", buttonText = resources.getString(R.string.action_insulin), iconRes = R.drawable.ic_bolus, activityClass = BolusActivity::class.java.name, ), StaticAction( settingName = "carbs", buttonText = resources.getString(R.string.action_carbs), iconRes = R.drawable.ic_carbs_orange, activityClass = ECarbActivity::class.java.name, ), StaticAction( settingName = "temp_target", buttonText = resources.getString(R.string.menu_tempt), iconRes = R.drawable.ic_temptarget_flat, activityClass = TempTargetActivity::class.java.name, ) ) } override fun getResourceReferences(resources: Resources): List { return getActions(resources).map { it.iconRes } } override fun getDefaultConfig(): Map { return mapOf( "tile_action_1" to "wizard", "tile_action_2" to "treatment", "tile_action_3" to "carbs", "tile_action_4" to "temp_target" ) } }