|
|
|
|
@ -30,13 +30,10 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
val name: String = (data as RowRepresentable).getDisplayName() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
open class StaticDataFilterElementRow(var row: RowRepresentable) : FilterElementRow() { |
|
|
|
|
open class StaticDataFilterElementRow(var row: RowRepresentable, var id: String) : FilterElementRow() { |
|
|
|
|
|
|
|
|
|
override val resId: Int? = row.resId |
|
|
|
|
|
|
|
|
|
fun getDataDisplayName() : String { |
|
|
|
|
return row.getDisplayName() |
|
|
|
|
} |
|
|
|
|
val name: String = row.getDisplayName() |
|
|
|
|
|
|
|
|
|
fun getDataLocalizedTitle(context: Context): String { |
|
|
|
|
return row.localizedTitle(context) |
|
|
|
|
@ -52,8 +49,8 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
data class Month(val month: Int) : SingleValueFilterElementRow(month) |
|
|
|
|
data class Day(val day: Int) : SingleValueFilterElementRow(day) |
|
|
|
|
data class PastDays(var lastDays: Int = 0) : FilterElementRow() |
|
|
|
|
data class Limit(val limit: net.pokeranalytics.android.model.Limit) : StaticDataFilterElementRow(limit) |
|
|
|
|
data class TableSize(val tableSize: net.pokeranalytics.android.model.TableSize) : StaticDataFilterElementRow(tableSize) |
|
|
|
|
data class Limit(val limit: net.pokeranalytics.android.model.Limit) : StaticDataFilterElementRow(limit, limit.longName) |
|
|
|
|
data class TableSize(val tableSize: net.pokeranalytics.android.model.TableSize) : StaticDataFilterElementRow(tableSize, tableSize.numberOfPlayer.toString()) |
|
|
|
|
data class Bankroll(val bankroll: Manageable) : DataFilterElementRow(bankroll) |
|
|
|
|
data class Game(val game: Manageable) : DataFilterElementRow(game) |
|
|
|
|
data class Location(val location: Manageable) : DataFilterElementRow(location) |
|
|
|
|
@ -82,14 +79,13 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
is Online -> QueryCondition.ONLINE |
|
|
|
|
is Weekday -> QueryCondition.WEEK_DAY |
|
|
|
|
is Weekend -> QueryCondition.WEEK_END |
|
|
|
|
|
|
|
|
|
is Today -> QueryCondition.TODAY |
|
|
|
|
is Yesterday -> QueryCondition.YESTERDAY |
|
|
|
|
is TodayAndYesterday -> QueryCondition.TODAY_AND_YESTERDAY |
|
|
|
|
is CurrentWeek -> QueryCondition.THIS_WEEK |
|
|
|
|
is CurrentMonth -> QueryCondition.THIS_MONTH |
|
|
|
|
is CurrentYear -> QueryCondition.THIS_YEAR |
|
|
|
|
/* |
|
|
|
|
is Today -> QueryCondition. |
|
|
|
|
is Yesterday -> R.string.yesterday |
|
|
|
|
is TodayAndYesterday -> R.string.yesterday_and_today |
|
|
|
|
is CurrentWeek -> R.string.current_week |
|
|
|
|
is CurrentMonth -> R.string.current_month |
|
|
|
|
is CurrentYear -> R.string.current_year |
|
|
|
|
is PastDays -> R.string.period_in_days |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
@ -112,7 +108,10 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
is DataFilterElementRow -> filterConditions.any { |
|
|
|
|
it.ids.contains(this.id) |
|
|
|
|
} |
|
|
|
|
else -> return true |
|
|
|
|
is StaticDataFilterElementRow -> filterConditions.any { |
|
|
|
|
it.ids.contains(this.id) |
|
|
|
|
} |
|
|
|
|
else -> true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -138,17 +137,25 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
is Month -> R.string.month_of_the_year |
|
|
|
|
is Day -> R.string.day_of_the_week |
|
|
|
|
is PastDays -> R.string.period_in_days |
|
|
|
|
is Blind -> TODO() |
|
|
|
|
is ResultMoreThan -> TODO() |
|
|
|
|
is ResultLessThan -> TODO() |
|
|
|
|
is Blind -> R.string.blinds |
|
|
|
|
is ResultMoreThan -> R.string.more_than |
|
|
|
|
is ResultLessThan -> R.string.less_than |
|
|
|
|
else -> null |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override val viewType: Int |
|
|
|
|
get() { |
|
|
|
|
return when (this) { |
|
|
|
|
is ResultMoreThan -> RowViewType.TITLE_VALUE_CHECK.ordinal |
|
|
|
|
else -> RowViewType.TITLE_CHECK.ordinal |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun getDisplayName(): String { |
|
|
|
|
return when (this) { |
|
|
|
|
is DataFilterElementRow -> this.name |
|
|
|
|
is StaticDataFilterElementRow -> this.getDataDisplayName() |
|
|
|
|
is StaticDataFilterElementRow -> this.name |
|
|
|
|
else -> super.getDisplayName() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -160,8 +167,6 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override val viewType: Int = RowViewType.TITLE_CHECK.ordinal |
|
|
|
|
|
|
|
|
|
val sectionToExclude: List<FilterSectionRow>? |
|
|
|
|
get() { |
|
|
|
|
val excluded = arrayListOf<FilterSectionRow>() |
|
|
|
|
|