fix screen refresh after unit change
This commit is contained in:
parent
f9d24a0153
commit
175f008d3b
|
@ -44,7 +44,6 @@ class OverviewPlugin @Inject constructor(
|
|||
rh: ResourceHelper,
|
||||
private val config: Config,
|
||||
private val dateUtil: DateUtil,
|
||||
private val profileFunction: ProfileFunction,
|
||||
private val iobCobCalculator: IobCobCalculator,
|
||||
private val repository: AppRepository,
|
||||
private val overviewData: OverviewData,
|
||||
|
@ -154,6 +153,18 @@ class OverviewPlugin @Inject constructor(
|
|||
.subscribe({
|
||||
overviewData.pumpStatus = it.getStatus(rh)
|
||||
}, fabricPrivacy::logException)
|
||||
disposable += rxBus
|
||||
.toObservable(EventPreferenceChange::class.java)
|
||||
.observeOn(aapsSchedulers.io)
|
||||
.subscribe({ event ->
|
||||
if (event.isChanged(rh, R.string.key_units)) {
|
||||
overviewData.reset()
|
||||
overviewData.prepareBucketedData("EventBucketedDataCreated")
|
||||
overviewData.prepareBgData("EventBucketedDataCreated")
|
||||
overviewBus.send(EventUpdateOverview("EventBucketedDataCreated", OverviewData.Property.GRAPH))
|
||||
loadAll("EventPreferenceChange")
|
||||
}
|
||||
}, fabricPrivacy::logException)
|
||||
|
||||
Thread { loadAll("onResume") }.start()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue