Add xml for the shader compilation screen (#2255)

* Add xml for the shader compilation screen
* Change ConstraintLayout for LinearLayout and adapt style to MD3
* Change some aspects of the progress indicator and the source of text color
This commit is contained in:
Pablo González 2023-04-23 21:43:48 +02:00 committed by GitHub
parent 178dbea801
commit 8c2b39858d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 138 additions and 0 deletions

View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/game_icon_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/icon"
android:focusable="false"
android:foreground="#A6000000"
android:foregroundTintMode="src_atop"
android:scaleType="centerCrop"
tools:src="@drawable/default_icon" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clipToPadding="false"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<com.google.android.material.card.MaterialCardView
android:id="@+id/item_card"
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_marginEnd="16dp"
app:cardBackgroundColor="#00000000"
app:cardElevation="4dp"
app:layout_constraintEnd_toEndOf="@id/guidelineIconText"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearance="?attr/shapeAppearanceCornerLarge">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/game_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/icon"
android:focusable="false"
tools:src="@drawable/default_icon" />
</com.google.android.material.card.MaterialCardView>
<LinearLayout
android:id="@+id/game_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:maxWidth="360dp"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/shader_info"
app:layout_constraintEnd_toEndOf="@id/guidelineTextEdge"
app:layout_constraintStart_toEndOf="@id/guidelineIconText"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/game_title"
style="?attr/textAppearanceTitleMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:textAlignment="viewStart"
android:textColor="@android:color/white"
android:textSize="20sp"
tools:text="The Legend of Zelda: Breath of the Wild" />
<TextView
android:id="@+id/game_version"
style="?attr/textAppearanceBodyMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textColor="@android:color/white"
tools:text="1.0.0" />
</LinearLayout>
<LinearLayout
android:id="@+id/shader_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/guidelineIconText"
app:layout_constraintTop_toBottomOf="@+id/game_info">
<TextView
android:id="@+id/shaders_compiling"
style="?attr/textAppearanceBodyMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/compiling_cached_shaders"
android:textColor="@android:color/white"
android:textSize="17sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
app:trackCornerRadius="4dp"
app:trackThickness="10dp" />
<TextView
android:id="@+id/progress"
style="?attr/textAppearanceBodyMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:textColor="@android:color/white"
tools:text="735/1337 (55%)" />
</LinearLayout>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guidelineIconText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.45" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guidelineTextEdge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.8" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@ -256,6 +256,7 @@
<!-- Software Keyboard --> <!-- Software Keyboard -->
<string name="input_hint">Input Text</string> <string name="input_hint">Input Text</string>
<!-- Misc --> <!-- Misc -->
<string name="compiling_cached_shaders">Compiling cached shaders...</string>
<!--suppress AndroidLintUnusedResources --> <!--suppress AndroidLintUnusedResources -->
<string name="expand_button_title" tools:override="true">Expand</string> <string name="expand_button_title" tools:override="true">Expand</string>
<string name="undo">Undo</string> <string name="undo">Undo</string>