diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt index e442b053..660c36d4 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/Action.kt @@ -122,6 +122,15 @@ open class Action : RealmObject() { } } + val background: Int + get() { + return when (this) { + POST_SB, POST_BB, CALL, CHECK, CALL_ALLIN -> R.drawable.rounded_kaki_medium_rect + FOLD -> R.drawable.rounded_red_rect + else -> R.drawable.rounded_green_rect + } + } + override val viewType: Int = RowViewType.TITLE_GRID.ordinal companion object { diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt index ce7993bc..ea87d690 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt @@ -421,9 +421,14 @@ class HandHistoryAdapter( actionReadRow.action?.let { type -> itemView.actionText.text = type.localizedTitle(itemView.context) - itemView.actionText.setTextColor(itemView.context.getColor(type.color)) + val background = itemView.context.getDrawable(type.background) + itemView.action_container.background = background } +// actionReadRow.action?.let { type -> +// itemView.actionText.setTextColor(itemView.context.getColor(type.color)) +// } + itemView.amountText.text = actionReadRow.amount?.formatted() } diff --git a/app/src/main/res/drawable/rounded_green_rect.xml b/app/src/main/res/drawable/rounded_green_rect.xml new file mode 100644 index 00000000..8c5dffa3 --- /dev/null +++ b/app/src/main/res/drawable/rounded_green_rect.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_kaki_medium_rect.xml b/app/src/main/res/drawable/rounded_kaki_medium_rect.xml index bd45849f..c034d956 100644 --- a/app/src/main/res/drawable/rounded_kaki_medium_rect.xml +++ b/app/src/main/res/drawable/rounded_kaki_medium_rect.xml @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_red_rect.xml b/app/src/main/res/drawable/rounded_red_rect.xml new file mode 100644 index 00000000..7b194320 --- /dev/null +++ b/app/src/main/res/drawable/rounded_red_rect.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/row_hand_action_read.xml b/app/src/main/res/layout/row_hand_action_read.xml index 2695c2d9..a797a0f2 100644 --- a/app/src/main/res/layout/row_hand_action_read.xml +++ b/app/src/main/res/layout/row_hand_action_read.xml @@ -4,6 +4,7 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" + android:gravity="center_vertical" android:layout_marginTop="2dp" android:layout_marginBottom="2dp"> @@ -14,33 +15,44 @@ android:layout_height="44dp" android:background="@android:color/transparent" /> - + android:orientation="horizontal"> + + + + + + + + - - \ No newline at end of file