Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #10600 from t895/modern-card
Android: Modernize game card
- Loading branch information
Showing
1 changed file
with
47 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,57 +1,61 @@ | ||
| <?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" | ||
| android:layout_width="match_parent" | ||
| xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| tools:layout_width="160dp" | ||
| android:layout_height="249dp" | ||
| android:transitionName="card_game" | ||
| android:focusable="true" | ||
| android:layout_height="wrap_content" | ||
| android:background="?attr/selectableItemBackground" | ||
| android:clickable="true" | ||
| android:foreground="?android:attr/selectableItemBackground" | ||
| app:cardCornerRadius="8dp"> | ||
| android:clipToPadding="false" | ||
| 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_height="match_parent" | ||
| android:orientation="vertical"> | ||
| android:layout_height="159dp" | ||
| android:layout_gravity="center" | ||
| app:cardCornerRadius="4dp" | ||
| tools:layout_width="140dp"> | ||
|
|
||
| <ImageView | ||
| android:id="@+id/image_game_screen" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="0dp" | ||
| android:layout_height="match_parent" | ||
| android:layout_weight="1" | ||
| tools:src="@drawable/placeholder_screenshot" | ||
| tools:scaleType="centerCrop"/> | ||
|
|
||
| <TextView | ||
| android:id="@+id/text_game_title" | ||
| style="@android:style/TextAppearance.Material.Subhead" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginLeft="16dp" | ||
| android:layout_marginRight="16dp" | ||
| android:layout_marginTop="16dp" | ||
| android:ellipsize="end" | ||
| android:lines="1" | ||
| android:maxLines="1" | ||
| tools:text="The Legend of Zelda: The Wind Waker"/> | ||
|
|
||
| <TextView | ||
| android:id="@+id/text_game_caption" | ||
| style="@android:style/TextAppearance.Material.Caption" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginBottom="16dp" | ||
| android:layout_marginTop="8dp" | ||
| android:layout_marginLeft="16dp" | ||
| android:layout_marginRight="16dp" | ||
| android:ellipsize="end" | ||
| android:lines="1" | ||
| android:maxLines="1" | ||
| tools:text="Nintendo"/> | ||
| tools:scaleType="centerCrop" | ||
| tools:src="@drawable/placeholder_screenshot" /> | ||
| </androidx.cardview.widget.CardView> | ||
|
|
||
| </LinearLayout> | ||
| <TextView | ||
| android:id="@+id/text_game_title" | ||
| style="@android:style/TextAppearance.Material.Subhead" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_gravity="start" | ||
| android:layout_marginTop="8dp" | ||
| android:ellipsize="end" | ||
| android:maxLines="2" | ||
| tools:layout_width="140dp" | ||
| tools:text="The Legend of Zelda: The Wind Waker" /> | ||
|
|
||
| </androidx.cardview.widget.CardView> | ||
| <TextView | ||
| android:id="@+id/text_game_caption" | ||
| style="@android:style/TextAppearance.Material.Caption" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_gravity="start" | ||
| android:layout_marginTop="8dp" | ||
| android:layout_marginBottom="8dp" | ||
| android:ellipsize="end" | ||
| android:lines="1" | ||
| android:maxLines="1" | ||
| tools:layout_width="140dp" | ||
| tools:text="Nintendo" /> | ||
|
|
||
| </LinearLayout> |