|
|
|
@ -24,7 +24,6 @@ import net.pokeranalytics.android.ui.view.RowRepresentableEditDescriptor |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable |
|
|
|
import net.pokeranalytics.android.util.extensions.formatted |
|
|
|
import net.pokeranalytics.android.util.extensions.formatted |
|
|
|
import timber.log.Timber |
|
|
|
import timber.log.Timber |
|
|
|
import kotlin.math.abs |
|
|
|
|
|
|
|
import kotlin.reflect.KClass |
|
|
|
import kotlin.reflect.KClass |
|
|
|
|
|
|
|
|
|
|
|
enum class HHKeyboard { |
|
|
|
enum class HHKeyboard { |
|
|
|
@ -227,8 +226,8 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rows.add(CustomizableRowRepresentable(customViewType = HandRowType.HEADER, resId = R.string.settings, value = "")) |
|
|
|
rows.add(CustomizableRowRepresentable(customViewType = HandRowType.HEADER, resId = R.string.settings, value = "")) |
|
|
|
|
|
|
|
|
|
|
|
rows.add(HandRowType.PLAYER_NUMBER) |
|
|
|
rows.add(HandRowType.PLAYER_NUMBER) |
|
|
|
|
|
|
|
|
|
|
|
if (this.handHistory.ante > 0) { |
|
|
|
if (this.handHistory.ante > 0) { |
|
|
|
rows.add(HandRowType.ANTE) |
|
|
|
rows.add(HandRowType.ANTE) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -276,19 +275,6 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra |
|
|
|
return rows |
|
|
|
return rows |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun backgroundColor(position: Int, row: RowRepresentable): Int? { |
|
|
|
|
|
|
|
return if (position < this.settingsRowCount) R.color.gray_darker else R.color.transparent |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun arrowIcon(position: Int, row: RowRepresentable): Int? { |
|
|
|
|
|
|
|
return when (row) { |
|
|
|
|
|
|
|
HandRowType.SETTINGS_HEADER -> { |
|
|
|
|
|
|
|
if (this.settingsExpanded) R.drawable.ic_arrow_up else R.drawable.ic_arrow_down |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else -> null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun editionRowRepresentation(): MutableList<RowRepresentable> { |
|
|
|
private fun editionRowRepresentation(): MutableList<RowRepresentable> { |
|
|
|
|
|
|
|
|
|
|
|
val rows: MutableList<RowRepresentable> = mutableListOf() |
|
|
|
val rows: MutableList<RowRepresentable> = mutableListOf() |
|
|
|
@ -828,6 +814,23 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun backgroundColor(position: Int, row: RowRepresentable): Int? { |
|
|
|
|
|
|
|
return if (this.isEdited) { |
|
|
|
|
|
|
|
if (position < this.settingsRowCount) R.color.green_header else R.color.transparent |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun arrowIcon(position: Int, row: RowRepresentable): Int? { |
|
|
|
|
|
|
|
return when (row) { |
|
|
|
|
|
|
|
HandRowType.SETTINGS_HEADER -> { |
|
|
|
|
|
|
|
if (this.settingsExpanded) R.drawable.ic_arrow_up else R.drawable.ic_arrow_down |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else -> null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
/*** |
|
|
|
* Defines the positions having straddled and |
|
|
|
* Defines the positions having straddled and |
|
|
|
* changes the player's actions accordingly |
|
|
|
* changes the player's actions accordingly |
|
|
|
|