Skip to content

Commit

Permalink
GameDetailsDialog: Don't use CircleImageView for banners
Browse files Browse the repository at this point in the history
Because trying to fit a 3:1 banner into a circle looks very awkward.

Also move the banner below the title/description now that it
takes up more space horizontally.
  • Loading branch information
JosJuice committed Nov 23, 2019
1 parent fcb96a1 commit 100f032
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
3 changes: 0 additions & 3 deletions Source/Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ dependencies {
// For REST calls
implementation 'com.android.volley:volley:1.1.1'

// For showing the banner as a circle a-la Material Design Guidelines
implementation 'de.hdodenhof:circleimageview:2.1.0'

// For loading huge screenshots from the disk.
implementation 'com.squareup.picasso:picasso:2.71828'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import org.dolphinemu.dolphinemu.services.GameFileCacheService;
import org.dolphinemu.dolphinemu.utils.PicassoUtils;

import de.hdodenhof.circleimageview.CircleImageView;

public final class GameDetailsDialog extends DialogFragment
{
private static final String ARG_GAME_PATH = "game_path";
Expand All @@ -44,7 +42,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
.inflate(R.layout.dialog_game_details, null);

final ImageView imageGameScreen = contents.findViewById(R.id.image_game_screen);
CircleImageView circleBanner = contents.findViewById(R.id.circle_banner);
ImageView banner = contents.findViewById(R.id.banner);

TextView textTitle = contents.findViewById(R.id.text_game_title);
TextView textDescription = contents.findViewById(R.id.text_description);
Expand Down Expand Up @@ -76,7 +74,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
.noPlaceholder()
.into(imageGameScreen);

PicassoUtils.loadGameBanner(circleBanner, gameFile);
PicassoUtils.loadGameBanner(banner, gameFile);

builder.setView(contents);
return builder.create();
Expand Down
34 changes: 15 additions & 19 deletions Source/Android/app/src/main/res/layout/dialog_game_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:transitionName="card_game">

<RelativeLayout
android:layout_width="480dp"
android:layout_height="match_parent">

<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/circle_banner"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="48dp"
<ImageView
android:id="@+id/banner"
android:layout_width="144dp"
android:layout_height="48dp"
android:layout_below="@+id/image_game_screen"
android:layout_marginLeft="16dp"
android:layout_marginTop="24dp"
tools:src="@drawable/placeholder_banner"
app:civ_border_color="?android:colorAccent"
app:civ_border_width="2dp"/>
android:layout_below="@+id/text_description"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
tools:src="@drawable/placeholder_banner"/>

<ImageView
android:id="@+id/image_game_screen"
Expand All @@ -38,21 +37,17 @@
<TextView
android:id="@+id/text_game_title"
style="@android:style/TextAppearance.Material.Headline"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_below="@+id/image_game_screen"
android:layout_marginLeft="36dp"
android:layout_marginRight="36dp"
android:layout_marginTop="24dp"
android:layout_toEndOf="@+id/circle_banner"
android:ellipsize="end"
tools:text="Rhythm Heaven Fever"/>

<TextView
android:id="@+id/text_description"
style="@android:style/TextAppearance.Material.Caption"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/text_game_title"
android:layout_alignStart="@+id/text_game_title"
Expand All @@ -66,15 +61,15 @@
android:layout_height="1dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/text_description"
android:layout_below="@+id/banner"
android:layout_marginTop="16dp"
android:background="#1F000000"/>

<ImageView
android:id="@+id/icon_country"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignStart="@+id/circle_banner"
android:layout_alignStart="@+id/banner"
android:layout_alignTop="@+id/divider"
android:layout_marginTop="24dp"
android:padding="6dp"
Expand All @@ -95,8 +90,9 @@
android:id="@+id/text_country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_toEndOf="@+id/icon_country"
android:layout_alignBottom="@+id/icon_country"
android:layout_alignStart="@+id/text_description"
android:layout_alignTop="@+id/icon_country"
android:gravity="center_vertical"
tools:text="United States"/>
Expand Down

0 comments on commit 100f032

Please sign in to comment.