ExtraTextView
additional functions for TextView.
Usage
see sample
In your layout
<com.github.chuross.widget.ExtraTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:ext_txt_drawable="@drawable/your_icon"
app:ext_txt_drawableWidth="24dp"
app:ext_txt_drawableHeight="24dp"/>
XMLAttributes
name | type | description | etc |
---|---|---|---|
ext_txt_drawable | resource | drawable icon resource | |
ext_txt_drawableTint | color | drawable tint color | |
ext_txt_drawableWidth | dimen | drawable width | If not defined, width will be match_parent . |
ext_txt_drawableHeight | dimen | drawable height | If not defined, height will be the same as view.width . |
ext_txt_drawablePosition | enum | drawable position | top or bottom or left or right |
ext_txt_drawableFit | boolean | auto fit drawable padding. If you use match_parent . | drawable position is left or right . |
ext_txt_cornerBorderColor | color | border color | required ext_txt_cornerBorderSize and ext_txt_cornerRadius |
ext_txt_cornerBorderSize | dimen | border width | required ext_txt_cornerRadius |
ext_txt_cornerRadius | dimen | corner radius | required ext_txt_cornerBorderSize |
Download
Gradle
- add JitPack repository to your project root
build.gradle
.
repositories {
maven {
url "https://jitpack.io"
}
}
- add the dependency
dependencies {
compile 'com.github.chuross:extra-textview:x.x.x'
}
License
Copyright 2017 chuross 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.