diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index c12b9e1d8e..f581c6356b 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -30,8 +30,8 @@ android { minSdk = 26 targetSdk = 36 - versionCode = 20 - versionName = "1.1.9" + versionCode = 21 + versionName = "1.2.0" ndk { abiFilters += listOf("arm64-v8a") diff --git a/android/app/src/main/java/com/izzy2lost/x1box/GameLibraryActivity.kt b/android/app/src/main/java/com/izzy2lost/x1box/GameLibraryActivity.kt index 56e93c1bd8..7e956b6693 100644 --- a/android/app/src/main/java/com/izzy2lost/x1box/GameLibraryActivity.kt +++ b/android/app/src/main/java/com/izzy2lost/x1box/GameLibraryActivity.kt @@ -3,7 +3,6 @@ package com.izzy2lost.x1box import android.content.Intent import android.content.res.Configuration import android.graphics.Bitmap -import android.graphics.Typeface import android.net.Uri import android.os.Bundle import android.os.ParcelFileDescriptor @@ -11,8 +10,6 @@ import android.text.SpannableStringBuilder import android.text.Spanned import android.text.method.LinkMovementMethod import android.text.style.ClickableSpan -import android.text.style.ForegroundColorSpan -import android.text.style.StyleSpan import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -609,11 +606,13 @@ class GameLibraryActivity : AppCompatActivity() { for (game in games) { val item = inflater.inflate(R.layout.item_game_entry, gamesListContainer, false) val nameText = item.findViewById(R.id.game_name_text) + val convertWarningText = item.findViewById(R.id.game_convert_warning_text) val sizeText = item.findViewById(R.id.game_size_text) val pathText = item.findViewById(R.id.game_path_text) val coverImage = item.findViewById(R.id.game_list_cover_image) nameText.text = game.title + bindConvertibleWarning(convertWarningText, game) sizeText.text = buildGameSizeText(game) pathText.text = game.relativePath @@ -654,9 +653,11 @@ class GameLibraryActivity : AppCompatActivity() { row!!.addView(item, itemLp) val nameText = item.findViewById(R.id.game_cover_name_text) + val convertWarningText = item.findViewById(R.id.game_cover_convert_warning_text) val coverImage = item.findViewById(R.id.game_cover_image) nameText.text = game.title + bindConvertibleWarning(convertWarningText, game) item.setOnClickListener { launchGame(game) } item.setOnLongClickListener { showGameContextMenu(game); true } bindCoverArt(coverImage, game) @@ -1199,29 +1200,16 @@ class GameLibraryActivity : AppCompatActivity() { } } - private fun buildGameSizeText(game: GameEntry): CharSequence { - val sizeLabel = getString(R.string.library_game_size, formatSize(game.sizeBytes)) - if (game.discImageFormat != DiscImageFormat.REGULAR_ISO) { - return sizeLabel + private fun bindConvertibleWarning(view: TextView, game: GameEntry) { + view.visibility = if (game.discImageFormat == DiscImageFormat.REGULAR_ISO) { + View.VISIBLE + } else { + View.GONE } + } - return SpannableStringBuilder(sizeLabel).apply { - append(" ") - val badgeStart = length - append(getString(R.string.library_regular_iso_badge)) - setSpan( - ForegroundColorSpan(getColor(R.color.xemu_warning)), - badgeStart, - length, - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE - ) - setSpan( - StyleSpan(Typeface.BOLD), - badgeStart, - length, - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE - ) - } + private fun buildGameSizeText(game: GameEntry): CharSequence { + return getString(R.string.library_game_size, formatSize(game.sizeBytes)) } private fun isConvertibleIso(game: GameEntry): Boolean { diff --git a/android/app/src/main/res/layout/item_game_cover.xml b/android/app/src/main/res/layout/item_game_cover.xml index 5dd8acfb90..52871b33b1 100644 --- a/android/app/src/main/res/layout/item_game_cover.xml +++ b/android/app/src/main/res/layout/item_game_cover.xml @@ -42,8 +42,25 @@ android:maxLines="2" android:textAlignment="center" android:textAppearance="@style/TextAppearance.Material3.TitleSmall" - app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/game_cover_art_card" /> + + diff --git a/android/app/src/main/res/layout/item_game_entry.xml b/android/app/src/main/res/layout/item_game_entry.xml index f4c851e070..d214ad5ca8 100644 --- a/android/app/src/main/res/layout/item_game_entry.xml +++ b/android/app/src/main/res/layout/item_game_entry.xml @@ -53,6 +53,18 @@ android:maxLines="2" android:textAppearance="@style/TextAppearance.Material3.TitleSmall" /> + + /dev/null 2>&1 && pwd)" +android_dir="${project_source_dir}/android" +key_props="${android_dir}/key.properties" +release_aab="${android_dir}/app/build/outputs/bundle/release/app-release.aab" + +if [[ ! -f "${key_props}" ]]; then + printf 'Creating "%s" with placeholders...\n' "${key_props}" + cat >"${key_props}" <<'EOF' +storeFile=/path/to/your-release-key.jks +storePassword=REPLACE_ME +keyAlias=REPLACE_ME +keyPassword=REPLACE_ME +EOF + printf '\nEdit %s with your real values, then rerun this script.\n' "${key_props}" + exit 1 +fi + +if grep -Fq 'REPLACE_ME' "${key_props}"; then + printf '\nPlease replace the placeholders in %s before building.\n' "${key_props}" + exit 1 +fi + +if grep -Fq '/path/to/your-release-key.jks' "${key_props}" || \ + grep -Fq 'C:/path/to/your-release-key.jks' "${key_props}"; then + printf '\nPlease replace the storeFile placeholder in %s before building.\n' "${key_props}" + exit 1 +fi + +cd "${android_dir}" +bash ./gradlew bundleRelease + +printf '\nBuild complete.\n' +printf 'Release AAB:\n' +printf ' %s\n' "${release_aab}"