|
|
|
|
@ -17,9 +17,9 @@ interface DynamicRowInterface { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface DynamicValues { |
|
|
|
|
fun items(realm: Realm): RealmResults<*> |
|
|
|
|
var sortingFieldName: String |
|
|
|
|
var sorting: Sort |
|
|
|
|
fun items(realm: Realm): RealmResults<*> |
|
|
|
|
var sortingFieldName: String |
|
|
|
|
var sorting: Sort |
|
|
|
|
fun clazz(): Class<out RealmObject> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -36,8 +36,10 @@ class SectionRow(stringRes: Int) : DynamicRowInterface { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
enum class SessionRow(val resId: Int) : DynamicRowInterface { |
|
|
|
|
BLINDS(R.string.blinds), |
|
|
|
|
GAME(R.string.game), |
|
|
|
|
BLINDS(R.string.blinds), |
|
|
|
|
LOCATION(R.string.location), |
|
|
|
|
BANKROLL(R.string.bankroll), |
|
|
|
|
DATE(R.string.date); |
|
|
|
|
|
|
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
|
@ -47,7 +49,7 @@ enum class SessionRow(val resId: Int) : DynamicRowInterface { |
|
|
|
|
override var viewType: Int = RowViewType.HEADER.ordinal |
|
|
|
|
get() { |
|
|
|
|
return when (this) { |
|
|
|
|
BLINDS, GAME, DATE -> RowViewType.TITLE_VALUE.ordinal |
|
|
|
|
BLINDS, GAME, DATE, BANKROLL, LOCATION -> RowViewType.TITLE_VALUE.ordinal |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -56,6 +58,8 @@ enum class SessionRow(val resId: Int) : DynamicRowInterface { |
|
|
|
|
return when (this) { |
|
|
|
|
BLINDS -> BottomSheetType.DOUBLE_EDIT_TEXT |
|
|
|
|
GAME -> BottomSheetType.LIST |
|
|
|
|
LOCATION -> BottomSheetType.LIST |
|
|
|
|
BANKROLL -> BottomSheetType.LIST |
|
|
|
|
DATE -> BottomSheetType.DATE |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|