MarqueeTextView循环模式修改(能显示完全不滚动)
This commit is contained in:
@@ -232,7 +232,12 @@ open class MarqueeTextView @JvmOverloads constructor(
|
||||
}
|
||||
//绘制文本
|
||||
if (mFinalDrawText.isNotBlank()) {
|
||||
canvas.drawText(mFinalDrawText, xLocation, height / 2 + textHeight / 2, textPaint)
|
||||
canvas.drawText(
|
||||
mFinalDrawText,
|
||||
if (mSingleContentWidth > width) xLocation else 0f,
|
||||
height / 2 + textHeight / 2,
|
||||
textPaint
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -79,6 +79,7 @@ class VipBroadcastView @JvmOverloads constructor(
|
||||
.setDuration(200)
|
||||
.apply {
|
||||
doOnEnd {
|
||||
binding.tvContent.stop()
|
||||
isGone = true
|
||||
}
|
||||
}
|
||||
|
@@ -40,12 +40,13 @@
|
||||
<com.yizhuan.erban.ui.widget.MarqueeTextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
app:marqueeRepeat="fillLoop"
|
||||
app:marqueeRepeat="singleLoop"
|
||||
app:marqueeSpeed="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
|
Reference in New Issue
Block a user