跳转至

HorizontalProgressView

添加: Version 0.2.0

快速使用

添加: Version 0.2.0

在示例图中,从上到下依次是 HorizontalProgressViewHorizontalTextProgressViewLineTextProgressView

<com.ave.vastgui.tools.view.progress.HorizontalProgressView
    android:layout_width="match_parent"
    android:layout_height="50dp" />
<com.ave.vastgui.tools.view.progress.HorizontalTextProgressView
    android:layout_width="match_parent"
    android:layout_height="50dp" />
<com.ave.vastgui.tools.view.progress.LineTextProgressView
    android:layout_width="match_parent"
    android:layout_height="50dp" />

查看默认样式

HorizontalProgressView

自定义图片背景

添加: Version 0.2.0   更新: Version 0.5.4

通过 horizontal_progress_background_drawable 和调用 setProgressBkDrawable 可以将图片设置为进度条背景。

binding.horizontalProgressView.setProgressBkDrawable(R.drawable.background)
<com.ave.vastgui.tools.view.progress.HorizontalProgressView
    ...
    app:horizontal_progress_background_drawable="@drawable/background" />

Image background

自定义图片进度条

添加: Version 0.2.0   更新: Version 0.5.4

通过 horizontal_progress_drawable 和调用 setProgressDrawable 可以将图片设置为进度条。

binding.horizontalProgressView.setProgressDrawable(R.drawable.progress)
<com.ave.vastgui.tools.view.progress.HorizontalProgressView
    ...
    app:horizontal_progress_drawable="@drawable/progress" />

Image progress

描边宽度

添加: Version 0.2.0   更新: Version 1.5.2

通过 horizontal_progress_stroke_width 和调用 mStrokeWidth 来设置进度条和边框的距离。

binding.horizontalProgressView.strokeWidth = 0f
<com.ave.vastgui.tools.view.progress.HorizontalProgressView
    ...
    app:horizontal_progress_stroke_width="0dp" />
Width 0dp Width 5dp
Width 0dp Width 5dp

HorizontalTextProgressView

进度条高度设置

添加: Version 0.5.5   更新: Version 1.5.2

进度条高度可以通过 horizontal_text_progress_heightprogressHeight 来进行设置。

binding.horizontalTextProgressView.progressHeight = 15f.DP
<com.ave.vastgui.tools.view.progress.HorizontalTextProgressView
    ...
    app:horizontal_text_progress_height="15dp" />
Height 15dp Height 25dp
Height 15dp Height 25dp

字体外边距

添加: Version 0.5.5   更新: Version 1.5.2

字体外边距可以通过 horizontal_text_progress_text_margintextMargin 进行设置。

binding.horizontalTextProgressView.textMargin = 10f.DP
<com.ave.vastgui.tools.view.progress.HorizontalTextProgressView
    ...
    app:horizontal_text_progress_text_margin="10dp" />

Text margin

文字框颜色设置

添加: Version 0.5.5   更新: Version 1.5.2

文字框颜色可以通过 horizontal_text_progress_box_colortextBoxColor 来进行设置。

binding.horizontalTextProgressView.textBoxColor = ColorUtils.colorHex2Int("#e84118")
<com.ave.vastgui.tools.view.progress.HorizontalTextProgressView
    ...
    app:horizontal_text_progress_box_color="#e84118" />

Text margin

LineTextProgressView

进度条高度设置

添加: Version 0.5.5   更新: Version 1.5.2

进度条高度可以通过 linetext_progress_heightprogressHeight 来进行设置。

binding.lineTextProgressView.progressHeight = 15f.DP
<com.ave.vastgui.tools.view.progress.LineTextProgressView
    ...
    app:linetext_progress_height="15dp" />
Height 15dp Height 25dp
Height 15dp Height 25dp

字体外边距

添加: Version 0.5.5   更新: Version 1.5.2

字体外边距可以通过 linetext_progress_text_margintextMargin 进行设置。

binding.lineTextProgressView.textMargin = 10f.DP
<com.ave.vastgui.tools.view.progress.LineTextProgressView
    ...
    app:linetext_progress_text_margin="10dp" />

Text margin

文字框颜色设置

添加: Version 0.5.5   更新: Version 1.5.2

文字框颜色可以通过 linetext_progress_box_colortextBoxColor 来进行设置。

binding.horizontalTextProgressView.textBoxColor = ColorUtils.colorHex2Int("#e84118")
<com.ave.vastgui.tools.view.progress.LineTextProgressView
    ...
    app:linetext_progress_box_color="#e84118" />

Text margin

示例代码

查看示例代码