diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/Bankroll.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/Bankroll.kt index 655aedd6..3ad24c5e 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/Bankroll.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/Bankroll.kt @@ -14,8 +14,8 @@ import net.pokeranalytics.android.model.interfaces.Identifiable import net.pokeranalytics.android.model.interfaces.NameManageable import net.pokeranalytics.android.model.interfaces.SaveValidityStatus import net.pokeranalytics.android.ui.view.RowRepresentable -import net.pokeranalytics.android.ui.view.rowrepresentable.BankrollRow -import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.BankrollPropertiesRow +import net.pokeranalytics.android.ui.view.rowrepresentable.SessionPropertiesRow import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow import net.pokeranalytics.android.util.Preferences import net.pokeranalytics.android.util.UserDefaults @@ -26,8 +26,8 @@ enum class ResultCaptureType { NET_RESULT; companion object { - val buyinCashedOutFields = listOf(SessionRow.CASHED_OUT, SessionRow.BUY_IN, SessionRow.TIPS) - val netResultFields = listOf(SessionRow.NET_RESULT) + val buyinCashedOutFields = listOf(SessionPropertiesRow.CASHED_OUT, SessionPropertiesRow.BUY_IN, SessionPropertiesRow.TIPS) + val netResultFields = listOf(SessionPropertiesRow.NET_RESULT) } val rowRepresentables: List @@ -73,17 +73,17 @@ open class Bankroll : RealmObject(), NameManageable, RowRepresentable { override fun updateValue(value: Any?, row: RowRepresentable) { when (row) { SimpleRow.NAME -> this.name = value as String? ?: "" - BankrollRow.ONLINE -> { + BankrollPropertiesRow.ONLINE -> { this.live = if (value is Boolean) !value else false } - BankrollRow.INITIAL_VALUE -> { + BankrollPropertiesRow.INITIAL_VALUE -> { this.initialValue = value as Double? ?: 0.0 } - BankrollRow.CURRENCY -> { + BankrollPropertiesRow.CURRENCY -> { //TODO handle a use default currency option this.currency?.code = value as String? } - BankrollRow.RATE -> { + BankrollPropertiesRow.RATE -> { this.currency?.rate = value as Double? } } diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/CustomField.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/CustomField.kt index 0371c160..6ce02720 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/CustomField.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/CustomField.kt @@ -19,7 +19,7 @@ import net.pokeranalytics.android.ui.fragment.components.bottomsheet.BottomSheet import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.RowViewType -import net.pokeranalytics.android.ui.view.rowrepresentable.CustomFieldRow +import net.pokeranalytics.android.ui.view.rowrepresentable.CustomFieldPropertiesRow import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow import net.pokeranalytics.android.util.enumerations.IntIdentifiable @@ -145,8 +145,8 @@ open class CustomField : RealmObject(), NameManageable, StaticRowRepresentableDa override fun updateValue(value: Any?, row: RowRepresentable) { when (row) { SimpleRow.NAME -> this.name = value as String? ?: "" - CustomFieldRow.TYPE -> this.type = (value as Type?)?.uniqueIdentifier ?: Type.LIST.uniqueIdentifier - CustomFieldRow.COPY_ON_DUPLICATE -> this.duplicateValue = value as Boolean? ?: false + CustomFieldPropertiesRow.TYPE -> this.type = (value as Type?)?.uniqueIdentifier ?: Type.LIST.uniqueIdentifier + CustomFieldPropertiesRow.COPY_ON_DUPLICATE -> this.duplicateValue = value as Boolean? ?: false } } @@ -232,7 +232,7 @@ open class CustomField : RealmObject(), NameManageable, StaticRowRepresentableDa private fun updatedRowRepresentationForCurrentState(): List { val rows = ArrayList() rows.add(SimpleRow.NAME) - rows.add(CustomFieldRow.TYPE) + rows.add(CustomFieldPropertiesRow.TYPE) if (type == Type.LIST.uniqueIdentifier && entries.size >= 0) { if (entries.isNotEmpty()) { diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/Game.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/Game.kt index 0a6df1f3..fa02d658 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/Game.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/Game.kt @@ -15,7 +15,7 @@ import net.pokeranalytics.android.model.interfaces.SaveValidityStatus import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor -import net.pokeranalytics.android.ui.view.rowrepresentable.GameRow +import net.pokeranalytics.android.ui.view.rowrepresentable.GamePropertiesRow import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow import net.pokeranalytics.android.util.NULL_TEXT import java.util.* @@ -71,7 +71,7 @@ open class Game : RealmObject(), NameManageable, StaticRowRepresentableDataSourc ): CharSequence { return when (row) { SimpleRow.NAME -> if (this.name.isNotEmpty()) this.name else NULL_TEXT - GameRow.SHORT_NAME -> this.shortName ?: NULL_TEXT + GamePropertiesRow.SHORT_NAME -> this.shortName ?: NULL_TEXT else -> return super.charSequenceForRow(row, context, 0) } } @@ -79,7 +79,7 @@ open class Game : RealmObject(), NameManageable, StaticRowRepresentableDataSourc override fun editDescriptors(row: RowRepresentable): List? { return when (row) { SimpleRow.NAME -> row.editingDescriptors(mapOf("defaultValue" to this.name)) - GameRow.SHORT_NAME -> row.editingDescriptors(mapOf("defaultValue" to this.shortName)) + GamePropertiesRow.SHORT_NAME -> row.editingDescriptors(mapOf("defaultValue" to this.shortName)) else -> null } } @@ -87,7 +87,7 @@ open class Game : RealmObject(), NameManageable, StaticRowRepresentableDataSourc override fun updateValue(value: Any?, row: RowRepresentable) { when (row) { SimpleRow.NAME -> this.name = value as String? ?: "" - GameRow.SHORT_NAME -> this.shortName = value as String? ?: "" + GamePropertiesRow.SHORT_NAME -> this.shortName = value as String? ?: "" } } diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/Player.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/Player.kt index 71edbd31..40592a58 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/Player.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/Player.kt @@ -14,7 +14,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.RowViewType import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable -import net.pokeranalytics.android.ui.view.rowrepresentable.PlayerRow +import net.pokeranalytics.android.ui.view.rowrepresentable.PlayerPropertiesRow import net.pokeranalytics.android.ui.view.rowrepresentable.SeparatorRow import net.pokeranalytics.android.util.NULL_TEXT import net.pokeranalytics.android.util.RANDOM_PLAYER @@ -82,16 +82,16 @@ open class Player : RealmObject(), NameManageable, Savable, Deletable, StaticRow tag: Int ): CharSequence { return when (row) { - PlayerRow.NAME -> if (this.name.isNotEmpty()) this.name else NULL_TEXT + PlayerPropertiesRow.NAME -> if (this.name.isNotEmpty()) this.name else NULL_TEXT else -> return super.charSequenceForRow(row, context, 0) } } override fun updateValue(value: Any?, row: RowRepresentable) { when (row) { - PlayerRow.NAME -> this.name = value as String? ?: "" - PlayerRow.SUMMARY -> this.summary = value as String? ?: "" - PlayerRow.IMAGE -> this.picture = value as String? ?: "" + PlayerPropertiesRow.NAME -> this.name = value as String? ?: "" + PlayerPropertiesRow.SUMMARY -> this.summary = value as String? ?: "" + PlayerPropertiesRow.IMAGE -> this.picture = value as String? ?: "" } } @@ -100,9 +100,9 @@ open class Player : RealmObject(), NameManageable, Savable, Deletable, StaticRow */ private fun updatedRowRepresentationForCurrentState(): List { val rows = ArrayList() - rows.add(PlayerRow.IMAGE) - rows.add(PlayerRow.NAME) - rows.add(PlayerRow.SUMMARY) + rows.add(PlayerPropertiesRow.IMAGE) + rows.add(PlayerPropertiesRow.NAME) + rows.add(PlayerPropertiesRow.SUMMARY) if (comments.size > 0) { // Adds Comments section @@ -185,8 +185,8 @@ open class Player : RealmObject(), NameManageable, Savable, Deletable, StaticRow override fun editDescriptors(row: RowRepresentable): List? { when (row) { - PlayerRow.NAME -> return row.editingDescriptors(mapOf("defaultValue" to this.name)) - PlayerRow.SUMMARY -> return row.editingDescriptors(mapOf("defaultValue" to this.summary)) + PlayerPropertiesRow.NAME -> return row.editingDescriptors(mapOf("defaultValue" to this.name)) + PlayerPropertiesRow.SUMMARY -> return row.editingDescriptors(mapOf("defaultValue" to this.summary)) } return null diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt index d2a406b3..2b2e20b2 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt @@ -29,10 +29,9 @@ import net.pokeranalytics.android.model.realm.handhistory.HandHistory import net.pokeranalytics.android.model.utils.CrashLogging import net.pokeranalytics.android.model.utils.SessionSetManager import net.pokeranalytics.android.ui.adapter.UnmanagedRowRepresentableException -import net.pokeranalytics.android.ui.fragment.GraphFragment import net.pokeranalytics.android.ui.graph.Graph import net.pokeranalytics.android.ui.view.* -import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.SessionPropertiesRow import net.pokeranalytics.android.util.NULL_TEXT import net.pokeranalytics.android.util.TextFormat import net.pokeranalytics.android.util.UserDefaults @@ -708,8 +707,8 @@ open class Session : RealmObject(), Savable, Editable, RowRepresentable, Timed, override fun updateValue(value: Any?, row: RowRepresentable) { when (row) { - SessionRow.BANKROLL -> bankroll = value as Bankroll? - SessionRow.BLINDS -> if (value is ArrayList<*>) { + SessionPropertiesRow.BANKROLL -> bankroll = value as Bankroll? + SessionPropertiesRow.BLINDS -> if (value is ArrayList<*>) { cgSmallBlind = try { (value[0] as String? ?: "0").toDouble() } catch (e: Exception) { @@ -731,27 +730,27 @@ open class Session : RealmObject(), Savable, Editable, RowRepresentable, Timed, cgSmallBlind = null cgBigBlind = null } - SessionRow.BREAK_TIME -> { + SessionPropertiesRow.BREAK_TIME -> { this.breakDuration = (value as Double? ?: 0.0).toLong() * 60 * 1000 } - SessionRow.BUY_IN -> { + SessionPropertiesRow.BUY_IN -> { val localResult = getOrCreateResult() localResult.buyin = value as Double? // this.updateRowRepresentation() } - SessionRow.CASHED_OUT, SessionRow.PRIZE -> { + SessionPropertiesRow.CASHED_OUT, SessionPropertiesRow.PRIZE -> { val localResult = getOrCreateResult() localResult.cashout = value as Double? } - SessionRow.NET_RESULT -> { + SessionPropertiesRow.NET_RESULT -> { val localResult = getOrCreateResult() localResult.netResult = value as Double? } - SessionRow.COMMENT -> comment = value as String? ?: "" - SessionRow.END_DATE -> if (value is Date?) { + SessionPropertiesRow.COMMENT -> comment = value as String? ?: "" + SessionPropertiesRow.END_DATE -> if (value is Date?) { this.endDate = value } - SessionRow.GAME -> { + SessionPropertiesRow.GAME -> { if (value is ArrayList<*>) { limit = try { (value[0] as Int?) @@ -770,18 +769,18 @@ open class Session : RealmObject(), Savable, Editable, RowRepresentable, Timed, game = null } } - SessionRow.INITIAL_BUY_IN -> { + SessionPropertiesRow.INITIAL_BUY_IN -> { this.tournamentEntryFee = (value as Double?) } - SessionRow.LOCATION -> location = value as Location? - SessionRow.PLAYERS -> { + SessionPropertiesRow.LOCATION -> location = value as Location? + SessionPropertiesRow.PLAYERS -> { if (value is Double) { this.tournamentNumberOfPlayers = value.toInt() } else { this.tournamentNumberOfPlayers = null } } - SessionRow.POSITION -> { + SessionPropertiesRow.POSITION -> { val localResult = if (result != null) result as Result else realm.createObject(Result::class.java) if (value is Double) { localResult.tournamentFinalPosition = value.toInt() @@ -790,17 +789,17 @@ open class Session : RealmObject(), Savable, Editable, RowRepresentable, Timed, } result = localResult } - SessionRow.START_DATE -> if (value is Date) { + SessionPropertiesRow.START_DATE -> if (value is Date) { this.startDate = value } - SessionRow.TABLE_SIZE -> tableSize = value as Int? - SessionRow.TIPS -> { + SessionPropertiesRow.TABLE_SIZE -> tableSize = value as Int? + SessionPropertiesRow.TIPS -> { val localResult = getOrCreateResult() localResult.tips = value as Double? } - SessionRow.TOURNAMENT_NAME -> tournamentName = value as TournamentName? - SessionRow.TOURNAMENT_TYPE -> tournamentType = (value as TournamentType?)?.ordinal - SessionRow.TOURNAMENT_FEATURE -> { + SessionPropertiesRow.TOURNAMENT_NAME -> tournamentName = value as TournamentName? + SessionPropertiesRow.TOURNAMENT_TYPE -> tournamentType = (value as TournamentType?)?.ordinal + SessionPropertiesRow.TOURNAMENT_FEATURE -> { value?.let { tournamentFeatures = RealmList() @@ -945,30 +944,30 @@ open class Session : RealmObject(), Savable, Editable, RowRepresentable, Timed, fun charSequenceForRow(row: RowRepresentable, context: Context): String { return when (row) { - SessionRow.BANKROLL -> bankroll?.name ?: NULL_TEXT - SessionRow.BLINDS -> getFormattedBlinds() - SessionRow.BREAK_TIME -> if (this.breakDuration > 0.0) this.breakDuration.toMinutes() else NULL_TEXT - SessionRow.BUY_IN -> this.result?.buyin?.toCurrency(currency) ?: NULL_TEXT - SessionRow.CASHED_OUT, SessionRow.PRIZE -> this.result?.cashout?.toCurrency(currency) ?: NULL_TEXT - SessionRow.NET_RESULT -> this.result?.netResult?.toCurrency(currency) ?: NULL_TEXT - SessionRow.COMMENT -> if (this.comment.isNotEmpty()) this.comment else NULL_TEXT - SessionRow.END_DATE -> this.endDate?.shortDateTime() ?: NULL_TEXT - SessionRow.GAME -> getFormattedGame() - SessionRow.INITIAL_BUY_IN -> tournamentEntryFee?.toCurrency(currency) ?: NULL_TEXT - SessionRow.LOCATION -> location?.name ?: NULL_TEXT - SessionRow.PLAYERS -> tournamentNumberOfPlayers?.toString() ?: NULL_TEXT - SessionRow.POSITION -> result?.tournamentFinalPosition?.toString() ?: NULL_TEXT - SessionRow.START_DATE -> this.startDate?.shortDateTime() ?: NULL_TEXT - SessionRow.TABLE_SIZE -> this.tableSize?.let { TableSize(it).localizedTitle(context) } ?: NULL_TEXT - SessionRow.TIPS -> result?.tips?.toCurrency(currency) ?: NULL_TEXT - SessionRow.TOURNAMENT_TYPE -> { + SessionPropertiesRow.BANKROLL -> bankroll?.name ?: NULL_TEXT + SessionPropertiesRow.BLINDS -> getFormattedBlinds() + SessionPropertiesRow.BREAK_TIME -> if (this.breakDuration > 0.0) this.breakDuration.toMinutes() else NULL_TEXT + SessionPropertiesRow.BUY_IN -> this.result?.buyin?.toCurrency(currency) ?: NULL_TEXT + SessionPropertiesRow.CASHED_OUT, SessionPropertiesRow.PRIZE -> this.result?.cashout?.toCurrency(currency) ?: NULL_TEXT + SessionPropertiesRow.NET_RESULT -> this.result?.netResult?.toCurrency(currency) ?: NULL_TEXT + SessionPropertiesRow.COMMENT -> if (this.comment.isNotEmpty()) this.comment else NULL_TEXT + SessionPropertiesRow.END_DATE -> this.endDate?.shortDateTime() ?: NULL_TEXT + SessionPropertiesRow.GAME -> getFormattedGame() + SessionPropertiesRow.INITIAL_BUY_IN -> tournamentEntryFee?.toCurrency(currency) ?: NULL_TEXT + SessionPropertiesRow.LOCATION -> location?.name ?: NULL_TEXT + SessionPropertiesRow.PLAYERS -> tournamentNumberOfPlayers?.toString() ?: NULL_TEXT + SessionPropertiesRow.POSITION -> result?.tournamentFinalPosition?.toString() ?: NULL_TEXT + SessionPropertiesRow.START_DATE -> this.startDate?.shortDateTime() ?: NULL_TEXT + SessionPropertiesRow.TABLE_SIZE -> this.tableSize?.let { TableSize(it).localizedTitle(context) } ?: NULL_TEXT + SessionPropertiesRow.TIPS -> result?.tips?.toCurrency(currency) ?: NULL_TEXT + SessionPropertiesRow.TOURNAMENT_TYPE -> { this.tournamentType?.let { TournamentType.values()[it].localizedTitle(context) } ?: run { NULL_TEXT } } - SessionRow.TOURNAMENT_FEATURE -> { + SessionPropertiesRow.TOURNAMENT_FEATURE -> { if (tournamentFeatures.size > 2) { "${tournamentFeatures.subList(0, 2).joinToString { it.name @@ -981,8 +980,8 @@ open class Session : RealmObject(), Savable, Editable, RowRepresentable, Timed, NULL_TEXT } } - SessionRow.TOURNAMENT_NAME -> tournamentName?.name ?: NULL_TEXT - SessionRow.HANDS -> this.handHistories?.size.toString() + SessionPropertiesRow.TOURNAMENT_NAME -> tournamentName?.name ?: NULL_TEXT + SessionPropertiesRow.HANDS -> this.handHistories?.size.toString() is CustomField -> { customFieldEntries.find { it.customField?.id == row.id }?.let { customFieldEntry -> return customFieldEntry.getFormattedValue(currency) diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/Transaction.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/Transaction.kt index 717a0110..a4e1ca3a 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/Transaction.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/Transaction.kt @@ -16,7 +16,7 @@ import net.pokeranalytics.android.ui.view.DefaultLegendValues import net.pokeranalytics.android.ui.view.LegendContent import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionPropertiesRow import net.pokeranalytics.android.util.TextFormat import net.pokeranalytics.android.util.extensions.findById import java.text.DateFormat @@ -43,7 +43,7 @@ open class Transaction : RealmObject(), Manageable, StaticRowRepresentableDataSo val rowRepresentation: List by lazy { val rows = ArrayList() - rows.addAll(TransactionRow.values()) + rows.addAll(TransactionPropertiesRow.values()) rows } @@ -102,11 +102,11 @@ open class Transaction : RealmObject(), Manageable, StaticRowRepresentableDataSo override fun updateValue(value: Any?, row: RowRepresentable) { when (row) { - TransactionRow.BANKROLL -> bankroll = value as Bankroll? - TransactionRow.TYPE -> type = value as TransactionType? - TransactionRow.AMOUNT -> amount = if (value == null) 0.0 else (value as String).toDouble() - TransactionRow.COMMENT -> comment = value as String? ?: "" - TransactionRow.DATE -> date = value as Date? ?: Date() + TransactionPropertiesRow.BANKROLL -> bankroll = value as Bankroll? + TransactionPropertiesRow.TYPE -> type = value as TransactionType? + TransactionPropertiesRow.AMOUNT -> amount = if (value == null) 0.0 else (value as String).toDouble() + TransactionPropertiesRow.COMMENT -> comment = value as String? ?: "" + TransactionPropertiesRow.DATE -> date = value as Date? ?: Date() } } diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/TransactionType.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/TransactionType.kt index 7d1454ba..09561a96 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/TransactionType.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/TransactionType.kt @@ -14,7 +14,7 @@ import net.pokeranalytics.android.ui.view.Localizable import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow -import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionTypeRow +import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionTypePropertiesRow import net.pokeranalytics.android.util.enumerations.IntIdentifiable import net.pokeranalytics.android.util.enumerations.IntSearchable import java.util.* @@ -56,7 +56,7 @@ open class TransactionType : RealmObject(), NameManageable, StaticRowRepresentab val rowRepresentation: List by lazy { val rows = ArrayList() rows.add(SimpleRow.NAME) - rows.addAll(TransactionTypeRow.values()) + rows.addAll(TransactionTypePropertiesRow.values()) rows } @@ -131,7 +131,7 @@ open class TransactionType : RealmObject(), NameManageable, StaticRowRepresentab override fun boolForRow(row: RowRepresentable): Boolean { return when (row) { - TransactionTypeRow.TRANSACTION_ADDITIVE -> this.additive + TransactionTypePropertiesRow.TRANSACTION_ADDITIVE -> this.additive else -> super.boolForRow(row) } } @@ -143,7 +143,7 @@ open class TransactionType : RealmObject(), NameManageable, StaticRowRepresentab override fun updateValue(value: Any?, row: RowRepresentable) { when (row) { SimpleRow.NAME -> this.name = value as String? ?: "" - TransactionTypeRow.TRANSACTION_ADDITIVE -> this.additive = value as Boolean? ?: false + TransactionTypePropertiesRow.TRANSACTION_ADDITIVE -> this.additive = value as Boolean? ?: false } } diff --git a/app/src/main/java/net/pokeranalytics/android/model/utils/FavoriteSessionFinder.kt b/app/src/main/java/net/pokeranalytics/android/model/utils/FavoriteSessionFinder.kt index e0353f3d..f6c8de6c 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/utils/FavoriteSessionFinder.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/utils/FavoriteSessionFinder.kt @@ -5,7 +5,7 @@ import io.realm.Realm import io.realm.Sort import net.pokeranalytics.android.model.realm.Location import net.pokeranalytics.android.model.realm.Session -import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.SessionPropertiesRow /** * Returns all significant parameters concatenated in a String @@ -24,24 +24,24 @@ private fun Session.parameterRepresentation(context: Context): String { /** * Returns a list of fields used to determine which kind of session is favorite */ -private fun Session.significantFields(): List { +private fun Session.significantFields(): List { when (this.type) { Session.Type.TOURNAMENT.ordinal -> { return listOf( - SessionRow.GAME, - SessionRow.INITIAL_BUY_IN, - SessionRow.BANKROLL, - SessionRow.TABLE_SIZE, - SessionRow.TOURNAMENT_NAME, - SessionRow.TOURNAMENT_TYPE + SessionPropertiesRow.GAME, + SessionPropertiesRow.INITIAL_BUY_IN, + SessionPropertiesRow.BANKROLL, + SessionPropertiesRow.TABLE_SIZE, + SessionPropertiesRow.TOURNAMENT_NAME, + SessionPropertiesRow.TOURNAMENT_TYPE ) } Session.Type.CASH_GAME.ordinal -> { return listOf( - SessionRow.GAME, - SessionRow.BLINDS, - SessionRow.BANKROLL, - SessionRow.TABLE_SIZE + SessionPropertiesRow.GAME, + SessionPropertiesRow.BLINDS, + SessionPropertiesRow.BANKROLL, + SessionPropertiesRow.TABLE_SIZE ) } } diff --git a/app/src/main/java/net/pokeranalytics/android/ui/fragment/SettingsFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/fragment/SettingsFragment.kt index ec3e29cc..34e21985 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/fragment/SettingsFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/fragment/SettingsFragment.kt @@ -34,7 +34,7 @@ import net.pokeranalytics.android.ui.fragment.components.RealmFragment import net.pokeranalytics.android.ui.modules.bankroll.BankrollActivity import net.pokeranalytics.android.ui.modules.datalist.DataListActivity import net.pokeranalytics.android.ui.view.RowRepresentable -import net.pokeranalytics.android.ui.view.rowrepresentable.SettingRow +import net.pokeranalytics.android.ui.view.rowrepresentable.SettingsRow import net.pokeranalytics.android.util.* import net.pokeranalytics.android.util.billing.AppGuard import net.pokeranalytics.android.util.billing.IAPProducts @@ -63,7 +63,7 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep val rowRepresentation: List by lazy { val rows = ArrayList() - rows.addAll(SettingRow.getRows()) + rows.addAll(SettingsRow.getRows()) rows } @@ -123,12 +123,12 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep } } realm.close() - settingsAdapterRow.refreshRow(SettingRow.CURRENCY) + settingsAdapterRow.refreshRow(SettingsRow.CURRENCY) } } } RequestCode.SUBSCRIPTION.value -> { - settingsAdapterRow.refreshRow(SettingRow.SUBSCRIPTION) + settingsAdapterRow.refreshRow(SettingsRow.SUBSCRIPTION) } } } @@ -143,39 +143,39 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep tag: Int ): CharSequence { return when (row) { - SettingRow.SUBSCRIPTION -> AppGuard.subscriptionStatus(requireContext()) - SettingRow.VERSION -> BuildConfig.VERSION_NAME + if (BuildConfig.DEBUG) " (${BuildConfig.VERSION_CODE}) DEBUG" else "" - SettingRow.CURRENCY -> UserDefaults.currency.symbol + SettingsRow.SUBSCRIPTION -> AppGuard.subscriptionStatus(requireContext()) + SettingsRow.VERSION -> BuildConfig.VERSION_NAME + if (BuildConfig.DEBUG) " (${BuildConfig.VERSION_CODE}) DEBUG" else "" + SettingsRow.CURRENCY -> UserDefaults.currency.symbol else -> "" } } override fun boolForRow(row: RowRepresentable): Boolean { return when (row) { - SettingRow.STOP_NOTIFICATION -> Preferences.showStopNotifications(requireContext()) + SettingsRow.STOP_NOTIFICATION -> Preferences.showStopNotifications(requireContext()) else -> false } } override fun onRowSelected(position: Int, row: RowRepresentable, tag: Int) { when (row) { - SettingRow.BANKROLL_REPORT -> BankrollActivity.newInstance(requireContext()) - SettingRow.TOP_10 -> Top10Activity.newInstance(requireContext()) - SettingRow.PLAYERS -> DataListActivity.newInstance(requireContext(), LiveData.PLAYER.ordinal) - SettingRow.SUBSCRIPTION -> { + SettingsRow.BANKROLL_REPORT -> BankrollActivity.newInstance(requireContext()) + SettingsRow.TOP_10 -> Top10Activity.newInstance(requireContext()) + SettingsRow.PLAYERS -> DataListActivity.newInstance(requireContext(), LiveData.PLAYER.ordinal) + SettingsRow.SUBSCRIPTION -> { if (!AppGuard.isProUser) { BillingActivity.newInstanceForResult(this, false) } else { this.openPlayStoreAccount() } } - SettingRow.RATE_APP -> showReviewManager() - SettingRow.CONTACT_US -> parentActivity?.openContactMail(R.string.contact) - SettingRow.BUG_REPORT -> parentActivity?.openContactMail(R.string.bug_report_subject, Realm.getDefaultInstance().path) - SettingRow.CURRENCY -> CurrenciesActivity.newInstanceForResult(this@SettingsFragment, RequestCode.CURRENCY.value) - SettingRow.EXPORT_CSV_SESSIONS -> this.sessionsCSVExport() - SettingRow.EXPORT_CSV_TRANSACTIONS -> this.transactionsCSVExport() - SettingRow.FOLLOW_US -> { + SettingsRow.RATE_APP -> showReviewManager() + SettingsRow.CONTACT_US -> parentActivity?.openContactMail(R.string.contact) + SettingsRow.BUG_REPORT -> parentActivity?.openContactMail(R.string.bug_report_subject, Realm.getDefaultInstance().path) + SettingsRow.CURRENCY -> CurrenciesActivity.newInstanceForResult(this@SettingsFragment, RequestCode.CURRENCY.value) + SettingsRow.EXPORT_CSV_SESSIONS -> this.sessionsCSVExport() + SettingsRow.EXPORT_CSV_TRANSACTIONS -> this.transactionsCSVExport() + SettingsRow.FOLLOW_US -> { when (position) { 0 -> parentActivity?.openUrl(URL.BLOG.value) 1 -> parentActivity?.openUrl(URL.INSTAGRAM.value) @@ -183,11 +183,11 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep 3 -> parentActivity?.openUrl(URL.FACEBOOK.value) } } - SettingRow.POKER_RUMBLE -> parentActivity?.openUrl(URL.POKER_RUMBLE.value) - SettingRow.DISCORD -> parentActivity?.openUrl(URL.DISCORD.value) - SettingRow.PRIVACY_POLICY -> parentActivity?.openUrl(URL.PRIVACY_POLICY.value) - SettingRow.TERMS_OF_USE -> parentActivity?.openUrl(URL.TERMS.value) - SettingRow.GDPR -> openGDPRActivity() + SettingsRow.POKER_RUMBLE -> parentActivity?.openUrl(URL.POKER_RUMBLE.value) + SettingsRow.DISCORD -> parentActivity?.openUrl(URL.DISCORD.value) + SettingsRow.PRIVACY_POLICY -> parentActivity?.openUrl(URL.PRIVACY_POLICY.value) + SettingsRow.TERMS_OF_USE -> parentActivity?.openUrl(URL.TERMS.value) + SettingsRow.GDPR -> openGDPRActivity() } row.relatedResultsRepresentable?.let { @@ -216,7 +216,7 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep override fun onRowValueChanged(value: Any?, row: RowRepresentable) { when (row) { - SettingRow.STOP_NOTIFICATION -> { + SettingsRow.STOP_NOTIFICATION -> { val show = value as Boolean if (!show) { StopNotificationManager.stopAllStopNotifications(requireContext()) @@ -322,7 +322,7 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep } override fun purchaseDidSucceed(purchase: Purchase) { - this.settingsAdapterRow.refreshRow(SettingRow.SUBSCRIPTION) + this.settingsAdapterRow.refreshRow(SettingsRow.SUBSCRIPTION) } override fun noPurchaseRetrieved() { diff --git a/app/src/main/java/net/pokeranalytics/android/ui/fragment/components/bottomsheet/BottomSheetFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/fragment/components/bottomsheet/BottomSheetFragment.kt index c0950af7..a74f9344 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/fragment/components/bottomsheet/BottomSheetFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/fragment/components/bottomsheet/BottomSheetFragment.kt @@ -21,8 +21,8 @@ import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate import net.pokeranalytics.android.ui.modules.data.EditableDataActivity import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor -import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow -import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.SessionPropertiesRow +import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionPropertiesRow import net.pokeranalytics.android.ui.viewmodel.BottomSheetViewModel import net.pokeranalytics.android.ui.viewmodel.BottomSheetViewModelFactory import java.util.* @@ -214,12 +214,12 @@ open class BottomSheetFragment : BottomSheetDialogFragment() { bottomSheetToolbar.menu.findItem(R.id.actionAdd).setOnMenuItemClickListener { val liveData = when (row) { - SessionRow.GAME -> LiveData.GAME - SessionRow.BANKROLL, TransactionRow.BANKROLL -> LiveData.BANKROLL - SessionRow.LOCATION -> LiveData.LOCATION - SessionRow.TOURNAMENT_NAME -> LiveData.TOURNAMENT_NAME - SessionRow.TOURNAMENT_FEATURE -> LiveData.TOURNAMENT_FEATURE - TransactionRow.TYPE -> LiveData.TRANSACTION_TYPE + SessionPropertiesRow.GAME -> LiveData.GAME + SessionPropertiesRow.BANKROLL, TransactionPropertiesRow.BANKROLL -> LiveData.BANKROLL + SessionPropertiesRow.LOCATION -> LiveData.LOCATION + SessionPropertiesRow.TOURNAMENT_NAME -> LiveData.TOURNAMENT_NAME + SessionPropertiesRow.TOURNAMENT_FEATURE -> LiveData.TOURNAMENT_FEATURE + TransactionPropertiesRow.TYPE -> LiveData.TRANSACTION_TYPE else -> throw PAIllegalStateException("row $it does not have an associated LiveData value") } diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/bankroll/BankrollActivity.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/bankroll/BankrollActivity.kt index cbd06531..b14cdf07 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/bankroll/BankrollActivity.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/bankroll/BankrollActivity.kt @@ -4,18 +4,14 @@ import android.content.Context import android.content.Intent import android.os.Bundle import androidx.fragment.app.Fragment -import io.realm.RealmResults import net.pokeranalytics.android.R -import net.pokeranalytics.android.model.realm.Bankroll -import net.pokeranalytics.android.model.realm.ComputableResult -import net.pokeranalytics.android.model.realm.Transaction import net.pokeranalytics.android.ui.activity.components.BaseActivity class BankrollActivity : BaseActivity() { - private lateinit var computableResults: RealmResults - private lateinit var bankrolls: RealmResults - private lateinit var transactions: RealmResults +// private lateinit var computableResults: RealmResults +// private lateinit var bankrolls: RealmResults +// private lateinit var transactions: RealmResults companion object { fun newInstance(context: Context) { diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/calendar/CalendarDetailsFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/calendar/CalendarDetailsFragment.kt index 5c3932e2..15a99442 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/calendar/CalendarDetailsFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/calendar/CalendarDetailsFragment.kt @@ -32,7 +32,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable import net.pokeranalytics.android.ui.view.rowrepresentable.GraphRow -import net.pokeranalytics.android.ui.view.rowrepresentable.StatDoubleRow +import net.pokeranalytics.android.ui.view.rowrepresentable.DualStatRow import timber.log.Timber import java.util.* import kotlin.collections.ArrayList @@ -202,8 +202,8 @@ class CalendarDetailsFragment : BaseFragment(), StaticRowRepresentableDataSource rowRepresentables.clear() rowRepresentables.add(CustomizableRowRepresentable(RowViewType.HEADER_TITLE, resId = R.string.net_result)) rowRepresentables.add(GraphRow(netResultDataSet, report = report, stat = Stat.NET_RESULT)) - rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.NET_RESULT), it.computedStat(Stat.HOURLY_RATE))) - rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.LOCATIONS_PLAYED), it.computedStat(Stat.LONGEST_STREAKS))) + rowRepresentables.add(DualStatRow(it.computedStat(Stat.NET_RESULT), it.computedStat(Stat.HOURLY_RATE))) + rowRepresentables.add(DualStatRow(it.computedStat(Stat.LOCATIONS_PLAYED), it.computedStat(Stat.LONGEST_STREAKS))) rowRepresentables.add(CustomizableRowRepresentable(RowViewType.HEADER_TITLE, resId = R.string.distribution)) rowRepresentables.add( GraphRow( @@ -213,11 +213,11 @@ class CalendarDetailsFragment : BaseFragment(), StaticRowRepresentableDataSource stat = Stat.STANDARD_DEVIATION ) ) - rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.WIN_RATIO), it.computedStat(Stat.MAXIMUM_NETRESULT))) + rowRepresentables.add(DualStatRow(it.computedStat(Stat.WIN_RATIO), it.computedStat(Stat.MAXIMUM_NETRESULT))) rowRepresentables.add(CustomizableRowRepresentable(RowViewType.HEADER_TITLE, resId = R.string.volume)) rowRepresentables.add(GraphRow(durationDataSet, report = report, stat = Stat.HOURLY_DURATION)) - rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.HOURLY_DURATION), it.computedStat(Stat.AVERAGE_HOURLY_DURATION))) - rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.DAYS_PLAYED), it.computedStat(Stat.MAXIMUM_DURATION))) + rowRepresentables.add(DualStatRow(it.computedStat(Stat.HOURLY_DURATION), it.computedStat(Stat.AVERAGE_HOURLY_DURATION))) + rowRepresentables.add(DualStatRow(it.computedStat(Stat.DAYS_PLAYED), it.computedStat(Stat.MAXIMUM_DURATION))) } launch(Dispatchers.Main) { diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/BankrollDataFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/BankrollDataFragment.kt index 36697514..d96e8a39 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/BankrollDataFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/BankrollDataFragment.kt @@ -19,7 +19,7 @@ import net.pokeranalytics.android.ui.fragment.CurrenciesFragment import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.RowViewType -import net.pokeranalytics.android.ui.view.rowrepresentable.BankrollRow +import net.pokeranalytics.android.ui.view.rowrepresentable.BankrollPropertiesRow import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow import net.pokeranalytics.android.ui.viewmodel.DataManagerViewModel @@ -81,7 +81,7 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS if (requestCode == RequestCode.CURRENCY.value && resultCode == RESULT_OK) { data?.let { val currencyCode = it.getStringExtra(CurrenciesFragment.INTENT_CURRENCY_CODE) - onRowValueChanged(currencyCode, BankrollRow.CURRENCY) + onRowValueChanged(currencyCode, BankrollPropertiesRow.CURRENCY) if (shouldShowCurrencyRate) { refreshRate() } @@ -129,8 +129,8 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS override fun isSelected(position: Int, row: RowRepresentable, tag: Int): Boolean { return when (row) { - BankrollRow.CAPTURE_BUYIN_CASHEDOUT -> this.bankrollModel.selectedCaptureType.value == ResultCaptureType.BUYIN_CASHEDOUT - BankrollRow.CAPTURE_NET_RESULT -> this.bankrollModel.selectedCaptureType.value == ResultCaptureType.NET_RESULT + BankrollPropertiesRow.CAPTURE_BUYIN_CASHED_OUT -> this.bankrollModel.selectedCaptureType.value == ResultCaptureType.BUYIN_CASHEDOUT + BankrollPropertiesRow.CAPTURE_NET_RESULT -> this.bankrollModel.selectedCaptureType.value == ResultCaptureType.NET_RESULT else -> false } } @@ -138,21 +138,21 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS override fun charSequenceForRow(row: RowRepresentable, context: Context, tag: Int): CharSequence { return when (row) { SimpleRow.NAME -> if (bankroll.name.isNotEmpty()) bankroll.name else NULL_TEXT - BankrollRow.CURRENCY -> { + BankrollPropertiesRow.CURRENCY -> { bankroll.currency?.code?.let { code -> Currency.getInstance(code).currencyCode } ?: run { NULL_TEXT } } - BankrollRow.INITIAL_VALUE -> { + BankrollPropertiesRow.INITIAL_VALUE -> { var c: Currency? = null this.bankroll.currency?.code?.let { c = Currency.getInstance(it) } this.bankroll.initialValue.toCurrency(c) } - BankrollRow.RATE -> { + BankrollPropertiesRow.RATE -> { val rate = this.bankroll.currency?.rate ?: 1.0 rate.toRate() } @@ -162,8 +162,8 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS override fun boolForRow(row: RowRepresentable): Boolean { return when(row) { - BankrollRow.ONLINE -> !bankroll.live - BankrollRow.REFRESH_RATE -> isRefreshingRate + BankrollPropertiesRow.ONLINE -> !bankroll.live + BankrollPropertiesRow.REFRESH_RATE -> isRefreshingRate else -> super.boolForRow(row) } } @@ -171,10 +171,10 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS override fun editDescriptors(row: RowRepresentable): List? { return when (row) { SimpleRow.NAME -> row.editingDescriptors(mapOf("defaultValue" to this.bankroll.name)) - BankrollRow.INITIAL_VALUE -> { + BankrollPropertiesRow.INITIAL_VALUE -> { row.editingDescriptors(mapOf("defaultValue" to this.bankroll.initialValue)) } - BankrollRow.RATE -> { + BankrollPropertiesRow.RATE -> { val rate = this.bankroll.currency?.rate row.editingDescriptors(mapOf("defaultValue" to rate)) } @@ -184,12 +184,12 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS override fun onRowSelected(position: Int, row: RowRepresentable, tag: Int) { when (row) { - BankrollRow.CURRENCY -> CurrenciesActivity.newInstanceForResult(this@BankrollDataFragment, + BankrollPropertiesRow.CURRENCY -> CurrenciesActivity.newInstanceForResult(this@BankrollDataFragment, RequestCode.CURRENCY.value ) - BankrollRow.REFRESH_RATE -> refreshRate() - BankrollRow.CAPTURE_BUYIN_CASHEDOUT -> this.bankrollModel.selectedCaptureType.value = ResultCaptureType.BUYIN_CASHEDOUT - BankrollRow.CAPTURE_NET_RESULT -> this.bankrollModel.selectedCaptureType.value = ResultCaptureType.NET_RESULT + BankrollPropertiesRow.REFRESH_RATE -> refreshRate() + BankrollPropertiesRow.CAPTURE_BUYIN_CASHED_OUT -> this.bankrollModel.selectedCaptureType.value = ResultCaptureType.BUYIN_CASHEDOUT + BankrollPropertiesRow.CAPTURE_NET_RESULT -> this.bankrollModel.selectedCaptureType.value = ResultCaptureType.NET_RESULT else -> super.onRowSelected(position, row, tag) } } @@ -198,11 +198,11 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS super.onRowValueChanged(value, row) when (row) { - BankrollRow.CURRENCY -> { // Clear the value when the currency has been updated + BankrollPropertiesRow.CURRENCY -> { // Clear the value when the currency has been updated this.lastRefreshRateCall = 0 this.rowRepresentableAdapter.notifyDataSetChanged() } - BankrollRow.ONLINE -> { + BankrollPropertiesRow.ONLINE -> { when (value as? Boolean) { false -> this.bankrollModel.selectedCaptureType.value = ResultCaptureType.NET_RESULT else -> this.bankrollModel.selectedCaptureType.value = null @@ -220,19 +220,19 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS rows.clear() rows.add(SimpleRow.NAME) - rows.add(BankrollRow.ONLINE) - rows.add(BankrollRow.INITIAL_VALUE) + rows.add(BankrollPropertiesRow.ONLINE) + rows.add(BankrollPropertiesRow.INITIAL_VALUE) rows.add(CustomizableRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.currency)) - rows.add(BankrollRow.CURRENCY) + rows.add(BankrollPropertiesRow.CURRENCY) if (this.shouldShowCurrencyRate) { - rows.add(BankrollRow.RATE) - rows.add(BankrollRow.REFRESH_RATE) + rows.add(BankrollPropertiesRow.RATE) + rows.add(BankrollPropertiesRow.REFRESH_RATE) } if (!this.bankroll.live) { rows.add(CustomizableRowRepresentable(customViewType = RowViewType.HEADER_TITLE, resId = R.string.bankroll_capture_method)) - rows.add(BankrollRow.CAPTURE_NET_RESULT) - rows.add(BankrollRow.CAPTURE_BUYIN_CASHEDOUT) + rows.add(BankrollPropertiesRow.CAPTURE_NET_RESULT) + rows.add(BankrollPropertiesRow.CAPTURE_BUYIN_CASHED_OUT) } } @@ -266,13 +266,13 @@ class BankrollDataFragment : EditableDataFragment(), StaticRowRepresentableDataS val currenciesConverterValue = "${bankroll.currency?.code}_${defaultCurrency.currencyCode}" FreeConverterApi.currencyRate(currenciesConverterValue, requireContext()) { rate -> - onRowValueChanged(rate, BankrollRow.RATE) + onRowValueChanged(rate, BankrollPropertiesRow.RATE) isRefreshingRate = false - rowRepresentableAdapter.refreshRow(BankrollRow.REFRESH_RATE) + rowRepresentableAdapter.refreshRow(BankrollPropertiesRow.REFRESH_RATE) } this.isRefreshingRate = true - this.rowRepresentableAdapter.refreshRow(BankrollRow.REFRESH_RATE) + this.rowRepresentableAdapter.refreshRow(BankrollPropertiesRow.REFRESH_RATE) } override fun willSaveData() { diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/CustomFieldDataFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/CustomFieldDataFragment.kt index c6963ee4..d749b99c 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/CustomFieldDataFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/CustomFieldDataFragment.kt @@ -20,7 +20,7 @@ import net.pokeranalytics.android.ui.extensions.px import net.pokeranalytics.android.ui.extensions.showAlertDialog import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor -import net.pokeranalytics.android.ui.view.rowrepresentable.CustomFieldRow +import net.pokeranalytics.android.ui.view.rowrepresentable.CustomFieldPropertiesRow import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow import net.pokeranalytics.android.util.NULL_TEXT import java.util.* @@ -82,7 +82,7 @@ class CustomFieldDataFragment : EditableDataFragment(), StaticRowRepresentableDa ) { super.onMoved(recyclerView, viewHolder, fromPos, target, toPos, x, y) - Collections.swap(customField.entries, fromPos - (CustomFieldRow.values().size + 1), toPos - (CustomFieldRow.values().size + 1)) + Collections.swap(customField.entries, fromPos - (CustomFieldPropertiesRow.values().size + 1), toPos - (CustomFieldPropertiesRow.values().size + 1)) customField.entries.forEachIndexed { index, rowRepresentable -> val entry = rowRepresentable as CustomFieldEntry entry.order = index @@ -140,7 +140,7 @@ class CustomFieldDataFragment : EditableDataFragment(), StaticRowRepresentableDa override fun boolForRow(row: RowRepresentable): Boolean { return when (row) { - CustomFieldRow.COPY_ON_DUPLICATE -> customField.duplicateValue + CustomFieldPropertiesRow.COPY_ON_DUPLICATE -> customField.duplicateValue // CustomFieldRow.TYPE -> isUpdating // very weird else -> super.boolForRow(row) } @@ -148,7 +148,7 @@ class CustomFieldDataFragment : EditableDataFragment(), StaticRowRepresentableDa override fun intForRow(row: RowRepresentable): Int { return when (row) { - CustomFieldRow.TYPE -> customField.type + CustomFieldPropertiesRow.TYPE -> customField.type else -> super.intForRow(row) } } @@ -178,7 +178,7 @@ class CustomFieldDataFragment : EditableDataFragment(), StaticRowRepresentableDa customField.updateRowRepresentation() rowRepresentableAdapter.notifyDataSetChanged() } - CustomFieldRow.TYPE -> { + CustomFieldPropertiesRow.TYPE -> { customField.updateValue(value, row) updateUI() rowRepresentableAdapter.notifyDataSetChanged() diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/LocationDataFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/LocationDataFragment.kt index a1fe1b02..10ba489d 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/LocationDataFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/LocationDataFragment.kt @@ -12,7 +12,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.RowViewType import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable -import net.pokeranalytics.android.ui.view.rowrepresentable.LocationRow +import net.pokeranalytics.android.ui.view.rowrepresentable.LocationPropertiesRow import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow import net.pokeranalytics.android.util.LocationManager import net.pokeranalytics.android.util.NULL_TEXT @@ -80,7 +80,7 @@ class LocationDataFragment : EditableDataFragment(), StaticRowRepresentableDataS override fun boolForRow(row: RowRepresentable): Boolean { return when (row) { - LocationRow.LOCATION_PERMISSION_SWITCH -> return locationActivated + LocationPropertiesRow.LOCATION_PERMISSION_SWITCH -> return locationActivated else -> super.boolForRow(row) } } @@ -104,7 +104,7 @@ class LocationDataFragment : EditableDataFragment(), StaticRowRepresentableDataS override fun onRowValueChanged(value: Any?, row: RowRepresentable) { when (row) { - LocationRow.LOCATION_PERMISSION_SWITCH -> { + LocationPropertiesRow.LOCATION_PERMISSION_SWITCH -> { if (value is Boolean && value != locationActivated) { rowPlaces.clear() locationActivated = value @@ -136,7 +136,7 @@ class LocationDataFragment : EditableDataFragment(), StaticRowRepresentableDataS private fun refreshRows() { rows.clear() rows.add(SimpleRow.NAME) - rows.add(LocationRow.LOCATION_PERMISSION_SWITCH) + rows.add(LocationPropertiesRow.LOCATION_PERMISSION_SWITCH) // Add info row to explain why we need the location permission rows.add(CustomizableRowRepresentable(customViewType = RowViewType.INFO, resId = R.string.location_when_in_use_usage_description)) diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/PlayerDataFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/PlayerDataFragment.kt index 8cda02b7..249d1896 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/PlayerDataFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/PlayerDataFragment.kt @@ -25,7 +25,7 @@ import net.pokeranalytics.android.ui.extensions.showAlertDialog import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.RowViewType -import net.pokeranalytics.android.ui.view.rowrepresentable.PlayerRow +import net.pokeranalytics.android.ui.view.rowrepresentable.PlayerPropertiesRow import net.pokeranalytics.android.util.NULL_TEXT import java.io.File @@ -61,7 +61,7 @@ class PlayerDataFragment : EditableDataFragment(), StaticRowRepresentableDataSou if (requestCode == REQUEST_CODE_PICK_COLOR && resultCode == RESULT_OK && data?.hasExtra(ColorPickerActivity.INTENT_COLOR) == true) { val color = data.getIntExtra(ColorPickerActivity.INTENT_COLOR, Color.TRANSPARENT) player.color = if (color != Color.TRANSPARENT) color else null - rowRepresentableAdapter.refreshRow(PlayerRow.IMAGE) + rowRepresentableAdapter.refreshRow(PlayerPropertiesRow.IMAGE) } } @@ -84,7 +84,7 @@ class PlayerDataFragment : EditableDataFragment(), StaticRowRepresentableDataSou player.updateRowRepresentation() if (!deleteButtonShouldAppear) { - onRowSelected(0, PlayerRow.NAME) + onRowSelected(0, PlayerPropertiesRow.NAME) } binding.addComment.setOnClickListener { @@ -97,8 +97,8 @@ class PlayerDataFragment : EditableDataFragment(), StaticRowRepresentableDataSou override fun getPhotos(files: ArrayList) { super.getPhotos(files) files.firstOrNull()?.let { picture -> - player.updateValue(picture.absolutePath, PlayerRow.IMAGE) - rowRepresentableAdapter.refreshRow(PlayerRow.IMAGE) + player.updateValue(picture.absolutePath, PlayerPropertiesRow.IMAGE) + rowRepresentableAdapter.refreshRow(PlayerPropertiesRow.IMAGE) } } @@ -130,15 +130,15 @@ class PlayerDataFragment : EditableDataFragment(), StaticRowRepresentableDataSou tag: Int ): CharSequence { return when (row) { - PlayerRow.NAME -> if (player.name.isNotEmpty()) player.name else NULL_TEXT - PlayerRow.SUMMARY -> if (player.summary.isNotEmpty()) player.summary else NULL_TEXT + PlayerPropertiesRow.NAME -> if (player.name.isNotEmpty()) player.name else NULL_TEXT + PlayerPropertiesRow.SUMMARY -> if (player.summary.isNotEmpty()) player.summary else NULL_TEXT else -> super.charSequenceForRow(row, context, 0) } } override fun onRowSelected(position: Int, row: RowRepresentable, tag: Int) { when (row) { - PlayerRow.IMAGE -> openPictureDialog() + PlayerPropertiesRow.IMAGE -> openPictureDialog() is Comment -> { val data = arrayListOf(RowRepresentableEditDescriptor(row.content)) showBottomSheet(row, this, data, isClearable = false, isDeletable = true) @@ -156,8 +156,8 @@ class PlayerDataFragment : EditableDataFragment(), StaticRowRepresentableDataSou } else -> { super.onRowValueChanged(value, row) - if (row == PlayerRow.NAME) { - rowRepresentableAdapter.refreshRow(PlayerRow.IMAGE) + if (row == PlayerPropertiesRow.NAME) { + rowRepresentableAdapter.refreshRow(PlayerPropertiesRow.IMAGE) } } @@ -205,8 +205,8 @@ class PlayerDataFragment : EditableDataFragment(), StaticRowRepresentableDataSou ColorPickerActivity.newInstanceForResult(this, REQUEST_CODE_PICK_COLOR) } getString(R.string.remove_picture) -> { - player.updateValue(null, PlayerRow.IMAGE) - rowRepresentableAdapter.refreshRow(PlayerRow.IMAGE) + player.updateValue(null, PlayerPropertiesRow.IMAGE) + rowRepresentableAdapter.refreshRow(PlayerPropertiesRow.IMAGE) } } } @@ -220,8 +220,8 @@ class PlayerDataFragment : EditableDataFragment(), StaticRowRepresentableDataSou override fun editDescriptors(row: RowRepresentable): List? { when (row) { - PlayerRow.NAME -> return arrayListOf(RowRepresentableEditDescriptor(this.player.name, R.string.name)) - PlayerRow.SUMMARY -> return arrayListOf(RowRepresentableEditDescriptor(this.player.summary, R.string.summary)) + PlayerPropertiesRow.NAME -> return arrayListOf(RowRepresentableEditDescriptor(this.player.name, R.string.name)) + PlayerPropertiesRow.SUMMARY -> return arrayListOf(RowRepresentableEditDescriptor(this.player.summary, R.string.summary)) } return null } diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/TransactionDataFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/TransactionDataFragment.kt index 8b860533..645f10ad 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/TransactionDataFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/TransactionDataFragment.kt @@ -15,7 +15,7 @@ import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource import net.pokeranalytics.android.ui.helpers.DateTimePickerManager import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor -import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionPropertiesRow import net.pokeranalytics.android.util.NULL_TEXT import net.pokeranalytics.android.util.extensions.round import net.pokeranalytics.android.util.extensions.shortDate @@ -63,38 +63,38 @@ class TransactionDataFragment : EditableDataFragment(), StaticRowRepresentableDa tag: Int ): CharSequence { return when (row) { - TransactionRow.BANKROLL -> this.transaction.bankroll?.name ?: NULL_TEXT - TransactionRow.TYPE -> this.transaction.type?.name ?: NULL_TEXT - TransactionRow.AMOUNT -> if (this.transaction.amount != 0.0) abs(this.transaction.amount).round() else NULL_TEXT - TransactionRow.COMMENT -> if (this.transaction.comment.isNotEmpty()) this.transaction.comment else NULL_TEXT - TransactionRow.DATE -> this.transaction.date.shortDate() + TransactionPropertiesRow.BANKROLL -> this.transaction.bankroll?.name ?: NULL_TEXT + TransactionPropertiesRow.TYPE -> this.transaction.type?.name ?: NULL_TEXT + TransactionPropertiesRow.AMOUNT -> if (this.transaction.amount != 0.0) abs(this.transaction.amount).round() else NULL_TEXT + TransactionPropertiesRow.COMMENT -> if (this.transaction.comment.isNotEmpty()) this.transaction.comment else NULL_TEXT + TransactionPropertiesRow.DATE -> this.transaction.date.shortDate() else -> super.charSequenceForRow(row, context, 0) } } override fun editDescriptors(row: RowRepresentable): List? { return when (row) { - TransactionRow.BANKROLL -> row.editingDescriptors( + TransactionPropertiesRow.BANKROLL -> row.editingDescriptors( mapOf( "defaultValue" to this.transaction.bankroll, "data" to getRealm().sorted() ) ) - TransactionRow.TYPE -> row.editingDescriptors( + TransactionPropertiesRow.TYPE -> row.editingDescriptors( mapOf( "defaultValue" to this.transaction.type, "data" to getRealm().sorted() ) ) - TransactionRow.AMOUNT -> row.editingDescriptors(mapOf("defaultValue" to (if (this.transaction.amount != 0.0) abs(this.transaction.amount).round() else ""))) - TransactionRow.COMMENT -> row.editingDescriptors(mapOf("defaultValue" to this.transaction.comment)) + TransactionPropertiesRow.AMOUNT -> row.editingDescriptors(mapOf("defaultValue" to (if (this.transaction.amount != 0.0) abs(this.transaction.amount).round() else ""))) + TransactionPropertiesRow.COMMENT -> row.editingDescriptors(mapOf("defaultValue" to this.transaction.comment)) else -> super.editDescriptors(row) } } override fun onRowSelected(position: Int, row: RowRepresentable, tag: Int) { when (row) { - TransactionRow.DATE -> DateTimePickerManager.create( + TransactionPropertiesRow.DATE -> DateTimePickerManager.create( requireContext(), row, this, @@ -121,8 +121,8 @@ class TransactionDataFragment : EditableDataFragment(), StaticRowRepresentableDa GlobalScope.launch(Dispatchers.Main) { delay(200) when (currentRow) { - TransactionRow.BANKROLL -> onRowSelected(0, TransactionRow.TYPE) - TransactionRow.TYPE -> onRowSelected(0, TransactionRow.AMOUNT) + TransactionPropertiesRow.BANKROLL -> onRowSelected(0, TransactionPropertiesRow.TYPE) + TransactionPropertiesRow.TYPE -> onRowSelected(0, TransactionPropertiesRow.AMOUNT) // TransactionRow.AMOUNT -> onRowSelected(0, TransactionRow.DATE) // TransactionRow.DATE -> onRowSelected(0, TransactionRow.COMMENT) } diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/TransactionTypeDataFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/TransactionTypeDataFragment.kt index c05f9229..0617b4de 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/data/TransactionTypeDataFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/data/TransactionTypeDataFragment.kt @@ -7,7 +7,7 @@ import net.pokeranalytics.android.ui.adapter.RowRepresentableDataSource import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow -import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionTypeRow +import net.pokeranalytics.android.ui.view.rowrepresentable.TransactionTypePropertiesRow class TransactionTypeDataFragment : EditableDataFragment(), RowRepresentableDataSource { @@ -47,7 +47,7 @@ class TransactionTypeDataFragment : EditableDataFragment(), RowRepresentableData override fun boolForRow(row: RowRepresentable): Boolean { return when (row) { - TransactionTypeRow.TRANSACTION_ADDITIVE -> this.transactionType.additive + TransactionTypePropertiesRow.TRANSACTION_ADDITIVE -> this.transactionType.additive else -> super.boolForRow(row) } } @@ -61,7 +61,7 @@ class TransactionTypeDataFragment : EditableDataFragment(), RowRepresentableData tag: Int ): Boolean { return when (row) { - TransactionTypeRow.TRANSACTION_ADDITIVE -> { + TransactionTypePropertiesRow.TRANSACTION_ADDITIVE -> { return this.transactionType.isValidForDelete(getRealm()) } else -> super.isEnabled(row, 0) @@ -70,7 +70,7 @@ class TransactionTypeDataFragment : EditableDataFragment(), RowRepresentableData override fun isSelectable(row: RowRepresentable): Boolean { return when (row) { - TransactionTypeRow.TRANSACTION_ADDITIVE -> { + TransactionTypePropertiesRow.TRANSACTION_ADDITIVE -> { val realm = getRealm() val useCount = realm.where(Transaction::class.java) .equalTo("type.id", this.transactionType.id).count() diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionFragment.kt index c7c58ff0..8e4041c8 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionFragment.kt @@ -37,7 +37,7 @@ import net.pokeranalytics.android.ui.modules.data.EditableDataActivity import net.pokeranalytics.android.ui.modules.datalist.DataListActivity import net.pokeranalytics.android.ui.modules.handhistory.HandHistoryActivity import net.pokeranalytics.android.ui.view.* -import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.SessionPropertiesRow import net.pokeranalytics.android.util.Preferences import net.pokeranalytics.android.util.extensions.* import timber.log.Timber @@ -226,8 +226,8 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr val data = this.editDescriptors(row) when (row) { - SessionRow.START_DATE -> DateTimePickerManager.create(requireContext(), row, this, session.startDate) - SessionRow.END_DATE -> { + SessionPropertiesRow.START_DATE -> DateTimePickerManager.create(requireContext(), row, this, session.startDate) + SessionPropertiesRow.END_DATE -> { if (session.startDate == null) { Toast.makeText(context, R.string.session_missing_start_date, Toast.LENGTH_SHORT).show() @@ -242,10 +242,10 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr } } - SessionRow.BANKROLL -> { + SessionPropertiesRow.BANKROLL -> { showBottomSheet(row, this, data, false, session.currency) } - SessionRow.HANDS -> { + SessionPropertiesRow.HANDS -> { val hhIds = session.handHistories?.map { it.id }?.toTypedArray() DataListActivity.newInstance(this, LiveData.HAND_HISTORY, false, hhIds, false) } @@ -265,10 +265,10 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr } this.sessionAdapter.refreshRow(row) when (row) { - SessionRow.CASHED_OUT, SessionRow.PRIZE, SessionRow.NET_RESULT, - SessionRow.BUY_IN, SessionRow.TIPS, SessionRow.START_DATE, - SessionRow.END_DATE, SessionRow.BREAK_TIME -> updateSessionUI() - SessionRow.BANKROLL -> { + SessionPropertiesRow.CASHED_OUT, SessionPropertiesRow.PRIZE, SessionPropertiesRow.NET_RESULT, + SessionPropertiesRow.BUY_IN, SessionPropertiesRow.TIPS, SessionPropertiesRow.START_DATE, + SessionPropertiesRow.END_DATE, SessionPropertiesRow.BREAK_TIME -> updateSessionUI() + SessionPropertiesRow.BANKROLL -> { updateSessionUI() updateMenuUI() // result capture method } @@ -518,7 +518,7 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr override fun actionIconForRow(row: RowRepresentable): Int? { return when (row) { - SessionRow.START_DATE, SessionRow.END_DATE -> { + SessionPropertiesRow.START_DATE, SessionPropertiesRow.END_DATE -> { R.drawable.ic_close } else -> null @@ -529,92 +529,92 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRepr val session = this.currentSession return when (row) { - SessionRow.BANKROLL -> row.editingDescriptors( + SessionPropertiesRow.BANKROLL -> row.editingDescriptors( mapOf( "defaultValue" to session.bankroll, "data" to getRealm().sorted() // LiveData.Bankroll.items(realm) ) ) - SessionRow.GAME -> row.editingDescriptors( + SessionPropertiesRow.GAME -> row.editingDescriptors( mapOf( "limit" to session.limit, "defaultValue" to session.game, "data" to getRealm().sorted() //LiveData.Game.items(realm) ) ) - SessionRow.LOCATION -> row.editingDescriptors( + SessionPropertiesRow.LOCATION -> row.editingDescriptors( mapOf( "defaultValue" to session.location, "data" to getRealm().sorted() // LiveData.Location.items(realm) ) ) - SessionRow.TOURNAMENT_FEATURE -> row.editingDescriptors( + SessionPropertiesRow.TOURNAMENT_FEATURE -> row.editingDescriptors( mapOf( "defaultValue" to session.tournamentFeatures, "data" to getRealm().sorted() //LiveData.TournamentFeature.items(realm) ) ) - SessionRow.TOURNAMENT_NAME -> row.editingDescriptors( + SessionPropertiesRow.TOURNAMENT_NAME -> row.editingDescriptors( mapOf( "defaultValue" to session.tournamentName, "data" to getRealm().sorted() //LiveData.TournamentName.items(realm) ) ) - SessionRow.TOURNAMENT_TYPE -> row.editingDescriptors( + SessionPropertiesRow.TOURNAMENT_TYPE -> row.editingDescriptors( mapOf( "defaultValue" to session.tournamentType ) ) - SessionRow.TABLE_SIZE -> row.editingDescriptors( + SessionPropertiesRow.TABLE_SIZE -> row.editingDescriptors( mapOf( "defaultValue" to session.tableSize ) ) - SessionRow.BLINDS -> row.editingDescriptors( + SessionPropertiesRow.BLINDS -> row.editingDescriptors( mapOf( "sb" to session.cgSmallBlind?.round(), "bb" to session.cgBigBlind?.round() ) ) - SessionRow.BUY_IN -> row.editingDescriptors( + SessionPropertiesRow.BUY_IN -> row.editingDescriptors( mapOf( "bb" to session.cgBigBlind, "fee" to session.tournamentEntryFee, "ratedBuyin" to session.result?.buyin ) ) - SessionRow.BREAK_TIME -> row.editingDescriptors(mapOf()) - SessionRow.CASHED_OUT, SessionRow.PRIZE -> row.editingDescriptors( + SessionPropertiesRow.BREAK_TIME -> row.editingDescriptors(mapOf()) + SessionPropertiesRow.CASHED_OUT, SessionPropertiesRow.PRIZE -> row.editingDescriptors( mapOf( "defaultValue" to session.result?.cashout ) ) - SessionRow.NET_RESULT -> row.editingDescriptors( + SessionPropertiesRow.NET_RESULT -> row.editingDescriptors( mapOf( "defaultValue" to session.result?.netResult ) ) - SessionRow.COMMENT -> row.editingDescriptors( + SessionPropertiesRow.COMMENT -> row.editingDescriptors( mapOf( "defaultValue" to session.comment ) ) - SessionRow.INITIAL_BUY_IN -> row.editingDescriptors( + SessionPropertiesRow.INITIAL_BUY_IN -> row.editingDescriptors( mapOf( "defaultValue" to session.tournamentEntryFee ) ) - SessionRow.PLAYERS -> row.editingDescriptors( + SessionPropertiesRow.PLAYERS -> row.editingDescriptors( mapOf( "defaultValue" to session.tournamentNumberOfPlayers ) ) - SessionRow.POSITION -> row.editingDescriptors( + SessionPropertiesRow.POSITION -> row.editingDescriptors( mapOf( "defaultValue" to session.result?.tournamentFinalPosition ) ) - SessionRow.TIPS -> row.editingDescriptors( + SessionPropertiesRow.TIPS -> row.editingDescriptors( mapOf( "sb" to session.cgSmallBlind?.round(), "bb" to session.cgBigBlind?.round(), diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionViewModel.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionViewModel.kt index 16835f99..42cb18d1 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionViewModel.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/session/SessionViewModel.kt @@ -15,7 +15,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable import net.pokeranalytics.android.ui.view.rowrepresentable.SeparatorRow -import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.SessionPropertiesRow import net.pokeranalytics.android.util.extensions.sorted import java.util.ArrayList @@ -100,7 +100,7 @@ class SessionViewModel : ViewModel() { } // Rows - rows.addAll(SessionRow.getRows(session, this.resultCaptureType, context)) + rows.addAll(SessionPropertiesRow.getRows(session, this.resultCaptureType, context)) // Add custom fields rows.add(SeparatorRow()) diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/CalendarTabs.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/CalendarTabs.kt index 677e3a0f..9adfc64d 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/CalendarTabs.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/CalendarTabs.kt @@ -2,7 +2,6 @@ package net.pokeranalytics.android.ui.view import net.pokeranalytics.android.R - enum class CalendarTabs : Displayable { NET_RESULTS, NET_HOURLY_RATE, diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/RowViewType.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/RowViewType.kt index bec2eed8..a75870ef 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/RowViewType.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/RowViewType.kt @@ -214,7 +214,7 @@ enum class RowViewType(private var layoutRes: Int) : ViewIdentifier { BindableHolder { override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { - if (row is StatDoubleRow) { + if (row is DualStatRow) { // Stat 1 itemView.findViewById(R.id.stat1Name)?.let { view -> @@ -363,7 +363,7 @@ enum class RowViewType(private var layoutRes: Int) : ViewIdentifier { BindableHolder { override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { - if (row is CustomFieldRow) { + if (row is CustomFieldPropertiesRow) { itemView.findViewById(R.id.chipGroup)?.let { chipGroup -> @@ -561,7 +561,7 @@ enum class RowViewType(private var layoutRes: Int) : ViewIdentifier { override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { itemView.findViewById(R.id.playerImageView)?.let { playerImageView -> val listener = View.OnClickListener { - adapter.delegate?.onRowSelected(position, PlayerRow.IMAGE) + adapter.delegate?.onRowSelected(position, PlayerPropertiesRow.IMAGE) } playerImageView.setPlayer(row as Player) playerImageView.setOnImageClickListener(listener) diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollMainRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollMainRow.kt index 7c3cd40e..6cec1e54 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollMainRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollMainRow.kt @@ -1,5 +1,6 @@ package net.pokeranalytics.android.ui.view.rowrepresentable +import android.content.Context import net.pokeranalytics.android.ui.modules.bankroll.BankrollRowRepresentable import net.pokeranalytics.android.ui.view.RowViewType @@ -10,4 +11,16 @@ class BankrollMainRow : override val viewType: Int = RowViewType.LEGEND_DEFAULT.ordinal -} \ No newline at end of file +} + + +class BankrollTotalRow(override var bankrollId: String?, var name: String) : + BankrollRowRepresentable { + + override val viewType: Int = RowViewType.TITLE_VALUE_ARROW.ordinal + + override fun localizedTitle(context: Context): String { + return name + } + +} diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollPropertiesRow.kt similarity index 82% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollPropertiesRow.kt index 09042aee..c5befc84 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollPropertiesRow.kt @@ -9,13 +9,13 @@ import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.RowViewType -enum class BankrollRow : RowRepresentable, DefaultEditDataSource { +enum class BankrollPropertiesRow : RowRepresentable, DefaultEditDataSource { ONLINE, INITIAL_VALUE, CURRENCY, RATE, REFRESH_RATE, - CAPTURE_BUYIN_CASHEDOUT, + CAPTURE_BUYIN_CASHED_OUT, CAPTURE_NET_RESULT; override val resId: Int? @@ -26,7 +26,7 @@ enum class BankrollRow : RowRepresentable, DefaultEditDataSource { CURRENCY -> R.string.currency RATE -> R.string.rate REFRESH_RATE -> R.string.refresh_rate - CAPTURE_BUYIN_CASHEDOUT -> R.string.stack_buy_in + CAPTURE_BUYIN_CASHED_OUT -> R.string.stack_buy_in CAPTURE_NET_RESULT -> R.string.net_result_only } } @@ -39,7 +39,7 @@ enum class BankrollRow : RowRepresentable, DefaultEditDataSource { CURRENCY -> RowViewType.TITLE_VALUE_ARROW.ordinal RATE -> RowViewType.TITLE_VALUE.ordinal REFRESH_RATE -> RowViewType.ROW_BUTTON.ordinal - CAPTURE_BUYIN_CASHEDOUT -> RowViewType.TITLE_CHECK.ordinal + CAPTURE_BUYIN_CASHED_OUT -> RowViewType.TITLE_CHECK.ordinal CAPTURE_NET_RESULT -> RowViewType.TITLE_CHECK.ordinal } } @@ -52,7 +52,7 @@ enum class BankrollRow : RowRepresentable, DefaultEditDataSource { CURRENCY -> BottomSheetType.NONE RATE -> BottomSheetType.NUMERIC_TEXT REFRESH_RATE -> BottomSheetType.NONE - CAPTURE_BUYIN_CASHEDOUT -> BottomSheetType.NONE + CAPTURE_BUYIN_CASHED_OUT -> BottomSheetType.NONE CAPTURE_NET_RESULT -> BottomSheetType.NONE } } @@ -77,13 +77,4 @@ enum class BankrollRow : RowRepresentable, DefaultEditDataSource { } } -// val resultCaptureType: ResultCaptureType? -// get() { -// return when (this) { -// CAPTURE_NET_RESULT -> ResultCaptureType.NET_RESULT -// CAPTURE_BUYIN_CASHEDOUT -> ResultCaptureType.BUYIN_CASHEDOUT -// else -> null -// } -// } - } \ No newline at end of file diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomFieldRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomFieldPropertiesRow.kt similarity index 88% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomFieldRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomFieldPropertiesRow.kt index 9cb64d5c..515aa3fa 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomFieldRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomFieldPropertiesRow.kt @@ -7,7 +7,7 @@ import net.pokeranalytics.android.ui.view.DefaultEditDataSource import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -enum class CustomFieldRow : RowRepresentable, DefaultEditDataSource { +enum class CustomFieldPropertiesRow : RowRepresentable, DefaultEditDataSource { TYPE, COPY_ON_DUPLICATE; @@ -50,7 +50,7 @@ enum class CustomFieldRow : RowRepresentable, DefaultEditDataSource { type.isEnabled = if (!isUpdating) { true } else { - !(currentChoiceIndex == CustomFieldRow.TYPE.ordinal || type == CustomField.Type.LIST) + !(currentChoiceIndex == CustomFieldPropertiesRow.TYPE.ordinal || type == CustomField.Type.LIST) } } return list diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomizableRowRepresentable.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomizableRowRepresentable.kt index 7e97110c..f5d71d37 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomizableRowRepresentable.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomizableRowRepresentable.kt @@ -6,17 +6,6 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType import net.pokeranalytics.android.util.TextFormat -class BankrollTotalRow(override var bankrollId: String?, var name: String) : - BankrollRowRepresentable { - - override val viewType: Int = RowViewType.TITLE_VALUE_ARROW.ordinal - - override fun localizedTitle(context: Context): String { - return name - } - -} - interface ViewIdentifier { val identifier: Int } diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/StatDoubleRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/DualStatRow.kt similarity index 71% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/StatDoubleRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/DualStatRow.kt index 6c27eadd..95a16c87 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/StatDoubleRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/DualStatRow.kt @@ -5,7 +5,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -class StatDoubleRow(var computedStat1: ComputedStat? = null, var computedStat2: ComputedStat? = null) : RowRepresentable { +class DualStatRow(var computedStat1: ComputedStat? = null, var computedStat2: ComputedStat? = null) : RowRepresentable { override val viewType: Int get() = RowViewType.STATS_DOUBLE.ordinal diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GameRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GamePropertiesRow.kt similarity index 92% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GameRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GamePropertiesRow.kt index 19fada44..4da5ba47 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GameRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GamePropertiesRow.kt @@ -6,7 +6,8 @@ import net.pokeranalytics.android.ui.view.DefaultEditDataSource import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -enum class GameRow : RowRepresentable, DefaultEditDataSource { +enum class GamePropertiesRow : RowRepresentable, DefaultEditDataSource { + SHORT_NAME; override val resId: Int? diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GraphRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GraphRow.kt index 3259a331..eb812a0b 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GraphRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/GraphRow.kt @@ -8,8 +8,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -class BankrollGraphRow : GraphRow(null, null, null, null), - BankrollRowRepresentable { +class BankrollGraphRow : GraphRow(null, null, null, null), BankrollRowRepresentable { override var bankrollId: String? = null diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/LocationRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/LocationPropertiesRow.kt similarity index 93% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/LocationRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/LocationPropertiesRow.kt index abff9ff2..d72625c7 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/LocationRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/LocationPropertiesRow.kt @@ -7,7 +7,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -enum class LocationRow : RowRepresentable, DefaultEditDataSource { +enum class LocationPropertiesRow : RowRepresentable, DefaultEditDataSource { LOCATION_PERMISSION_SWITCH, LOCATION_LOADER; diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/PlayerRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/PlayerPropertiesRow.kt similarity index 97% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/PlayerRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/PlayerPropertiesRow.kt index 44d37f87..cbfdbb84 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/PlayerRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/PlayerPropertiesRow.kt @@ -9,7 +9,7 @@ import net.pokeranalytics.android.ui.view.RowViewType /** * An enum managing the player rows */ -enum class PlayerRow : RowRepresentable { +enum class PlayerPropertiesRow : RowRepresentable { IMAGE, NAME, SUMMARY; diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/ReportRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/ReportRow.kt index a0da7590..d015c36d 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/ReportRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/ReportRow.kt @@ -18,7 +18,6 @@ enum class ReportRow : RowRepresentable { TOURNAMENT_TYPES, GAME; - companion object { /** * Return the report rows diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SessionRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SessionPropertiesRow.kt similarity index 99% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SessionRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SessionPropertiesRow.kt index 2c126815..a1998f52 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SessionRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SessionPropertiesRow.kt @@ -16,7 +16,7 @@ import net.pokeranalytics.android.ui.view.RowViewType import net.pokeranalytics.android.util.extensions.round -enum class SessionRow : RowRepresentable { +enum class SessionPropertiesRow : RowRepresentable { PRIZE, CASHED_OUT, diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SettingRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SettingsRow.kt similarity index 99% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SettingRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SettingsRow.kt index b0e3596a..4468ef6c 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SettingRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SettingsRow.kt @@ -7,7 +7,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -enum class SettingRow : RowRepresentable { +enum class SettingsRow : RowRepresentable { // More BANKROLL_REPORT, diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SimpleRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SimpleRow.kt index 5dbfb1b7..3142f7b1 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SimpleRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/SimpleRow.kt @@ -8,6 +8,7 @@ import net.pokeranalytics.android.ui.view.RowViewType enum class SimpleRow : RowRepresentable, DefaultEditDataSource { + NAME; override val resId: Int? = R.string.name diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/StatRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/StatRow.kt index 390d0656..5cfc0bd4 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/StatRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/StatRow.kt @@ -7,11 +7,10 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -class StatRow(stat: Stat, computedStat: ComputedStat?, groupName: String = "", var title: String? = null) : RowRepresentable { - - var stat: Stat = stat - var computedStat: ComputedStat? = computedStat - var groupName: String = groupName +class StatRow(var stat: Stat, + var computedStat: ComputedStat?, + var groupName: String = "", + var title: String? = null) : RowRepresentable { override val viewType: Int get() = RowViewType.STATS.ordinal diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionPropertiesRow.kt similarity index 96% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionPropertiesRow.kt index 456cb5b8..fdf45771 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionPropertiesRow.kt @@ -10,7 +10,8 @@ import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor import net.pokeranalytics.android.ui.view.RowViewType -enum class TransactionRow : RowRepresentable, DefaultEditDataSource { +enum class TransactionPropertiesRow : RowRepresentable, DefaultEditDataSource { + BANKROLL, TYPE, AMOUNT, diff --git a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionTypeRow.kt b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionTypePropertiesRow.kt similarity index 90% rename from app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionTypeRow.kt rename to app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionTypePropertiesRow.kt index a54484b1..49d52bf6 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionTypeRow.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionTypePropertiesRow.kt @@ -6,7 +6,8 @@ import net.pokeranalytics.android.ui.view.DefaultEditDataSource import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowViewType -enum class TransactionTypeRow : RowRepresentable, DefaultEditDataSource { +enum class TransactionTypePropertiesRow : RowRepresentable, DefaultEditDataSource { + TRANSACTION_ADDITIVE; override val resId: Int? @@ -30,6 +31,4 @@ enum class TransactionTypeRow : RowRepresentable, DefaultEditDataSource { } } - - } diff --git a/app/src/main/java/net/pokeranalytics/android/ui/viewmodel/BottomSheetViewModel.kt b/app/src/main/java/net/pokeranalytics/android/ui/viewmodel/BottomSheetViewModel.kt index 9e96380e..144fe35d 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/viewmodel/BottomSheetViewModel.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/viewmodel/BottomSheetViewModel.kt @@ -10,7 +10,7 @@ import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate import net.pokeranalytics.android.ui.fragment.components.bottomsheet.BottomSheetType import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor -import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow +import net.pokeranalytics.android.ui.view.rowrepresentable.SessionPropertiesRow import java.util.* class BottomSheetViewModelFactory(var row: RowRepresentable, var delegate: RowRepresentableDelegate): ViewModelProvider.Factory { @@ -105,7 +105,7 @@ class BottomSheetViewModel(var row: RowRepresentable) : ViewModel() { throw RowRepresentableEditDescriptorException("RowRepresentableEditDescriptor inconsistency") } - this.isEditingBlinds = this.row == SessionRow.BLINDS + this.isEditingBlinds = this.row == SessionPropertiesRow.BLINDS this.stringValue = descriptors[0].defaultValue as? String this.secondStringValue = descriptors[1].defaultValue as? String