|
@@ -304,14 +304,14 @@ export struct LyricView2 {
|
|
|
curve: Curve.Linear
|
|
curve: Curve.Linear
|
|
|
})
|
|
})
|
|
|
.heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST)
|
|
.heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST)
|
|
|
- .padding({ top:5,bottom:5 })
|
|
|
|
|
|
|
+ .padding(this.isSingleLine?0:{ 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
|
|
|
)
|
|
)
|
|
|
.visibility(this.isSingleLine?
|
|
.visibility(this.isSingleLine?
|
|
|
- (index == this.currentIndex ?Visibility.Visible:Visibility.None)
|
|
|
|
|
- :Visibility.Visible)
|
|
|
|
|
|
|
+ (index >= this.currentIndex && index <= this.currentIndex + 1 ? Visibility.Visible : Visibility.None)
|
|
|
|
|
+ : Visibility.Visible)
|
|
|
.width(this.alignMode == 'center' ? '95%' : '85%')
|
|
.width(this.alignMode == 'center' ? '95%' : '85%')
|
|
|
|
|
|
|
|
// 中文翻译(整行显示)
|
|
// 中文翻译(整行显示)
|
|
@@ -322,12 +322,15 @@ 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)
|
|
|
- .padding({ bottom:5 })
|
|
|
|
|
|
|
+ .padding(this.isSingleLine?{ bottom:2 }:{ bottom:5 })
|
|
|
.textAlign(this.alignMode == 'center' ? TextAlign.Center : TextAlign.Start)
|
|
.textAlign(this.alignMode == 'center' ? TextAlign.Center : TextAlign.Start)
|
|
|
.animation({
|
|
.animation({
|
|
|
duration: 150,
|
|
duration: 150,
|
|
|
curve: Curve.Linear
|
|
curve: Curve.Linear
|
|
|
})
|
|
})
|
|
|
|
|
+ .visibility(this.isSingleLine?
|
|
|
|
|
+ (index >= this.currentIndex && index <= this.currentIndex + 1 ? Visibility.Visible : Visibility.None)
|
|
|
|
|
+ : Visibility.Visible)
|
|
|
.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
|
|
@@ -461,9 +464,9 @@ export struct LyricView2 {
|
|
|
.fontWeight(index == this.currentIndex? FontWeight.Bold : this.textWeight)
|
|
.fontWeight(index == this.currentIndex? FontWeight.Bold : this.textWeight)
|
|
|
.margin(isEnglish(word.word) ?{ right:4 }:{})
|
|
.margin(isEnglish(word.word) ?{ right:4 }:{})
|
|
|
.visibility(this.isSingleLine?
|
|
.visibility(this.isSingleLine?
|
|
|
- (index == this.currentIndex ?Visibility.Visible:Visibility.None)
|
|
|
|
|
- :Visibility.Visible)
|
|
|
|
|
- .padding({ top:5,bottom:5 })
|
|
|
|
|
|
|
+ (index >= this.currentIndex && index <= this.currentIndex + 1 ? Visibility.Visible : Visibility.None)
|
|
|
|
|
+ : Visibility.Visible)
|
|
|
|
|
+ .padding(this.isSingleLine?0:{ 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)
|
|
@@ -490,6 +493,10 @@ export struct LyricView2 {
|
|
|
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)
|
|
|
.padding({ bottom:5 })
|
|
.padding({ bottom:5 })
|
|
|
|
|
+ .padding(this.isSingleLine?{ bottom:2 }:{ bottom:5 })
|
|
|
|
|
+ .visibility(this.isSingleLine?
|
|
|
|
|
+ (index >= this.currentIndex && index <= this.currentIndex + 1 ? Visibility.Visible : Visibility.None)
|
|
|
|
|
+ : Visibility.Visible)
|
|
|
}
|
|
}
|
|
|
.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%': '85%')
|
|
.width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '85%')
|