zoukankan      html  css  js  c++  java
  • Android BGradualProgress 多种渐变、直角or弧角、进度条、加载条

    可实现多种渐变、直角or弧角、进度条、加载条 (Various gradient, right or arc angle, progress bar and loading bar can be realized)

    Github地址

    YangsBryant/BGradualProgress

    (Github排版比较好,建议进入这里查看详情,如果觉得好,点个star吧!)



    引入module

    allprojects {
        repositories {
            google()
            jcenter()
            maven { url 'https://www.jitpack.io' }
        }
    }
    implementation 'com.github.YangsBryant:BGradualProgress:1.0.4'

    布局控件

    <com.bryant.progresslibrary.BGradualProgress
            android:id="@+id/progress"
            android:layout_width="72dp"
            android:layout_height="72dp"
            app:grp_endColor="#00000000"
            app:grp_midColor="#5289F5"
            app:grp_startColor="#dce7fd"
            app:grp_max="100"
            app:grp_roundColor="#dce7fd"
            app:grp_roundWidth="6dp"
            app:grp_startAngle="-90"
            app:grp_textColor="#5289F5"
            app:grp_textSize="16sp"
            app:layout_constraintTop_toTopOf="parent"
            android:layout_marginTop="50dp"
            app:layout_constraintLeft_toLeftOf="parent"
            android:layout_marginStart="30dp"
            />
        
    Tips:这是gif里的第一个控件,参考圆环底色+渐变 起始 中间 终止 的颜色值,可调出柔和、好看的渐变  
    #GIF图里的代码上面的demo有

    BGradualProgress控件属性

    方法名 属性
    app:grp_roundColor 环形的背景颜色
    app:grp_roundWidth 环形的宽带
    app:grp_progressFillet 进度条是否用圆角画笔
    app:grp_max 环形的最大值
    app:grp_text 中间的文字内容
    app:grp_textColor 中间的文字颜色
    app:grp_textSize 中间文件的字体大小
    app:grp_textShow 是否显示文字
    app:grp_startAngle 进度初始点的绘制位置
    app:grp_startColor 渐变的起始色
    app:grp_midColor 渐变的中间色
    app:grp_endColor 渐变的终止色

     

    BGradualProgress动态属性

    方法名 属性
    setMax(int max) 设置进度的最大值
    getProgress() 获取当前进度值
    setProgress(int progress) 设置当前进度
    setText(String text) 更新文本内容
    setRoundColor(int roundColor) 设置圆环底色
    setStartColor(int startColor) 设置渐变起始色
    setMidColor(int midColor) 设置渐变中间色
    setEndColor(int endColor) 设置渐变终止色
  • 相关阅读:
    C#.Net Winform 应用程序莫名其妙崩溃。
    不小心点击安装了搜狗手机助手,顿时有一种草搜狗全体人员的感觉。
    家乐福张江店班车时刻表
    为什么学习设计模式
    同一端口如何区分不同的Socket
    用命令行CMD .bat 相关操作 如: 创建快捷方式 复制文件等
    C++ 时间获取和时间测量
    get all ODBC drivers 驱动
    命令行 编译C#.NET项目
    如何打开.hlp文件指定的topic
  • 原文地址:https://www.cnblogs.com/94xiyang/p/11653917.html
Copyright © 2011-2022 走看看