diff --git a/AGENTS.md b/AGENTS.md index e569b85..e7ce6f0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,11 +13,12 @@ ALWAYS use the `task *` commands | Command | Purpose | | -------------- | ---------------------------------------- | +| `task lint` | Gradle Lint | | `task compile` | Compile Kotlin | | `task debug` | Build debug variant (APK) | | `task release` | Build release variant (APK) | | `task bundle` | Build Android App Bundle (AAB) | -| `task lint` | Prettier check + yamllint + actionlint | +| `task check` | Prettier check (check non-kotlin files) | | `task format` | Prettier write (format non-kotlin files) | Do NOT use `-q` or pipe Gradle output through `Select-Object` — both hide progress and make long builds look hung. diff --git a/Taskfile.yml b/Taskfile.yml index c853527..00cc4ff 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,22 +11,27 @@ tasks: - rm -rf .cache - zensical serve --open - lint: - desc: Lint + check: + desc: Check Non-Kotlin Files + aliases: [prettier:check] cmds: - prettier --check . - yamllint -c .github/yamllint.yaml . - actionlint -shellcheck="-e SC2129" format: - desc: Format + desc: Format Non-Kotlin Files aliases: [prettier, prettier:write] cmds: - prettier --write . + lint: + desc: Gradle Lint + cmd: "{{.GRADLEW}} lint {{.CLI_ARGS}}" + compile: desc: Compile Kotlin - cmd: "{{.GRADLEW}} :app:compileDebugKotlin" + cmd: "{{.GRADLEW}} :app:compileDebugKotlin {{.CLI_ARGS}}" debug: desc: Build Debug (recommended android studio) diff --git a/app/src/main/java/org/cssnr/remotewallpaper/ui/history/HistoryAdapter.kt b/app/src/main/java/org/cssnr/remotewallpaper/ui/history/HistoryAdapter.kt index d8c6722..6e3dabc 100644 --- a/app/src/main/java/org/cssnr/remotewallpaper/ui/history/HistoryAdapter.kt +++ b/app/src/main/java/org/cssnr/remotewallpaper/ui/history/HistoryAdapter.kt @@ -13,6 +13,7 @@ import org.cssnr.remotewallpaper.db.HistoryItem import java.time.Instant import java.time.ZoneId import java.time.format.DateTimeFormatter +import java.util.Locale class HistoryAdapter( private var items: List, @@ -63,8 +64,8 @@ class HistoryAdapter( } else { holder.itemUrl.text = items[position].url } - holder.itemCode.text = items[position].status.toString() - holder.itemId.text = items[position].id.toString() + holder.itemCode.text = String.format(Locale.getDefault(), "%d", items[position].status) + holder.itemId.text = String.format(Locale.getDefault(), "%d", items[position].id) // Date val instant = Instant.ofEpochMilli(items[position].timestamp) val zonedDateTime = instant.atZone(ZoneId.systemDefault()) diff --git a/app/src/main/java/org/cssnr/remotewallpaper/ui/history/HistoryFragment.kt b/app/src/main/java/org/cssnr/remotewallpaper/ui/history/HistoryFragment.kt index e1936ea..ab69e84 100644 --- a/app/src/main/java/org/cssnr/remotewallpaper/ui/history/HistoryFragment.kt +++ b/app/src/main/java/org/cssnr/remotewallpaper/ui/history/HistoryFragment.kt @@ -26,6 +26,7 @@ import org.cssnr.remotewallpaper.R import org.cssnr.remotewallpaper.databinding.FragmentHistoryBinding import org.cssnr.remotewallpaper.db.HistoryDatabase import org.cssnr.remotewallpaper.db.HistoryItem +import java.util.Locale const val LOG_TAG = "History" @@ -198,7 +199,7 @@ class HistoryFragment : Fragment() { //itemUrl.movementMethod = LinkMovementMethod.getInstance() itemUrl.text = data.url ?: "No URL" - itemStatus.text = data.status.toString() + itemStatus.text = String.format(Locale.getDefault(), "%d", data.status) if (!data.error.isNullOrBlank()) { itemError.text = data.error diff --git a/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/app/src/main/res/mipmap-anydpi/ic_launcher.xml index 036d09b..65291b9 100644 --- a/app/src/main/res/mipmap-anydpi/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml index 036d09b..65291b9 100644 --- a/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7c59f11..3030e91 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ swiperefreshlayout = "1.2.0" workRuntimeKtx = "2.11.2" # viewpager2 = "1.1.0" -okhttp = "5.4.0" +okhttp = "5.5.0" retrofit = "3.0.0" moshiKotlinCodegen = "1.15.2" photoview = "1.0.3"