GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - GcsSloop/ViewSupport: View辅助工具包,帮助你快速优雅的完成自定义View

BranchesTags
Open more actions menu

Latest commit

 

History

64 Commits
64 Commits

Folders and files

NameName
Last commit message
Last commit date
Library
Library
 
 
Sample
Sample
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README-EN.md
README-EN.md
 
 
README.md
README.md
 
 
ViewSupport.iml
ViewSupport.iml
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

ViewSupport

该开源库的主要作用就是简化自定义View过程中的一些流程,让自定义View更简单,更方便,更高效,例如:

  • 继承 CustomView 以自动获取 View 大小以及默认画笔。
  • 使用 CanvasAidUtils 绘制当前坐标系以检查绘制的位置。
  • 使用 MathUtils 方便的进行角度弧度转换,计算距离。

除此之外,它还有更多的工具和辅助类来帮助你更方便的自定义View,更多信息请查看下面表格。

如果你对此有什么比较好的建议,欢迎提交 Issues 来告诉我。

对自定义View感兴趣的欢迎来 我的博客 查看相关文章。


工具列表

PS: 点击工具名称查看源码,点击Wiki查看简介。

工具 Wiki 简介
CustomView 查看 自定义View基类,帮助你节省部分代码
CanvasAidUtils 查看 Canvas辅助工具,你可以用它绘制坐标系来帮助你检查视图的位置,并在完成之后移除该坐标系。
CanvasUtils 查看 Canvas绘图工具,封装了一些Canvas没有提供的方法,目前只能用来画一条线。
DensityUtils 查看 密度工具, 根据设备进行如下单位转换: sp -> px, px -> sp, dp -> px, px -> dp
MathUtils 查看 数学工具, 封装一些数学算法,例如: 获取两点之间的距离,获取线段上某一点的位置, 获取线段与水平线夹角 等
ViewUtils 查看 视图工具, 封装了一些与视图相关等内容,如 手动测量视图大小, 为视图动态设置margin 等
ApiHelper 查看 版本检查工具,里面定义了很多与版本相关的常量,并且开放了几个检查方法,检查一个类(class)是否拥有某个字段或者某个方法。
MotionEventHelper 查看 MotionEvent 辅助类,帮助转换 MotionEvent 中的坐标系。

文档

  • 点击这里查看文档
  • 点击这里查看Wiki
  • 点击这里查看更新日志

示例

点击此处下载 Sample

如何添加该开源库

Gradle:

Step 1. 添加JitPack仓库

在当前项目的根目录下的 build.gradle 文件中添加如下内容:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Step 2. 添加项目依赖

dependencies {
        compile 'com.github.GcsSloop:ViewSupport:v1.3.0'
}

About Me

微博: @GcsSloop

License

Copyright (c) 2016 GcsSloop

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

View辅助工具包,帮助你快速优雅的完成自定义View

Resources

Readme
Apache-2.0 license
Activity

Stars

391 stars

Watchers

11 watching

Forks

91 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.