Skip to content

Commit

Permalink
fix: lrc searchbox layout
Browse files Browse the repository at this point in the history
  • Loading branch information
lovegaoshi committed Nov 26, 2024
1 parent d5924cb commit 9648ff9
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 270 deletions.
2 changes: 1 addition & 1 deletion azusa-player-mobile
Submodule azusa-player-mobile updated 98 files
+32 −0 .github/workflows/android-release.yml
+16 −16 .github/workflows/play-release.yml
+16 −0 .github/workflows/play-review.yml
+0 −11 .yarn/patches/@react-native-gradle-plugin-npm-0.76.1-f19c439d00.patch
+0 −55 .yarn/patches/react-native-npm-0.76.1-c738a2fa39.patch
+18 −0 android/app/src/main/java/com/noxplay/noxplayer/APMVolumeListener.kt
+10 −0 android/app/src/main/java/com/noxplay/noxplayer/MainActivity.kt
+1 −1 android/app/src/main/res/xml/shortcuts.xml
+1 −10 android/settings.gradle
+1 −1 babel.config.js
+366 −296 ios/Podfile.lock
+33 −35 package.json
+0 −20 patches/@react-navigation+drawer+7.0.1.patch
+0 −13 patches/@sharcoux+slider+8.0.4.patch
+47 −0 patches/expo-image+2.0.1.patch
+0 −90 patches/react-native-draggable-flatlist+4.0.1.patch
+150 −0 patches/react-native-flashdrag-list+0.2.4.patch
+18 −0 patches/react-native-paper+5.12.5.patch
+0 −0 patches/react-native-screens+4.3.0.patch
+2 −0 src/@types/dotenv.d.ts
+2 −2 src/App.tsx
+13 −33 src/AzusaPlayer.tsx
+144 −1 src/components/billing/View.tsx
+0 −4 src/components/billing/bill.ts
+29 −32 src/components/bottomtab/NoxBottomTab.tsx
+0 −4 src/components/buttons/ShadowedElement.tsx
+2 −3 src/components/commonui/Collapsible.tsx
+161 −0 src/components/commonui/HorizontalCarousel.tsx
+0 −2 src/components/dialogs/GenericInputDialog.tsx
+26 −23 src/components/explore/SongTab.tsx
+2 −2 src/components/landscape/AzusaPlayerLandscape.tsx
+3 −3 src/components/landscape/LandscapeActions.tsx
+1 −1 src/components/login/bilibili/Bilibili.tsx
+11 −8 src/components/login/google/YTM.tsx
+11 −1 src/components/login/google/useYTMLogin.ts
+130 −0 src/components/miniplayer/Artwork.tsx
+1 −0 src/components/miniplayer/Constants.ts
+53 −0 src/components/miniplayer/Lrc.tsx
+132 −0 src/components/miniplayer/MiniControls.tsx
+40 −13 src/components/miniplayer/PlayerTopInfo.tsx
+36 −0 src/components/miniplayer/ProgressBar.tsx
+121 −0 src/components/miniplayer/TrackInfo.tsx
+135 −0 src/components/miniplayer/View.tsx
+4 −1 src/components/player/Lyric.tsx
+1 −0 src/components/player/TrackInfo/ABSliderMenu.tsx
+2 −1 src/components/player/TrackInfo/SongMenu.tsx
+0 −34 src/components/player/TrackInfo/TrackInfo.tsx
+2 −18 src/components/player/TrackInfo/TrackInfoTemplate.tsx
+0 −27 src/components/player/View.tsx
+10 −11 src/components/player/controls/PlayerProgressControls.tsx
+32 −11 src/components/player/controls/ProgressBar.tsx
+2 −2 src/components/player/controls/ThumbsUpButton.tsx
+3 −3 src/components/player/controls/usePlayerControls.ts
+1 −0 src/components/playlist/SongList/SongInfo.tsx
+2 −4 src/components/playlist/SongList/SongList.tsx
+8 −4 src/components/playlist/usePlaylistRN.ts
+1 −1 src/components/playlists/PlaylistItem.tsx
+45 −40 src/components/playlists/Playlists.tsx
+3 −2 src/components/playlists/View.tsx
+13 −29 src/components/setting/AboutSettings.tsx
+21 −10 src/components/setting/DeveloperSettings.tsx
+3 −2 src/components/setting/DownloadSettings.tsx
+6 −2 src/components/setting/GeneralSettings.tsx
+1 −1 src/components/setting/LanguageSettings.tsx
+16 −3 src/components/setting/View.tsx
+1 −1 src/components/setting/appearances/NoWeebButton.tsx
+2 −2 src/components/setting/appearances/SelectDarkModeButton.tsx
+1 −1 src/components/setting/appearances/SelectPhotoButton.tsx
+68 −156 src/components/setting/appearances/SkinSettings.tsx
+2 −1 src/components/setting/appearances/View.tsx
+3 −72 src/components/setting/helpers/BooleanSetting.tsx
+16 −0 src/components/setting/helpers/RenderSetting.tsx
+67 −0 src/components/setting/helpers/SelectSetting.tsx
+0 −0 src/components/setting/helpers/SettingEntry.ts
+63 −0 src/components/setting/helpers/SettingListItem.tsx
+1 −1 src/components/setting/plugins/MusicFreeButton.tsx
+1 −1 src/components/setting/plugins/View.tsx
+5 −0 src/components/style.ts
+0 −1 src/components/styles/NoxThemeGen.js
+2 −2 src/hooks/useAccentColor.ts
+30 −11 src/hooks/useActiveTrack.ts
+18 −11 src/hooks/useSetupPlayer.ts
+1 −3 src/hooks/useTPControls.ts
+114 −22 src/hooks/useVIP.ts
+26 −2 src/localization/en/translation.json
+26 −2 src/localization/zhcn/translation.json
+3 −0 src/objects/Storage.ts
+37 −23 src/services/PlaybackService.ts
+0 −6 src/stores/useApp.ts
+8 −1 src/stores/useSnack.ts
+9 −0 src/types/component.d.ts
+3 −0 src/types/storage.d.ts
+12 −5 src/utils/Bilibili/BiliUser.ts
+1 −0 src/utils/RNUtils.ts
+2 −2 src/utils/mediafetch/ytbSearch.ytbi.ts
+0 −2 src/utils/mediafetch/ytbvideo.ytbi.ts
+5 −0 src/utils/muse.ts
+901 −432 yarn.lock
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@babel/preset-typescript": "^7.26.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
"@types/base-64": "^1.0.2",
"@types/chrome": "^0.0.280",
"@types/chrome": "^0.0.287",
"@types/he": "^1.2.3",
"@types/js-base64": "^3.3.1",
"@types/md5": "^2.3.5",
Expand Down Expand Up @@ -53,13 +53,13 @@
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^2.9.2",
"node-sass": "^9.0.0",
"prettier": "^3.3.3",
"prettier": "^3.4.1",
"progress-bar-webpack-plugin": "^2.1.0",
"react-refresh": "^0.14.2",
"sass-loader": "^16.0.3",
"style-loader": "^4.0.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.6.3",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"typescript": "^5.7.2",
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4",
"webpack-config-utils": "^2.3.1",
Expand All @@ -70,20 +70,20 @@
"not dead"
],
"dependencies": {
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@ffmpeg/core": "^0.12.6",
"@ffmpeg/ffmpeg": "^0.12.10",
"@ffmpeg/util": "^0.12.1",
"@fontsource/roboto": "^5.1.0",
"@fortawesome/fontawesome-free": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/fontawesome-free": "^6.7.1",
"@fortawesome/free-brands-svg-icons": "^6.7.1",
"@hello-pangea/dnd": "^17.0.0",
"@mui/icons-material": "^6.1.6",
"@mui/lab": "6.0.0-beta.14",
"@mui/material": "^6.1.6",
"@mui/styles": "^6.1.6",
"axios": "^1.7.7",
"@mui/icons-material": "^6.1.8",
"@mui/lab": "6.0.0-dev.240424162023-9968b4889d",
"@mui/material": "^6.1.8",
"@mui/styles": "^6.1.8",
"axios": "^1.7.8",
"base-64": "^1.0.0",
"base64-js": "^1.5.1",
"big-integer": "^1.6.52",
Expand All @@ -101,7 +101,7 @@
"file-saver": "^2.0.5",
"fs": "^0.0.1-security",
"he": "^1.2.0",
"i18next": "^23.16.5",
"i18next": "^23.16.8",
"libmuse": "https://github.com/lovegaoshi/muse.git#commit=0bffe2319baf825037bece6869d360d6d307eb72",
"material-ui-confirm": "^3.0.16",
"md5": "^2.3.0",
Expand All @@ -115,7 +115,7 @@
"react-contexify": "^6.0.0",
"react-dom": "^18.3.1",
"react-hotkeys-hook": "^4.6.1",
"react-i18next": "^15.1.1",
"react-i18next": "^15.1.2",
"react-jinke-music-player": "git+https://[email protected]/lovegaoshi/react-music-player.git",
"react-lrc": "^3.2.1",
"react-swipeable": "^7.0.2",
Expand Down
87 changes: 33 additions & 54 deletions src/components/lyric/Lyric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@ import useApp from '@stores/useApp';
import useLyric from '@hooks/useLyric';
import LyricSearchBar from './LyricSearchBar';

const styles = () => ({
inputOffset: {
height: 40,
width: 123,
},
inputLrc: {
height: 40,
width: 375,
},
inputSelect: {
height: 40,
width: 500,
},
});

interface Props {
currentAudio: NoxMediaChrome.RJKMAudio;
}
Expand Down Expand Up @@ -81,7 +66,7 @@ function LrcView({ lyricOffset, lrc, className }: LrcViewProps) {
);
}

export default withStyles(styles)((props: Props) => {
export default (props: Props) => {
const { colorTheme, ScrollBar } = useApp((state) => state.playerStyle);
const [songTitle, setSongTitle] = useState('');
const debouncedSongTitle = useDebouncedValue(songTitle, 1000);
Expand Down Expand Up @@ -124,35 +109,34 @@ export default withStyles(styles)((props: Props) => {
}}
/>
</Grid>
<Grid sx={mStyles.lrcInputGrid} size={12} container spacing={0}>
<TextField
sx={mStyles.lrcOffsetGrid}
type='number'
variant='outlined'
label='歌词补偿(毫秒)'
InputProps={{
className: classes.inputOffset,
}}
value={usedLyric.currentTimeOffset}
onChange={onLrcOffsetChange}
/>
<TextField
variant='outlined'
label='歌词搜索'
InputProps={{
className: classes.inputLrc,
}}
InputLabelProps={{
shrink: true,
}}
placeholder={songTitle}
value={songTitle}
onChange={(e) => setSongTitle(e.target.value)}
/>
</Grid>

<Grid sx={mStyles.lrcSearchBarGrid} size={12}>
<LyricSearchBar currentAudio={currentAudio} usedLyric={usedLyric} />
<Grid sx={mStyles.lrcInputGrid} size={12} container spacing={1}>
<Grid size={3}>
<TextField
sx={mStyles.lrcOffsetGrid}
type='number'
inputProps={mStyles.lrcOffsetInput}
variant='outlined'
label='歌词补偿(毫秒)'
value={usedLyric.currentTimeOffset}
onChange={onLrcOffsetChange}
/>
</Grid>
<Grid size={'grow'}>
<TextField
sx={mStyles.lrcSearchGrid}
variant='outlined'
label='歌词搜索'
placeholder={songTitle}
value={songTitle}
onChange={(e) => setSongTitle(e.target.value)}
/>
</Grid>
<Grid sx={mStyles.lrcSearchBarGrid} size={12}>
<LyricSearchBar
currentAudio={currentAudio}
usedLyric={usedLyric}
/>
</Grid>
</Grid>
</Grid>
</Grid>
Expand All @@ -165,7 +149,7 @@ export default withStyles(styles)((props: Props) => {
</Grid>
</Grid>
);
});
};

const mStyles = {
mainContainer: { maxHeight: '100vh', minHeight: '100vh', overflow: 'hidden' },
Expand All @@ -184,29 +168,24 @@ const mStyles = {
overflow: 'hidden',
},
lrcInputGrid: {
paddingTop: '12px',
align: 'center',
paddingTop: '8px',
paddingLeft: '2px',
overflow: 'hidden',
width: '500px',
},
lrcOffsetGrid: {
align: 'right',
paddingTop: '8px',
paddingRight: '2px',
overflow: 'hidden',
},
lrcOffsetInput: { step: '500' },
lrcSearchGrid: {
align: 'center',
paddingTop: '8px',
overflow: 'hidden',
maxWidth: 'fit-content',
width: '-webkit-fill-available',
},
lrcSearchBarGrid: {
align: 'center',
paddingTop: '8px',
paddingLeft: '2px',
overflow: 'hidden',
},
lrcGrid: {
paddingBottom: 10,
Expand Down
6 changes: 5 additions & 1 deletion src/components/lyric/LyricSearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function LyricSearchBar({ currentAudio, usedLyric }: Props) {
onChange={onOptionSet}
id='LyricSearchBar'
options={lrcOptions}
sx={{ width: 500 }}
sx={style}
size='small'
renderInput={(params) => <TextField {...params} label='歌词选择' />}
renderOption={(props, option) => (
Expand All @@ -41,3 +41,7 @@ export default function LyricSearchBar({ currentAudio, usedLyric }: Props) {
</div>
);
}

const style = {
width: '-webkit-fill-available',
};
Loading

0 comments on commit 9648ff9

Please sign in to comment.