|
@@ -1,5 +1,6 @@
|
|
|
import TitleBar from './TitleBar'
|
|
import TitleBar from './TitleBar'
|
|
|
-import { Animator, curves, display, PromptAction, promptAction, router, SymbolGlyphModifier, window } from '@kit.ArkUI';
|
|
|
|
|
|
|
+import { Animator,
|
|
|
|
|
+ curves, display, PromptAction, promptAction, router, SymbolGlyphModifier, window } from '@kit.ArkUI';
|
|
|
import { VideoItem } from '../viewmodel/VideoItem';
|
|
import { VideoItem } from '../viewmodel/VideoItem';
|
|
|
import {
|
|
import {
|
|
|
AppUtil,
|
|
AppUtil,
|
|
@@ -73,7 +74,6 @@ import { CommonConstants2 } from '../common/util/CommonConstants2';
|
|
|
import { hilog } from '@kit.PerformanceAnalysisKit';
|
|
import { hilog } from '@kit.PerformanceAnalysisKit';
|
|
|
import { LazyDataSource } from '../common/util/LazyDataSource';
|
|
import { LazyDataSource } from '../common/util/LazyDataSource';
|
|
|
import MediaTable from '../common/util/MediaTable';
|
|
import MediaTable from '../common/util/MediaTable';
|
|
|
-import { ImageKnifeComponent } from '@ohos/imageknife';
|
|
|
|
|
import NetAxiosUtil from '../common/util/NetAxiosUtil';
|
|
import NetAxiosUtil from '../common/util/NetAxiosUtil';
|
|
|
import ImageUtils from '../common/util/ImageUtils';
|
|
import ImageUtils from '../common/util/ImageUtils';
|
|
|
import { ringtone } from '@kit.RingtoneKit';
|
|
import { ringtone } from '@kit.RingtoneKit';
|
|
@@ -86,6 +86,7 @@ import { HSBColorPicker, HSBColorPickerLayout } from '@keke/color-picker'
|
|
|
import { DEBUG } from 'BuildProfile';
|
|
import { DEBUG } from 'BuildProfile';
|
|
|
import { LrcParser } from '@sgaolei/lrc_parser';
|
|
import { LrcParser } from '@sgaolei/lrc_parser';
|
|
|
import { IBestIcon } from "@ibestservices/ibest-ui";
|
|
import { IBestIcon } from "@ibestservices/ibest-ui";
|
|
|
|
|
+import app, { AppResponse } from '@system.app';
|
|
|
|
|
|
|
|
const TAG = 'LocalMusic';
|
|
const TAG = 'LocalMusic';
|
|
|
|
|
|
|
@@ -130,7 +131,7 @@ interface GeneratedObjectLiteralInterface_1 {
|
|
|
// DRM资源,需要配置支持的DRM类型, 以chinaDRM为例。
|
|
// DRM资源,需要配置支持的DRM类型, 以chinaDRM为例。
|
|
|
drmScheme: string;
|
|
drmScheme: string;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+const ITEM_HEIGHT: number = 58; // 列表项高度
|
|
|
//功能强大的音乐播放器
|
|
//功能强大的音乐播放器
|
|
|
@Preview
|
|
@Preview
|
|
|
@Component
|
|
@Component
|
|
@@ -172,10 +173,21 @@ export struct LocalMusic {
|
|
|
@State isShowHistory:boolean = true //是否显示最近播放
|
|
@State isShowHistory:boolean = true //是否显示最近播放
|
|
|
@State isCustomizeBg: boolean = false //自定义背景界面
|
|
@State isCustomizeBg: boolean = false //自定义背景界面
|
|
|
@State isGridMusic: boolean = false //是否网格布局
|
|
@State isGridMusic: boolean = false //是否网格布局
|
|
|
|
|
+ @State isScrollHide: boolean = false //是否滚动隐藏
|
|
|
|
|
+ @State isSameTimePlay: boolean = false //是否和其他app同时播放
|
|
|
@State customizeBgPath: string | undefined = '';
|
|
@State customizeBgPath: string | undefined = '';
|
|
|
@State isDarkMode: boolean = false
|
|
@State isDarkMode: boolean = false
|
|
|
@State lyricTextWeight: number = 400
|
|
@State lyricTextWeight: number = 400
|
|
|
@State currentSwiperIndex: number = 0
|
|
@State currentSwiperIndex: number = 0
|
|
|
|
|
+ @State blurValue: number = 0 //背景模糊
|
|
|
|
|
+ @State bgBrightness: number = 0 //背景亮度
|
|
|
|
|
+ private listScroller: ListScroller = new ListScroller()
|
|
|
|
|
+ private listArea: Area = {
|
|
|
|
|
+ width: 0,
|
|
|
|
|
+ height: 0,
|
|
|
|
|
+ position: {},
|
|
|
|
|
+ globalPosition: {}
|
|
|
|
|
+ }
|
|
|
@StorageProp('currentColorMode') @Watch('onColorModeChange') currentMode: number =
|
|
@StorageProp('currentColorMode') @Watch('onColorModeChange') currentMode: number =
|
|
|
ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT;
|
|
ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT;
|
|
|
|
|
|
|
@@ -363,21 +375,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
// 组件生命周期
|
|
// 组件生命周期
|
|
|
aboutToAppear() {
|
|
aboutToAppear() {
|
|
|
- this.sortType = PreferencesUtil.getNumberSync(SettingPage.SORT_TYPE, 4)
|
|
|
|
|
- this.isCustomizeBg = PreferencesUtil.getBooleanSync(SettingPage.IS_CUSTOMIZE_BG, false)
|
|
|
|
|
- this.customizeBgPath = PreferencesUtil.getStringSync(SettingPage.IS_CUSTOMIZE_BG_PATH, '')
|
|
|
|
|
- this.isGridMusic = PreferencesUtil.getBooleanSync(SettingPage.IS_GRID_MUSIC, false)
|
|
|
|
|
- if(this.isCustomizeBg){
|
|
|
|
|
- this.titleBarModel.setRightTitleStateNormalStyleColor(Color.Transparent)
|
|
|
|
|
- this.titleBarModel.setTitleBarBackground(Color.Transparent)
|
|
|
|
|
- this.titleBarModel.setTitleBarBottomLineColor(Color.Transparent)
|
|
|
|
|
- this.titleBarModel.setLeftTitleStateNormalStyleColor(Color.Transparent)
|
|
|
|
|
-
|
|
|
|
|
- }else{
|
|
|
|
|
- this.titleBarModel.setTitleBarBackground($r('app.color.title_bar_bg'))
|
|
|
|
|
- this.titleBarModel.setTitleBarBottomLineColor($r('app.color.title_bar_bg'))
|
|
|
|
|
- // this.titleBarModel .setRightTitleBackground($r('app.color.title_bar_bg'))
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.initSetting()
|
|
|
|
|
|
|
|
Utility.getAppName(getContext(this)).then((appName: string) => {
|
|
Utility.getAppName(getContext(this)).then((appName: string) => {
|
|
|
this.appName = appName
|
|
this.appName = appName
|
|
@@ -385,11 +383,6 @@ export struct LocalMusic {
|
|
|
this.packName = AppUtil.getBundleName()
|
|
this.packName = AppUtil.getBundleName()
|
|
|
this.loadCacheFromStorage(); // 加载缓存
|
|
this.loadCacheFromStorage(); // 加载缓存
|
|
|
|
|
|
|
|
- this.isSavePlayMode = PreferencesUtil.getBooleanSync(SettingPage.iS_SAVE_PLAY_MODE, true)
|
|
|
|
|
- if (this.isSavePlayMode) {
|
|
|
|
|
- this.playType = PreferencesUtil.getNumberSync('musicPlayType', 0)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.historyList = PreferencesUtil.getSync(LocalMusic.HISTORY_MUSIC, this.historyList) as Array<VideoItem>
|
|
this.historyList = PreferencesUtil.getSync(LocalMusic.HISTORY_MUSIC, this.historyList) as Array<VideoItem>
|
|
|
|
|
|
|
|
this.mkDownLoadDir()
|
|
this.mkDownLoadDir()
|
|
@@ -426,7 +419,8 @@ export struct LocalMusic {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
let event: Callback<InterruptEvent> = (event) => {
|
|
let event: Callback<InterruptEvent> = (event) => {
|
|
|
- LogUtils.getInstance().LOGI(`event: ${JSON.stringify(event)}`);
|
|
|
|
|
|
|
+ LogUtils.getInstance().LOGI(`onecold 与其他应用音频冲突 被截断点event: ${JSON.stringify(event)}`);
|
|
|
|
|
+ this.savePlaybackPosition()
|
|
|
if (event.hintType === InterruptHintType.INTERRUPT_HINT_PAUSE) {
|
|
if (event.hintType === InterruptHintType.INTERRUPT_HINT_PAUSE) {
|
|
|
this.pause();
|
|
this.pause();
|
|
|
} else if (event.hintType === InterruptHintType.INTERRUPT_HINT_RESUME) {
|
|
} else if (event.hintType === InterruptHintType.INTERRUPT_HINT_RESUME) {
|
|
@@ -479,11 +473,20 @@ export struct LocalMusic {
|
|
|
context.getApplicationContext().setColorMode(colorMode)
|
|
context.getApplicationContext().setColorMode(colorMode)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- doChangeSetting(){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ initSetting(){
|
|
|
this.sortType = PreferencesUtil.getNumberSync(SettingPage.SORT_TYPE, 4)
|
|
this.sortType = PreferencesUtil.getNumberSync(SettingPage.SORT_TYPE, 4)
|
|
|
this.isCustomizeBg = PreferencesUtil.getBooleanSync(SettingPage.IS_CUSTOMIZE_BG, false)
|
|
this.isCustomizeBg = PreferencesUtil.getBooleanSync(SettingPage.IS_CUSTOMIZE_BG, false)
|
|
|
this.customizeBgPath = PreferencesUtil.getStringSync(SettingPage.IS_CUSTOMIZE_BG_PATH, '')
|
|
this.customizeBgPath = PreferencesUtil.getStringSync(SettingPage.IS_CUSTOMIZE_BG_PATH, '')
|
|
|
this.isGridMusic = PreferencesUtil.getBooleanSync(SettingPage.IS_GRID_MUSIC, false)
|
|
this.isGridMusic = PreferencesUtil.getBooleanSync(SettingPage.IS_GRID_MUSIC, false)
|
|
|
|
|
+ this.isScrollHide = PreferencesUtil.getBooleanSync(SettingPage.IS_SCROLL_HIDE, false)
|
|
|
|
|
+ this.isSameTimePlay = PreferencesUtil.getBooleanSync(SettingPage.IS_SAMETIME_PLAY, false)
|
|
|
|
|
+ this.isSavePlayMode = PreferencesUtil.getBooleanSync(SettingPage.iS_SAVE_PLAY_MODE, true)
|
|
|
|
|
+ this.blurValue = PreferencesUtil.getNumberSync(SettingPage.CUSTOMIZE_BG_BLUR, 0)
|
|
|
|
|
+ this.bgBrightness = PreferencesUtil.getNumberSync(SettingPage.BG_BRIGHTNESS, 0)
|
|
|
|
|
+ if (this.isSavePlayMode) {
|
|
|
|
|
+ this.playType = PreferencesUtil.getNumberSync('musicPlayType', 0)
|
|
|
|
|
+ }
|
|
|
if(this.isCustomizeBg){
|
|
if(this.isCustomizeBg){
|
|
|
this.titleBarModel.setRightTitleStateNormalStyleColor(Color.Transparent)
|
|
this.titleBarModel.setRightTitleStateNormalStyleColor(Color.Transparent)
|
|
|
this.titleBarModel.setTitleBarBackground(Color.Transparent)
|
|
this.titleBarModel.setTitleBarBackground(Color.Transparent)
|
|
@@ -495,7 +498,10 @@ export struct LocalMusic {
|
|
|
this.titleBarModel.setRightTitleStateNormalStyleColor($r('app.color.title_bar_bg'))
|
|
this.titleBarModel.setRightTitleStateNormalStyleColor($r('app.color.title_bar_bg'))
|
|
|
this.titleBarModel.setLeftTitleStateNormalStyleColor($r('app.color.title_bar_bg'))
|
|
this.titleBarModel.setLeftTitleStateNormalStyleColor($r('app.color.title_bar_bg'))
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ doChangeSetting(){
|
|
|
|
|
+ this.initSetting()
|
|
|
this.doUpdateData()
|
|
this.doUpdateData()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -503,21 +509,16 @@ export struct LocalMusic {
|
|
|
if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
|
- this.hideDone = false;
|
|
|
|
|
- this.getUIContext().animateTo({
|
|
|
|
|
- duration: 300
|
|
|
|
|
- }, () => {
|
|
|
|
|
- this.bottomBarHeight = 55 + 0;
|
|
|
|
|
- this.topBarHeight = 50 + 0;
|
|
|
|
|
- this.barOpacity = 1;
|
|
|
|
|
- this.currentYOffset = 0;
|
|
|
|
|
- this.isHiding = false;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.setBarHeightNormal()
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onPageShow() {
|
|
onPageShow() {
|
|
|
|
|
+ app.setImageCacheCount(100);
|
|
|
|
|
+ // 设置解码前图片数据内存缓存上限为100MB (100MB=100*1024*1024B=104857600B)
|
|
|
|
|
+ app.setImageRawDataCacheSize(104857600);
|
|
|
Logger.info('onecold onPageShow currentBreakpoint= ' + this.currentBreakpoint)
|
|
Logger.info('onecold onPageShow currentBreakpoint= ' + this.currentBreakpoint)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1759,9 +1760,11 @@ export struct LocalMusic {
|
|
|
Column() {
|
|
Column() {
|
|
|
this.tabTitle()
|
|
this.tabTitle()
|
|
|
this.listViewTitle()
|
|
this.listViewTitle()
|
|
|
- this.getGridView()
|
|
|
|
|
- this.getListView()
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(this.isGridMusic){
|
|
|
|
|
+ this.getGridView()
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.getListView()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
|
.height('100%')
|
|
.height('100%')
|
|
@@ -1876,13 +1879,15 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
.hitTestBehavior(HitTestMode.Transparent)
|
|
.hitTestBehavior(HitTestMode.Transparent)
|
|
|
.position({ bottom: 0 }) // 将 Row 固定在底部
|
|
.position({ bottom: 0 }) // 将 Row 固定在底部
|
|
|
- .opacity(this.barOpacity)
|
|
|
|
|
|
|
+ .opacity(this.barBottomOpacity)
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.height('100%')
|
|
.height('100%')
|
|
|
.backgroundImage(this.isCustomizeBg?this.customizeBgPath:$r('app.color.bottom_control_background'))
|
|
.backgroundImage(this.isCustomizeBg?this.customizeBgPath:$r('app.color.bottom_control_background'))
|
|
|
.backgroundImageSize(this.isCoverOpacity()?{width:'100%'}:{ height: '100%'})
|
|
.backgroundImageSize(this.isCoverOpacity()?{width:'100%'}:{ height: '100%'})
|
|
|
.backgroundImagePosition(Alignment.Center)
|
|
.backgroundImagePosition(Alignment.Center)
|
|
|
|
|
+ .backdropBlur(this.blurValue)
|
|
|
|
|
+ .backgroundBrightness({rate:this.isCustomizeBg?0.1:0,lightUpDegree:this.bgBrightness})
|
|
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2195,7 +2200,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- .height(58)
|
|
|
|
|
|
|
+ .height(ITEM_HEIGHT)
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.visibility(this.isShowDir(item.name)?Visibility.Visible:Visibility.None)
|
|
.visibility(this.isShowDir(item.name)?Visibility.Visible:Visibility.None)
|
|
|
.opacity(this.opacityItem) // 绑定透明度
|
|
.opacity(this.opacityItem) // 绑定透明度
|
|
@@ -2312,7 +2317,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
- .height(58)
|
|
|
|
|
|
|
+ .height(ITEM_HEIGHT)
|
|
|
.justifyContent(FlexAlign.SpaceBetween)
|
|
.justifyContent(FlexAlign.SpaceBetween)
|
|
|
.stateStyles({
|
|
.stateStyles({
|
|
|
pressed: { opacity: 0.6 } // 按压反馈
|
|
pressed: { opacity: 0.6 } // 按压反馈
|
|
@@ -2533,6 +2538,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
|
|
+ // ToastUtil.showToast('当前的手机的折叠状态 ='+DisplayUtil.getFoldStatus())
|
|
|
if (this.modeType === 0) {
|
|
if (this.modeType === 0) {
|
|
|
if (ArrayUtil.isNotEmpty(this.getCurFileList())) {
|
|
if (ArrayUtil.isNotEmpty(this.getCurFileList())) {
|
|
|
this.doPlay(this.getCurFileList()[0])
|
|
this.doPlay(this.getCurFileList()[0])
|
|
@@ -2810,10 +2816,13 @@ export struct LocalMusic {
|
|
|
this.itemMove(index, index + 1)
|
|
this.itemMove(index, index + 1)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private scroller: Scroller = new Scroller();
|
|
|
|
|
+ @State startIndex:number = 0
|
|
|
|
|
+ @State endIndex:number = 0
|
|
|
@Builder
|
|
@Builder
|
|
|
getGridView(){
|
|
getGridView(){
|
|
|
|
|
|
|
|
- Grid() {
|
|
|
|
|
|
|
+ Grid(this.scroller) {
|
|
|
LazyForEach(this.dataSource, (item: VideoItem, index: number) => {
|
|
LazyForEach(this.dataSource, (item: VideoItem, index: number) => {
|
|
|
GridItem() {
|
|
GridItem() {
|
|
|
Stack({ alignContent: Alignment.Center }) {
|
|
Stack({ alignContent: Alignment.Center }) {
|
|
@@ -2861,6 +2870,13 @@ export struct LocalMusic {
|
|
|
this.left(index);
|
|
this.left(index);
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // if (this.offsetY > this.FIX_VP_Y * 0.7) {
|
|
|
|
|
+ // this.scroller.scrollToIndex(index + 10, true,ScrollAlign.CENTER);
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
.onActionEnd(() => {
|
|
.onActionEnd(() => {
|
|
|
this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
@@ -2887,15 +2903,20 @@ export struct LocalMusic {
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.height('100%')
|
|
.height('100%')
|
|
|
.editMode(true)
|
|
.editMode(true)
|
|
|
- .margin({ bottom: this.isCoverOpacity() ? 50 : 165 })
|
|
|
|
|
|
|
+ .margin({ bottom: this.isCoverOpacity() ? 80 : 175 })
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
|
.scrollBar(BarState.Off)
|
|
.scrollBar(BarState.Off)
|
|
|
.supportAnimation(true)
|
|
.supportAnimation(true)
|
|
|
- .cachedCount(20)
|
|
|
|
|
|
|
+ // .cachedCount(5)
|
|
|
.columnsTemplate('1fr '.repeat(this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_SM ? 2 : 4))
|
|
.columnsTemplate('1fr '.repeat(this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_SM ? 2 : 4))
|
|
|
.rowsGap(12)
|
|
.rowsGap(12)
|
|
|
.visibility(this.isGridMusic?Visibility.Visible:Visibility.None)
|
|
.visibility(this.isGridMusic?Visibility.Visible:Visibility.None)
|
|
|
.enableScrollInteraction(true)
|
|
.enableScrollInteraction(true)
|
|
|
|
|
+ // 滚轴滑动,记录下滑动时的起始位置和终点位置
|
|
|
|
|
+ .onScrollIndex((start: number, end: number) => {
|
|
|
|
|
+ this.startIndex = start
|
|
|
|
|
+ this.endIndex = end
|
|
|
|
|
+ })
|
|
|
.onScrollFrameBegin((offset: number) => {
|
|
.onScrollFrameBegin((offset: number) => {
|
|
|
//滚动小屏幕 比如puraX外屏和手机横屏可以隐藏bottomBarHeight topBarHeight
|
|
//滚动小屏幕 比如puraX外屏和手机横屏可以隐藏bottomBarHeight topBarHeight
|
|
|
if(this.isPhoneLan()){
|
|
if(this.isPhoneLan()){
|
|
@@ -2903,7 +2924,11 @@ export struct LocalMusic {
|
|
|
}else if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
}else if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
|
- this.setBarHeightNormal()
|
|
|
|
|
|
|
+ if(this.isScrollHide){
|
|
|
|
|
+ this.setBarHeightHide2(offset)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.setBarHeightNormal()
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
this.setBarHeightHide(offset)
|
|
this.setBarHeightHide(offset)
|
|
|
}
|
|
}
|
|
@@ -2921,7 +2946,7 @@ export struct LocalMusic {
|
|
|
Stack() {
|
|
Stack() {
|
|
|
|
|
|
|
|
Column() {
|
|
Column() {
|
|
|
- Image(StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.ic_avatar6') : item.pixelMapPath)
|
|
|
|
|
|
|
+ Image(StrUtil.isEmpty(item.pixelMapPath) ?Utility.getMusisBg2(index) : item.pixelMapPath)
|
|
|
.height(150)
|
|
.height(150)
|
|
|
.width(150)
|
|
.width(150)
|
|
|
.alt($r('app.media.ic_avatar6'))
|
|
.alt($r('app.media.ic_avatar6'))
|
|
@@ -3130,14 +3155,14 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
.width(180)
|
|
.width(180)
|
|
|
}
|
|
}
|
|
|
- .height('40%')
|
|
|
|
|
|
|
+ .height(item.type === CommonConstants.TYPE_IS_DIR ?'22%':'40%')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ private listMaxScrollOffsetY: number = 0
|
|
|
@Builder
|
|
@Builder
|
|
|
getListView() {
|
|
getListView() {
|
|
|
|
|
|
|
|
- List() {
|
|
|
|
|
|
|
+ List({ scroller: this.listScroller }) {
|
|
|
LazyForEach(this.dataSource, (item: VideoItem, index: number) => {
|
|
LazyForEach(this.dataSource, (item: VideoItem, index: number) => {
|
|
|
ListItem() {
|
|
ListItem() {
|
|
|
Column() {
|
|
Column() {
|
|
@@ -3191,7 +3216,9 @@ export struct LocalMusic {
|
|
|
.animation({ curve: Curve.Sharp, duration: 300 })
|
|
.animation({ curve: Curve.Sharp, duration: 300 })
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- .swipeAction((((this.modeType==3||this.modeType==2)&&this.isCanBack) && item.type !== CommonConstants.TYPE_IS_CSJAD &&
|
|
|
|
|
|
|
+ .swipeAction((
|
|
|
|
|
+ (this.modeType==0||this.modeType==1 ||((this.modeType==3||this.modeType==2)&&this.isCanBack))
|
|
|
|
|
+ && item.type !== CommonConstants.TYPE_IS_CSJAD &&
|
|
|
!this.isHistory) ? { end: this.DeleteButton(item, index, item.filePath) } : {}) //左滑
|
|
!this.isHistory) ? { end: this.DeleteButton(item, index, item.filePath) } : {}) //左滑
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
|
|
|
|
@@ -3254,7 +3281,23 @@ export struct LocalMusic {
|
|
|
this.itemMove(indexA, indexA - 1);
|
|
this.itemMove(indexA, indexA - 1);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ let curListOffset = this.listScroller.currentOffset()
|
|
|
|
|
+ // 获取手指信息
|
|
|
|
|
+ let fingerInfo = event.fingerList[0]
|
|
|
|
|
+ let clickPercentY =
|
|
|
|
|
+ (fingerInfo.globalY - Number(this.listArea.globalPosition.y)) / Number(this.listArea.height)
|
|
|
|
|
+ if (clickPercentY > 0.8 && !this.listScroller.isAtEnd()) {
|
|
|
|
|
+ let scrollVelocity = clickPercentY > 0.9 ? 4 : 2
|
|
|
|
|
+ if (this.listMaxScrollOffsetY - curListOffset.yOffset > scrollVelocity + 5) {
|
|
|
|
|
+ this.listScroller.scrollTo({xOffset: 0, yOffset: curListOffset.yOffset += scrollVelocity})
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (clickPercentY < 0.2 && curListOffset.yOffset >= 0) {
|
|
|
|
|
+ let scrollVelocity = clickPercentY < 0.1 ? 4 : 2
|
|
|
|
|
+ if (curListOffset.yOffset > scrollVelocity + 5) {
|
|
|
|
|
+ this.listScroller.scrollTo({xOffset: 0, yOffset: curListOffset.yOffset -= scrollVelocity})
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
.onActionEnd((event: GestureEvent) => {
|
|
.onActionEnd((event: GestureEvent) => {
|
|
@@ -3288,7 +3331,7 @@ export struct LocalMusic {
|
|
|
}, (item: VideoItem) => item.filePath)
|
|
}, (item: VideoItem) => item.filePath)
|
|
|
}
|
|
}
|
|
|
// .divider({ strokeWidth: 1, color: this.isDarkMode? '#333333':'#ffe9f0f0' })
|
|
// .divider({ strokeWidth: 1, color: this.isDarkMode? '#333333':'#ffe9f0f0' })
|
|
|
- .margin({ bottom: this.isCoverOpacity() ? 50 : 158 })
|
|
|
|
|
|
|
+ .margin({ bottom: this.isCoverOpacity() ? 80 : 166 })
|
|
|
.cachedCount(30)
|
|
.cachedCount(30)
|
|
|
.borderRadius(20)
|
|
.borderRadius(20)
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
@@ -3309,14 +3352,25 @@ export struct LocalMusic {
|
|
|
xxl: 20
|
|
xxl: 20
|
|
|
}).getValue(this.currentBreakpoint)
|
|
}).getValue(this.currentBreakpoint)
|
|
|
)
|
|
)
|
|
|
|
|
+ .onAreaChange((oldValue: Area, newValue: Area) => {
|
|
|
|
|
+ this.listArea = newValue
|
|
|
|
|
+ this.listMaxScrollOffsetY = this.videoLocalList.length * (ITEM_HEIGHT) - 10
|
|
|
|
|
+ })
|
|
|
.onScrollFrameBegin((offset: number) => {
|
|
.onScrollFrameBegin((offset: number) => {
|
|
|
|
|
+
|
|
|
//滚动小屏幕 比如puraX外屏和手机横屏可以隐藏bottomBarHeight topBarHeight
|
|
//滚动小屏幕 比如puraX外屏和手机横屏可以隐藏bottomBarHeight topBarHeight
|
|
|
if(this.isPhoneLan()){
|
|
if(this.isPhoneLan()){
|
|
|
this.setBarHeightHide(offset)
|
|
this.setBarHeightHide(offset)
|
|
|
}else if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
}else if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
|
|
|
+ if(this.isScrollHide){
|
|
|
|
|
+ this.setBarHeightHide2(offset)
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
this.setBarHeightNormal()
|
|
this.setBarHeightNormal()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}else{
|
|
}else{
|
|
|
this.setBarHeightHide(offset)
|
|
this.setBarHeightHide(offset)
|
|
|
}
|
|
}
|
|
@@ -3334,6 +3388,7 @@ export struct LocalMusic {
|
|
|
this.bottomBarHeight = 55 + 0;
|
|
this.bottomBarHeight = 55 + 0;
|
|
|
this.topBarHeight = 50 + 0;
|
|
this.topBarHeight = 50 + 0;
|
|
|
this.barOpacity = 1;
|
|
this.barOpacity = 1;
|
|
|
|
|
+ this.barBottomOpacity = 1
|
|
|
this.currentYOffset = 0;
|
|
this.currentYOffset = 0;
|
|
|
this.isHiding = false;
|
|
this.isHiding = false;
|
|
|
});
|
|
});
|
|
@@ -3346,9 +3401,11 @@ export struct LocalMusic {
|
|
|
this.bottomBarHeight = this.bottomBarHeight * (1 - this.currentYOffset / 100);
|
|
this.bottomBarHeight = this.bottomBarHeight * (1 - this.currentYOffset / 100);
|
|
|
this.topBarHeight = this.topBarHeight * (1 - this.currentYOffset / 100);
|
|
this.topBarHeight = this.topBarHeight * (1 - this.currentYOffset / 100);
|
|
|
this.barOpacity = 1 - this.currentYOffset / 100;
|
|
this.barOpacity = 1 - this.currentYOffset / 100;
|
|
|
|
|
+ this.barBottomOpacity = 1 - this.currentYOffset / 100;
|
|
|
} else {
|
|
} else {
|
|
|
this.topBarHeight = 0;
|
|
this.topBarHeight = 0;
|
|
|
this.bottomBarHeight = 0;
|
|
this.bottomBarHeight = 0;
|
|
|
|
|
+ this.barBottomOpacity = 0
|
|
|
this.barOpacity = 0;
|
|
this.barOpacity = 0;
|
|
|
this.hideDone = true;
|
|
this.hideDone = true;
|
|
|
}
|
|
}
|
|
@@ -3360,6 +3417,33 @@ export struct LocalMusic {
|
|
|
duration: 300
|
|
duration: 300
|
|
|
}, () => {
|
|
}, () => {
|
|
|
this.bottomBarHeight = 55 + 0;
|
|
this.bottomBarHeight = 55 + 0;
|
|
|
|
|
+ this.topBarHeight = 50 + 0;
|
|
|
|
|
+ this.barOpacity = 1;
|
|
|
|
|
+ this.barBottomOpacity = 1
|
|
|
|
|
+ this.currentYOffset = 0;
|
|
|
|
|
+ this.isHiding = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //这个方法没隐藏bottomBar,只隐藏topBar
|
|
|
|
|
+ setBarHeightHide2(offset: number){
|
|
|
|
|
+ if (offset > 0 && !this.hideDone) {
|
|
|
|
|
+ this.currentYOffset += offset;
|
|
|
|
|
+ if (this.currentYOffset <= 100) {
|
|
|
|
|
+ this.topBarHeight = this.topBarHeight * (1 - this.currentYOffset / 100);
|
|
|
|
|
+ this.barOpacity = 1 - this.currentYOffset / 100;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.topBarHeight = 0;
|
|
|
|
|
+ this.barOpacity = 0;
|
|
|
|
|
+ this.hideDone = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.isHiding = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (offset < 0 && this.isHiding) {
|
|
|
|
|
+ this.hideDone = false;
|
|
|
|
|
+ this.getUIContext().animateTo({
|
|
|
|
|
+ duration: 300
|
|
|
|
|
+ }, () => {
|
|
|
this.topBarHeight = 50 + 0;
|
|
this.topBarHeight = 50 + 0;
|
|
|
this.barOpacity = 1;
|
|
this.barOpacity = 1;
|
|
|
this.currentYOffset = 0;
|
|
this.currentYOffset = 0;
|
|
@@ -4607,6 +4691,7 @@ export struct LocalMusic {
|
|
|
@StorageProp('currentWidthBreakpoint') currentWidthBreakpoint: WidthBreakpoint | undefined = WidthBreakpoint.WIDTH_SM;
|
|
@StorageProp('currentWidthBreakpoint') currentWidthBreakpoint: WidthBreakpoint | undefined = WidthBreakpoint.WIDTH_SM;
|
|
|
@State topBarHeight: number = 50
|
|
@State topBarHeight: number = 50
|
|
|
@State barOpacity: number = 1
|
|
@State barOpacity: number = 1
|
|
|
|
|
+ @State barBottomOpacity: number = 1
|
|
|
private hideDone: boolean = false;
|
|
private hideDone: boolean = false;
|
|
|
@State currentYOffset: number = 0;
|
|
@State currentYOffset: number = 0;
|
|
|
@State bottomBarHeight: number = 55;
|
|
@State bottomBarHeight: number = 55;
|
|
@@ -4642,7 +4727,7 @@ export struct LocalMusic {
|
|
|
isPhoneLan() {
|
|
isPhoneLan() {
|
|
|
if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
|
&& this.currentBreakpoint !== BreakpointTypeEnum.SM) {
|
|
&& this.currentBreakpoint !== BreakpointTypeEnum.SM) {
|
|
|
- if (DisplayUtil.getFoldStatus() === 0 || DisplayUtil.getFoldStatus() === 2) {
|
|
|
|
|
|
|
+ if (DisplayUtil.getFoldStatus() === 0 ) {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -4882,6 +4967,7 @@ export struct LocalMusic {
|
|
|
this.setHighLyricTextSize(PreferencesUtil.getNumberSync('HighLyricTextSize', 1.23))
|
|
this.setHighLyricTextSize(PreferencesUtil.getNumberSync('HighLyricTextSize', 1.23))
|
|
|
this.lyricController.setLineSpace(PreferencesUtil.getNumberSync('LyricLineSpace', 52))
|
|
this.lyricController.setLineSpace(PreferencesUtil.getNumberSync('LyricLineSpace', 52))
|
|
|
this.changeLyricColor(PreferencesUtil.getStringSync('LyricColor', '#FFFFFF'))
|
|
this.changeLyricColor(PreferencesUtil.getStringSync('LyricColor', '#FFFFFF'))
|
|
|
|
|
+ this.changeLyricHightLightColor(PreferencesUtil.getStringSync('LyricHighLightColor', '#FFFFFF'))
|
|
|
this.isHightLightCenter = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_SIMI, false)
|
|
this.isHightLightCenter = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_SIMI, false)
|
|
|
this.lyricController.setHightLightCenter(this.isHightLightCenter)
|
|
this.lyricController.setHightLightCenter(this.isHightLightCenter)
|
|
|
this.lyricTextWeight = PreferencesUtil.getNumberSync('lyricTextWeight',400)
|
|
this.lyricTextWeight = PreferencesUtil.getNumberSync('lyricTextWeight',400)
|
|
@@ -5782,6 +5868,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
@State timeOffset: number = 0.0
|
|
@State timeOffset: number = 0.0
|
|
|
@State currentLyricColor: string = '#FFFFFF'
|
|
@State currentLyricColor: string = '#FFFFFF'
|
|
|
|
|
+ @State currentHighLightLyricColor: string = '#FF4081'
|
|
|
// 歌词字号状态
|
|
// 歌词字号状态
|
|
|
@State currentLyricSize: number = 20
|
|
@State currentLyricSize: number = 20
|
|
|
// 高亮歌词放大倍数
|
|
// 高亮歌词放大倍数
|
|
@@ -5789,6 +5876,25 @@ export struct LocalMusic {
|
|
|
@State currentLyricLineSpace: number = 52 //{
|
|
@State currentLyricLineSpace: number = 52 //{
|
|
|
@State currentLyricAlignMode: number = 1
|
|
@State currentLyricAlignMode: number = 1
|
|
|
@State blurDegree: number = 2
|
|
@State blurDegree: number = 2
|
|
|
|
|
+ @State isShowSelectColor: boolean = false
|
|
|
|
|
+ @State isShowHLSelectColor: boolean = false
|
|
|
|
|
+ // 构建颜色选择器
|
|
|
|
|
+ @Builder
|
|
|
|
|
+ SelectColor(isHighColor:boolean) {
|
|
|
|
|
+ Row({space: 10}) {
|
|
|
|
|
+ HSBColorPicker({
|
|
|
|
|
+ color: '#FFFFFF',
|
|
|
|
|
+ radius: 8,
|
|
|
|
|
+ layout: HSBColorPickerLayout.COLUMN,
|
|
|
|
|
+ predefine: ['#8b27f4', '#73f9fc', '#fffe55', '#f5cee3', '#eb4827', '#e93bf4', '#3e68f4', '#c5e6d3', '#e4e4e4', '#fa7105'],
|
|
|
|
|
+ onChange:(value: string) =>isHighColor?this.changeLyricHightLightColor(value):this.changeLyricColor(value)
|
|
|
|
|
+ })
|
|
|
|
|
+ .height(250)
|
|
|
|
|
+ .layoutWeight(1)
|
|
|
|
|
+ .padding(25)
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('66%')
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 构建字号控制器
|
|
// 构建字号控制器
|
|
|
@Builder
|
|
@Builder
|
|
@@ -5814,7 +5920,7 @@ export struct LocalMusic {
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.setLyricAlignMode(index)
|
|
this.setLyricAlignMode(index)
|
|
|
})
|
|
})
|
|
|
- .margin({ left: 8, right: 8 })
|
|
|
|
|
|
|
+ .margin({ left: 10, right: 8 })
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
.width('76%')
|
|
.width('76%')
|
|
@@ -5823,22 +5929,148 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
.margin({ top:10,bottom:10,right:20,left:20})
|
|
.margin({ top:10,bottom:10,right:20,left:20})
|
|
|
|
|
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ Text(`高亮居中:`)
|
|
|
|
|
+ .fontSize(14)
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
+
|
|
|
|
|
+ Column(){
|
|
|
|
|
+ Toggle({ type: ToggleType.Switch, isOn: this.isHightLightCenter })
|
|
|
|
|
+ .selectedColor($r('app.color.tab_item_bg'))
|
|
|
|
|
+ .switchPointColor(Color.White)
|
|
|
|
|
+ .onChange((checked: boolean) => {
|
|
|
|
|
+ this.isHightLightCenter = checked;
|
|
|
|
|
+ PreferencesUtil.put(SettingPage.IS_SHOW_SIMI, this.isHightLightCenter)
|
|
|
|
|
+ this.lyricController.setHightLightCenter(this.isHightLightCenter)
|
|
|
|
|
+ })
|
|
|
|
|
+ .width(50)
|
|
|
|
|
+ .height(30)
|
|
|
|
|
+ .alignSelf(ItemAlign.Start)
|
|
|
|
|
+ .margin({ left: 12 })
|
|
|
|
|
+ Blank()
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('76%')
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ .margin({
|
|
|
|
|
+ left: 20,
|
|
|
|
|
+ right: 15,
|
|
|
|
|
+ top: 10,
|
|
|
|
|
+ bottom: 10
|
|
|
|
|
+ })
|
|
|
Row() {
|
|
Row() {
|
|
|
Text(`歌词颜色:`)
|
|
Text(`歌词颜色:`)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
|
|
+ Text(this.currentLyricColor)
|
|
|
|
|
+ .fontSize(15)
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
+ .margin({ left: 12, right: 12 })
|
|
|
|
|
+ Column(){}
|
|
|
|
|
+ .backgroundColor(this.currentLyricColor)
|
|
|
|
|
+ .margin({ right: 12 })
|
|
|
|
|
+ .borderRadius(20)
|
|
|
|
|
+ .height(28)
|
|
|
|
|
+ .width(28)
|
|
|
|
|
|
|
|
- Row({space: 10}) {
|
|
|
|
|
- HSBColorPicker({
|
|
|
|
|
- color: '#FFFFFF',
|
|
|
|
|
- radius: 8,
|
|
|
|
|
- layout: HSBColorPickerLayout.COLUMN,
|
|
|
|
|
- onChange:(value: string) =>this.changeLyricColor(value)
|
|
|
|
|
- })
|
|
|
|
|
- .height(88)
|
|
|
|
|
- .layoutWeight(1)
|
|
|
|
|
- .padding({left:15,right:35})
|
|
|
|
|
|
|
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ SymbolGlyph($r('sys.symbol.paintbrush'))
|
|
|
|
|
+ .fontColor([Color.White])
|
|
|
|
|
+ .effectStrategy(1)
|
|
|
|
|
+ Text(`选择颜色`)
|
|
|
|
|
+ .fontSize(13)
|
|
|
|
|
+ .margin({ left: 10 })
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
|
|
+ .border({
|
|
|
|
|
+ color: '#FFFFFF',
|
|
|
|
|
+ radius: 20,
|
|
|
|
|
+ width: 1.8
|
|
|
|
|
+ })
|
|
|
|
|
+ .height(36)
|
|
|
|
|
+ .width(110)
|
|
|
|
|
+ .onClick(()=>{
|
|
|
|
|
+ this.isShowSelectColor = !this.isShowSelectColor
|
|
|
|
|
+ })
|
|
|
|
|
+ .bindPopup(this.isShowSelectColor, {
|
|
|
|
|
+ builder: this.SelectColor(false),
|
|
|
|
|
+ placement: Placement.Top,
|
|
|
|
|
+ // autoCancel: true,
|
|
|
|
|
+ mask: {color:'#33000000'},
|
|
|
|
|
+ // popupColor: Color.Yellow,
|
|
|
|
|
+ enableArrow: false,//是否显示箭头
|
|
|
|
|
+ showInSubWindow: false,
|
|
|
|
|
+ onStateChange: (e) => {
|
|
|
|
|
+ if (!e.isVisible) {
|
|
|
|
|
+ this.isShowSelectColor = false
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('76%')
|
|
|
|
|
+ .margin({ top:10,bottom:10,right:45,left:20})
|
|
|
|
|
+
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ Text(`高亮颜色:`)
|
|
|
|
|
+ .fontSize(14)
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
+ Text(this.currentHighLightLyricColor)
|
|
|
|
|
+ .fontSize(15)
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
+ .margin({ left: 12, right: 12 })
|
|
|
|
|
+ Column(){}
|
|
|
|
|
+ .backgroundColor(this.currentHighLightLyricColor)
|
|
|
|
|
+ .margin({ right: 12 })
|
|
|
|
|
+ .borderRadius(20)
|
|
|
|
|
+ .height(28)
|
|
|
|
|
+ .width(28)
|
|
|
|
|
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ SymbolGlyph($r('sys.symbol.paintbrush'))
|
|
|
|
|
+ .fontColor([Color.White])
|
|
|
|
|
+ .effectStrategy(1)
|
|
|
|
|
+ Text(`选择颜色`)
|
|
|
|
|
+ .fontSize(13)
|
|
|
|
|
+ .margin({ left: 10 })
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
|
|
+ .border({
|
|
|
|
|
+ color: '#FFFFFF',
|
|
|
|
|
+ radius: 20,
|
|
|
|
|
+ width: 1.8
|
|
|
|
|
+ })
|
|
|
|
|
+ .height(36)
|
|
|
|
|
+ .width(110)
|
|
|
|
|
+ .onClick(()=>{
|
|
|
|
|
+ this.isShowHLSelectColor = !this.isShowHLSelectColor
|
|
|
|
|
+ })
|
|
|
|
|
+ .bindPopup(this.isShowHLSelectColor, {
|
|
|
|
|
+ builder: this.SelectColor(true),
|
|
|
|
|
+ placement: Placement.Top,
|
|
|
|
|
+ // autoCancel: true,
|
|
|
|
|
+ mask: {color:'#33000000'},
|
|
|
|
|
+ // popupColor: Color.Yellow,
|
|
|
|
|
+ enableArrow: false,//是否显示箭头
|
|
|
|
|
+ showInSubWindow: false,
|
|
|
|
|
+ onStateChange: (e) => {
|
|
|
|
|
+ if (!e.isVisible) {
|
|
|
|
|
+ this.isShowHLSelectColor = false
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
.width('76%')
|
|
.width('76%')
|
|
@@ -5881,7 +6113,6 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
Slider({
|
|
Slider({
|
|
|
value: this.currentHightLyricSize,
|
|
value: this.currentHightLyricSize,
|
|
|
min: 1,
|
|
min: 1,
|
|
@@ -6003,32 +6234,6 @@ export struct LocalMusic {
|
|
|
bottom: 15
|
|
bottom: 15
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- Row() {
|
|
|
|
|
- Text(`高亮居中:`)
|
|
|
|
|
- .fontSize(14)
|
|
|
|
|
- .fontColor(Color.White)
|
|
|
|
|
- Column(){
|
|
|
|
|
- Toggle({ type: ToggleType.Switch, isOn: this.isHightLightCenter })
|
|
|
|
|
- .selectedColor($r('app.color.tab_item_bg'))
|
|
|
|
|
- .switchPointColor(Color.White)
|
|
|
|
|
- .onChange((checked: boolean) => {
|
|
|
|
|
- this.isHightLightCenter = checked;
|
|
|
|
|
- PreferencesUtil.put(SettingPage.IS_SHOW_SIMI, this.isHightLightCenter)
|
|
|
|
|
- this.lyricController.setHightLightCenter(this.isHightLightCenter)
|
|
|
|
|
- })
|
|
|
|
|
- .width(50)
|
|
|
|
|
- .height(30)
|
|
|
|
|
- }
|
|
|
|
|
- .justifyContent(FlexAlign.Start)
|
|
|
|
|
- .width('76%')
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- .margin({
|
|
|
|
|
- left: 20,
|
|
|
|
|
- right: 15,
|
|
|
|
|
- top: 5,
|
|
|
|
|
- bottom: 15
|
|
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
Row() {
|
|
Row() {
|
|
|
this.pushLyricButton($r('app.media.cut_current'), 0, '本地歌词')
|
|
this.pushLyricButton($r('app.media.cut_current'), 0, '本地歌词')
|
|
@@ -6085,10 +6290,16 @@ export struct LocalMusic {
|
|
|
this.currentLyricColor = color
|
|
this.currentLyricColor = color
|
|
|
this.lyricController
|
|
this.lyricController
|
|
|
.setTextColor(this.currentLyricColor)
|
|
.setTextColor(this.currentLyricColor)
|
|
|
- .setHighlightColor(this.currentLyricColor)
|
|
|
|
|
PreferencesUtil.putSync('LyricColor', this.currentLyricColor)
|
|
PreferencesUtil.putSync('LyricColor', this.currentLyricColor)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private changeLyricHightLightColor(color: string) {
|
|
|
|
|
+ this.currentHighLightLyricColor = color
|
|
|
|
|
+ this.lyricController
|
|
|
|
|
+ .setHighlightColor(this.currentHighLightLyricColor)
|
|
|
|
|
+ PreferencesUtil.putSync('LyricHighLightColor', this.currentHighLightLyricColor)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 构建时间控制器
|
|
// 构建时间控制器
|
|
|
@Builder
|
|
@Builder
|
|
|
BuildTimeControls() {
|
|
BuildTimeControls() {
|
|
@@ -6101,7 +6312,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
Row() {
|
|
Row() {
|
|
|
this.PrecisionTimeButton($r('app.media.ic_previous'), -0.5, ' -0.5s ')
|
|
this.PrecisionTimeButton($r('app.media.ic_previous'), -0.5, ' -0.5s ')
|
|
|
- this.PrecisionTimeButton($r('app.media.loop'), 0, 'RESET')
|
|
|
|
|
|
|
+ this.PrecisionTimeButton($r('app.media.loop'), 0, '重置')
|
|
|
this.PrecisionTimeButton($r('app.media.ic_next'), 0.5, ' +0.5s ')
|
|
this.PrecisionTimeButton($r('app.media.ic_next'), 0.5, ' +0.5s ')
|
|
|
}
|
|
}
|
|
|
.justifyContent(FlexAlign.Center)
|
|
.justifyContent(FlexAlign.Center)
|
|
@@ -6112,25 +6323,27 @@ export struct LocalMusic {
|
|
|
// 精度按钮组件
|
|
// 精度按钮组件
|
|
|
@Builder
|
|
@Builder
|
|
|
PrecisionTimeButton(icon: Resource, step: number, label: string) {
|
|
PrecisionTimeButton(icon: Resource, step: number, label: string) {
|
|
|
- Column() {
|
|
|
|
|
- Image(icon)
|
|
|
|
|
- .width(28)
|
|
|
|
|
- .margin({ bottom: 5 })
|
|
|
|
|
- .opacity(this.isButtonDisabled(step) ? 0.5 : 1)
|
|
|
|
|
|
|
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
|
|
+ Column() {
|
|
|
|
|
+ Image(icon)
|
|
|
|
|
+ .width(28)
|
|
|
|
|
+ .margin({ bottom: 5 })
|
|
|
|
|
+ .opacity(this.isButtonDisabled(step) ? 0.5 : 1)
|
|
|
|
|
|
|
|
- Text(label)
|
|
|
|
|
- .fontSize(12)
|
|
|
|
|
- .fontColor('#FFFFFF')
|
|
|
|
|
|
|
+ Text(label)
|
|
|
|
|
+ .fontSize(12)
|
|
|
|
|
+ .fontColor('#FFFFFF')
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
.enabled(!this.isButtonDisabled(step))
|
|
.enabled(!this.isButtonDisabled(step))
|
|
|
.onClick(() => this.handlePrecisionAdjust(step))
|
|
.onClick(() => this.handlePrecisionAdjust(step))
|
|
|
.padding(5)
|
|
.padding(5)
|
|
|
- .width(60)
|
|
|
|
|
- .height(60)
|
|
|
|
|
|
|
+ .width(66)
|
|
|
|
|
+ .height(66)
|
|
|
.margin({ left: 18, right: 18 })
|
|
.margin({ left: 18, right: 18 })
|
|
|
.border({
|
|
.border({
|
|
|
color: '#FFFFFF',
|
|
color: '#FFFFFF',
|
|
|
- radius: 20,
|
|
|
|
|
width: 1.8
|
|
width: 1.8
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -6169,17 +6382,19 @@ export struct LocalMusic {
|
|
|
// 导入 本地歌词 搜索歌词
|
|
// 导入 本地歌词 搜索歌词
|
|
|
@Builder
|
|
@Builder
|
|
|
pushLyricButton(icon: Resource, step: number, label: string) {
|
|
pushLyricButton(icon: Resource, step: number, label: string) {
|
|
|
- Row() {
|
|
|
|
|
- Image(icon)
|
|
|
|
|
|
|
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
|
|
+ Row() {
|
|
|
|
|
+ Image(icon)
|
|
|
.width(14)
|
|
.width(14)
|
|
|
.margin({ left: 13 })
|
|
.margin({ left: 13 })
|
|
|
|
|
|
|
|
- Text(label)
|
|
|
|
|
- .fontSize(12)
|
|
|
|
|
- .margin({ left: 6 })
|
|
|
|
|
- .fontColor('#FFFFFF')
|
|
|
|
|
|
|
+ Text(label)
|
|
|
|
|
+ .fontSize(12)
|
|
|
|
|
+ .margin({ left: 6 })
|
|
|
|
|
+ .fontColor('#FFFFFF')}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
- // .visibility(step === 1 ? (Utility.isNoble() ? Visibility.Visible : Visibility.None) : Visibility.Visible)
|
|
|
|
|
|
|
+
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
switch (step) {
|
|
switch (step) {
|
|
|
case 0:
|
|
case 0:
|
|
@@ -6219,6 +6434,7 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
.padding(5)
|
|
.padding(5)
|
|
|
.width(110)
|
|
.width(110)
|
|
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
.height(40)
|
|
.height(40)
|
|
|
.margin({ left: 6, right: 6 })
|
|
.margin({ left: 6, right: 6 })
|
|
|
.border({
|
|
.border({
|