mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-03 06:42:09 +08:00
桌面歌词的最大字体大小允许调整到500
This commit is contained in:
parent
5d00d81b43
commit
9438c5e1b9
@ -131,6 +131,12 @@ public class LyricView extends Activity implements View.OnTouchListener {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setLayoutParamsHeight() {
|
||||
int height = textView.getPaint().getFontMetricsInt(null) * maxLineNum + 8;
|
||||
if (height > maxHeight - 100) height = maxHeight - 100;
|
||||
layoutParams.height = height;
|
||||
}
|
||||
|
||||
private void fixViewPosition() {
|
||||
int maxX = maxWidth - layoutParams.width;
|
||||
int x = (int)(maxWidth * prevViewPercentageX);
|
||||
@ -138,6 +144,8 @@ public class LyricView extends Activity implements View.OnTouchListener {
|
||||
else if (x > maxX) x = maxX;
|
||||
if (layoutParams.x != x) layoutParams.x = x;
|
||||
|
||||
setLayoutParamsHeight();
|
||||
|
||||
int maxY = maxHeight - layoutParams.height;
|
||||
int y = (int)(maxHeight * prevViewPercentageY);
|
||||
if (y < 0) y = 0;
|
||||
@ -309,8 +317,7 @@ public class LyricView extends Activity implements View.OnTouchListener {
|
||||
// layoutParams.width= DisplayUtil.dp2px(mContext,55);
|
||||
// layoutParams.height= DisplayUtil.dp2px(mContext,55);
|
||||
layoutParams.width = (int)(maxWidth * widthPercentage);
|
||||
// layoutParams.height = 100;
|
||||
layoutParams.height = textView.getPaint().getFontMetricsInt(null) * maxLineNum + 8;
|
||||
setLayoutParamsHeight();
|
||||
|
||||
//显示位置与指定位置的相对位置差
|
||||
layoutParams.x = (int)(maxWidth * prevViewPercentageX);
|
||||
@ -343,7 +350,7 @@ public class LyricView extends Activity implements View.OnTouchListener {
|
||||
if (textView == null) return;
|
||||
this.maxLineNum = maxLineNum;
|
||||
textView.setMaxLines(maxLineNum);
|
||||
layoutParams.height = textView.getPaint().getFontMetricsInt(null) * maxLineNum + 8;
|
||||
setLayoutParamsHeight();
|
||||
|
||||
int maxY = maxHeight - layoutParams.height;
|
||||
int y = layoutParams.y;
|
||||
@ -515,7 +522,7 @@ public class LyricView extends Activity implements View.OnTouchListener {
|
||||
this.textSize = size;
|
||||
if (windowManager == null || textView == null) return;
|
||||
textView.setTextSize(size);
|
||||
layoutParams.height = textView.getPaint().getFontMetricsInt(null) * maxLineNum + 8;
|
||||
setLayoutParamsHeight();
|
||||
windowManager.updateViewLayout(textView, layoutParams);
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
- 允许桌面歌词拖动到状态栏上(感谢@ftevxk)
|
||||
- 允许选择更新日志弹窗里的文本内容
|
||||
- 桌面歌词的最大字体大小允许调整到500(#107)
|
||||
|
||||
### 修复
|
||||
|
||||
|
@ -33,7 +33,7 @@ export default memo(() => {
|
||||
<Text style={{ color: theme.secondary10 }}>{isSliding ? sliderSize : fontSize}</Text>
|
||||
<Slider
|
||||
minimumValue={100}
|
||||
maximumValue={360}
|
||||
maximumValue={500}
|
||||
onSlidingComplete={handleSlidingComplete}
|
||||
onValueChange={handleValueChange}
|
||||
onSlidingStart={handleSlidingStart}
|
||||
|
Loading…
x
Reference in New Issue
Block a user