fix issue with lateinit in filterElement

feature/top10
Razmig Sarkissian 7 years ago
parent f8e78e6a51
commit b720ba8a91
  1. 4
      app/src/main/java/net/pokeranalytics/android/model/realm/FilterComponent.kt
  2. 1
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/FilterElementRow.kt

@ -11,7 +11,7 @@ import kotlin.collections.ArrayList
open class FilterComponent(var filterName : String = "", var sectionName: String = "") : RealmObject() { open class FilterComponent(var filterName : String = "", var sectionName: String = "") : RealmObject() {
constructor(filterElementRows: ArrayList<FilterElementRow>) : this(filterElementRows.first().filterName, filterElementRows.first().sectionName) { constructor(filterElementRows: ArrayList<FilterElementRow>) : this(filterElementRows.first().filterName, filterElementRows.first().filterSectionRow.name) {
this.ids = when (FilterType.valueOf(this.filterName)) { this.ids = when (FilterType.valueOf(this.filterName)) {
FilterType.GAME -> { FilterType.GAME -> {
RealmList<String>().apply { RealmList<String>().apply {
@ -35,7 +35,7 @@ open class FilterComponent(var filterName : String = "", var sectionName: String
} }
} }
constructor(filterElementRow:FilterElementRow) : this(filterElementRow.filterName, filterElementRow.sectionName) { constructor(filterElementRow:FilterElementRow) : this(filterElementRow.filterName, filterElementRow.filterSectionRow.name) {
when (filterElementRow) { when (filterElementRow) {
is From -> date = filterElementRow.date is From -> date = filterElementRow.date
is To -> date = filterElementRow.date is To -> date = filterElementRow.date

@ -44,7 +44,6 @@ sealed class FilterElementRow : RowRepresentable {
lateinit var filterSectionRow: FilterSectionRow lateinit var filterSectionRow: FilterSectionRow
val filterName : String = this.filterType.name val filterName : String = this.filterType.name
val sectionName : String = this.filterSectionRow.name
private val filterType : FilterType private val filterType : FilterType
get() { get() {

Loading…
Cancel
Save