From a6bc3e2ed9055adf0a1c9b1318ccb4d96fcbcf5c Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Mon, 15 Apr 2024 08:37:25 -0700 Subject: [PATCH 1/7] chore: AGP 8.3 --- android/build.gradle | 4 ++-- android/gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 63e697af..847cd5aa 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -20,10 +20,10 @@ buildscript { mavenCentral() } dependencies { - classpath('com.android.tools.build:gradle:8.1.4') + classpath('com.android.tools.build:gradle:8.3.1') classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") } } -apply plugin: "com.facebook.react.rootproject" \ No newline at end of file +apply plugin: "com.facebook.react.rootproject" diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 0ad737d5..fce403e4 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From c1f7cc8cf2ed512af205b99d92cf7bf92f5d11f8 Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Mon, 15 Apr 2024 09:41:36 -0700 Subject: [PATCH 2/7] chore: dep upgrade --- android/app/build.gradle | 2 +- ...ch => react-native-blob-util+0.19.9.patch} | 0 .../react-native-vector-icons+10.0.3.patch | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) rename patches/{react-native-blob-util+0.19.8.patch => react-native-blob-util+0.19.9.patch} (100%) create mode 100644 patches/react-native-vector-icons+10.0.3.patch diff --git a/android/app/build.gradle b/android/app/build.gradle index bc687b11..df0d2f3b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -160,7 +160,7 @@ dependencies { implementation jscFlavor } implementation "androidx.core:core-ktx:1.12.0" - implementation 'androidx.core:core-google-shortcuts:1.0.0' + implementation 'androidx.core:core-google-shortcuts:1.1.0' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/patches/react-native-blob-util+0.19.8.patch b/patches/react-native-blob-util+0.19.9.patch similarity index 100% rename from patches/react-native-blob-util+0.19.8.patch rename to patches/react-native-blob-util+0.19.9.patch diff --git a/patches/react-native-vector-icons+10.0.3.patch b/patches/react-native-vector-icons+10.0.3.patch new file mode 100644 index 00000000..86067ae0 --- /dev/null +++ b/patches/react-native-vector-icons+10.0.3.patch @@ -0,0 +1,19 @@ +--- a/node_modules/react-native-vector-icons/fonts.gradle ++++ b/node_modules/react-native-vector-icons/fonts.gradle +@@ -27,11 +27,15 @@ afterEvaluate { + android.applicationVariants.all { def variant -> + def targetName = variant.name.capitalize() + def lintVitalAnalyzeTask = tasks.findByName("lintVitalAnalyze${targetName}") +- + if (lintVitalAnalyzeTask) { + lintVitalAnalyzeTask.dependsOn(fontCopyTask) + } + ++ def generateReportTask = tasks.findByName("generate${targetName}LintVitalReportModel") ++ if (generateReportTask) { ++ generateReportTask.dependsOn(fontCopyTask) ++ } ++ + def generateAssetsTask = tasks.findByName("generate${targetName}Assets") + generateAssetsTask.dependsOn(fontCopyTask) + } From 502c5b6d4cd1f4439a3a694b65b189908922e103 Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:07:37 -0700 Subject: [PATCH 3/7] chore: disable progress wavy --- src/components/player/controls/ProgressWavy.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/player/controls/ProgressWavy.tsx b/src/components/player/controls/ProgressWavy.tsx index c02653b2..39edcf10 100644 --- a/src/components/player/controls/ProgressWavy.tsx +++ b/src/components/player/controls/ProgressWavy.tsx @@ -13,7 +13,7 @@ export default () => { return ( - {playerSetting.wavyProgressBar && ( + {false && playerSetting.wavyProgressBar && ( Date: Tue, 16 Apr 2024 10:40:58 -0700 Subject: [PATCH 4/7] feat: scroll to active song at playlist change --- src/components/playlist/SongList/SongList.tsx | 2 +- src/components/playlist/usePlaylistRN.ts | 4 ++-- src/components/playlists/Playlists.tsx | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/playlist/SongList/SongList.tsx b/src/components/playlist/SongList/SongList.tsx index d6e7f52a..06d113b3 100644 --- a/src/components/playlist/SongList/SongList.tsx +++ b/src/components/playlist/SongList/SongList.tsx @@ -45,7 +45,7 @@ const PlaylistList = () => { const [contentViewHeight, setContentViewHeight] = useState(0); const [scrollPositionY, setScrollPositionY] = useState(0); - useEffect(() => scrollTo(), [songListScrollCounter]); + useEffect(() => scrollTo(-1, true), [songListScrollCounter]); useFocusEffect( React.useCallback(() => { diff --git a/src/components/playlist/usePlaylistRN.ts b/src/components/playlist/usePlaylistRN.ts index 504780b8..a3828729 100644 --- a/src/components/playlist/usePlaylistRN.ts +++ b/src/components/playlist/usePlaylistRN.ts @@ -118,12 +118,12 @@ export default (playlist: NoxMedia.Playlist) => { usedPlaylist.playSong(song, playSongCallback); }; - const scrollTo = (toIndex = -1) => { + const scrollTo = (toIndex = -1, reset = false) => { const currentIndex = toIndex < 0 ? playlist.songList.findIndex(song => song.id === currentPlayingId) : toIndex; - if (currentIndex > -1) { + if (currentIndex > -1 || reset) { playlistRef.current?.scrollToIndex({ index: currentIndex, viewPosition: 0.5, diff --git a/src/components/playlists/Playlists.tsx b/src/components/playlists/Playlists.tsx index 1b1a5f05..bf70a07a 100644 --- a/src/components/playlists/Playlists.tsx +++ b/src/components/playlists/Playlists.tsx @@ -31,6 +31,7 @@ export default () => { const addPlaylistButtonRef = useRef(null); const setCurrentPlaylist = useNoxSetting(state => state.setCurrentPlaylist); const setPlaylistIds = useNoxSetting(state => state.setPlaylistIds); + const scroll = useNoxSetting(state => state.incSongListScrollCounter); const { removePlaylist } = usePlaylistAA(); const { TwoWayAlert } = useAlert(); // HACK: I know its bad! But somehow this hook isnt updating in its own @@ -51,6 +52,7 @@ export default () => { const goToPlaylist = (playlistId: string) => { setCurrentPlaylist(playlists[playlistId]); + scroll(); navigation.navigate(NoxRoutes.Playlist as never); }; From 6e83ad47f1ca75e063b43fb9c940e4ca0529bf72 Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:44:06 -0700 Subject: [PATCH 5/7] chore: dep upgrade --- package.json | 8 ++-- yarn.lock | 122 +++++++++++++++++++++++++-------------------------- 2 files changed, 65 insertions(+), 65 deletions(-) diff --git a/package.json b/package.json index 0334cee8..effff2e2 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@sentry/react-native": "^5.20.0", "@sharcoux/slider": "^7.1.1", "@shopify/flash-list": "^1.6.4", - "@shopify/react-native-skia": "0.1.225", + "@shopify/react-native-skia": "1.2.0", "axios": "^1.6.8", "babel-plugin-transform-remove-console": "^6.9.4", "base-64": "^1.0.0", @@ -128,15 +128,15 @@ "@types/jest": "^29.5.12", "@types/md5": "^2.3.5", "@types/node": "^20.12.7", - "@types/react": "^18.2.78", + "@types/react": "^18.2.79", "@types/react-native": "^0.73.0", "@types/react-native-background-timer": "^2.0.2", "@types/react-native-share-menu": "^5.0.5", "@types/react-native-video": "^5.0.20", "@types/react-test-renderer": "^18.0.6", "@types/uuid": "^9.0.8", - "@typescript-eslint/eslint-plugin": "^7.6.0", - "@typescript-eslint/parser": "^7.6.0", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "@welldone-software/why-did-you-render": "^8.0.1", "argparse": "^2.0.1", "babel-jest": "^29.6.4", diff --git a/yarn.lock b/yarn.lock index a62df8cd..f8788ea2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4046,13 +4046,13 @@ recyclerlistview "4.2.0" tslib "2.4.0" -"@shopify/react-native-skia@0.1.225": - version "0.1.225" - resolved "https://registry.npmjs.org/@shopify/react-native-skia/-/react-native-skia-0.1.225.tgz#78fe35fa6a080e5b10b25110490868638250295b" - integrity sha512-EVqFd8JmE2Phh1CQpIKbJqjS9tacB0wKMJYjQZxc7W9xkXy7euKDNAps+xwG/yVToHNXqT6qP4AGSTT4mtu5Jg== +"@shopify/react-native-skia@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@shopify/react-native-skia/-/react-native-skia-1.2.0.tgz#27b91b8b46c56de0d4a308e0c2fcea4dac35d17c" + integrity sha512-tIWk+mR/hMZFSMXHE6AlnPGjYlc7ZlK3UfjLjAiqwIFcO9/S+atzA+m6+5mVUm3kheamJIPOM/+Ode7BX9DlvA== dependencies: canvaskit-wasm "0.39.1" - react-reconciler "^0.27.0" + react-reconciler "0.27.0" "@sideway/address@^4.1.3": version "4.1.4" @@ -4503,10 +4503,10 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/react@^18.2.78": - version "18.2.78" - resolved "https://registry.npmjs.org/@types/react/-/react-18.2.78.tgz#94aec453d0ccca909998a2b4b2fd78af15a7d2fe" - integrity sha512-qOwdPnnitQY4xKlKayt42q5W5UQrSHjgoXNVEtxeqdITJ99k4VXJOP3vt8Rkm9HmgJpH50UNU+rlqfkfWOqp0A== +"@types/react@^18.2.79": + version "18.2.79" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.79.tgz#c40efb4f255711f554d47b449f796d1c7756d865" + integrity sha512-RwGAGXPl9kSXwdNTafkOEuFrTBD5SA2B3iEB96xi8+xu5ddUa/cpvyVCSNn+asgLCTHkb5ZxN8gbuibYJi4s1w== dependencies: "@types/prop-types" "*" csstype "^3.0.2" @@ -4576,16 +4576,16 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/eslint-plugin@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.6.0.tgz#1f5df5cda490a0bcb6fbdd3382e19f1241024242" - integrity sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A== +"@typescript-eslint/eslint-plugin@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.0.tgz#bf34a02f221811505b8bf2f31060c8560c1bb0a3" + integrity sha512-GJWR0YnfrKnsRoluVO3PRb9r5aMZriiMMM/RHj5nnTrBy1/wIgk76XCtCKcnXGjpZQJQRFtGV9/0JJ6n30uwpQ== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "7.6.0" - "@typescript-eslint/type-utils" "7.6.0" - "@typescript-eslint/utils" "7.6.0" - "@typescript-eslint/visitor-keys" "7.6.0" + "@typescript-eslint/scope-manager" "7.7.0" + "@typescript-eslint/type-utils" "7.7.0" + "@typescript-eslint/utils" "7.7.0" + "@typescript-eslint/visitor-keys" "7.7.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.3.1" @@ -4603,15 +4603,15 @@ "@typescript-eslint/typescript-estree" "5.62.0" debug "^4.3.4" -"@typescript-eslint/parser@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.6.0.tgz#0aca5de3045d68b36e88903d15addaf13d040a95" - integrity sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg== +"@typescript-eslint/parser@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.7.0.tgz#6b1b3ce76c5de002c43af8ae933613b0f2b4bcc6" + integrity sha512-fNcDm3wSwVM8QYL4HKVBggdIPAy9Q41vcvC/GtDobw3c4ndVT3K6cqudUmjHPw8EAp4ufax0o58/xvWaP2FmTg== dependencies: - "@typescript-eslint/scope-manager" "7.6.0" - "@typescript-eslint/types" "7.6.0" - "@typescript-eslint/typescript-estree" "7.6.0" - "@typescript-eslint/visitor-keys" "7.6.0" + "@typescript-eslint/scope-manager" "7.7.0" + "@typescript-eslint/types" "7.7.0" + "@typescript-eslint/typescript-estree" "7.7.0" + "@typescript-eslint/visitor-keys" "7.7.0" debug "^4.3.4" "@typescript-eslint/scope-manager@5.62.0": @@ -4622,13 +4622,13 @@ "@typescript-eslint/types" "5.62.0" "@typescript-eslint/visitor-keys" "5.62.0" -"@typescript-eslint/scope-manager@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.6.0.tgz#1e9972f654210bd7500b31feadb61a233f5b5e9d" - integrity sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w== +"@typescript-eslint/scope-manager@7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.7.0.tgz#3f0db079b275bb8b0cb5be7613fb3130cfb5de77" + integrity sha512-/8INDn0YLInbe9Wt7dK4cXLDYp0fNHP5xKLHvZl3mOT5X17rK/YShXaiNmorl+/U4VKCVIjJnx4Ri5b0y+HClw== dependencies: - "@typescript-eslint/types" "7.6.0" - "@typescript-eslint/visitor-keys" "7.6.0" + "@typescript-eslint/types" "7.7.0" + "@typescript-eslint/visitor-keys" "7.7.0" "@typescript-eslint/type-utils@5.62.0": version "5.62.0" @@ -4640,13 +4640,13 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/type-utils@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.6.0.tgz#644f75075f379827d25fe0713e252ccd4e4a428c" - integrity sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw== +"@typescript-eslint/type-utils@7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.7.0.tgz#36792ff4209a781b058de61631a48df17bdefbc5" + integrity sha512-bOp3ejoRYrhAlnT/bozNQi3nio9tIgv3U5C0mVDdZC7cpcQEDZXvq8inrHYghLVwuNABRqrMW5tzAv88Vy77Sg== dependencies: - "@typescript-eslint/typescript-estree" "7.6.0" - "@typescript-eslint/utils" "7.6.0" + "@typescript-eslint/typescript-estree" "7.7.0" + "@typescript-eslint/utils" "7.7.0" debug "^4.3.4" ts-api-utils "^1.3.0" @@ -4655,10 +4655,10 @@ resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== -"@typescript-eslint/types@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.6.0.tgz#53dba7c30c87e5f10a731054266dd905f1fbae38" - integrity sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ== +"@typescript-eslint/types@7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.7.0.tgz#23af4d24bf9ce15d8d301236e3e3014143604f27" + integrity sha512-G01YPZ1Bd2hn+KPpIbrAhEWOn5lQBrjxkzHkWvP6NucMXFtfXoevK82hzQdpfuQYuhkvFDeQYbzXCjR1z9Z03w== "@typescript-eslint/typescript-estree@5.62.0": version "5.62.0" @@ -4673,13 +4673,13 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.6.0.tgz#112a3775563799fd3f011890ac8322f80830ac17" - integrity sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw== +"@typescript-eslint/typescript-estree@7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.0.tgz#b5dd6383b4c6a852d7b256a37af971e8982be97f" + integrity sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ== dependencies: - "@typescript-eslint/types" "7.6.0" - "@typescript-eslint/visitor-keys" "7.6.0" + "@typescript-eslint/types" "7.7.0" + "@typescript-eslint/visitor-keys" "7.7.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -4701,17 +4701,17 @@ eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/utils@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.6.0.tgz#e400d782280b6f724c8a1204269d984c79202282" - integrity sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA== +"@typescript-eslint/utils@7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.7.0.tgz#3d2b6606a60ac34f3c625facfb3b3ab7e126f58d" + integrity sha512-LKGAXMPQs8U/zMRFXDZOzmMKgFv3COlxUQ+2NMPhbqgVm6R1w+nU1i4836Pmxu9jZAuIeyySNrN/6Rc657ggig== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.15" "@types/semver" "^7.5.8" - "@typescript-eslint/scope-manager" "7.6.0" - "@typescript-eslint/types" "7.6.0" - "@typescript-eslint/typescript-estree" "7.6.0" + "@typescript-eslint/scope-manager" "7.7.0" + "@typescript-eslint/types" "7.7.0" + "@typescript-eslint/typescript-estree" "7.7.0" semver "^7.6.0" "@typescript-eslint/visitor-keys@5.62.0": @@ -4722,12 +4722,12 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.6.0.tgz#d1ce13145844379021e1f9bd102c1d78946f4e76" - integrity sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw== +"@typescript-eslint/visitor-keys@7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.0.tgz#950148cf1ac11562a2d903fdf7acf76714a2dc9e" + integrity sha512-h0WHOj8MhdhY8YWkzIF30R379y0NqyOHExI9N9KCzvmu05EgG4FumeYa3ccfKUSphyWkWQE1ybVrgz/Pbam6YA== dependencies: - "@typescript-eslint/types" "7.6.0" + "@typescript-eslint/types" "7.7.0" eslint-visitor-keys "^3.4.3" "@ungap/structured-clone@^1.2.0": @@ -12376,9 +12376,9 @@ react-native@0.73.6: ws "^6.2.2" yargs "^17.6.2" -react-reconciler@^0.27.0: +react-reconciler@0.27.0: version "0.27.0" - resolved "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.27.0.tgz#360124fdf2d76447c7491ee5f0e04503ed9acf5b" + resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.27.0.tgz#360124fdf2d76447c7491ee5f0e04503ed9acf5b" integrity sha512-HmMDKciQjYmBRGuuhIaKA1ba/7a+UsM5FzOZsMO2JYHt9Jh8reCb7j1eDC95NOyUlKM9KRyvdx0flBuDvYSBoA== dependencies: loose-envify "^1.1.0" From 682181e7e1a126f440a48565b7330af4596ff9ac Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:48:12 -0700 Subject: [PATCH 6/7] chore: disable progress wavy --- src/components/player/controls/WavyAnimation.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/player/controls/WavyAnimation.tsx b/src/components/player/controls/WavyAnimation.tsx index b9b8f543..15adfeaa 100644 --- a/src/components/player/controls/WavyAnimation.tsx +++ b/src/components/player/controls/WavyAnimation.tsx @@ -3,12 +3,14 @@ import { Canvas, Path, Skia, - useClockValue, - useComputedValue, + useClock, LinearGradient, vec, } from '@shopify/react-native-skia'; -import { useDerivedValue, useSharedValue } from 'react-native-reanimated'; +import { + useDerivedValue as useComputedValue, + useSharedValue, +} from 'react-native-reanimated'; import { line, curveBasis } from 'd3'; import { colord } from 'colord'; @@ -34,7 +36,7 @@ export default function WaveAnimation({ }: Props) { const verticalOffset = useSharedValue(initialVerticalOffset); const amplitude = useSharedValue(initialAmplitude); - const clock = useClockValue(); + const clock = useClock(); const extrapolatedWidth = Math.max(width * progress * 0.9 - 3, 0); const parsedColor = colord(color); @@ -66,14 +68,14 @@ export default function WaveAnimation({ }; const animatedPath = useComputedValue(() => { - const current = (clock.current / 500) % 255; + const current = (clock.value / 500) % 255; const start = Skia.Path.MakeFromSVGString(createWavePath(current)); const end = Skia.Path.MakeFromSVGString(createWavePath(Math.PI * current)); return start!.interpolate(end!, 0.5)!; }, [clock, verticalOffset, progress]); const animatedPath2 = useComputedValue(() => { - const current = (clock.current / 700) % 255; + const current = (clock.value / 700) % 255; const start = Skia.Path.MakeFromSVGString(createWavePath(current)); const end = Skia.Path.MakeFromSVGString(createWavePath(Math.PI * current)); return start!.interpolate(end!, 0.5)!; From 8fed1f6a0928aaf8b7e6ce3a92398f89ffc12c7a Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:40:28 -0700 Subject: [PATCH 7/7] refactor: use flatlist in skin items --- .../setting/appearances/SkinSettings.tsx | 140 +++++++++--------- 1 file changed, 73 insertions(+), 67 deletions(-) diff --git a/src/components/setting/appearances/SkinSettings.tsx b/src/components/setting/appearances/SkinSettings.tsx index 050c2b80..7631515b 100644 --- a/src/components/setting/appearances/SkinSettings.tsx +++ b/src/components/setting/appearances/SkinSettings.tsx @@ -14,7 +14,7 @@ import { RadioButton, } from 'react-native-paper'; import Animated, { - Layout, + LinearTransition, LightSpeedInLeft, LightSpeedOutRight, useAnimatedStyle, @@ -23,7 +23,7 @@ import Animated, { runOnJS, } from 'react-native-reanimated'; import { - ScrollView, + FlatList, GestureDetector, Gesture, PanGesture, @@ -148,63 +148,65 @@ const SkinItem = ({ skin, checked, setChecked }: SkinItemProps) => { return ( - - - - - - - {`${skin.metaData.themeName} by ${skin.metaData.themeAuthor}`} - - {skin.metaData.themeDesc} - - - + + + + + + + + {`${skin.metaData.themeName} by ${skin.metaData.themeAuthor}`} + + {skin.metaData.themeDesc} + + + + + + + + - - - - - - + + ); @@ -218,7 +220,7 @@ const SkinSettings = () => { const getThemeID = (skin: NoxTheme.Style) => `${skin.metaData.themeName}.${skin.metaData.themeAuthor}`; const [checked, setChecked] = React.useState(getThemeID(playerStyle)); - const scrollViewRef = React.useRef(null); + const scrollViewRef = React.useRef(null); // eslint-disable-next-line @typescript-eslint/no-explicit-any const loadCustomSkin = async (skins: any) => { @@ -238,12 +240,8 @@ const SkinSettings = () => { theme => getThemeID(theme) === checked ); if (currentThemeIndex > -1) { - scrollViewRef.current?.scrollTo({ - x: 0, - y: Math.max( - 0, - currentThemeIndex * 107 - Dimensions.get('window').height / 2 - ), + scrollViewRef.current?.scrollToIndex({ + index: currentThemeIndex, animated: false, }); } @@ -257,16 +255,24 @@ const SkinSettings = () => { ]} > - - {allThemes.map(item => ( + console.error(e)} + getItemLayout={(data, index) => ({ + length: 107, + offset: 107 * index, + index, + })} + renderItem={({ item }) => ( - ))} - + )} + /> ); };