Android 彩票走势图View

彩票走势图

原博地址:刀放下好好说话
原博的Github:rjpacket/ChartView
GitHub地址:点我
Kotlin版本点我

就是一个自定义表格,彩票走势图那种,根据这个改良了,原博不适用我的项目用法,无奈~~ ,直接看图吧~~


[图片上传失败...(image-a4d7e7-1557129486939)]

tab页上点击效果是刷新数据,行数列数都是随机的,是否连线也是根据一个变量控制

  // 是否显示连线的控制变量
  chart_view.isShowLinkLine = !chart_view.isShowLinkLine
  // 这个是刷新数据的方法 
  updateCellGroupData()

另外,各种颜色字体大小都可以在自定义属性上定义,或者代码控制。PS:TypedValue这个类很好用的

自定义属性:

    <declare-styleable name="ChartView">
        <attr name="chart_mode" format="integer" />
        <attr name="columns" format="integer" />
        <attr name="cell_width" format="dimension" />
        <attr name="cell_height" format="dimension" />
        <attr name="number_size" format="dimension" />
        <attr name="ball_color" format="color" />
        <attr name="number_normal_color" format="color" />
        <attr name="number_selected_color" format="color" />
        <attr name="link_line_color" format="color" />
        <attr name="link_line_width" format="dimension" />
        <attr name="stroke_color" format="color" />
        <attr name="background_color" format="color" />
    </declare-styleable>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。