mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
Android: Add type to game list (disc/psexe)
This commit is contained in:
parent
dec475db62
commit
8c33163ef1
|
@ -57,7 +57,8 @@ AndroidHostInterface::AndroidHostInterface(jobject java_object) : m_java_object(
|
|||
m_settings.SetDefaults();
|
||||
m_settings.bios_path = "/sdcard/PSX/BIOS/scph1001.bin";
|
||||
m_settings.memory_card_a_path = "/sdcard/PSX/memory_card_a.mcd";
|
||||
m_settings.cpu_execution_mode = CPUExecutionMode::CachedInterpreter;
|
||||
m_settings.cpu_execution_mode = CPUExecutionMode::Recompiler;
|
||||
//m_settings.cpu_execution_mode = CPUExecutionMode::CachedInterpreter;
|
||||
//m_settings.gpu_renderer = GPURenderer::Software;
|
||||
m_settings.speed_limiter_enabled = false;
|
||||
m_settings.video_sync_enabled = false;
|
||||
|
@ -453,7 +454,7 @@ DEFINE_JNI_ARGS_METHOD(jarray, GameList_getEntries, jobject unused, jstring j_ca
|
|||
jclass entry_class = env->FindClass("com/github/stenzek/duckstation/GameListEntry");
|
||||
Assert(entry_class != nullptr);
|
||||
|
||||
jmethodID entry_constructor = env->GetMethodID(entry_class, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)V");
|
||||
jmethodID entry_constructor = env->GetMethodID(entry_class, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)V");
|
||||
Assert(entry_constructor != nullptr);
|
||||
|
||||
jobjectArray entry_array = env->NewObjectArray(gl.GetEntryCount(), entry_class, nullptr);
|
||||
|
@ -466,9 +467,10 @@ DEFINE_JNI_ARGS_METHOD(jarray, GameList_getEntries, jobject unused, jstring j_ca
|
|||
jstring code = env->NewStringUTF(entry.code.c_str());
|
||||
jstring title = env->NewStringUTF(entry.title.c_str());
|
||||
jstring region = env->NewStringUTF(Settings::GetConsoleRegionName(entry.region));
|
||||
jstring type = env->NewStringUTF(GameList::EntryTypeToString(entry.type));
|
||||
jlong size = entry.total_size;
|
||||
|
||||
jobject entry_jobject = env->NewObject(entry_class, entry_constructor, path, code, title, region, size);
|
||||
jobject entry_jobject = env->NewObject(entry_class, entry_constructor, path, code, title, region, type, size);
|
||||
|
||||
env->SetObjectArrayElement(entry_array, counter++, entry_jobject);
|
||||
}
|
||||
|
|
|
@ -7,13 +7,21 @@ import android.widget.TextView;
|
|||
import androidx.core.content.ContextCompat;
|
||||
|
||||
public class GameListEntry {
|
||||
public enum EntryType
|
||||
{
|
||||
Disc,
|
||||
PSExe
|
||||
}
|
||||
|
||||
private String mPath;
|
||||
private String mCode;
|
||||
private String mTitle;
|
||||
private ConsoleRegion mRegion;
|
||||
private EntryType mType;
|
||||
private long mSize;
|
||||
|
||||
public GameListEntry(String path, String code, String title, String region, long size) {
|
||||
public GameListEntry(String path, String code, String title, String region,
|
||||
String type, long size) {
|
||||
mPath = path;
|
||||
mCode = code;
|
||||
mTitle = title;
|
||||
|
@ -24,6 +32,12 @@ public class GameListEntry {
|
|||
} catch (IllegalArgumentException e) {
|
||||
mRegion = ConsoleRegion.NTSC_U;
|
||||
}
|
||||
|
||||
try {
|
||||
mType = EntryType.valueOf(type);
|
||||
} catch (IllegalArgumentException e) {
|
||||
mType = EntryType.Disc;
|
||||
}
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
|
@ -42,6 +56,8 @@ public class GameListEntry {
|
|||
return mRegion;
|
||||
}
|
||||
|
||||
public EntryType getType() { return mType; }
|
||||
|
||||
public void fillView(View view) {
|
||||
((TextView) view.findViewById(R.id.game_list_view_entry_title)).setText(mTitle);
|
||||
((TextView) view.findViewById(R.id.game_list_view_entry_path)).setText(mPath);
|
||||
|
@ -49,21 +65,36 @@ public class GameListEntry {
|
|||
String sizeString = String.format("%.2f MB", (double) mSize / 1048576.0);
|
||||
((TextView) view.findViewById(R.id.game_list_view_entry_size)).setText(sizeString);
|
||||
|
||||
int drawableId;
|
||||
int regionDrawableId;
|
||||
switch (mRegion) {
|
||||
case NTSC_J:
|
||||
drawableId = R.drawable.flag_jp;
|
||||
regionDrawableId = R.drawable.flag_jp;
|
||||
break;
|
||||
case NTSC_U:
|
||||
default:
|
||||
drawableId = R.drawable.flag_us;
|
||||
regionDrawableId = R.drawable.flag_us;
|
||||
break;
|
||||
case PAL:
|
||||
drawableId = R.drawable.flag_eu;
|
||||
regionDrawableId = R.drawable.flag_eu;
|
||||
break;
|
||||
}
|
||||
|
||||
((ImageView) view.findViewById(R.id.game_list_view_entry_region_icon))
|
||||
.setImageDrawable(ContextCompat.getDrawable(view.getContext(), drawableId));
|
||||
.setImageDrawable(ContextCompat.getDrawable(view.getContext(), regionDrawableId));
|
||||
|
||||
int typeDrawableId;
|
||||
switch (mType) {
|
||||
case Disc:
|
||||
default:
|
||||
typeDrawableId = R.drawable.ic_media_cdrom;
|
||||
break;
|
||||
|
||||
case PSExe:
|
||||
typeDrawableId = R.drawable.ic_emblem_system;
|
||||
break;
|
||||
}
|
||||
|
||||
((ImageView) view.findViewById(R.id.game_list_view_entry_type_icon))
|
||||
.setImageDrawable(ContextCompat.getDrawable(view.getContext(), typeDrawableId));
|
||||
}
|
||||
}
|
||||
|
|
47
android/app/src/main/res/drawable/ic_emblem_system.xml
Normal file
47
android/app/src/main/res/drawable/ic_emblem_system.xml
Normal file
|
@ -0,0 +1,47 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
<path
|
||||
android:pathData="M44.1942,41.636A19.6222,6.1872 0,1 1,4.9497 41.636A19.6222,6.1872 0,1 1,44.1942 41.636z"
|
||||
android:strokeAlpha="0.40909088"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.40909088"
|
||||
android:strokeLineCap="butt">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M23.25,0.4688C22.7846,0.5006 22.3322,0.5727 21.875,0.625L21.8438,0.625L20.75,6.5938C18.9673,6.9997 17.2901,7.6887 15.7813,8.625L10.875,5.0938C9.5487,6.1234 8.3418,7.3243 7.2813,8.625L10.6875,13.5938C9.6533,15.1743 8.8755,16.979 8.4375,18.875C8.4374,18.884 8.4374,18.9047 8.4375,18.9063L2.5,19.8438C2.3914,20.7304 2.3438,21.6467 2.3438,22.5625C2.3438,23.3118 2.3644,24.0511 2.4375,24.7813L8.375,25.8438C8.7973,27.9056 9.5995,29.8313 10.7188,31.5313L7.1875,36.375C8.1988,37.6305 9.3664,38.7736 10.625,39.7813L15.625,36.3438C17.3724,37.4585 19.3231,38.2401 21.4375,38.625L22.375,44.5313C23.0412,44.5919 23.7243,44.5938 24.4063,44.5938C25.3689,44.5938 26.2885,44.5573 27.2188,44.4375L28.3438,38.4063C30.3513,37.9067 32.2372,37.04 33.875,35.875L38.6875,39.375C39.9355,38.3132 41.0768,37.0927 42.0625,35.7813L38.5625,30.7188C39.5104,29.0818 40.1671,27.2756 40.5,25.3438L46.4063,24.4063C46.458,23.7899 46.4688,23.1922 46.4688,22.5625C46.4688,21.4683 46.3416,20.3954 46.1875,19.3438L40.1875,18.25C39.7173,16.5138 38.9458,14.8939 37.9688,13.4375L41.5,8.5938C40.4054,7.2551 39.1568,6.0186 37.7813,4.9688L32.6875,8.4688C31.2235,7.6029 29.648,6.9386 27.9375,6.5625L27,0.625C26.1467,0.5246 25.2864,0.4688 24.4063,0.4688C24.1684,0.4688 23.9236,0.4613 23.6875,0.4688C23.5724,0.4724 23.4585,0.4621 23.3438,0.4688C23.3127,0.4706 23.281,0.4666 23.25,0.4688zM24.0625,15.6563C24.1767,15.6505 24.2907,15.6563 24.4063,15.6563C28.1054,15.6563 31.125,18.6759 31.125,22.375C31.125,26.0741 28.1054,29.0625 24.4063,29.0625C20.7071,29.0625 17.7188,26.0741 17.7188,22.375C17.7188,18.7915 20.5233,15.8358 24.0625,15.6563z"
|
||||
android:strokeAlpha="1"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#808080"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="1"
|
||||
android:strokeLineCap="butt">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M32.13,22.3608A7.7197,7.7197 45,1 1,16.6905 22.3608A7.7197,7.7197 135,1 1,32.13 22.3608z"
|
||||
android:strokeAlpha="0.64772725"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="1.64875567"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.64772725"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M22.5578,1.6501L21.6796,7.4291C20.0086,7.8097 16.9349,8.9735 15.5206,9.8511L10.8486,6.3639C9.6054,7.3291 9.5201,7.3945 8.5261,8.6137L11.9041,13.6236C10.9347,15.1051 9.7703,17.7451 9.3522,19.6317C9.3522,19.6317 3.4328,20.6296 3.4328,20.6296C3.3311,21.4606 3.38,23.2394 3.4485,23.9238L9.1027,24.9423C9.4985,26.875 10.9797,29.9859 12.0289,31.5794L8.4533,36.3034C9.4012,37.4803 9.591,37.5879 10.7707,38.5324L15.5519,35.0296C17.1898,36.0745 20.4409,37.3455 22.4228,37.7063L23.2075,43.4125C23.8319,43.4693 25.557,43.6288 26.4289,43.5165L27.3071,37.5764C29.1889,37.1081 32.4403,35.7734 33.9754,34.6815L38.7515,38.1323C39.9213,37.137 39.9318,36.9871 40.8557,35.7578L37.3165,30.7271C38.205,29.1927 39.3537,26.1918 39.6657,24.381L45.4604,23.4196C45.5089,22.8419 45.5113,21.2308 45.3669,20.245L39.4631,19.2264C39.0224,17.599 37.5099,14.6665 36.5941,13.3013L40.3464,8.5773C39.3204,7.3226 38.939,7.1504 37.6496,6.1664L32.7073,9.7056C31.335,8.894 28.5987,7.6569 26.9953,7.3044L26.1223,1.6501C25.3224,1.556 23.0149,1.5978 22.5578,1.6501z"
|
||||
android:strokeAlpha="0.34659088"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.9999997"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.34659088"
|
||||
android:strokeLineCap="butt"/>
|
||||
</vector>
|
110
android/app/src/main/res/drawable/ic_media_cdrom.xml
Normal file
110
android/app/src/main/res/drawable/ic_media_cdrom.xml
Normal file
|
@ -0,0 +1,110 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
<path
|
||||
android:pathData="M46.9619,41.511A6.0319,22.6274 90,1 1,1.7071 41.511A6.0319,22.6274 90,1 1,46.9619 41.511z"
|
||||
android:strokeAlpha="0.55"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="evenOdd"
|
||||
android:fillAlpha="0.55"
|
||||
android:strokeLineCap="butt">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M24.347,4.1667C12.7994,4.1667 3.5137,13.4524 3.5137,25C3.5137,36.5476 12.7994,45.8333 24.347,45.8333C35.8946,45.8333 45.1803,36.5476 45.1803,25C45.1803,13.4524 35.8946,4.1667 24.347,4.1667L24.347,4.1667zM24.347,30C21.6089,30 19.347,27.7381 19.347,25C19.347,22.2619 21.6089,20 24.347,20C27.0851,20 29.347,22.2619 29.347,25C29.347,27.7381 27.0851,30 24.347,30z"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero">
|
||||
</path>
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M24.347,4.1667C12.7994,4.1667 3.5137,13.4524 3.5137,25C3.5137,36.5476 12.7994,45.8333 24.347,45.8333C35.8946,45.8333 45.1803,36.5476 45.1803,25C45.1803,13.4524 35.8946,4.1667 24.347,4.1667L24.347,4.1667zM24.347,30C21.6089,30 19.347,27.7381 19.347,25C19.347,22.2619 21.6089,20 24.347,20C27.0851,20 29.347,22.2619 29.347,25C29.347,27.7381 27.0851,30 24.347,30z"
|
||||
android:strokeAlpha="1"
|
||||
android:strokeColor="#808080"
|
||||
android:fillType="nonZero">
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M24.347,14.8958C18.7044,14.8958 14.2428,19.4886 14.2428,25C14.2428,30.6426 18.8356,35.1042 24.347,35.1042C29.9896,35.1042 34.4512,30.5114 34.4512,25C34.4512,19.3574 29.8584,14.8958 24.347,14.8958L24.347,14.8958zM24.347,30.5114C21.3289,30.5114 18.8356,28.0181 18.8356,25C18.8356,21.9819 21.3289,19.4886 24.347,19.4886C27.3651,19.4886 29.8584,21.9819 29.8584,25C29.8584,28.0181 27.3651,30.5114 24.347,30.5114z"
|
||||
android:strokeAlpha="0.10999995"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.10999995"/>
|
||||
<path
|
||||
android:pathData="M29.9221,5.6692L26.3255,19.6639C27.4502,19.9634 28.3497,20.6594 28.9606,21.6224L41.3529,14.0732C38.8176,9.9434 34.7487,6.9051 29.9221,5.6692z"
|
||||
android:strokeAlpha="1"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="1">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M17.3078,43.7661L22.0431,30.1146C20.9468,29.7236 20.1077,28.956 19.5779,27.946L6.6069,34.4506C8.7939,38.7748 12.5993,42.1375 17.3078,43.7661z"
|
||||
android:strokeAlpha="1"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="1">
|
||||
</path>
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M24.347,5.2024C13.3735,5.2024 4.5494,14.0265 4.5494,25C4.5494,35.9735 13.3735,44.7976 24.347,44.7976C35.3205,44.7976 44.1446,35.9735 44.1446,25C44.1446,14.0265 35.3205,5.2024 24.347,5.2024L24.347,5.2024z"
|
||||
android:strokeAlpha="0.5464481"
|
||||
android:fillColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.5464481">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M30.494,25.019A6.0988,6.0988 0,1 1,18.2964 25.019A6.0988,6.0988 0,1 1,30.494 25.019z"
|
||||
android:strokeAlpha="0.6721311"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.93053865"
|
||||
android:fillColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.21265164"
|
||||
android:strokeLineCap="butt">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M24.347,4.1667C12.7994,4.1667 3.5137,13.4524 3.5137,25C3.5137,36.5476 12.7994,45.8333 24.347,45.8333C35.8946,45.8333 45.1803,36.5476 45.1803,25C45.1803,13.4524 35.8946,4.1667 24.347,4.1667L24.347,4.1667zM24.347,30C21.6089,30 19.347,27.7381 19.347,25C19.347,22.2619 21.6089,20 24.347,20C27.0851,20 29.347,22.2619 29.347,25C29.347,27.7381 27.0851,30 24.347,30z"
|
||||
android:strokeAlpha="0.1142857"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.1142857">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M24.347,4.1667C12.7994,4.1667 3.5137,13.4524 3.5137,25C3.5137,36.5476 12.7994,45.8333 24.347,45.8333C35.8946,45.8333 45.1803,36.5476 45.1803,25C45.1803,13.4524 35.8946,4.1667 24.347,4.1667L24.347,4.1667zM24.347,30C21.6089,30 19.347,27.7381 19.347,25C19.347,22.2619 21.6089,20 24.347,20C27.0851,20 29.347,22.2619 29.347,25C29.347,27.7381 27.0851,30 24.347,30z"
|
||||
android:strokeAlpha="0.09714284"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.09714284">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M24.347,4.1667C12.7994,4.1667 3.5137,13.4524 3.5137,25C3.5137,36.5476 12.7994,45.8333 24.347,45.8333C35.8946,45.8333 45.1803,36.5476 45.1803,25C45.1803,13.4524 35.8946,4.1667 24.347,4.1667L24.347,4.1667zM24.347,30C21.6089,30 19.347,27.7381 19.347,25C19.347,22.2619 21.6089,20 24.347,20C27.0851,20 29.347,22.2619 29.347,25C29.347,27.7381 27.0851,30 24.347,30z"
|
||||
android:strokeAlpha="0.71428573"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.71428573">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M24.347,4.1667C12.7994,4.1667 3.5137,13.4524 3.5137,25C3.5137,36.5476 12.7994,45.8333 24.347,45.8333C35.8946,45.8333 45.1803,36.5476 45.1803,25C45.1803,13.4524 35.8946,4.1667 24.347,4.1667L24.347,4.1667zM24.347,30C21.6089,30 19.347,27.7381 19.347,25C19.347,22.2619 21.6089,20 24.347,20C27.0851,20 29.347,22.2619 29.347,25C29.347,27.7381 27.0851,30 24.347,30z"
|
||||
android:strokeAlpha="0.62285715"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.62285715">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M24.347,4.1667C12.7994,4.1667 3.5137,13.4524 3.5137,25C3.5137,36.5476 12.7994,45.8333 24.347,45.8333C35.8946,45.8333 45.1803,36.5476 45.1803,25C45.1803,13.4524 35.8946,4.1667 24.347,4.1667L24.347,4.1667zM24.347,30C21.6089,30 19.347,27.7381 19.347,25C19.347,22.2619 21.6089,20 24.347,20C27.0851,20 29.347,22.2619 29.347,25C29.347,27.7381 27.0851,30 24.347,30z"
|
||||
android:strokeAlpha="0.3714286"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.3714286">
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M24.347,4.1667C12.7994,4.1667 3.5137,13.4524 3.5137,25C3.5137,36.5476 12.7994,45.8333 24.347,45.8333C35.8946,45.8333 45.1803,36.5476 45.1803,25C45.1803,13.4524 35.8946,4.1667 24.347,4.1667L24.347,4.1667zM24.347,30C21.6089,30 19.347,27.7381 19.347,25C19.347,22.2619 21.6089,20 24.347,20C27.0851,20 29.347,22.2619 29.347,25C29.347,27.7381 27.0851,30 24.347,30z"
|
||||
android:strokeAlpha="0.23428573"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:fillAlpha="0.23428573">
|
||||
</path>
|
||||
</vector>
|
|
@ -6,32 +6,42 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/game_list_view_entry_type_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:srcCompat="@drawable/ic_media_cdrom" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/game_list_view_entry_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Game Title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:text="Game Title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/game_list_view_entry_type_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/game_list_view_entry_path"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingBottom="8px"
|
||||
android:text="Game Path"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/game_list_view_entry_type_icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/game_list_view_entry_title" />
|
||||
|
||||
<TextView
|
||||
|
@ -40,11 +50,11 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:text="123.4 MB"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textSize="12sp"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@ -52,12 +62,13 @@
|
|||
android:id="@+id/game_list_view_entry_region_icon"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginTop="4px"
|
||||
android:layout_marginTop="8px"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:paddingBottom="8px"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:paddingBottom="8px"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/game_list_view_entry_size"
|
||||
app:srcCompat="@drawable/flag_jp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -3,8 +3,8 @@
|
|||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorPrimary">@color/design_default_color_primary</item>
|
||||
<item name="colorPrimaryDark">@color/design_default_color_primary_dark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "common/cd_image.h"
|
||||
#include "common/iso_reader.h"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cctype>
|
||||
#include <tinyxml2.h>
|
||||
#include <utility>
|
||||
|
@ -20,6 +21,12 @@ GameList::GameList() = default;
|
|||
|
||||
GameList::~GameList() = default;
|
||||
|
||||
const char* GameList::EntryTypeToString(GameList::EntryType type)
|
||||
{
|
||||
static std::array<const char*, 2> names = {{"Disc", "PSExe"}};
|
||||
return names[static_cast<int>(type)];
|
||||
}
|
||||
|
||||
std::string GameList::GetGameCodeForPath(const char* image_path)
|
||||
{
|
||||
std::unique_ptr<CDImage> cdi = CDImage::Open(image_path);
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
GameList();
|
||||
~GameList();
|
||||
|
||||
static const char* EntryTypeToString(EntryType type);
|
||||
|
||||
static std::string GetGameCodeForImage(CDImage* cdi);
|
||||
static std::string GetGameCodeForPath(const char* image_path);
|
||||
static std::optional<ConsoleRegion> GetRegionForCode(std::string_view code);
|
||||
|
|
Loading…
Reference in a new issue