|
|
|
|
@ -4,21 +4,12 @@ import android.content.Context |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RowGroup(stringRes: Int?, rows: ArrayList<DynamicRowInterface>) : DynamicRowInterface { |
|
|
|
|
class SectionRow(stringRes: Int) : DynamicRowInterface { |
|
|
|
|
|
|
|
|
|
var stringRes: Int? = stringRes |
|
|
|
|
var rows: ArrayList<DynamicRowInterface> = rows |
|
|
|
|
var stringRes: Int = stringRes |
|
|
|
|
|
|
|
|
|
var size: Int = 0 |
|
|
|
|
get() { |
|
|
|
|
return this.rows.size |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun localizedTitle(context: Context): String? { |
|
|
|
|
stringRes?.let { |
|
|
|
|
return context.getString(it) |
|
|
|
|
} |
|
|
|
|
return null |
|
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
|
return context.getString(this.stringRes) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override var viewType: Int = 0 |
|
|
|
|
@ -27,7 +18,7 @@ class RowGroup(stringRes: Int?, rows: ArrayList<DynamicRowInterface>) : DynamicR |
|
|
|
|
|
|
|
|
|
interface DynamicRowInterface { |
|
|
|
|
|
|
|
|
|
fun localizedTitle(context: Context): String? |
|
|
|
|
fun localizedTitle(context: Context): String |
|
|
|
|
var viewType: Int |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@ -37,7 +28,7 @@ enum class SessionRow(val resId: Int) : DynamicRowInterface { |
|
|
|
|
GAME(R.string.app_name), |
|
|
|
|
DATE(R.string.app_name); |
|
|
|
|
|
|
|
|
|
override fun localizedTitle(context: Context): String? { |
|
|
|
|
override fun localizedTitle(context: Context): String { |
|
|
|
|
return context.getString(this.resId) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -57,7 +48,7 @@ enum class BankrollRow(val resId: Int) : DynamicRowInterface { |
|
|
|
|
LIVE(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) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|