From c48bf5af465b03f3faf5975091edcd0f3cea220a Mon Sep 17 00:00:00 2001 From: Mahdi Hosseinzadeh Date: Sun, 21 Jul 2024 13:43:23 +0330 Subject: [PATCH] Rebase the app on Clipper changes Based on Clipper v1.19.0 (commit 42b57c8d) --- .github/workflows/ci.yml | 6 +- .idea/runConfigurations/Tests__All_.xml | 5 +- build.gradle.kts | 38 +- gradle/libs.versions.toml | 36 +- gradle/wrapper/gradle-wrapper.jar | Bin 43462 -> 43453 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 +- raw/icons.svg | 2891 +++++++++-------- src/main/kotlin/ir/mahozad/cutcon/Defaults.kt | 19 +- src/main/kotlin/ir/mahozad/cutcon/Main.kt | 11 +- .../kotlin/ir/mahozad/cutcon/MainViewModel.kt | 149 +- .../kotlin/ir/mahozad/cutcon/Utilities.kt | 58 +- .../mahozad/cutcon/component/MediaPlayer.kt | 205 +- .../ir/mahozad/cutcon/converter/Converter.kt | 64 +- .../mahozad/cutcon/converter/Mp3Converter.kt | 7 +- .../mahozad/cutcon/converter/Mp4Converter.kt | 3 - .../mahozad/cutcon/converter/RawConverter.kt | 1 - .../mahozad/cutcon/localization/Messages.kt | 1 + .../mahozad/cutcon/localization/MessagesEn.kt | 13 +- .../mahozad/cutcon/localization/MessagesFa.kt | 13 +- .../kotlin/ir/mahozad/cutcon/model/Format.kt | 10 +- .../kotlin/ir/mahozad/cutcon/model/Models.kt | 12 +- .../ir/mahozad/cutcon/ui/Decorations.kt | 100 +- .../ir/mahozad/cutcon/ui/ErrorWindow.kt | 17 +- .../kotlin/ir/mahozad/cutcon/ui/MainWindow.kt | 19 +- .../cutcon/ui/dialog/AnimatedDialog.kt | 57 + .../cutcon/ui/dialog/AppExitConfirmDialog.kt | 49 +- .../cutcon/ui/dialog/ChangelogDialog.kt | 52 +- .../mahozad/cutcon/ui/dialog/FinishDilaogs.kt | 30 +- .../ir/mahozad/cutcon/ui/icon/Forward30En.kt | 6 +- .../ir/mahozad/cutcon/ui/icon/Forward5En.kt | 4 +- .../ir/mahozad/cutcon/ui/icon/Rewind30En.kt | 6 +- .../ir/mahozad/cutcon/ui/icon/Rewind5En.kt | 4 +- .../ir/mahozad/cutcon/ui/icon/SidePanelOff.kt | 4 +- .../ir/mahozad/cutcon/ui/icon/SidePanelOn.kt | 4 +- .../ir/mahozad/cutcon/ui/icon/SpeedFast.kt | 3 +- .../kotlin/ir/mahozad/cutcon/ui/icon/Star.kt | 20 +- .../ir/mahozad/cutcon/ui/panel/ConfigPanel.kt | 10 +- .../ir/mahozad/cutcon/ui/panel/MainPanel.kt | 11 +- .../ir/mahozad/cutcon/ui/panel/SidePanel.kt | 98 +- .../ir/mahozad/cutcon/ui/theme/Theme.kt | 10 +- .../ir/mahozad/cutcon/ui/widget/CoverInput.kt | 178 +- .../ir/mahozad/cutcon/ui/widget/Display.kt | 46 +- .../ir/mahozad/cutcon/ui/widget/Dropdown.kt | 26 +- .../ir/mahozad/cutcon/ui/widget/IntroInput.kt | 143 +- .../cutcon/ui/widget/MediaPlayerProgress.kt | 2 +- .../mahozad/cutcon/ui/widget/QualityInput.kt | 18 +- .../mahozad/cutcon/ui/widget/SaveAsInput.kt | 4 +- .../cutcon/ui/widget/ScreenshotButton.kt | 23 +- .../kotlin/ir/mahozad/cutcon/TestHelpers.kt | 34 +- .../kotlin/ir/mahozad/cutcon/UtilitiesTest.kt | 151 +- .../cutcon/component/MediaPlayerTest.kt | 238 +- .../cutcon/converter/ConvertersTest.kt | 70 +- .../mahozad/cutcon/viewmodel/AppExitTest.kt | 9 +- .../cutcon/viewmodel/AspectRatioTest.kt | 5 + .../mahozad/cutcon/viewmodel/CalendarTest.kt | 7 +- .../ir/mahozad/cutcon/viewmodel/CoverTest.kt | 13 + .../ir/mahozad/cutcon/viewmodel/IntroTest.kt | 29 +- .../IsChangelogDialogDisplayedTest.kt | 58 +- .../cutcon/viewmodel/IsFullscreenTest.kt | 9 +- .../viewmodel/IsScreenshotInputEnabledTest.kt | 54 - .../mahozad/cutcon/viewmodel/KeyEventTest.kt | 63 +- .../mahozad/cutcon/viewmodel/LanguageTest.kt | 8 +- .../cutcon/viewmodel/MainViewModelTest.kt | 57 +- .../mahozad/cutcon/viewmodel/MediaInfoTest.kt | 171 +- .../mahozad/cutcon/viewmodel/SaveFileTest.kt | 3 +- .../cutcon/viewmodel/ScreenshotInputTest.kt | 132 + .../ir/mahozad/cutcon/viewmodel/StatusTest.kt | 16 +- .../cutcon/viewmodel/WindowWidthTest.kt | 81 + src/test/resources/reference/10.png | Bin 0 -> 756 bytes src/test/resources/reference/11.png | Bin 0 -> 9095 bytes src/test/resources/reference/12.png | Bin 0 -> 5509 bytes src/test/resources/reference/13.png | Bin 0 -> 3860 bytes src/test/resources/reference/7.png | Bin 14068 -> 14084 bytes src/test/resources/test.avif | Bin 0 -> 1026 bytes src/test/resources/test.jpg | Bin 0 -> 3809 bytes src/test/resources/test.svgz | Bin 0 -> 882 bytes .../mahozad/cutcon/ui/widget/DisplayTest.kt | 120 + src/uiTest/resources/reference/1.png | Bin 0 -> 6125 bytes src/uiTest/resources/reference/2.png | Bin 0 -> 6542 bytes 80 files changed, 3490 insertions(+), 2328 deletions(-) create mode 100644 src/main/kotlin/ir/mahozad/cutcon/ui/dialog/AnimatedDialog.kt delete mode 100644 src/test/kotlin/ir/mahozad/cutcon/viewmodel/IsScreenshotInputEnabledTest.kt create mode 100644 src/test/kotlin/ir/mahozad/cutcon/viewmodel/ScreenshotInputTest.kt create mode 100644 src/test/kotlin/ir/mahozad/cutcon/viewmodel/WindowWidthTest.kt create mode 100644 src/test/resources/reference/10.png create mode 100644 src/test/resources/reference/11.png create mode 100644 src/test/resources/reference/12.png create mode 100644 src/test/resources/reference/13.png create mode 100644 src/test/resources/test.avif create mode 100644 src/test/resources/test.jpg create mode 100644 src/test/resources/test.svgz create mode 100644 src/uiTest/kotlin/ir/mahozad/cutcon/ui/widget/DisplayTest.kt create mode 100644 src/uiTest/resources/reference/1.png create mode 100644 src/uiTest/resources/reference/2.png diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52001fd..ae813b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,15 +13,15 @@ jobs: - name: Checkout the code uses: actions/checkout@v4 - name: Set up a specific Java version - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "temurin" # OR adopt OR microsoft OR... - java-version: "21" + java-version: "17" - name: Run all unit tests run: ./gradlew test --stacktrace - name: Upload test reports if: always() # Run even if the previous steps failed - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tests-report path: build/reports/tests/ diff --git a/.idea/runConfigurations/Tests__All_.xml b/.idea/runConfigurations/Tests__All_.xml index 93f7fcd..c173dd9 100644 --- a/.idea/runConfigurations/Tests__All_.xml +++ b/.idea/runConfigurations/Tests__All_.xml @@ -17,8 +17,7 @@