diff --git a/android/app/src/main/java/cn/toside/music/mobile/userApi/Console.java b/android/app/src/main/java/cn/toside/music/mobile/userApi/Console.java index 90cd4b0..25bc9b3 100644 --- a/android/app/src/main/java/cn/toside/music/mobile/userApi/Console.java +++ b/android/app/src/main/java/cn/toside/music/mobile/userApi/Console.java @@ -15,7 +15,7 @@ public class Console implements QuickJSContext.Console { private void sendLog(String type, String log) { Message message = this.eventHandler.obtainMessage(); - message.what = 1001; + message.what = HandlerWhat.LOG; message.obj = new Object[]{type, log}; Log.d("UserApi Log", "[" + type + "]" + log); this.eventHandler.sendMessage(message); diff --git a/src/components/player/ProgressBar.tsx b/src/components/player/ProgressBar.tsx index ae06755..0e50a40 100644 --- a/src/components/player/ProgressBar.tsx +++ b/src/components/player/ProgressBar.tsx @@ -2,7 +2,7 @@ import { memo, useCallback, useEffect, useMemo, useRef } from 'react' import { View, PanResponder } from 'react-native' import { createStyle } from '@/utils/tools' import { useTheme } from '@/store/theme/hook' -import { scaleSizeW } from '@/utils/pixelRatio' +import { scaleSizeW, scaleSizeH } from '@/utils/pixelRatio' import { useDrag } from '@/utils/hooks' // import { AppColors } from '@/theme' @@ -95,11 +95,9 @@ const Progress = ({ progress, duration }: { width: progressDotSize, height: progressDotSize, borderRadius: progressDotSize, - position: 'absolute', right: -progressDotSize / 2, - top: -(progressDotSize - progressHeight) / 2, + top: -(progressDotSize - progressHeightSize) / 2, backgroundColor: theme['c-primary-light-100'], - zIndex: 9, } as const }, [theme]) @@ -121,6 +119,7 @@ const Progress = ({ progress, duration }: { const progressContentPadding = 10 const progressHeight = 3.6 +const progressHeightSize = scaleSizeH(progressHeight) let progressDotSize = Math.round(scaleSizeW(12)) if (progressDotSize % 2 != 0) progressDotSize += 1 const styles = createStyle({ @@ -137,12 +136,12 @@ const styles = createStyle({ borderRadius: 4, }, progressDot: { - width: progressDotSize, - height: progressDotSize, - borderRadius: progressDotSize, + // width: progressDotSize, + // height: progressDotSize, + // borderRadius: progressDotSize, position: 'absolute', - right: -progressDotSize / 2, - top: -(progressDotSize - progressHeight) / 2, + // right: -progressDotSize / 2, + // top: -(progressDotSize - progressHeight) / 2, zIndex: 9, }, pressBar: { diff --git a/src/screens/PlayDetail/Horizontal/Pic.tsx b/src/screens/PlayDetail/Horizontal/Pic.tsx index 52f5068..59ea4a0 100644 --- a/src/screens/PlayDetail/Horizontal/Pic.tsx +++ b/src/screens/PlayDetail/Horizontal/Pic.tsx @@ -61,10 +61,12 @@ export default memo(({ componentId }: { componentId: string }) => { const styles = createStyle({ container: { - flex: 0, + flexShrink: 1, + flexGrow: 0, justifyContent: 'center', alignItems: 'center', // backgroundColor: 'rgba(0,0,0,0.1)', + overflow: 'hidden', }, content: { // elevation: 3, diff --git a/src/screens/PlayDetail/Horizontal/Player/ControlBtn.tsx b/src/screens/PlayDetail/Horizontal/Player/ControlBtn.tsx index 10f3892..72be881 100644 --- a/src/screens/PlayDetail/Horizontal/Player/ControlBtn.tsx +++ b/src/screens/PlayDetail/Horizontal/Player/ControlBtn.tsx @@ -7,6 +7,7 @@ import { playNext, playPrev, togglePlay } from '@/core/player/player' import { useIsPlay } from '@/store/player/hook' import { useLayout } from '@/utils/hooks' import { marginLeft } from '../constant' +import { BTN_WIDTH } from '../MoreBtn/Btn' // const WIDTH = scaleSizeW(48) @@ -43,9 +44,10 @@ const TogglePlayBtn = ({ size }: { size: number }) => { ) } +const MIN_SIZE = BTN_WIDTH * 1.1 export default () => { const { onLayout, height, width } = useLayout() - const size = Math.min(height * 0.65, (width - marginLeft) * 0.52 * 0.3) * global.lx.fontSize + const size = Math.max(Math.min(height * 0.65, (width - marginLeft) * 0.52 * 0.3) * global.lx.fontSize, MIN_SIZE) return ( @@ -58,7 +60,8 @@ export default () => { const styles = StyleSheet.create({ content: { - flex: 1, + flexGrow: 1, + flexShrink: 1, flexDirection: 'row', // paddingVertical: 8, gap: 22, diff --git a/src/screens/PlayDetail/Horizontal/Player/index.tsx b/src/screens/PlayDetail/Horizontal/Player/index.tsx index a40af98..292402f 100644 --- a/src/screens/PlayDetail/Horizontal/Player/index.tsx +++ b/src/screens/PlayDetail/Horizontal/Player/index.tsx @@ -20,9 +20,8 @@ export default memo(() => { const styles = createStyle({ container: { - flex: 1, - // flexShrink: 0, - // flexGrow: 1, + flexShrink: 0, + flexGrow: 1, marginLeft: marginLeftRaw, // paddingRight: 15, // backgroundColor: 'rgba(0,0,0,0.1)', diff --git a/src/screens/PlayDetail/Horizontal/index.tsx b/src/screens/PlayDetail/Horizontal/index.tsx index e79f88b..6403747 100644 --- a/src/screens/PlayDetail/Horizontal/index.tsx +++ b/src/screens/PlayDetail/Horizontal/index.tsx @@ -84,7 +84,8 @@ const styles = createStyle({ // backgroundColor: 'rgba(0,0,0,0.1)', }, leftContent: { - flex: 0, + flexShrink: 1, + flexGrow: 0, marginLeft: marginLeftRaw, // flexDirection: 'row', // backgroundColor: 'rgba(0,0,0,0.1)', diff --git a/src/screens/PlayDetail/Vertical/Player/components/ControlBtn.tsx b/src/screens/PlayDetail/Vertical/Player/components/ControlBtn.tsx index 89a538d..79da7c9 100644 --- a/src/screens/PlayDetail/Vertical/Player/components/ControlBtn.tsx +++ b/src/screens/PlayDetail/Vertical/Player/components/ControlBtn.tsx @@ -6,9 +6,7 @@ import { playNext, playPrev, togglePlay } from '@/core/player/player' import { useIsPlay } from '@/store/player/hook' import { createStyle } from '@/utils/tools' import { useLayout } from '@/utils/hooks' -// import { scaleSizeW } from '@/utils/pixelRatio' - -// const WIDTH = scaleSizeW(50) +import { BTN_WIDTH } from './MoreBtn/Btn' const PrevBtn = ({ size }: { size: number }) => { const theme = useTheme() @@ -43,9 +41,11 @@ const TogglePlayBtn = ({ size }: { size: number }) => { ) } +const MIN_SIZE = BTN_WIDTH * 1.2 + export default () => { const { onLayout, height, width } = useLayout() - const size = Math.min(height * 0.5, width * 0.4 * 0.33) * global.lx.fontSize + const size = Math.max(Math.min(height * 0.5, width * 0.4 * 0.33) * global.lx.fontSize, MIN_SIZE) return ( @@ -62,11 +62,10 @@ const styles = createStyle({ flexDirection: 'row', justifyContent: 'space-evenly', alignItems: 'center', - flex: 1, - paddingLeft: '4%', - paddingRight: '4%', - // paddingTop: '8.6%', - // paddingBottom: '8.6%', + flexGrow: 1, + flexShrink: 1, + paddingHorizontal: '4%', + paddingVertical: 6, // backgroundColor: 'rgba(0, 0, 0, .1)', }, cotrolBtn: { diff --git a/src/screens/PlayDetail/Vertical/Player/index.tsx b/src/screens/PlayDetail/Vertical/Player/index.tsx index 9d11a8d..c6aed4a 100644 --- a/src/screens/PlayDetail/Vertical/Player/index.tsx +++ b/src/screens/PlayDetail/Vertical/Player/index.tsx @@ -25,7 +25,8 @@ export default memo(() => { const styles = createStyle({ container: { - flex: 1, + flexShrink: 1, + flexGrow: 1, width: '100%', // paddingTop: progressContentPadding, // marginTop: -progressContentPadding, @@ -38,7 +39,7 @@ const styles = createStyle({ info: { flex: 0, flexDirection: 'row', - paddingBottom: 5, + // paddingBottom: 5, // justifyContent: 'flex-end', }, status: { diff --git a/src/screens/PlayDetail/Vertical/index.tsx b/src/screens/PlayDetail/Vertical/index.tsx index 05eb3fd..b2c0d2e 100644 --- a/src/screens/PlayDetail/Vertical/index.tsx +++ b/src/screens/PlayDetail/Vertical/index.tsx @@ -1,5 +1,5 @@ import { memo, useState, useRef, useMemo, useEffect } from 'react' -import { View, StyleSheet, AppState } from 'react-native' +import { View, AppState } from 'react-native' import Header from './components/Header' // import Aside from './components/Aside' @@ -76,7 +76,7 @@ export default memo(({ componentId }: { componentId: string }) => { @@ -89,7 +89,7 @@ export default memo(({ componentId }: { componentId: string }) => { */} - + @@ -97,32 +97,32 @@ export default memo(({ componentId }: { componentId: string }) => { ) }) -const styles = StyleSheet.create({ - container: { - flexGrow: 1, - flexShrink: 1, - backgroundColor: '#fff', - }, - pagerView: { - flex: 1, - }, - pageIndicator: { - flex: 0, - flexDirection: 'row', - justifyContent: 'center', - paddingTop: 10, - // backgroundColor: 'rgba(0,0,0,0.1)', - }, - pageIndicatorItem: { - height: 3, - width: '5%', - marginLeft: 2, - marginRight: 2, - borderRadius: 2, - }, - // player: { - // flex: 0, - // height: '36%', - // // backgroundColor: 'rgba(0,0,0,0.1)', - // }, -}) +// const styles = StyleSheet.create({ +// // container: { +// // flexGrow: 1, +// // flexShrink: 0, +// // backgroundColor: '#fff', +// // }, +// pagerView: { +// flex: 1, +// }, +// pageIndicator: { +// flex: 0, +// flexDirection: 'row', +// justifyContent: 'center', +// paddingTop: 10, +// // backgroundColor: 'rgba(0,0,0,0.1)', +// }, +// pageIndicatorItem: { +// height: 3, +// width: '5%', +// marginLeft: 2, +// marginRight: 2, +// borderRadius: 2, +// }, +// // player: { +// // flex: 0, +// // height: '36%', +// // // backgroundColor: 'rgba(0,0,0,0.1)', +// // }, +// })