Various improvements

hh
Laurent 6 years ago
parent 5f30b844dc
commit 65015641ba
  1. 2
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt
  2. 14
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ActionList.kt
  3. 3
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ComputedAction.kt
  4. 3
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/HandHistoryViewModel.kt
  5. 13
      app/src/main/res/layout/row_hand_action.xml
  6. 4
      app/src/main/res/layout/row_hand_action_read.xml
  7. 8
      app/src/main/res/layout/row_hand_player_summary.xml
  8. 6
      app/src/main/res/layout/row_hhsettings_player_setup.xml
  9. 4
      app/src/main/res/layout/row_hhsettings_player_setup_read.xml
  10. 8
      app/src/main/res/values/styles.xml

@ -153,7 +153,7 @@ class HandHistoryAdapter(
private var currentPosition = 0 private var currentPosition = 0
fun color(isFocused: Boolean) : Int { fun color(isFocused: Boolean) : Int {
val color = if (isFocused) R.color.kaki_medium else R.color.kaki val color = if (isFocused) R.color.kaki_medium else R.color.kaki_darker
return itemView.context.getColor(color) return itemView.context.getColor(color)
} }

@ -531,7 +531,7 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>()
previousComputedAction?.action?.let { previousAction -> previousComputedAction?.action?.let { previousAction ->
return when (previousAction.type) { return when (previousAction.type) {
Action.Type.POST_BB, Action.Type.POST_SB, Action.Type.STRADDLE, Action.Type.BET, Action.Type.RAISE -> previousAction.amount Action.Type.POST_BB, Action.Type.POST_SB, Action.Type.STRADDLE, Action.Type.BET, Action.Type.RAISE, Action.Type.POT -> previousAction.amount
Action.Type.CALL -> getStreetLastSignificantAction(previousAction.street, previousAction.index)?.action?.amount Action.Type.CALL -> getStreetLastSignificantAction(previousAction.street, previousAction.index)?.action?.amount
else -> null else -> null
} }
@ -592,18 +592,6 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>()
return nextActions.map { it.position } return nextActions.map { it.position }
} }
/***
* Updates the small blind amount
*/
// fun updateBlinds() {
// this.handHistory.smallBlind?.let { sb ->
// this.firstOrNull { it.action.type == Action.Type.POST_SB }?.setAmount(sb)
// }
// this.handHistory.bigBlind?.let { bb ->
// this.firstOrNull { it.action.type == Action.Type.POST_BB }?.setAmount(bb)
// }
// }
/*** /***
* Updates the remaining stacks for each action of the big blind * Updates the remaining stacks for each action of the big blind
*/ */

@ -130,7 +130,8 @@ class ComputedAction(var manager: ActionManager,
} }
when (this.action.type) { when (this.action.type) {
Action.Type.POST_BB, Action.Type.BET, Action.Type.RAISE, Action.Type.BET_ALLIN, Action.Type.RAISE_ALLIN -> { Action.Type.POST_BB, Action.Type.BET, Action.Type.RAISE, Action.Type.POT,
Action.Type.BET_ALLIN, Action.Type.RAISE_ALLIN -> {
// Updates the next call amount if any // Updates the next call amount if any
getStreetNextCalls().forEach { getStreetNextCalls().forEach {

@ -541,6 +541,7 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra
*/ */
fun clearCards() { fun clearCards() {
val row = this.rowRepresentables[this.currentSelection.index] as CardsRow val row = this.rowRepresentables[this.currentSelection.index] as CardsRow
this.playerHandMaxCards = null
row.clear() row.clear()
} }
@ -561,7 +562,7 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra
fun cardSelectionEnded() { fun cardSelectionEnded() {
val index = this.currentSelection.index val index = this.currentSelection.index
val cardsRow = this.rowRepresentables[index] as CardsRow val cardsRow = this.rowRepresentables[index] as CardsRow
if (cardsRow is PlayerCardsRow) { if (cardsRow.cardCount > 0 && cardsRow is PlayerCardsRow) {
this.playerHandMaxCards = cardsRow.cardCount this.playerHandMaxCards = cardsRow.cardCount
} }
} }

@ -2,13 +2,15 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp">
<net.pokeranalytics.android.ui.view.PlayerImageView <net.pokeranalytics.android.ui.view.PlayerImageView
android:id="@+id/player_image_rha" android:id="@+id/player_image_rha"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_width="48dp" android:layout_width="44dp"
android:layout_height="48dp" android:layout_height="44dp"
android:background="@android:color/transparent" /> android:background="@android:color/transparent" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
@ -27,12 +29,13 @@
<androidx.appcompat.widget.AppCompatEditText <androidx.appcompat.widget.AppCompatEditText
android:id="@+id/amountEditText" android:id="@+id/amountEditText"
style="@style/PokerAnalyticsTheme.EditText" style="@style/PokerAnalyticsTheme.HHEditText"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="2" android:layout_weight="2"
android:layout_height="wrap_content" android:layout_height="44dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:paddingEnd="4dp"
android:gravity="end" android:gravity="end"
android:maxLines="1" /> android:maxLines="1" />

@ -8,8 +8,8 @@
<net.pokeranalytics.android.ui.view.PlayerImageView <net.pokeranalytics.android.ui.view.PlayerImageView
android:id="@+id/player_image_rhar" android:id="@+id/player_image_rhar"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_width="48dp" android:layout_width="44dp"
android:layout_height="48dp" android:layout_height="44dp"
android:background="@android:color/transparent" /> android:background="@android:color/transparent" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView

@ -2,13 +2,15 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp">
<net.pokeranalytics.android.ui.view.PlayerImageView <net.pokeranalytics.android.ui.view.PlayerImageView
android:id="@+id/hps_player_image" android:id="@+id/hps_player_image"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_width="48dp" android:layout_width="44dp"
android:layout_height="48dp" android:layout_height="44dp"
android:background="@android:color/transparent" /> android:background="@android:color/transparent" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton

@ -2,12 +2,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:orientation="horizontal"> android:orientation="horizontal">
<net.pokeranalytics.android.ui.view.PlayerImageView <net.pokeranalytics.android.ui.view.PlayerImageView
android:id="@+id/player_image" android:id="@+id/player_image"
android:layout_width="48dp" android:layout_width="44dp"
android:layout_height="48dp" android:layout_height="44dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:background="@android:color/transparent" /> android:background="@android:color/transparent" />

@ -8,8 +8,8 @@
<net.pokeranalytics.android.ui.view.PlayerImageView <net.pokeranalytics.android.ui.view.PlayerImageView
android:id="@+id/ps_player_image" android:id="@+id/ps_player_image"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_width="48dp" android:layout_width="44dp"
android:layout_height="48dp" android:layout_height="44dp"
android:background="@android:color/transparent" /> android:background="@android:color/transparent" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton

@ -332,6 +332,12 @@
<item name="android:paddingBottom">16dp</item> <item name="android:paddingBottom">16dp</item>
</style> </style>
<style name="PokerAnalyticsTheme.HHEditText">
<item name="android:textColor">@color/white</item>
<item name="android:fontFamily">@font/roboto</item>
<item name="android:textColorHint">@color/white_transparent</item>
<item name="android:textSize">16sp</item>
</style>
<!-- Button --> <!-- Button -->
@ -356,7 +362,7 @@
<item name="android:paddingStart">4dp</item> <item name="android:paddingStart">4dp</item>
<item name="android:paddingEnd">8dp</item> <item name="android:paddingEnd">8dp</item>
<item name="android:textSize">12sp</item> <item name="android:textSize">12sp</item>
<item name="backgroundTint">@color/kaki</item> <item name="backgroundTint">@color/kaki_darker</item>
</style> </style>
<style name="PokerAnalyticsTheme.PlayerButton"> <style name="PokerAnalyticsTheme.PlayerButton">

Loading…
Cancel
Save