Merge branch 'master' of gitlab.com:stax-river/poker-analytics

dev_raz_wip
Aurelien Hubert 7 years ago
commit d652195dde
  1. 28
      app/src/main/java/net/pokeranalytics/android/ui/view/RowRepresentable.kt

@ -5,8 +5,23 @@ import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.LiveData import net.pokeranalytics.android.model.LiveData
import net.pokeranalytics.android.ui.fragment.components.bottomsheet.BottomSheetType import net.pokeranalytics.android.ui.fragment.components.bottomsheet.BottomSheetType
/**
* An interface used so that enums values can be represented visually
* as rows in RecyclerViews
*/
interface RowRepresentable { interface RowRepresentable {
/**
* The resource identifier of the localized title
*/
val resId: Int?
get() {
return null
}
/**
* The localized title of the row
*/
fun localizedTitle(context: Context): String { fun localizedTitle(context: Context): String {
this.resId?.let { this.resId?.let {
return context.getString(it) return context.getString(it)
@ -14,16 +29,17 @@ interface RowRepresentable {
return "LOCALISATION NOT FOUND" return "LOCALISATION NOT FOUND"
} }
val resId: Int? /**
get() { * The type of view associated with the row
return null */
}
val viewType: Int val viewType: Int
get() { get() {
return 0 return 0
} }
/**
* The type of bottom sheet displayed when the row is clicked on
*/
val bottomSheetType: BottomSheetType val bottomSheetType: BottomSheetType
get() { get() {
return BottomSheetType.NONE return BottomSheetType.NONE

Loading…
Cancel
Save