|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package net.pokeranalytics.android.model.realm |
|
|
|
package net.pokeranalytics.android.model.realm |
|
|
|
|
|
|
|
|
|
|
|
import io.realm.Realm |
|
|
|
import io.realm.Realm |
|
|
|
|
|
|
|
import io.realm.RealmList |
|
|
|
import io.realm.RealmObject |
|
|
|
import io.realm.RealmObject |
|
|
|
import io.realm.annotations.Ignore |
|
|
|
import io.realm.annotations.Ignore |
|
|
|
import io.realm.annotations.PrimaryKey |
|
|
|
import io.realm.annotations.PrimaryKey |
|
|
|
@ -19,16 +20,19 @@ import java.util.* |
|
|
|
|
|
|
|
|
|
|
|
open class CustomField : RealmObject(), Manageable, StaticRowRepresentableDataSource, RowRepresentable { |
|
|
|
open class CustomField : RealmObject(), Manageable, StaticRowRepresentableDataSource, RowRepresentable { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum class Type(var resId: Int) { |
|
|
|
|
|
|
|
LIST(R.string.items_list), |
|
|
|
|
|
|
|
NUMBER(R.string.number), |
|
|
|
|
|
|
|
AMOUNT(R.string.amount) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
companion object { |
|
|
|
|
|
|
|
|
|
|
|
val rowRepresentation: List<RowRepresentable> by lazy { |
|
|
|
val rowRepresentation: List<RowRepresentable> by lazy { |
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
rows.add(SimpleRow.NAME) |
|
|
|
rows.add(SimpleRow.NAME) |
|
|
|
rows.addAll(CustomFieldRow.values()) |
|
|
|
rows.addAll(CustomFieldRow.values()) |
|
|
|
rows |
|
|
|
rows |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -38,6 +42,12 @@ open class CustomField : RealmObject(), Manageable, StaticRowRepresentableDataSo |
|
|
|
// The name of the currency field |
|
|
|
// The name of the currency field |
|
|
|
var name: String = "" |
|
|
|
var name: String = "" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Migration |
|
|
|
|
|
|
|
var type: Int = Type.LIST.ordinal |
|
|
|
|
|
|
|
var duplicateValue: Boolean = false |
|
|
|
|
|
|
|
var entries: RealmList<String> = RealmList() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @todo |
|
|
|
// @todo |
|
|
|
|
|
|
|
|
|
|
|
override fun getDisplayName(): String { |
|
|
|
override fun getDisplayName(): String { |
|
|
|
|