Files
OcheCompanion/app/src/main/res/layout/activity_game.xml
Alexander Doerflinger 689bf2808a Added a Player stats view to the GameResult
Currently only showing the stats of the winning player and also only the overall stats, has to be improved to show stats of all players and also only the stats of the match, not the overall one.
2026-02-02 14:54:06 +01:00

204 lines
8.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
tools:context=".GameActivity"
android:background="@color/background_primary"
android:id="@+id/main">
<!-- 1. HIGH-IMPACT SCOREBOARD (TOP) -->
<LinearLayout
android:id="@+id/scoreContainer"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@color/surface_primary"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tvPlayerName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:letterSpacing="0.3"
android:textColor="@color/text_secondary"
android:textSize="11sp"
tools:text="SNAKEBITE" />
<TextView
android:id="@+id/tvScorePrimary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:letterSpacing="-0.08"
android:textColor="@color/volt_green"
android:textSize="100sp"
android:textStyle="bold"
tools:text="501" />
<TextView
android:id="@+id/tvLegAvg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text_dim"
android:textSize="10sp"
tools:text="AVG: 0.0" />
</LinearLayout>
<!-- 2. TRACKER BAR -->
<LinearLayout
android:id="@+id/trackerBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="12dp"
app:layout_constraintTop_toBottomOf="@id/scoreContainer">
<TextView android:id="@+id/tvDart1" style="@style/Oche_DartPill" />
<TextView android:id="@+id/tvDart2" style="@style/Oche_DartPill" android:layout_marginHorizontal="12dp" />
<TextView android:id="@+id/tvDart3" style="@style/Oche_DartPill" />
<ImageButton
android:id="@+id/btnUndoDart"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="24dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_history"
app:tint="@color/text_dim" />
</LinearLayout>
<!-- 3. INTERACTIVE INPUT ZONE (STUCK TO BOTTOM) -->
<LinearLayout
android:id="@+id/bottomSection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="parent">
<!-- MULTIPLIER BAR (Directly above the keyboard stack) -->
<LinearLayout
android:id="@+id/multiplierLayout"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="8dp"
android:background="@drawable/shape_round_surface"
android:padding="4dp">
<TextView android:id="@+id/btnMultiplierSingle" style="@style/Oche_Multiplier_Label" android:text="@string/txt_game_btn_single" />
<TextView android:id="@+id/btnMultiplierDouble" style="@style/Oche_Multiplier_Label" android:text="@string/txt_game_btn_double" android:layout_marginHorizontal="2dp" />
<TextView android:id="@+id/btnMultiplierTriple" style="@style/Oche_Multiplier_Label" android:text="@string/txt_game_btn_triple" />
</LinearLayout>
<!-- SMART ROUTE (Nested here to appear between multipliers and keys when active) -->
<LinearLayout
android:id="@+id/layoutCheckoutSuggestion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="12dp"
android:background="@drawable/shape_checkout_glow"
android:gravity="center"
android:padding="12dp"
android:visibility="gone">
<TextView
android:id="@+id/tvCheckoutSuggestion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:textColor="@color/volt_green"
android:textSize="13sp"
tools:text="T20 • T19 • D12" />
</LinearLayout>
<!-- THE SEAMLESS GRID -->
<GridLayout
android:id="@+id/glKeyboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="12dp"
android:columnCount="4"
android:rowCount="5"
android:useDefaultMargins="false">
<!-- Buttons inflated via setupKeyboard() in GameActivity -->
</GridLayout>
<!-- FINAL ACTIONS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="72dp"
android:orientation="horizontal"
android:paddingHorizontal="14dp"
android:paddingBottom="12dp"
android:layout_marginTop="4dp">
<Button
android:id="@+id/btnBull"
android:layout_width="90dp"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:backgroundTint="@color/surface_primary"
android:onClick="onBullTap"
android:text="@string/txt_game_btn_bull"
android:fontFamily="sans-serif-black"
android:textColor="@color/double_red" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btnSubmitTurn"
style="@style/Widget.Oche_Button_Primary"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:layout_weight="1"
android:text="@string/txt_game_btn_submit"
app:icon="@drawable/ic_chevron_right"
app:iconGravity="end" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:id="@+id/dimmer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dim_color"
android:visibility="gone"/>
<TextView
android:id="@+id/winner_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
style="@style/TextAppearance.Oche.Hero"
android:textColor="@color/volt_green"
android:visibility="gone"
tools:text="Zander"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/show_stats_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_game_show_statistics"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/winner_text"
style="@style/Widget.Oche_Button_Primary"
android:visibility="gone"/>
<nl.dionsegijn.konfetti.xml.KonfettiView
android:id="@+id/konfetti_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<com.aldo.apps.ochecompanion.ui.PlayerStatsView
android:id="@+id/player_stats_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15dp"
android:visibility="gone"/>
</androidx.constraintlayout.widget.ConstraintLayout>