get history
This commit is contained in:
parent
fdcf75c1d9
commit
269e94a8b5
1 changed files with 8 additions and 4 deletions
|
@ -39,7 +39,7 @@ class DashPodHistoryActivity : NoSplashAppCompatActivity() {
|
||||||
private var statusView: TextView? = null
|
private var statusView: TextView? = null
|
||||||
private var recyclerView: RecyclerView? = null
|
private var recyclerView: RecyclerView? = null
|
||||||
private var linearLayoutManager: LinearLayoutManager? = null
|
private var linearLayoutManager: LinearLayoutManager? = null
|
||||||
private val fullHistoryList: List<HistoryRecordEntity> = ArrayList<HistoryRecordEntity>()
|
private val fullHistoryList: MutableList<HistoryRecordEntity> = ArrayList<HistoryRecordEntity>()
|
||||||
private val filteredHistoryList: MutableList<HistoryRecordEntity> = ArrayList<HistoryRecordEntity>()
|
private val filteredHistoryList: MutableList<HistoryRecordEntity> = ArrayList<HistoryRecordEntity>()
|
||||||
private var recyclerViewAdapter: RecyclerViewAdapter? = null
|
private var recyclerViewAdapter: RecyclerViewAdapter? = null
|
||||||
private var manualChange = false
|
private var manualChange = false
|
||||||
|
@ -47,10 +47,14 @@ class DashPodHistoryActivity : NoSplashAppCompatActivity() {
|
||||||
|
|
||||||
private fun prepareData() {
|
private fun prepareData() {
|
||||||
val gc = GregorianCalendar()
|
val gc = GregorianCalendar()
|
||||||
gc.add(Calendar.HOUR_OF_DAY, -24)
|
// TODO: limit to the last 3 days. Using 30days here for testing
|
||||||
|
gc.add(Calendar.DAY_OF_MONTH, -30)
|
||||||
|
|
||||||
//
|
val since = gc.timeInMillis
|
||||||
//fullHistoryList.addAll(dashHistory.getRecordsAfter(gc.getTimeInMillis()));
|
val records = dashHistory.getRecordsAfter(since)
|
||||||
|
.subscribeOn(aapsSchedulers.io)
|
||||||
|
.blockingGet()
|
||||||
|
fullHistoryList.addAll(records)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun filterHistory(group: PumpHistoryEntryGroup) {
|
private fun filterHistory(group: PumpHistoryEntryGroup) {
|
||||||
|
|
Loading…
Reference in a new issue