Created a Player Selection

When a new Game is started now a Player Selection Screen pops up, to select the players to be performing in the next match.
This commit is contained in:
Alexander Doerflinger
2026-02-06 09:42:05 +01:00
parent 4b8766b304
commit 7e668b664b
9 changed files with 482 additions and 70 deletions

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="6dp"
app:cardBackgroundColor="@color/surface_secondary"
app:cardCornerRadius="12dp"
app:cardElevation="0dp"
app:strokeColor="@color/border_subtle"
app:strokeWidth="1dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivPlayerProfile"
android:layout_width="44dp"
android:layout_height="44dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/ShapeAppearance.MaterialComponents.SmallComponent"
tools:src="@drawable/ic_users" />
<TextView
android:id="@+id/tvPlayerName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:fontFamily="sans-serif-black"
android:textColor="@color/text_primary"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/selectionOverlay"
app:layout_constraintStart_toEndOf="@id/ivPlayerProfile"
app:layout_constraintTop_toTopOf="parent"
tools:text="Snakebite" />
<!-- Checkmark/Selection Indicator -->
<FrameLayout
android:id="@+id/selectionOverlay"
android:layout_width="24dp"
android:layout_height="24dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_circle_overlay"
android:backgroundTint="@color/volt_green" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center"
android:src="@drawable/ic_chevron_right"
app:tint="@color/midnight_black" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/surface_primary"
android:orientation="vertical"
android:padding="24dp">
<!-- Bottom Sheet Drag Handle -->
<View
android:layout_width="40dp"
android:layout_height="4dp"
android:layout_gravity="center"
android:layout_marginBottom="24dp"
android:background="@color/text_dim"
android:alpha="0.5" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="WHO'S ON THE OCHE?"
android:fontFamily="sans-serif-black"
android:textColor="@color/text_primary"
android:textSize="20sp"
android:letterSpacing="0.05" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="20dp"
android:text="Select up to 8 players for this match"
android:textColor="@color/text_secondary"
android:textSize="12sp"
android:textAllCaps="true"
android:letterSpacing="0.1" />
<!-- Squad List -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvSquadSelection"
android:layout_width="match_parent"
android:layout_height="320dp"
android:clipToPadding="false"
android:paddingBottom="80dp"
tools:listitem="@layout/item_player_selection" />
<!-- Action Button (Positioned at bottom of sheet) -->
<com.google.android.material.button.MaterialButton
android:id="@+id/btnConfirmSelection"
style="@style/Widget.Oche_Button_Primary"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginTop="-70dp"
android:text="START MATCH"
app:icon="@drawable/ic_play"
app:iconGravity="textEnd"
app:iconSize="20dp"
app:cornerRadius="16dp" />
</LinearLayout>