Merge branch 'master' of gitlab.com:stax-river/poker-analytics

feature/top10
Laurent 7 years ago
commit 1a72188c3c
  1. 2
      app/src/androidTest/java/net/pokeranalytics/android/filter/SessionFilterInstrumentedUnitTest.kt
  2. 2
      app/src/main/java/net/pokeranalytics/android/model/filter/SessionFilterable.kt
  3. 26
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/FilterCategoryRow.kt
  4. 28
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/FilterRow.kt
  5. 9
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/FilterSubcategoryRow.kt

@ -541,7 +541,7 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() {
realm.beginTransaction()
val s1 = Session.testInstance(netResult = 200.0)
Session.testInstance(netResult = 500.0)
val s2 = Session.testInstance(netResult = 50.0)
Session.testInstance(netResult = 50.0)
Session.testInstance(netResult = 570.0)
realm.commitTransaction()

@ -55,7 +55,7 @@ enum class SessionFilterable(private var fieldName:String? = null, private var s
SMALL_BLIND("cgSmallBlind"),
COMMENT("comment"),
TOURNAMENT_FEATURES("tournamentFeatures.id"),
NET_RESULT("result.ratedNet"),
NET_RESULT("computableResult.ratedNet"),
BUY_IN("result.buyin"),
CASH_OUT("result.cashout"),
TIPS("result.tips"),

@ -4,6 +4,32 @@ import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.RowViewType
/*
enum class FilterCategoryRow(override val resId: Int?, val subCategories:Array<out RowRepresentable>, override val viewType: Int = RowViewType.TITLE_VALUE_ARROW.ordinal) : RowRepresentable {
GENERAL(R.string.general, GeneralSubCategory.values()),
DATE,
DURATION,
SESSION,
CASH,
TOURNAMENT,
ONLINE,
RESULT,
TRANSACTION_TYPES,
// Title Custom fields
LOCATION,
BANKROLL,
PLAYERS;
private enum class GeneralSubCategory(val category : FilterCategoryRow = GENERAL): RowRepresentable {
CASH_TOURNAMENT,
LIVE_ONLINE,
GAME,
LIMIT_TYPE,
TABLE_SIZE,
}
*/
enum class FilterCategoryRow : RowRepresentable {
GENERAL,

@ -4,6 +4,34 @@ import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.view.RowRepresentable
import net.pokeranalytics.android.ui.view.RowViewType
/*
sealed class FilterElement : RowRepresentable {
class Cash : FilterElement()
class Tournament : FilterElement()
data class Game(val game: net.pokeranalytics.android.model.realm.Game) : FilterElement()
var value : Any? = null
override val resId: Int?
get() {
return when (this) {
is Cash -> R.string.cash_game
is Tournament -> R.string.tournament
else -> null
}
}
override val viewType: Int
get() {
return when (this) {
else -> RowViewType.TITLE_CHECK.ordinal
}
}
}
*/
enum class FilterRow : RowRepresentable {
// General

@ -15,7 +15,14 @@ import java.text.DateFormatSymbols
import java.util.*
import kotlin.collections.ArrayList
/*
GAME -> {
val games = realm.copyFromRealm(LiveData.GAME.items(realm) as RealmResults<Game>)
games.forEach {
rows.add(FilterElement.Game(game = it))
}
}
*/
enum class FilterSubcategoryRow : RowRepresentable {
// General

Loading…
Cancel
Save