Add selectable

feature/top10
Aurelien Hubert 7 years ago
parent 56d73c4974
commit 405ac674d4
  1. 21
      app/src/main/java/net/pokeranalytics/android/ui/fragment/CalendarFragment.kt

@ -91,6 +91,10 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope, StaticRowRep
return rows
}
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) {
//toast("Open $row")
}
// Business
@ -268,10 +272,10 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope, StaticRowRep
sortedMonthlyReports = monthlyReports.toSortedMap(compareByDescending { it })
sortedYearlyReports = yearlyReports.toSortedMap(compareByDescending { it })
// Logs
/*
Timber.d("Computation: ${System.currentTimeMillis() - startDate.time}ms")
// Logs
/*
Timber.d("========== YEAR x MONTH")
sortedMonthlyReports.keys.forEach {
Timber.d("$it => ${sortedMonthlyReports[it]?.computedStat(Stat.NETRESULT)?.value}")
@ -286,9 +290,7 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope, StaticRowRep
GlobalScope.launch(Dispatchers.Main) {
displayData()
}
}
}
/**
@ -304,9 +306,7 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope, StaticRowRep
// Create monthly reports
TimeFilter.MONTH -> {
val years: ArrayList<String> = ArrayList()
sortedMonthlyReports.keys.forEach { date ->
if (!years.contains(date.getDateYear())) {
years.add(date.getDateYear())
@ -323,7 +323,8 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope, StaticRowRep
CustomizableRowRepresentable(
customViewType = RowViewType.TITLE_VALUE_ARROW,
title = date.getDateMonth(),
computedStat = computedStat
computedStat = computedStat,
isSelectable = true
)
)
}
@ -332,21 +333,19 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope, StaticRowRep
// Create yearly reports
TimeFilter.YEAR -> {
sortedYearlyReports.keys.forEach { date ->
Timber.d("$date => ${sortedYearlyReports[date]?.computedStat(Stat.NETRESULT)?.value}")
sortedYearlyReports[date]?.computedStat(currentStat)?.let { computedStat ->
rows.add(
CustomizableRowRepresentable(
customViewType = RowViewType.TITLE_VALUE_ARROW,
title = date.getDateYear(),
computedStat = computedStat
computedStat = computedStat,
isSelectable = true
)
)
}
}
}
}
Timber.d("Display data: ${System.currentTimeMillis() - startDate.time}ms")

Loading…
Cancel
Save