|
|
|
|
@ -5,8 +5,23 @@ import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.model.LiveData |
|
|
|
|
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 { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The resource identifier of the localized title |
|
|
|
|
*/ |
|
|
|
|
val resId: Int? |
|
|
|
|
get() { |
|
|
|
|
return null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The localized title of the row |
|
|
|
|
*/ |
|
|
|
|
fun localizedTitle(context: Context): String { |
|
|
|
|
this.resId?.let { |
|
|
|
|
return context.getString(it) |
|
|
|
|
@ -14,16 +29,17 @@ interface RowRepresentable { |
|
|
|
|
return "LOCALISATION NOT FOUND" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val resId: Int? |
|
|
|
|
get() { |
|
|
|
|
return null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The type of view associated with the row |
|
|
|
|
*/ |
|
|
|
|
val viewType: Int |
|
|
|
|
get() { |
|
|
|
|
return 0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The type of bottom sheet displayed when the row is clicked on |
|
|
|
|
*/ |
|
|
|
|
val bottomSheetType: BottomSheetType |
|
|
|
|
get() { |
|
|
|
|
return BottomSheetType.NONE |
|
|
|
|
|