forked from penguin86/luna-tracker
Merge pull request 'fix puke event quantity' (#18) from mwarning/luna-tracker:fixpuke into master
I already tagged the commit when I accepted the previous PR, so it may have already been picked up by the F-Droid build pipeline. I'll send this one too and see if it makes in time.
This commit is contained in:
@@ -275,7 +275,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
|
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
|
||||||
val pos = spinner.selectedItemPosition
|
val pos = spinner.selectedItemPosition
|
||||||
logEvent(LunaEvent(LunaEvent.TYPE_PUKE, pos))
|
logEvent(LunaEvent(LunaEvent.TYPE_PUKE, pos + 1))
|
||||||
}
|
}
|
||||||
d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() }
|
d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() }
|
||||||
val alertDialog = d.create()
|
val alertDialog = d.create()
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class NumericUtils (val context: Context) {
|
|||||||
LunaEvent.TYPE_TEMPERATURE ->
|
LunaEvent.TYPE_TEMPERATURE ->
|
||||||
(item.quantity / 10.0f).toString()
|
(item.quantity / 10.0f).toString()
|
||||||
LunaEvent.TYPE_PUKE ->
|
LunaEvent.TYPE_PUKE ->
|
||||||
context.resources.getStringArray(R.array.AmountLabels)[item.quantity]
|
context.resources.getStringArray(R.array.AmountLabels)[item.quantity - 1]
|
||||||
else ->
|
else ->
|
||||||
item.quantity
|
item.quantity
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user