GameDetailsDialog: Don't use CircleImageView for banners

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.
This commit is contained in:
JosJuice 2019-06-16 10:37:15 +02:00
parent fcb96a179d
commit 100f032e2f
3 changed files with 17 additions and 26 deletions

View File

@ -89,9 +89,6 @@ dependencies {
// For REST calls // For REST calls
implementation 'com.android.volley:volley:1.1.1' 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. // For loading huge screenshots from the disk.
implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.squareup.picasso:picasso:2.71828'

View File

@ -17,8 +17,6 @@ import org.dolphinemu.dolphinemu.model.GameFile;
import org.dolphinemu.dolphinemu.services.GameFileCacheService; import org.dolphinemu.dolphinemu.services.GameFileCacheService;
import org.dolphinemu.dolphinemu.utils.PicassoUtils; import org.dolphinemu.dolphinemu.utils.PicassoUtils;
import de.hdodenhof.circleimageview.CircleImageView;
public final class GameDetailsDialog extends DialogFragment public final class GameDetailsDialog extends DialogFragment
{ {
private static final String ARG_GAME_PATH = "game_path"; private static final String ARG_GAME_PATH = "game_path";
@ -44,7 +42,7 @@ public final class GameDetailsDialog extends DialogFragment
.inflate(R.layout.dialog_game_details, null); .inflate(R.layout.dialog_game_details, null);
final ImageView imageGameScreen = contents.findViewById(R.id.image_game_screen); 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 textTitle = contents.findViewById(R.id.text_game_title);
TextView textDescription = contents.findViewById(R.id.text_description); TextView textDescription = contents.findViewById(R.id.text_description);
@ -76,7 +74,7 @@ public final class GameDetailsDialog extends DialogFragment
.noPlaceholder() .noPlaceholder()
.into(imageGameScreen); .into(imageGameScreen);
PicassoUtils.loadGameBanner(circleBanner, gameFile); PicassoUtils.loadGameBanner(banner, gameFile);
builder.setView(contents); builder.setView(contents);
return builder.create(); return builder.create();

View File

@ -4,23 +4,22 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:transitionName="card_game"> android:transitionName="card_game">
<RelativeLayout <RelativeLayout
android:layout_width="480dp" android:layout_width="480dp"
android:layout_height="match_parent"> android:layout_height="match_parent">
<de.hdodenhof.circleimageview.CircleImageView <ImageView
android:id="@+id/circle_banner" android:id="@+id/banner"
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="144dp"
android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_below="@+id/image_game_screen" android:layout_below="@+id/text_description"
android:layout_marginLeft="16dp" android:layout_marginTop="16dp"
android:layout_marginTop="24dp" android:layout_marginBottom="16dp"
tools:src="@drawable/placeholder_banner" tools:src="@drawable/placeholder_banner"/>
app:civ_border_color="?android:colorAccent"
app:civ_border_width="2dp"/>
<ImageView <ImageView
android:id="@+id/image_game_screen" android:id="@+id/image_game_screen"
@ -38,21 +37,17 @@
<TextView <TextView
android:id="@+id/text_game_title" android:id="@+id/text_game_title"
style="@android:style/TextAppearance.Material.Headline" style="@android:style/TextAppearance.Material.Headline"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_below="@+id/image_game_screen" android:layout_below="@+id/image_game_screen"
android:layout_marginLeft="36dp"
android:layout_marginRight="36dp"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_toEndOf="@+id/circle_banner"
android:ellipsize="end" android:ellipsize="end"
tools:text="Rhythm Heaven Fever"/> tools:text="Rhythm Heaven Fever"/>
<TextView <TextView
android:id="@+id/text_description" android:id="@+id/text_description"
style="@android:style/TextAppearance.Material.Caption" style="@android:style/TextAppearance.Material.Caption"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignEnd="@+id/text_game_title" android:layout_alignEnd="@+id/text_game_title"
android:layout_alignStart="@+id/text_game_title" android:layout_alignStart="@+id/text_game_title"
@ -66,7 +61,7 @@
android:layout_height="1dp" android:layout_height="1dp"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_below="@+id/text_description" android:layout_below="@+id/banner"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:background="#1F000000"/> android:background="#1F000000"/>
@ -74,7 +69,7 @@
android:id="@+id/icon_country" android:id="@+id/icon_country"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_alignStart="@+id/circle_banner" android:layout_alignStart="@+id/banner"
android:layout_alignTop="@+id/divider" android:layout_alignTop="@+id/divider"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:padding="6dp" android:padding="6dp"
@ -95,8 +90,9 @@
android:id="@+id/text_country" android:id="@+id/text_country"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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_alignBottom="@+id/icon_country"
android:layout_alignStart="@+id/text_description"
android:layout_alignTop="@+id/icon_country" android:layout_alignTop="@+id/icon_country"
android:gravity="center_vertical" android:gravity="center_vertical"
tools:text="United States"/> tools:text="United States"/>