AndroidAPS/wear/src/main/java/info/nightscout/androidaps/tile/ActionSource.kt

72 lines
2.6 KiB
Kotlin
Raw Normal View History

2021-12-14 12:17:04 +01:00
package info.nightscout.androidaps.tile
import info.nightscout.androidaps.R
2022-01-11 23:19:20 +01:00
import info.nightscout.androidaps.interaction.actions.BolusActivity
import info.nightscout.androidaps.interaction.actions.TreatmentActivity
2021-12-14 12:17:04 +01:00
import info.nightscout.androidaps.interaction.actions.ECarbActivity
import info.nightscout.androidaps.interaction.actions.TempTargetActivity
2022-01-11 22:30:24 +01:00
import info.nightscout.androidaps.interaction.actions.WizardActivity
2021-12-14 12:17:04 +01:00
2022-01-11 10:38:20 +01:00
object ActionSource : TileSource {
2021-12-14 12:17:04 +01:00
override fun getActions(): List<Action> {
2021-12-14 12:17:04 +01:00
return listOf(
Action(
id = 0,
settingName = "wizzard",
2021-12-14 12:17:04 +01:00
nameRes = R.string.menu_wizard,
iconRes = R.drawable.ic_calculator_green,
2022-01-11 22:30:24 +01:00
activityClass = WizardActivity::class.java.getName(),
background = false,
actionString = "",
2021-12-14 12:17:04 +01:00
),
Action(
id = 1,
2022-01-11 23:19:20 +01:00
settingName = "treatment",
nameRes = R.string.menu_treatment,
2021-12-14 12:17:04 +01:00
iconRes = R.drawable.ic_bolus_carbs,
activityClass = TreatmentActivity::class.java.getName(),
background = false,
actionString = "",
2021-12-14 12:17:04 +01:00
),
Action(
id = 2,
2022-01-11 23:19:20 +01:00
settingName = "bolus",
nameRes = R.string.action_bolus,
iconRes = R.drawable.ic_bolus,
activityClass = BolusActivity::class.java.getName(),
background = false,
actionString = "",
),
Action(
id = 3,
settingName = "carbs",
2021-12-14 12:17:04 +01:00
nameRes = R.string.action_carbs,
iconRes = R.drawable.ic_carbs_orange,
activityClass = ECarbActivity::class.java.getName(),
background = false,
actionString = "",
2021-12-14 12:17:04 +01:00
),
Action(
2022-01-11 23:19:20 +01:00
id = 4,
settingName = "temp_target",
2021-12-14 12:17:04 +01:00
nameRes = R.string.menu_tempt,
iconRes = R.drawable.ic_temptarget_flat,
activityClass = TempTargetActivity::class.java.getName(),
background = false,
actionString = "",
2021-12-14 12:17:04 +01:00
)
)
}
2022-01-11 10:38:20 +01:00
override fun getDefaultConfig(): Map<String, String> {
return mapOf(
"tile_action_1" to "wizzard",
2022-01-11 23:19:20 +01:00
"tile_action_2" to "treatment",
2022-01-11 10:38:20 +01:00
"tile_action_3" to "carbs",
"tile_action_4" to "temp_target"
)
}
2021-12-14 12:17:04 +01:00
}