Browse Source
[android / GameUI] Add grid compact layout and fix ugly borders on grid layout (#401)
[android / GameUI] Add grid compact layout and fix ugly borders on grid layout (#401)
Tis PR adds a new layout for the Game Adapter with shorter cards and fixes the ugly borders in Game Adapter's Grid layout. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/401 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: Nixyn <contact@innix.space> Co-committed-by: Nixyn <contact@innix.space>pull/495/head
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
7 changed files with 161 additions and 8 deletions
-
46src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
-
13src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt
-
9src/android/app/src/main/res/drawable/gradient_overlay_bottom.xml
-
15src/android/app/src/main/res/layout/card_game_grid.xml
-
82src/android/app/src/main/res/layout/card_game_grid_compact.xml
-
3src/android/app/src/main/res/menu/menu_game_views.xml
-
1src/android/app/src/main/res/values/strings.xml
@ -0,0 +1,9 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<gradient |
|||
android:angle="270" |
|||
android:startColor="@android:color/transparent" |
|||
android:centerColor="#66000000" |
|||
android:endColor="#AA000000" |
|||
android:type="linear" /> |
|||
</shape> |
|||
@ -0,0 +1,82 @@ |
|||
<?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="wrap_content" |
|||
android:focusable="false" |
|||
android:focusableInTouchMode="false" |
|||
android:padding="4dp"> |
|||
|
|||
<org.yuzu.yuzu_emu.views.GradientBorderCardView |
|||
android:id="@+id/card_game_grid_compact" |
|||
app:cardElevation="0dp" |
|||
app:cardBackgroundColor="@color/eden_card_background" |
|||
app:strokeWidth="0dp" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:clickable="true" |
|||
android:clipToPadding="true" |
|||
android:focusable="true" |
|||
android:transitionName="card_game_compact" |
|||
app:cardCornerRadius="16dp" |
|||
android:foreground="@color/eden_border_gradient_start"> |
|||
|
|||
<androidx.constraintlayout.widget.ConstraintLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:paddingTop="14dp" |
|||
android:paddingLeft="6dp" |
|||
android:paddingRight="6dp" |
|||
android:paddingBottom="6dp"> |
|||
|
|||
<FrameLayout |
|||
android:id="@+id/image_container" |
|||
android:layout_width="150dp" |
|||
android:layout_height="100dp" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent"> |
|||
|
|||
<com.google.android.material.imageview.ShapeableImageView |
|||
android:id="@+id/image_game_screen_compact" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
app:shapeAppearance="@style/ShapeAppearance.Material3.Corner.Medium" |
|||
android:scaleType="centerCrop" |
|||
tools:src="@drawable/default_icon" /> |
|||
|
|||
<View |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:background="@drawable/gradient_overlay_bottom" /> |
|||
|
|||
<com.google.android.material.textview.MaterialTextView |
|||
android:id="@+id/text_game_title_compact" |
|||
style="@style/SynthwaveText.Body" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="bottom" |
|||
android:layout_margin="6dp" |
|||
android:requiresFadingEdge="horizontal" |
|||
android:textAlignment="center" |
|||
android:textSize="12sp" |
|||
android:textStyle="bold" |
|||
android:textColor="@android:color/white" |
|||
android:shadowColor="@android:color/black" |
|||
android:shadowDx="1" |
|||
android:shadowDy="1" |
|||
android:shadowRadius="2" |
|||
android:maxLines="2" |
|||
android:ellipsize="end" |
|||
tools:text="The Legend of Zelda: Skyward Sword" /> |
|||
|
|||
</FrameLayout> |
|||
|
|||
</androidx.constraintlayout.widget.ConstraintLayout> |
|||
|
|||
</org.yuzu.yuzu_emu.views.GradientBorderCardView> |
|||
|
|||
</FrameLayout> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue