|
|
|
|
@ -216,8 +216,20 @@ open class FilterDetailsFragment : PokerAnalyticsFragment(), StaticRowRepresenta |
|
|
|
|
this.rowsForFilterSubcategoryRow.clear() |
|
|
|
|
this.rows.addAll(it.filterElements) |
|
|
|
|
|
|
|
|
|
this.rows.forEach {element -> |
|
|
|
|
currentFilter?.filterConditions?.forEach { |
|
|
|
|
Timber.d(it.toString()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.rows.forEach { element -> |
|
|
|
|
if (element is FilterElementRow && currentFilter?.contains(element) == true) { |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
when (element) { |
|
|
|
|
is FilterElementRow.From -> element.date = currentFilter?.getValueForElement(element) as Date? ?: Date() |
|
|
|
|
is FilterElementRow.To -> element.date = currentFilter?.getValueForElement(element) as Date? ?: Date() |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
this.selectedRows.add(element) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -235,11 +247,20 @@ open class FilterDetailsFragment : PokerAnalyticsFragment(), StaticRowRepresenta |
|
|
|
|
//TODO: Save currentFilter details data |
|
|
|
|
Timber.d("Save data for filter: ${currentFilter?.id}") |
|
|
|
|
|
|
|
|
|
selectedRows?.forEach { |
|
|
|
|
Timber.d("Selected rows: $it") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val realm = getRealm() |
|
|
|
|
realm.beginTransaction() |
|
|
|
|
currentFilter?.createOrUpdateFilterConditions(selectedRows) |
|
|
|
|
realm.commitTransaction() |
|
|
|
|
|
|
|
|
|
currentFilter?.filterConditions?.forEach { |
|
|
|
|
Timber.d("Condition: $it") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
finishActivityWithResult(currentFilter?.id) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|