|
|
|
@ -6,73 +6,73 @@ import net.pokeranalytics.android.ui.fragment.components.BottomSheetType |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface DynamicRowInterface { |
|
|
|
interface DynamicRowInterface { |
|
|
|
fun localizedTitle(context: Context): String |
|
|
|
fun localizedTitle(context: Context): String |
|
|
|
var viewType: Int |
|
|
|
var viewType: Int |
|
|
|
var bottomSheetType: BottomSheetType |
|
|
|
var bottomSheetType: BottomSheetType |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class SectionRow(stringRes: Int) : DynamicRowInterface { |
|
|
|
class SectionRow(stringRes: Int) : DynamicRowInterface { |
|
|
|
|
|
|
|
|
|
|
|
var stringRes: Int = stringRes |
|
|
|
var stringRes: Int = stringRes |
|
|
|
|
|
|
|
|
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
return context.getString(this.stringRes) |
|
|
|
return context.getString(this.stringRes) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override var viewType: Int = 0 |
|
|
|
override var viewType: Int = 0 |
|
|
|
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE |
|
|
|
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
enum class SessionRow(val resId: Int) : DynamicRowInterface { |
|
|
|
enum class SessionRow(val resId: Int) : DynamicRowInterface { |
|
|
|
BLINDS(R.string.app_name), |
|
|
|
BLINDS(R.string.app_name), |
|
|
|
GAME(R.string.title_history), |
|
|
|
GAME(R.string.title_history), |
|
|
|
DATE(R.string.title_settings); |
|
|
|
DATE(R.string.title_settings); |
|
|
|
|
|
|
|
|
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
return context.getString(this.resId) |
|
|
|
return context.getString(this.resId) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override var viewType: Int = RowViewType.HEADER.ordinal |
|
|
|
override var viewType: Int = RowViewType.HEADER.ordinal |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
return when (this) { |
|
|
|
return when (this) { |
|
|
|
BLINDS, GAME, DATE -> RowViewType.TITLE_VALUE.ordinal |
|
|
|
BLINDS, GAME, DATE -> RowViewType.TITLE_VALUE.ordinal |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE |
|
|
|
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
return when (this) { |
|
|
|
return when (this) { |
|
|
|
BLINDS -> BottomSheetType.BLINDS |
|
|
|
BLINDS -> BottomSheetType.BLINDS |
|
|
|
GAME -> BottomSheetType.GAME |
|
|
|
GAME -> BottomSheetType.GAME |
|
|
|
DATE -> BottomSheetType.DATE |
|
|
|
DATE -> BottomSheetType.DATE |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
enum class BankrollRow(val resId: Int) : DynamicRowInterface { |
|
|
|
enum class BankrollRow(val resId: Int) : DynamicRowInterface { |
|
|
|
NAME(R.string.app_name), |
|
|
|
NAME(R.string.app_name), |
|
|
|
LIVE(R.string.app_name), |
|
|
|
LIVE(R.string.app_name), |
|
|
|
CURRENCY(R.string.app_name); |
|
|
|
CURRENCY(R.string.app_name); |
|
|
|
|
|
|
|
|
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
return context.getString(this.resId) |
|
|
|
return context.getString(this.resId) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override var viewType: Int = 1 |
|
|
|
override var viewType: Int = 1 |
|
|
|
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE |
|
|
|
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
enum class DataObjectRowType(val resId: Int) : DynamicRowInterface { |
|
|
|
enum class DataObjectRowType(val resId: Int) : DynamicRowInterface { |
|
|
|
BANKROLL(R.string.bankroll), |
|
|
|
BANKROLL(R.string.bankroll), |
|
|
|
GAME(R.string.game), |
|
|
|
GAME(R.string.game), |
|
|
|
LOCATION(R.string.location), |
|
|
|
LOCATION(R.string.location), |
|
|
|
TOURNAMENT_TYPE(R.string.tournament_type), |
|
|
|
TOURNAMENT_TYPE(R.string.tournament_type), |
|
|
|
TRANSACTION_TYPE(R.string.transaction_type); |
|
|
|
TRANSACTION_TYPE(R.string.transaction_type); |
|
|
|
|
|
|
|
|
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
return context.getString(this.resId) |
|
|
|
return context.getString(this.resId) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override var viewType: Int = RowViewType.TITLE.ordinal |
|
|
|
override var viewType: Int = RowViewType.TITLE.ordinal |
|
|
|
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE |
|
|
|
override var bottomSheetType: BottomSheetType = BottomSheetType.NONE |
|
|
|
} |
|
|
|
} |
|
|
|
|