UI
: Missing countries have been added, and visual problems have been fixed
6
.idea/render.experimental.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RenderSettings">
|
||||
<option name="showDecorations" value="true" />
|
||||
</component>
|
||||
</project>
|
2
app/proguard-rules.pro
vendored
@ -2,4 +2,4 @@
|
||||
-keep class emu.zenith.data.ZenithSettings {
|
||||
public java.lang.Object getEnvStateVar(java.lang.String);
|
||||
}
|
||||
-keep class emu.zenith.data.KernelModel
|
||||
-keep class emu.zenith.data.KernelModel
|
||||
|
BIN
app/src/main/assets/countries/ch.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/assets/countries/eu.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/assets/countries/hk.png
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 5.6 KiB |
@ -25,8 +25,6 @@ namespace zenith::fs {
|
||||
}
|
||||
|
||||
bool BiosLoader::loadBios(JNIEnv* android, kernel::KernelModel &model) {
|
||||
if (!scpRomHeader)
|
||||
return false;
|
||||
biosf = model.fd;
|
||||
|
||||
biosf.read(std::span<u8>{scpRomHeader, hdrSize});
|
||||
@ -102,8 +100,9 @@ namespace zenith::fs {
|
||||
auto biosModel{fmt::format("{} v{}.{}({})", countries.at(info[4]), biosVerP1, biosVerP2, manuDate)};
|
||||
|
||||
auto originModel{fmt::format("Console {}-{}",
|
||||
fmt::join(info | take(9), ""),
|
||||
fmt::join(info | drop(9) | take(5), ""))};
|
||||
fmt::join(info | take(8), ""),
|
||||
fmt::join(info | drop(8) | take(6), ""))};
|
||||
// 19700101–123456
|
||||
|
||||
model.biosName = java::JNIString(android, biosModel);
|
||||
model.biosDetails = java::JNIString(android, originModel);
|
||||
|
@ -18,4 +18,4 @@ abstract class GenericListContainer <T : ViewBinding> {
|
||||
|
||||
abstract fun compareItem(prob: GenericListContainer<T>): Boolean
|
||||
abstract fun isTheSame(prob: GenericListContainer<T>): Boolean
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ class GenericViewHolder<out T: ViewBinding>(view : T) : ViewHolder(view.root) {
|
||||
val binding = view
|
||||
}
|
||||
|
||||
@Suppress("LeakingThis")
|
||||
open class GenericViewAdapter
|
||||
: RecyclerView.Adapter<GenericViewHolder<ViewBinding>>() {
|
||||
companion object {
|
||||
@ -29,7 +28,6 @@ open class GenericViewAdapter
|
||||
private val asyncDiffer = AsyncListDiffer(this, viewDiffer)
|
||||
|
||||
private val entities = mutableListOf<GenericListContainer<out ViewBinding>>()
|
||||
|
||||
private val viewItems: List<GenericListContainer<in ViewBinding>> get() = asyncDiffer.currentList
|
||||
|
||||
private val factory = mutableMapOf<ViewBindingFactory, Int>()
|
||||
|
@ -31,10 +31,14 @@ class KernelViewItem(
|
||||
binding.kernelDetails.text = model.biosDetails
|
||||
|
||||
val flag = when (model.biosName?.substringBefore(' ')) {
|
||||
"Japan" -> "countries/jp.png"
|
||||
"USA" -> "countries/us.png"
|
||||
"Japan" -> "countries/jp.png"
|
||||
"Europe" -> "countries/eu.png"
|
||||
"China" -> "countries/ch.png"
|
||||
"Honk Kong" -> "countries/jp.png"
|
||||
else -> ""
|
||||
}
|
||||
|
||||
val bitmap = BitmapFactory.decodeStream(context.assets.open(flag))
|
||||
binding.kernelFlag.setImageBitmap(bitmap)
|
||||
|
||||
|
@ -1,69 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
<com.google.android.material.card.MaterialCardView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.CardView.Elevated"
|
||||
android:layout_margin="4dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/kernelFlag"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_margin="8dp"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:contentDescription="@string/kernel_item_flag_description" />
|
||||
<ImageView
|
||||
android:id="@+id/kernelFlag"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_margin="8dp"
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kernelFullQualified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/kernel_item_object"
|
||||
android:layout_margin="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:contentDescription="@string/kernel_item_flag_description" />
|
||||
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
<TextView
|
||||
android:id="@+id/kernelFullQualified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/kernel_item_object"
|
||||
android:layout_margin="4dp"
|
||||
|
||||
app:layout_constraintStart_toEndOf="@+id/kernelFlag"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kernelName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/kernel_item_origin_version"
|
||||
app:layout_constraintStart_toEndOf="@+id/kernelFlag"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
android:layout_margin="4dp"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
<TextView
|
||||
android:id="@+id/kernelName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/kernel_item_origin_version"
|
||||
|
||||
app:layout_constraintStart_toEndOf="@+id/kernelFlag"
|
||||
app:layout_constraintTop_toBottomOf="@+id/kernelFullQualified" />
|
||||
android:layout_margin="4dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kernelDetails"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/kernel_item_name"
|
||||
app:layout_constraintStart_toEndOf="@+id/kernelFlag"
|
||||
app:layout_constraintTop_toBottomOf="@+id/kernelFullQualified" />
|
||||
|
||||
android:layout_margin="4dp"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
<TextView
|
||||
android:id="@+id/kernelDetails"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/kernel_item_name"
|
||||
|
||||
app:layout_constraintStart_toEndOf="@+id/kernelFlag"
|
||||
app:layout_constraintTop_toBottomOf="@+id/kernelName" />
|
||||
android:layout_margin="4dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/kernelChecker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@+id/kernelFlag"
|
||||
app:layout_constraintTop_toBottomOf="@+id/kernelName" />
|
||||
|
||||
android:layout_margin="8dp"
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/kernelChecker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
android:layout_margin="8dp"
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
@ -14,12 +14,12 @@
|
||||
|
||||
<string name="prefer_group_core">Core</string>
|
||||
<string name="prefer_kernel_model">Kernel Selector</string>
|
||||
<string name="prefer_summary_kernel_model">Open the Kernel file selection, eligible for the booting process</string>
|
||||
<string name="prefer_summary_kernel_model">Open the kernel file selection, eligible for the booting process</string>
|
||||
|
||||
<string name="datastore_root_dir">DSDB_ROOT_DIRECTORY</string>
|
||||
<string name="kernel_button_select">Select</string>
|
||||
<string name="kernel_item_object">0000000000000.bin</string>
|
||||
<string name="kernel_item_origin_version">USA v0.0(01/01/1970)</string>
|
||||
<string name="kernel_item_origin_version">USA v00.00(01/01/1970)</string>
|
||||
<string name="kernel_item_name">Console 19700101–123456</string>
|
||||
<string name="kernel_item_flag_description">Kernel nationality</string>
|
||||
</resources>
|
||||
|
@ -1,24 +1,8 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
|
||||
android.useAndroidX=true
|
||||
# Kotlin code style for this project: "official" or "obsolete":
|
||||
|
||||
kotlin.code.style=official
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
|
||||
android.nonTransitiveRClass=true
|
||||
org.gradle.unsafe.configuration-cache=true
|
||||
|