|
@@ -297,14 +297,14 @@ export struct LyricView2 {
|
|
|
y: index == this.currentIndex ? this.controller.getHighlightScale() : 1,
|
|
y: index == this.currentIndex ? this.controller.getHighlightScale() : 1,
|
|
|
centerX: this.alignMode == 'center' ? '50%' : 0
|
|
centerX: this.alignMode == 'center' ? '50%' : 0
|
|
|
})
|
|
})
|
|
|
- .maxLines(1)
|
|
|
|
|
- .textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
|
|
|
|
|
.fontColor(index == this.currentIndex ? this.textHighlightColor : this.textColor)
|
|
.fontColor(index == this.currentIndex ? this.textHighlightColor : this.textColor)
|
|
|
.fontWeight(index == this.currentIndex && this.isHighlightBold ? FontWeight.Bold : this.textWeight)
|
|
.fontWeight(index == this.currentIndex && this.isHighlightBold ? FontWeight.Bold : this.textWeight)
|
|
|
.animation({
|
|
.animation({
|
|
|
duration: 150,
|
|
duration: 150,
|
|
|
curve: Curve.Linear
|
|
curve: Curve.Linear
|
|
|
})
|
|
})
|
|
|
|
|
+ .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST)
|
|
|
|
|
+ .padding({ top:5,bottom:5 })
|
|
|
.blendMode(
|
|
.blendMode(
|
|
|
index == this.currentIndex ? BlendMode.DST_IN : undefined,
|
|
index == this.currentIndex ? BlendMode.DST_IN : undefined,
|
|
|
index == this.currentIndex ? BlendApplyType.OFFSCREEN : undefined
|
|
index == this.currentIndex ? BlendApplyType.OFFSCREEN : undefined
|
|
@@ -312,7 +312,7 @@ export struct LyricView2 {
|
|
|
.visibility(this.isSingleLine?
|
|
.visibility(this.isSingleLine?
|
|
|
(index == this.currentIndex ?Visibility.Visible:Visibility.None)
|
|
(index == this.currentIndex ?Visibility.Visible:Visibility.None)
|
|
|
:Visibility.Visible)
|
|
:Visibility.Visible)
|
|
|
- .width(this.alignMode == 'center' ? '95%' : '90%')
|
|
|
|
|
|
|
+ .width(this.alignMode == 'center' ? '95%' : '85%')
|
|
|
|
|
|
|
|
// 中文翻译(整行显示)
|
|
// 中文翻译(整行显示)
|
|
|
if (item.translation) {
|
|
if (item.translation) {
|
|
@@ -322,9 +322,7 @@ export struct LyricView2 {
|
|
|
.fontColor(this.currentMediaPosition >= item.beginTime ?
|
|
.fontColor(this.currentMediaPosition >= item.beginTime ?
|
|
|
index == this.currentIndex ? this.textHighlightColor : this.textColor : this.textColor)
|
|
index == this.currentIndex ? this.textHighlightColor : this.textColor : this.textColor)
|
|
|
.fontWeight(index == this.currentIndex && this.isHighlightBold ? FontWeight.Bold : this.textWeight)
|
|
.fontWeight(index == this.currentIndex && this.isHighlightBold ? FontWeight.Bold : this.textWeight)
|
|
|
- .margin({ top: 4 })
|
|
|
|
|
- .maxLines(1)
|
|
|
|
|
- .textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
|
|
|
|
|
|
|
+ .padding({ bottom:5 })
|
|
|
.animation({
|
|
.animation({
|
|
|
duration: 150,
|
|
duration: 150,
|
|
|
curve: Curve.Linear
|
|
curve: Curve.Linear
|
|
@@ -335,7 +333,7 @@ export struct LyricView2 {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
.justifyContent(this.alignMode === 'center' ? FlexAlign.Center : FlexAlign.Start)
|
|
.justifyContent(this.alignMode === 'center' ? FlexAlign.Center : FlexAlign.Start)
|
|
|
- .width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '90%')
|
|
|
|
|
|
|
+ .width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '85%')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 在 Row 上应用渐变
|
|
// 在 Row 上应用渐变
|
|
@@ -465,6 +463,7 @@ export struct LyricView2 {
|
|
|
.visibility(this.isSingleLine?
|
|
.visibility(this.isSingleLine?
|
|
|
(index == this.currentIndex ?Visibility.Visible:Visibility.None)
|
|
(index == this.currentIndex ?Visibility.Visible:Visibility.None)
|
|
|
:Visibility.Visible)
|
|
:Visibility.Visible)
|
|
|
|
|
+ .padding({ top:5,bottom:5 })
|
|
|
.shaderStyle(index == this.currentIndex ?{
|
|
.shaderStyle(index == this.currentIndex ?{
|
|
|
direction: GradientDirection.Right,
|
|
direction: GradientDirection.Right,
|
|
|
colors: this.getWordByWordLyricLyricItemLinearGradient(item, word, index)
|
|
colors: this.getWordByWordLyricLyricItemLinearGradient(item, word, index)
|
|
@@ -480,7 +479,7 @@ export struct LyricView2 {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
.justifyContent(this.alignMode === 'center' ? FlexAlign.Center : FlexAlign.Start)
|
|
.justifyContent(this.alignMode === 'center' ? FlexAlign.Center : FlexAlign.Start)
|
|
|
- .width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '90%')
|
|
|
|
|
|
|
+ .width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '85%')
|
|
|
|
|
|
|
|
// 中文翻译(整行显示)
|
|
// 中文翻译(整行显示)
|
|
|
if (item.translation) {
|
|
if (item.translation) {
|
|
@@ -490,12 +489,13 @@ export struct LyricView2 {
|
|
|
.fontColor(this.currentMediaPosition >= item.beginTime ?
|
|
.fontColor(this.currentMediaPosition >= item.beginTime ?
|
|
|
index == this.currentIndex ? this.textHighlightColor : this.textColor : this.textColor)
|
|
index == this.currentIndex ? this.textHighlightColor : this.textColor : this.textColor)
|
|
|
.fontWeight(index == this.currentIndex? FontWeight.Bold : this.textWeight)
|
|
.fontWeight(index == this.currentIndex? FontWeight.Bold : this.textWeight)
|
|
|
- .margin({ top: 4 })
|
|
|
|
|
|
|
+ .padding({ bottom:5 })
|
|
|
}
|
|
}
|
|
|
.justifyContent(this.alignMode === 'center' ? FlexAlign.Center : FlexAlign.Start)
|
|
.justifyContent(this.alignMode === 'center' ? FlexAlign.Center : FlexAlign.Start)
|
|
|
- .width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '90%')
|
|
|
|
|
|
|
+ .width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '85%')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .height('auto')
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|