parent
acf77888a4
commit
5c2542f758
@ -0,0 +1,38 @@ |
||||
package net.pokeranalytics.android.model.handhistory |
||||
|
||||
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
||||
import java.util.* |
||||
|
||||
enum class Position(var value: String) { |
||||
SB("SB"), |
||||
BB("BB"), |
||||
UTG("UTG"), |
||||
UTG1("UTG+1"), |
||||
UTG2("UTG+2"), |
||||
UTG3("UTG+3"), |
||||
MP("MP"), |
||||
HJ("HJ"), |
||||
CO("CO"), |
||||
BUT("BUT"); |
||||
|
||||
companion object { |
||||
|
||||
fun positionsPerPlayers(playerCount: Int) : LinkedHashSet<Position> { |
||||
return when(playerCount) { |
||||
2 -> linkedSetOf(SB, BB) |
||||
3 -> linkedSetOf(SB, BB, BUT) |
||||
4 -> linkedSetOf(SB, BB, UTG, BUT) |
||||
5 -> linkedSetOf(SB, BB, UTG, CO, BUT) |
||||
6 -> linkedSetOf(SB, BB, UTG, HJ, CO, BUT) |
||||
7 -> linkedSetOf(SB, BB, UTG, MP, HJ, CO, BUT) |
||||
8 -> linkedSetOf(SB, BB, UTG, UTG1, MP, HJ, CO, BUT) |
||||
9 -> linkedSetOf(SB, BB, UTG, UTG1, UTG2, MP, HJ, CO, BUT) |
||||
10 -> linkedSetOf(SB, BB, UTG, UTG1, UTG2, UTG3, MP, HJ, CO, BUT) |
||||
else -> throw PAIllegalStateException("Unmanaged number of players") |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
} |
||||
@ -1,27 +1,37 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
android:id="@+id/mainLayout" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent"> |
||||
|
||||
<androidx.core.widget.NestedScrollView |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:fillViewport="true" |
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"> |
||||
<com.google.android.material.appbar.AppBarLayout |
||||
android:id="@+id/appBar" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:theme="@style/PokerAnalyticsTheme.Toolbar.Session" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent"> |
||||
|
||||
<FrameLayout |
||||
<androidx.appcompat.widget.Toolbar |
||||
android:id="@+id/toolbar" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content"> |
||||
android:layout_height="?attr/actionBarSize" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" |
||||
app:title="@string/hand_history" /> |
||||
|
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/recyclerView" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:clipToPadding="false" /> |
||||
</com.google.android.material.appbar.AppBarLayout> |
||||
|
||||
</FrameLayout> |
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/recyclerView" |
||||
android:layout_width="0dp" |
||||
android:layout_height="0dp" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@+id/appBar" /> |
||||
|
||||
</androidx.core.widget.NestedScrollView> |
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout> |
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
||||
Loading…
Reference in new issue