Fix Objectives processing
This commit is contained in:
parent
52ffc8d7ff
commit
3f8e56d50e
3 changed files with 4 additions and 2 deletions
|
@ -412,6 +412,7 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
loopPlugin.goToZeroTemp(T.hours(1).mins().toInt(), profile, OfflineEvent.Reason.DISCONNECT_PUMP)
|
loopPlugin.goToZeroTemp(T.hours(1).mins().toInt(), profile, OfflineEvent.Reason.DISCONNECT_PUMP)
|
||||||
rxBus.send(EventRefreshOverview("suspend_menu"))
|
rxBus.send(EventRefreshOverview("suspend_menu"))
|
||||||
}
|
}
|
||||||
|
sp.putBoolean(R.string.key_objectiveusedisconnect, true)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ class ProfileSwitchDialog : DialogFragmentWithDate() {
|
||||||
ValueWithUnit.Percent(percent),
|
ValueWithUnit.Percent(percent),
|
||||||
ValueWithUnit.Hour(timeShift).takeIf { timeShift != 0 },
|
ValueWithUnit.Hour(timeShift).takeIf { timeShift != 0 },
|
||||||
ValueWithUnit.Minute(duration).takeIf { duration != 0 })
|
ValueWithUnit.Minute(duration).takeIf { duration != 0 })
|
||||||
|
if (percent == 90 && duration == 10) sp.putBoolean(R.string.key_objectiveuseprofileswitch, true)
|
||||||
if (isTT) {
|
if (isTT) {
|
||||||
disposable += repository.runTransactionForResult(
|
disposable += repository.runTransactionForResult(
|
||||||
InsertAndCancelCurrentTemporaryTargetTransaction(
|
InsertAndCancelCurrentTemporaryTargetTransaction(
|
||||||
|
|
|
@ -86,10 +86,10 @@ abstract class Objective(injector: HasAndroidInjector, spName: String, @StringRe
|
||||||
|
|
||||||
abstract fun isCompleted(): Boolean
|
abstract fun isCompleted(): Boolean
|
||||||
|
|
||||||
open fun isCompleted(trueTime: Long): Boolean = isCompleted
|
open fun isCompleted(trueTime: Long): Boolean = isCompleted()
|
||||||
|
|
||||||
open val progress: String
|
open val progress: String
|
||||||
get() = resourceHelper.gs(if (isCompleted) R.string.completed_well_done else R.string.not_completed_yet)
|
get() = resourceHelper.gs(if (isCompleted()) R.string.completed_well_done else R.string.not_completed_yet)
|
||||||
|
|
||||||
fun hint(hint: Hint): Task {
|
fun hint(hint: Hint): Task {
|
||||||
hints.add(hint)
|
hints.add(hint)
|
||||||
|
|
Loading…
Reference in a new issue