Modernize game card

+Remove background on card
+Increase max # of lines for game title
+Root layout is now a linear layout with the card view rounding the corners on the box art
This commit is contained in:
Charles Lombardo 2022-04-22 12:56:58 -04:00
parent 2e01dc0c82
commit 6eb9111657
1 changed files with 47 additions and 43 deletions

View File

@ -1,57 +1,61 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_height="wrap_content"
tools:layout_width="160dp" android:background="?attr/selectableItemBackground"
android:layout_height="249dp"
android:transitionName="card_game"
android:focusable="true"
android:clickable="true" android:clickable="true"
android:foreground="?android:attr/selectableItemBackground" android:clipToPadding="false"
app:cardCornerRadius="8dp"> android:focusable="true"
android:orientation="vertical"
android:paddingStart="4dp"
android:paddingTop="8dp"
android:paddingEnd="4dp"
android:transitionName="card_game"
tools:layout_width="160dp">
<LinearLayout <androidx.cardview.widget.CardView
android:id="@+id/card_game_art"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="159dp"
android:orientation="vertical"> android:layout_gravity="center"
app:cardCornerRadius="4dp"
tools:layout_width="140dp">
<ImageView <ImageView
android:id="@+id/image_game_screen" android:id="@+id/image_game_screen"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
tools:src="@drawable/placeholder_screenshot" tools:scaleType="centerCrop"
tools:scaleType="centerCrop"/> tools:src="@drawable/placeholder_screenshot" />
</androidx.cardview.widget.CardView>
<TextView <TextView
android:id="@+id/text_game_title" android:id="@+id/text_game_title"
style="@android:style/TextAppearance.Material.Subhead" style="@android:style/TextAppearance.Material.Subhead"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_gravity="start"
android:layout_marginRight="16dp" android:layout_marginTop="8dp"
android:layout_marginTop="16dp"
android:ellipsize="end" android:ellipsize="end"
android:lines="1" android:maxLines="2"
android:maxLines="1" tools:layout_width="140dp"
tools:text="The Legend of Zelda: The Wind Waker"/> tools:text="The Legend of Zelda: The Wind Waker" />
<TextView <TextView
android:id="@+id/text_game_caption" android:id="@+id/text_game_caption"
style="@android:style/TextAppearance.Material.Caption" style="@android:style/TextAppearance.Material.Caption"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_gravity="start"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginLeft="16dp" android:layout_marginBottom="8dp"
android:layout_marginRight="16dp"
android:ellipsize="end" android:ellipsize="end"
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
tools:text="Nintendo"/> tools:layout_width="140dp"
tools:text="Nintendo" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>