Fixes an issue where the Game and Location reports showed bad legend

blinds
Laurent 5 years ago
parent 25e5119822
commit 689cdd844a
  1. 13
      app/src/main/java/net/pokeranalytics/android/model/filter/QueryCondition.kt

@ -164,6 +164,10 @@ sealed class QueryCondition : RowRepresentable {
return this.getDisplayName(context, this.listOfValues)
}
override fun getDisplayName(context: Context): String {
return getDisplayName(context, this.listOfValues)
}
private fun getDisplayName(context: Context, values: List<T>): String {
val prefix = this.resId?.let {
context.getString(it) + " "
@ -176,10 +180,6 @@ sealed class QueryCondition : RowRepresentable {
}
}
override fun getDisplayName(context: Context): String {
return getDisplayName(context, this.listOfValues)
}
override fun compareTo(other: ListOfValues<T>): Int {
return listOfValues.sorted().first().compareTo(other.listOfValues.sorted().first())
}
@ -248,6 +248,7 @@ sealed class QueryCondition : RowRepresentable {
abstract class ListOfString : ListOfValues<String>() {
override var operator: Operator = Operator.ANY
override var listOfValues = mutableListOf<String>()
override fun labelForValue(value: String, context: Context): String {
return value
}
@ -309,6 +310,10 @@ sealed class QueryCondition : RowRepresentable {
return completeLabel
}
override fun getDisplayNameWithValues(context: Context): String {
return this.getDisplayName(context)
}
open fun entityName(realm: Realm, context: Context): String {
return entityName(context)
}

Loading…
Cancel
Save