|
|
|
|
@ -28,7 +28,7 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
interface LessOperator : Operator |
|
|
|
|
|
|
|
|
|
open class BoolFilterElementRow : FilterElementRow() |
|
|
|
|
open class DateFilterElementRow(var dateValue: Date = Date()) : FilterElementRow() |
|
|
|
|
open class DateFilterElementRow(var dateValue: Date = Date(), var showTime: Boolean = false) : FilterElementRow() |
|
|
|
|
open class NumericFilterElementRow(open val doubleValue: Double = 0.0) : FilterElementRow() |
|
|
|
|
open class StringFilterElementRow(val stringValue: String = "") : FilterElementRow() |
|
|
|
|
|
|
|
|
|
@ -86,6 +86,10 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
object From : DateFilterElementRow() |
|
|
|
|
object To : DateFilterElementRow() |
|
|
|
|
|
|
|
|
|
object FromTime : DateFilterElementRow(showTime = true) |
|
|
|
|
object ToTime : DateFilterElementRow(showTime = true) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Data classes - holding value |
|
|
|
|
object ResultMoreThan : AmountFilterElement(), MoreOperator |
|
|
|
|
|
|
|
|
|
@ -153,6 +157,8 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
is Blind -> QueryCondition.BLINDS |
|
|
|
|
is From -> QueryCondition.STARTED_FROM_DATE |
|
|
|
|
is To -> QueryCondition.ENDED_TO_DATE |
|
|
|
|
is FromTime -> QueryCondition.STARTED_FROM_TIME |
|
|
|
|
is ToTime -> QueryCondition.ENDED_TO_TIME |
|
|
|
|
is Month -> QueryCondition.MONTH |
|
|
|
|
is Day -> QueryCondition.DAY_OF_WEEK |
|
|
|
|
is Year -> QueryCondition.YEAR |
|
|
|
|
@ -180,7 +186,6 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
is DurationMoreThan -> QueryCondition.MORE_THAN_DURATION |
|
|
|
|
is DurationLessThan -> QueryCondition.LESS_THAN_DURATION |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: Check the conditions |
|
|
|
|
is LastGames -> QueryCondition.LAST_GAMES |
|
|
|
|
is LastSessions -> QueryCondition.LAST_SESSIONS |
|
|
|
|
@ -215,8 +220,8 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
is CurrentWeek -> R.string.current_week |
|
|
|
|
is CurrentMonth -> R.string.current_month |
|
|
|
|
is CurrentYear -> R.string.current_year |
|
|
|
|
is From -> R.string.from |
|
|
|
|
is To -> R.string.to |
|
|
|
|
is From, FromTime -> R.string.from |
|
|
|
|
is To, ToTime -> R.string.to |
|
|
|
|
is Live -> R.string.live |
|
|
|
|
is Online -> R.string.online |
|
|
|
|
is Weekday -> R.string.week_days |
|
|
|
|
@ -235,7 +240,7 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
override val viewType: Int |
|
|
|
|
get() { |
|
|
|
|
return when (this) { |
|
|
|
|
is PastDays, is From, is To, is LastGames, is LastSessions, is ReBuyMoreThan, is ReBuyLessThan, |
|
|
|
|
is PastDays, is From, is To, is FromTime, is ToTime, is LastGames, is LastSessions, is ReBuyMoreThan, is ReBuyLessThan, |
|
|
|
|
is DurationMoreThan, is DurationLessThan -> RowViewType.TITLE_VALUE_CHECK.ordinal |
|
|
|
|
else -> RowViewType.TITLE_CHECK.ordinal |
|
|
|
|
} |
|
|
|
|
@ -330,22 +335,4 @@ sealed class FilterElementRow : RowRepresentable { |
|
|
|
|
return null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
override fun editingDescriptors(map: Map<String, Any?>): ArrayList<RowRepresentableEditDescriptor>? { |
|
|
|
|
when (this) { |
|
|
|
|
PAST_DAYS -> { |
|
|
|
|
val defaultValue: String? by map |
|
|
|
|
val data = arrayListOf<RowRepresentableEditDescriptor>() |
|
|
|
|
data.add( |
|
|
|
|
RowRepresentableEditDescriptor( |
|
|
|
|
defaultValue, |
|
|
|
|
inputType = InputType.TYPE_CLASS_NUMBER |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return super.editingDescriptors(map) |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
} |