|
|
|
@ -1,7 +1,6 @@ |
|
|
|
package net.pokeranalytics.android.model.filter |
|
|
|
package net.pokeranalytics.android.model.filter |
|
|
|
|
|
|
|
|
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
import com.ibm.icu.text.RuleBasedNumberFormat |
|
|
|
|
|
|
|
import io.realm.Realm |
|
|
|
import io.realm.Realm |
|
|
|
import io.realm.RealmQuery |
|
|
|
import io.realm.RealmQuery |
|
|
|
import io.realm.RealmResults |
|
|
|
import io.realm.RealmResults |
|
|
|
@ -428,8 +427,13 @@ sealed class QueryCondition : FilterElementRow { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun labelForValue(value: Int, context: Context): String { |
|
|
|
override fun labelForValue(value: Int, context: Context): String { |
|
|
|
val nf = RuleBasedNumberFormat(Locale.getDefault(), RuleBasedNumberFormat.ORDINAL) |
|
|
|
val suffix = when (value%10) { |
|
|
|
return nf.format(value) + " " + context.getString(R.string.position) |
|
|
|
1 -> context.getString(R.string.ordinal_suffix_first) |
|
|
|
|
|
|
|
2 -> context.getString(R.string.ordinal_suffix_second) |
|
|
|
|
|
|
|
3 -> context.getString(R.string.ordinal_suffix_third) |
|
|
|
|
|
|
|
else -> context.getString(R.string.ordinal_suffix_default) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return "$value$suffix "+context.getString(R.string.position) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun entityName(context: Context): String { |
|
|
|
override fun entityName(context: Context): String { |
|
|
|
|