Format class

dev_raz_wip
Aurelien Hubert 7 years ago
parent 49b59379e9
commit 0b0aa872c4
  1. 104
      app/src/main/java/net/pokeranalytics/android/ui/adapter/components/DynamicRowInterface.kt

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

Loading…
Cancel
Save