From bfc687a7705e9cbe25d24a58b51a9a6dc9478fb0 Mon Sep 17 00:00:00 2001 From: Jordon de Hoog Date: Fri, 15 Sep 2023 11:19:38 -0400 Subject: [PATCH] move some things --- .github/workflows/ci.yml | 4 +++- .../kotlin/dev/jordond/kmpalette/palette/graphics/Palette.kt | 2 +- .../jordond/kmpalette/palette/internal/ColorCutQuantizer.kt | 4 ++-- .../kmpalette/palette/{ => internal}/utils/ColorUtils.kt | 2 +- .../kmpalette/palette/{ => internal}/utils/PriorityQueue.kt | 2 +- .../dev/jordond/kmpalette/palette/{ => internal}/utils/pow.kt | 2 +- .../kmpalette/palette/{ => internal}/utils/ColorUtilsTest.kt | 2 +- .../kmpalette/palette/{ => internal}/utils/PowKtTest.kt | 4 ++-- 8 files changed, 12 insertions(+), 10 deletions(-) rename androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/{ => internal}/utils/ColorUtils.kt (99%) rename androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/{ => internal}/utils/PriorityQueue.kt (98%) rename androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/{ => internal}/utils/pow.kt (66%) rename androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/{ => internal}/utils/ColorUtilsTest.kt (98%) rename androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/{ => internal}/utils/PowKtTest.kt (71%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee9a2c5..acf1647 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: matrix: api-level: [ 24, 29, 31 ] runs-on: macos-latest - name: Test API ${{ matrix.config.api-level }} + name: Test API ${{ matrix.api-level }} needs: verify steps: - name: Checkout @@ -142,6 +142,7 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} + arch: x86_64 force-avd-creation: false disable-animations: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none @@ -151,6 +152,7 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} + arch: x86_64 disable-animations: true force-avd-creation: false ram-size: 4096M diff --git a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/graphics/Palette.kt b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/graphics/Palette.kt index 12c023f..4ab63ac 100644 --- a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/graphics/Palette.kt +++ b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/graphics/Palette.kt @@ -24,7 +24,7 @@ import dev.drewhamilton.poko.Poko import dev.jordond.kmpalette.palette.graphics.Palette.Builder import dev.jordond.kmpalette.palette.internal.ColorCutQuantizer import dev.jordond.kmpalette.palette.internal.scale -import dev.jordond.kmpalette.palette.utils.ColorUtils +import dev.jordond.kmpalette.palette.internal.utils.ColorUtils import kotlin.math.abs import kotlin.math.ceil import kotlin.math.floor diff --git a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/ColorCutQuantizer.kt b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/ColorCutQuantizer.kt index a3624c8..6823fc9 100644 --- a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/ColorCutQuantizer.kt +++ b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/ColorCutQuantizer.kt @@ -16,8 +16,8 @@ package dev.jordond.kmpalette.palette.internal import dev.jordond.kmpalette.palette.graphics.Palette -import dev.jordond.kmpalette.palette.utils.ColorUtils -import dev.jordond.kmpalette.palette.utils.PriorityQueue +import dev.jordond.kmpalette.palette.internal.utils.ColorUtils +import dev.jordond.kmpalette.palette.internal.utils.PriorityQueue import kotlin.math.min import kotlin.math.round diff --git a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/ColorUtils.kt b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/ColorUtils.kt similarity index 99% rename from androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/ColorUtils.kt rename to androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/ColorUtils.kt index abaae7f..6dcbb56 100644 --- a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/ColorUtils.kt +++ b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/ColorUtils.kt @@ -1,4 +1,4 @@ -package dev.jordond.kmpalette.palette.utils +package dev.jordond.kmpalette.palette.internal.utils import androidx.annotation.ColorInt import androidx.annotation.FloatRange diff --git a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/PriorityQueue.kt b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/PriorityQueue.kt similarity index 98% rename from androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/PriorityQueue.kt rename to androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/PriorityQueue.kt index cb94ad6..bedc656 100644 --- a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/PriorityQueue.kt +++ b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/PriorityQueue.kt @@ -1,4 +1,4 @@ -package dev.jordond.kmpalette.palette.utils +package dev.jordond.kmpalette.palette.internal.utils internal class PriorityQueue( private val comparator: Comparator, diff --git a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/pow.kt b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/pow.kt similarity index 66% rename from androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/pow.kt rename to androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/pow.kt index bde1eb9..55a2a94 100644 --- a/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/utils/pow.kt +++ b/androidx-palette/src/commonMain/kotlin/dev/jordond/kmpalette/palette/internal/utils/pow.kt @@ -1,4 +1,4 @@ -package dev.jordond.kmpalette.palette.utils +package dev.jordond.kmpalette.palette.internal.utils import kotlin.math.pow diff --git a/androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/utils/ColorUtilsTest.kt b/androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/internal/utils/ColorUtilsTest.kt similarity index 98% rename from androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/utils/ColorUtilsTest.kt rename to androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/internal/utils/ColorUtilsTest.kt index 34ee27d..ad5b986 100644 --- a/androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/utils/ColorUtilsTest.kt +++ b/androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/internal/utils/ColorUtilsTest.kt @@ -1,4 +1,4 @@ -package dev.jordond.kmpalette.palette.utils +package dev.jordond.kmpalette.palette.internal.utils import kotlin.math.pow import kotlin.math.roundToInt diff --git a/androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/utils/PowKtTest.kt b/androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/internal/utils/PowKtTest.kt similarity index 71% rename from androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/utils/PowKtTest.kt rename to androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/internal/utils/PowKtTest.kt index ec59861..7610e8c 100644 --- a/androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/utils/PowKtTest.kt +++ b/androidx-palette/src/commonTest/kotlin/dev/jordond/kmpalette/palette/internal/utils/PowKtTest.kt @@ -1,4 +1,4 @@ -package dev.jordond.kmpalette.palette.utils +package dev.jordond.kmpalette.palette.internal.utils import kotlin.test.Test import kotlin.test.assertTrue @@ -6,7 +6,7 @@ import kotlin.test.assertTrue class PowKtTest { @Test - fun `should return 1 when exponent is 0`() { + fun `should calculate the exponent value`() { assertTrue(pow(2.0, 1.0) == 2.0) assertTrue(pow(2.0, 2.0) == 4.0) assertTrue(pow(2.0, 3.0) == 8.0)