Skip to content

Commit

Permalink
Merge pull request #717 from lovegaoshi/dev
Browse files Browse the repository at this point in the history
feat: miniplayer collapse on sharemenu
  • Loading branch information
lovegaoshi authored Jan 10, 2025
2 parents ab2e16e + 3675a17 commit f12fc0b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/dialogs/NoxInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface InputProps {
text: string;
setText: (text: string) => void;
secureTextEntry?: boolean;
style?: TextStyle;
style?: TextStyle | TextStyle[];
reactNative?: boolean;
numberOfLines?: number;
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/miniplayer/View.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import TrackInfo from './TrackInfo';
import PlayerControls from '../player/controls/PlayerProgressControls';
import Lrc from './Lrc';
import ProgressBar from './ProgressBar';
import { useNoxSetting } from '@stores/useApp';

const SnapToRatio = 0.15;

Expand Down Expand Up @@ -110,7 +111,10 @@ export default () => {
};
});

useEffect(expand, []);
useEffect(() => {
expand();
useNoxSetting.setState({ collapse, expand });
}, []);

return (
<GestureDetector gesture={lrcVisible ? disabledGesture : scrollDragGesture}>
Expand Down
2 changes: 2 additions & 0 deletions src/components/playlist/BiliSearch/BiliSearchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default ({
const setExternalSearchText = useNoxSetting(
state => state.setExternalSearchText,
);
const miniPlayerCollapse = useNoxSetting(state => state.collapse);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [sharedData, setSharedData] = useState<any>(null);
const [, setSharedMimeType] = useState<string | null>(null);
Expand Down Expand Up @@ -83,6 +84,7 @@ export default ({
route: NoxRoutes.PlayerHome,
options: { screen: NoxRoutes.Playlist },
});
miniPlayerCollapse();
return handleSearch(data);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/playlists/Playlists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export default () => {
copy.splice(toIndex, 0, removed[0]!);
setPlaylistIds(copy);
}}
extraData={[currentPlaylist.id, currentPlayingList.id]}
extraData={[currentPlaylist.id, currentPlayingList.id, playerStyle]}
/>
</View>
<View style={styles.bottomInfo}>
Expand Down
8 changes: 4 additions & 4 deletions src/components/setting/appearances/NoWeebDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const NoWeebDialog = ({ visible, setVisible }: Props) => {
<View style={styles.colorBlockSpace} />
<Text>{t('AppearanceSettings.PrimaryColor')}</Text>
<NoxInput
style={styles.marginTop}
style={[styles.marginTop, { color: playerStyle.colors.onSurface }]}
autofocus={false}
selectTextOnFocus={false}
text={primaryColor}
Expand All @@ -93,7 +93,7 @@ const NoWeebDialog = ({ visible, setVisible }: Props) => {
<View style={styles.colorBlockSpace} />
<Text>{t('AppearanceSettings.SecondaryColor')}</Text>
<NoxInput
style={styles.marginTop}
style={[styles.marginTop, { color: playerStyle.colors.onSurface }]}
autofocus={false}
selectTextOnFocus={false}
text={secondaryColor}
Expand All @@ -113,7 +113,7 @@ const NoWeebDialog = ({ visible, setVisible }: Props) => {
<View style={styles.colorBlockSpace} />
<Text>{t('AppearanceSettings.ContrastColor')}</Text>
<NoxInput
style={styles.marginTop}
style={[styles.marginTop, { color: playerStyle.colors.onSurface }]}
autofocus={false}
selectTextOnFocus={false}
text={contrastColor}
Expand All @@ -133,7 +133,7 @@ const NoWeebDialog = ({ visible, setVisible }: Props) => {
<View style={styles.colorBlockSpace} />
<Text>{t('AppearanceSettings.BackgroundColor')}</Text>
<NoxInput
style={styles.marginTop}
style={[styles.marginTop, { color: playerStyle.colors.onSurface }]}
autofocus={false}
selectTextOnFocus={false}
text={backgroundColor}
Expand Down
1 change: 1 addition & 0 deletions src/components/styles/AzusaThemeRaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export default {
colors: {
background: 'rgba(255, 255, 255, 0.4)',
karaokeOn: 'rgba(103, 80, 164, 1)',
karaokeOff: 'rgba(83, 79, 89, 1)',
},
playerControlIconContained: undefined,
loadingIcon:
Expand Down
4 changes: 4 additions & 0 deletions src/stores/useAPMUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export interface APMUIStore {
setSongMenuVisible: (val: boolean) => void;
songMenuSongIndexes: number[];
setSongMenuSongIndexes: (val: number[]) => void;
collapse: () => void;
expand: () => void;
}

const store: StateCreator<APMUIStore, [], [], APMUIStore> = set => ({
Expand Down Expand Up @@ -66,6 +68,8 @@ const store: StateCreator<APMUIStore, [], [], APMUIStore> = set => ({
setSongMenuVisible: val => set({ songMenuVisible: val }),
songMenuSongIndexes: [],
setSongMenuSongIndexes: val => set({ songMenuSongIndexes: val }),
collapse: () => void 0,
expand: () => void 0,
});

export default store;

0 comments on commit f12fc0b

Please sign in to comment.