Improve read mode UI

hh
Laurent 6 years ago
parent 64d3bf9d58
commit ba7c29a7f9
  1. 9
      app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt
  2. 7
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt
  3. 9
      app/src/main/res/layout/row_hand_action_read.xml

@ -106,6 +106,15 @@ open class Action : RealmObject() {
} }
} }
val color: Int
get() {
return when (this) {
POST_SB, POST_BB, CALL, CHECK, CALL_ALLIN -> R.color.kaki_lighter
FOLD -> R.color.red
else -> R.color.green
}
}
override val viewType: Int = RowViewType.TITLE_GRID.ordinal override val viewType: Int = RowViewType.TITLE_GRID.ordinal
companion object { companion object {

@ -402,7 +402,12 @@ class HandHistoryAdapter(
val actionReadRow = row as ActionReadRow val actionReadRow = row as ActionReadRow
itemView.playersText.text = actionReadRow.positions.joinToString(", ") { it.value } itemView.playersText.text = actionReadRow.positions.joinToString(", ") { it.value }
itemView.actionText.text = actionReadRow.action?.localizedTitle(itemView.context)
actionReadRow.action?.let { type ->
itemView.actionText.text = type.localizedTitle(itemView.context)
itemView.actionText.setTextColor(itemView.context.getColor(type.color))
}
itemView.amountText.text = actionReadRow.amount?.formatted() itemView.amountText.text = actionReadRow.amount?.formatted()
} }

@ -17,9 +17,8 @@
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/playersText" android:id="@+id/playersText"
style="@style/PokerAnalyticsTheme.TextView.RowTitle" style="@style/PokerAnalyticsTheme.TextView.RowTitle"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1.5"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:gravity="center_vertical" android:gravity="center_vertical"
tools:text="BB" tools:text="BB"
@ -28,9 +27,8 @@
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actionText" android:id="@+id/actionText"
style="@style/PokerAnalyticsTheme.TextView.RowTitle" style="@style/PokerAnalyticsTheme.TextView.RowTitle"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:gravity="center_vertical" android:gravity="center_vertical"
tools:text="raises"/> tools:text="raises"/>
@ -38,9 +36,8 @@
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/amountText" android:id="@+id/amountText"
style="@style/PokerAnalyticsTheme.TextView.RowTitle" style="@style/PokerAnalyticsTheme.TextView.RowTitle"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:gravity="end|center_vertical" android:gravity="end|center_vertical"

Loading…
Cancel
Save