UI & feature improvements: Remove Update Stats button, add media attachments to score history, fix layout issues

This commit is contained in:
cmclark00 2025-03-20 13:35:32 -04:00
parent ca8b4fd77b
commit 239aaa5c32
16 changed files with 1028 additions and 142 deletions

View file

@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="?attr/actionBarSize">
android:layout_height="match_parent">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
@ -18,11 +17,11 @@
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
<fragment
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_activity_main"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_height="0dp"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@id/nav_view"
app:layout_constraintLeft_toLeftOf="parent"

View file

@ -3,16 +3,51 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:padding="16dp">
android:background="@color/background">
<com.google.android.material.card.MaterialCardView
android:id="@+id/cardViewExport"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Export Your Scores"
android:textAppearance="?attr/textAppearanceSubtitle1"
android:textColor="@color/tetris_navy"
android:layout_marginBottom="8dp"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/buttonExport"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Export to CSV"
app:icon="@android:drawable/ic_menu_share" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewHistory"
android:layout_width="0dp"
android:layout_height="0dp"
android:clipToPadding="false"
android:padding="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/cardViewExport" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,110 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView 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"
android:orientation="vertical"
android:padding="16dp"
android:fillViewport="true"
android:background="@color/background">
<com.google.android.material.textfield.TextInputLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu">
android:orientation="vertical"
android:padding="16dp">
<AutoCompleteTextView
android:id="@+id/autoCompleteGameFilter"
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Filter by Game"
android:inputType="none"/>
</com.google.android.material.textfield.TextInputLayout>
android:layout_marginBottom="16dp"
android:textColorHint="@color/tetris_navy"
app:boxStrokeColor="@color/tetris_navy"
app:hintTextColor="@color/tetris_navy"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewScores"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<AutoCompleteTextView
android:id="@+id/autoCompleteGameFilter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Filter by Game"
android:textColor="@color/tetris_navy"
android:inputType="none"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Game Version">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewScores"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:nestedScrollingEnabled="false"
android:layout_marginBottom="16dp"/>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextGameVersion"
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
android:layout_marginBottom="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/buttonUpdateStats"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Update Stats" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Average Score"
android:textAppearance="?attr/textAppearanceSubtitle1" />
<LinearLayout
<TextView
android:id="@+id/textViewAverageScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?attr/textAppearanceHeadline4"
tools:text="1000" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
android:layout_marginBottom="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp">
<TextView
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Average Score"
android:textAppearance="?attr/textAppearanceSubtitle1" />
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/textViewAverageScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?attr/textAppearanceHeadline4"
tools:text="1000" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="High Score"
android:textAppearance="?attr/textAppearanceSubtitle1" />
</com.google.android.material.card.MaterialCardView>
<TextView
android:id="@+id/textViewHighScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?attr/textAppearanceHeadline4"
tools:text="2000" />
</LinearLayout>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp">
</com.google.android.material.card.MaterialCardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="High Score"
android:textAppearance="?attr/textAppearanceSubtitle1" />
<TextView
android:id="@+id/textViewHighScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?attr/textAppearanceHeadline4"
tools:text="2000" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</LinearLayout>
</ScrollView>

View file

@ -14,34 +14,151 @@
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/textViewGameVersion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceSubtitle1"
android:textColor="@color/tetris_turquoise"
android:textStyle="bold"
tools:text="Tetris (NES)"/>
<TextView
android:id="@+id/textViewScore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceHeadline5"
android:textColor="@color/tetris_navy"
android:textStyle="bold" />
android:textStyle="bold"
tools:text="999,999" />
<TextView
android:id="@+id/textViewDate"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?attr/textAppearanceBody2" />
android:orientation="horizontal"
android:layout_marginTop="8dp">
<TextView
android:id="@+id/textViewLevelInfo"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date: "
android:textStyle="bold"
android:textAppearance="?attr/textAppearanceBody2" />
<TextView
android:id="@+id/textViewDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceBody2"
tools:text="03/20/2025" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?attr/textAppearanceBody2" />
android:orientation="horizontal"
android:layout_marginTop="4dp">
<TextView
android:id="@+id/textViewLinesCleared"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Levels: "
android:textStyle="bold"
android:textAppearance="?attr/textAppearanceBody2" />
<TextView
android:id="@+id/textViewLevelInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceBody2"
tools:text="18 → 29" />
</LinearLayout>
<LinearLayout
android:id="@+id/layoutLinesCleared"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textAppearance="?attr/textAppearanceBody2" />
android:orientation="horizontal"
android:layout_marginTop="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lines: "
android:textStyle="bold"
android:textAppearance="?attr/textAppearanceBody2" />
<TextView
android:id="@+id/textViewLinesCleared"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceBody2"
tools:text="230" />
</LinearLayout>
<!-- Media section -->
<FrameLayout
android:id="@+id/mediaContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp">
<!-- Media preview -->
<androidx.cardview.widget.CardView
android:id="@+id/cardViewMedia"
android:layout_width="match_parent"
android:layout_height="180dp"
android:visibility="gone"
app:cardCornerRadius="4dp"
tools:visibility="visible">
<!-- ImageView for photos -->
<ImageView
android:id="@+id/imageViewMedia"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:contentDescription="Score media" />
<!-- Video thumbnail with play indicator -->
<FrameLayout
android:id="@+id/videoContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<VideoView
android:id="@+id/videoViewMedia"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<ImageView
android:id="@+id/imageViewVideoThumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:contentDescription="Video thumbnail" />
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:src="@android:drawable/ic_media_play"
android:alpha="0.7"
android:contentDescription="Play video" />
</FrameLayout>
</androidx.cardview.widget.CardView>
<!-- Add media button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/buttonAddMedia"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Add Photo/Video"
app:icon="@android:drawable/ic_menu_camera"
style="@style/Widget.MaterialComponents.Button.OutlinedButton" />
</FrameLayout>
</LinearLayout>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="documents" path="Documents" />
<external-path name="external_files" path="Documents" />
<external-files-path name="tetris_media" path="Pictures/tetris_media" />
<external-files-path name="camera_photos" path="." />
</paths>