cleanup, improvement and bug fix

hh
Laurent 6 years ago
parent 223ca8ea18
commit 5f30b844dc
  1. 5
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ActionList.kt
  2. 4
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt
  3. 7
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/views/KeyboardActionView.kt
  4. 5
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/views/KeyboardCardView.kt
  5. 9
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/views/KeyboardContainer.kt
  6. 1
      app/src/main/res/layout/view_hand_keyboard_card.xml
  7. 2
      app/src/main/res/values/styles.xml

@ -584,10 +584,11 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>()
} }
/*** /***
* Returns all positions of the street, identified by the action at the given [index] * Returns all positions to act in the street after the action at the given [index]
*/ */
fun positionsToActAfterIndex(index: Int): List<Position> { fun positionsToActAfterIndex(index: Int): List<Position> {
val nextActions = this.drop(index + 1) val street = this[index].street
val nextActions = this.drop(index + 1).filter { it.street == street }
return nextActions.map { it.position } return nextActions.map { it.position }
} }

@ -233,10 +233,6 @@ class ComputedAction(var manager: ActionManager,
this.setEffectiveAmount(significantAmount - committedAmount) this.setEffectiveAmount(significantAmount - committedAmount)
} }
// private fun getStreetSignificantActionBefore(index: Int): ComputedAction? {
// return this.manager.getStreetLastSignificantAction(this.street, index - 1)
// }
private fun getStreetLastSignificantAction(): ComputedAction? { private fun getStreetLastSignificantAction(): ComputedAction? {
return this.manager.getStreetLastSignificantAction(this.street, this.action.index - 1) return this.manager.getStreetLastSignificantAction(this.street, this.action.index - 1)
} }

@ -91,11 +91,4 @@ class KeyboardActionView(context: Context) : AbstractKeyboardView(context),
this.dataAdapter.notifyDataSetChanged() this.dataAdapter.notifyDataSetChanged()
} }
// override fun charSequenceForRow(row: RowRepresentable): String {
// this.context?.let {
// return row.localizedTitle(it)
// }
// return "UNKNOWN CONTEXT FOR ROW $row"
// }
} }

@ -79,9 +79,4 @@ class KeyboardCardView(context: Context) : AbstractKeyboardView(context) {
} }
// fun setCardCentralizer(centralizer: CardCentralizer) {
// this.cardValueAdapter.centralizer = centralizer
// this.cardSuitAdapter.centralizer = centralizer
// }
} }

@ -73,15 +73,13 @@ class KeyboardContainer : FrameLayout {
} }
fun show(type: HHKeyboard) { fun show(type: HHKeyboard) {
// Timber.d("show keyboard : $type")
// showAnimated()
this.keyboards[type]?.let { this.keyboards[type]?.let {
show(it) show(it)
} ?: run { } ?: run {
throw PAIllegalStateException("missing keyboard") throw PAIllegalStateException("missing keyboard")
} }
} }
private fun show(keyboardView: AbstractKeyboardView) { private fun show(keyboardView: AbstractKeyboardView) {
@ -105,9 +103,4 @@ class KeyboardContainer : FrameLayout {
actionKeyboard.setAvailableActions(availableActions) actionKeyboard.setAvailableActions(availableActions)
} }
// fun setCardCentralizer(centralizer: CardCentralizer) {
// val cardKeyboard = this.keyboards[HHKeyboard.CARD] as KeyboardCardView
// cardKeyboard.setCardCentralizer(centralizer)
// }
} }

@ -19,7 +19,6 @@
android:id="@+id/closeButton" android:id="@+id/closeButton"
style="@style/PokerAnalyticsTheme.Button" style="@style/PokerAnalyticsTheme.Button"
app:icon="@drawable/ic_close" app:icon="@drawable/ic_close"
android:gravity="center"
android:layout_width="44dp" android:layout_width="44dp"
android:layout_height="44dp" /> android:layout_height="44dp" />

@ -343,7 +343,7 @@
<item name="android:fontFamily">@font/roboto_medium</item> <item name="android:fontFamily">@font/roboto_medium</item>
<item name="android:textColor">@color/black</item> <item name="android:textColor">@color/black</item>
<item name="android:paddingStart">4dp</item> <item name="android:paddingStart">4dp</item>
<item name="android:paddingEnd">8dp</item> <item name="android:paddingEnd">4dp</item>
<item name="android:textSize">12sp</item> <item name="android:textSize">12sp</item>
</style> </style>

Loading…
Cancel
Save