Giter Site home page Giter Site logo

rulerview's Introduction

RulerView

目前可提供的配置的属性

                                                                     
name format default 备注
indicateColor color|reference Color.BLACK 指示器颜色
indicateWidth dimension|reference 12dp 指示器的宽度
indicateHeight dimension|reference 24dp 指示器高度
smallIndicateColor color|reference Color.BLACK 小指示器的颜色
smallIndicateWidth dimension|reference 10dp 小指示器宽度
smallIndicateHeight dimension|reference 10dp 小指示器高度
textColor color|reference Color.BLACK 字体颜色
textSize dimension|reference 12dp 字体大小
indicateMarginText dimension|reference 16dp 指示器距离文字的距离
isDrawText boolean true 是否绘制文字
startIndex integer|reference 0 开始下标
endIndex integer|reference 100 结束下标
smallIndicateCount integer|reference 4大指示器之间间隔多少个小的
indicatePadding dimension|reference 12dp 指示器之间的距离
orientationenum(horizontal||vertical) horizontal 尺子的方向
gravityenum(top||bottom) bottom文字位置相对尺子的位置
多指触控支持

一睹为快

这里写图片描述

在计划中的功能

  • 适配wrap_content
  • 添加springBack功能
  • 支持代码设置状态
  • 添加状态接口回调
  • 自定义准线位置(现在默认是屏幕中间)

已知问题

因为RulerView第一进入就会把所有刻度绘制出来,多出来的部分只是屏幕未能显示出来,所以这样就会导致一个问题,如果绘制的内容很多(也就是说大范围),很容易卡顿,因为是RulerView是继承自View,所以没有做回收机制,同时RulerView的初衷就应该是小范围选择,当然了这个问题,在做的时候,曾经想过办法解决,但还在想的阶段,1.使用Canvas clip 动态限制绘制区域 2.动态绘制屏幕区域(类似与常见的绘制动态滚动圆弧做法) 3.重做,用RecyclerView+自定义LayoutManager。

rulerview's People

Contributors

loveqlrc avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.