Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/razerdp/strokelayouts
// 一系列可以自定义描边的layouts
https://github.com/razerdp/strokelayouts
Last synced: 2 months ago
JSON representation
// 一系列可以自定义描边的layouts
- Host: GitHub
- URL: https://github.com/razerdp/strokelayouts
- Owner: razerdp
- License: mit
- Created: 2017-11-23T07:57:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-25T12:43:25.000Z (over 4 years ago)
- Last Synced: 2024-03-03T10:35:08.456Z (10 months ago)
- Language: Java
- Size: 667 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StrokeLayouts
// 一系列可以自定义描边的layouts(代码极其简单,但很实用)---
#### 介绍:
不多说,请看图:
![image](https://github.com/razerdp/StrokeLayouts/blob/master/arts/demo.gif)
[![Download](https://api.bintray.com/packages/razerdp/maven/StrokeLayouts/images/download.svg)](https://bintray.com/razerdp/maven/StrokeLayouts/_latestVersion)
#### 依赖(请把{latestVersion}换成上面标签所述版本):> compile 'com.github.razerdp:StrokeLayouts:{latestVersion}'
#### 使用方法:
目前只定义了常用的几个Layout:
- StrokeRelativeLayout
- StrokeLinearLayout
- StrokeFrameLayout
使用与平时的方法没什么不同,自定义控件只增加了`边框宽度`、`边框颜色`和`边的排除`方法
```attrs
```在代码中使用:
```java
StrokeRelativeLayout rlStroke;
rlStroke.setExcludeSide(ExcludeSide.EXCLUDE_LEFT);
/*
more :
rlStroke.setExcludeSide(ExcludeSide.EXCLUDE_LEFT+ExcludeSide.EXCLUDE_TOP);
or
rlStroke.setExcludeSide(ExcludeSide.EXCLUDE_LEFT|ExcludeSide.EXCLUDE_TOP);
*/
//ExcludeSide:
ExcludeSide.EXCLUDE_ALL // 排除所有边
ExcludeSide.EXCLUDE_NONE // 不排除边
ExcludeSide.EXCLUDE_LEFT // 排除左边
ExcludeSide.EXCLUDE_TOP // 排除上边
ExcludeSide.EXCLUDE_RIGHT // 排除右边
ExcludeSide.EXCLUDE_BOTTOM // 排除下边
}
```#### License
MIT