Skip to content

Commit df7b8ba

Browse files
committed
Initial commit.
0 parents  commit df7b8ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1163
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
.idea
5+
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild

README.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# CompoundIconTextView
2+
3+
An android library that is able to set a vector drawable at text view pre-Lollipop.
4+
5+
[![Platform](http://img.shields.io/badge/platform-android-brightgreen.svg?style=flat)](http://developer.android.com/index.html)
6+
[![Language](http://img.shields.io/badge/language-java-orange.svg?style=flat)](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
7+
[![License](http://img.shields.io/badge/license-apache2.0-lightgrey.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
8+
[![Download CompoundIconTextView](https://api.bintray.com/packages/aakira/maven/compound-icon-textview/images/download.svg)](https://bintray.com/aakira/maven/compound-icon-textview/_latestVersion)
9+
10+
## Preview
11+
12+
![PREVIEW][preview]
13+
14+
## Features
15+
16+
* Set a vector drawable at text view pre-Lollipop
17+
18+
## Usage
19+
20+
### Code
21+
22+
```Java
23+
24+
CompoundIconTextView tv = (CompoundIconTextView) findViewById(R.id.compoundIconTextView);
25+
26+
// set icon drawable
27+
tv.setVectorDrawableTop(R.drawable.ic_android_black_24dp);
28+
tv.setVectorDrawableLeft(R.drawable.ic_android_black_24dp);
29+
30+
// set icon color
31+
tv.setIconColorResource(R.color.colorPrimary);
32+
33+
// set icon size
34+
tv.setIconSizeResource(R.dimen.icon_size, R.dimen.icon_size);
35+
tv.setIconSize(32, 32);
36+
37+
// clear icon
38+
tv.setVectorDrawableRight(CompoundIconTextView.UNDEFINED_RESOURCE);
39+
40+
```
41+
42+
### Xml
43+
44+
```xml
45+
46+
<?xml version="1.0" encoding="UTF-8"?>
47+
<com.github.aakira.compoundicontextview.CompoundIconTextView
48+
android:id="@+id/compoundIconTextView"
49+
android:layout_width="wrap_content"
50+
android:layout_height="wrap_content"
51+
android:drawablePadding="4dp"
52+
android:gravity="center"
53+
android:text="Hello World!"
54+
android:textColor="#3F51B5"
55+
android:textSize="16sp"
56+
app:cit_drawableLeft="@drawable/ic_android_black_24dp"
57+
app:cit_iconColor="#000"
58+
app:cit_iconHeight="16dp"
59+
app:cit_iconWidth="16dp" />
60+
```
61+
62+
### Attributes
63+
64+
|attribute name|description|
65+
|:-:|:-:|
66+
|cit_drawableLeft|Sets a drawable or vector drawable to left of TextView|
67+
|cit_drawableTop|Sets a drawable or vector drawable to top of TextView|
68+
|cit_drawableBottom|Sets a drawable or vector drawable to bottom of TextView|
69+
|cit_drawableRight|Sets a drawable or vector drawable to right of TextView|
70+
|cit_iconWidth|Sets a width of icon|
71+
|cit_iconHeight|Sets a width of icon|
72+
|cit_iconColor|Sets a icon color|
73+
74+
## Setup
75+
76+
### Gradle
77+
78+
Add the dependency in your `build.gradle`
79+
80+
```groovy
81+
buildscript {
82+
repositories {
83+
jcenter()
84+
}
85+
}
86+
87+
dependencies {
88+
compile 'com.github.aakira:compound-text-view:1.0.0@aar'
89+
}
90+
```
91+
## Using libraries
92+
93+
* [Material icons](https://material.io/icons/#ic_cloud_download)
94+
95+
## Author
96+
97+
### Akira Aratani
98+
99+
* Twitter
100+
- [@_a_akira](https://twitter.com/_a_akira)
101+
* Mail
102+
103+
104+
## License
105+
106+
```
107+
Copyright (C) 2017 A.Akira
108+
109+
Licensed under the Apache License, Version 2.0 (the "License");
110+
you may not use this file except in compliance with the License.
111+
You may obtain a copy of the License at
112+
113+
http://www.apache.org/licenses/LICENSE-2.0
114+
115+
Unless required by applicable law or agreed to in writing, software
116+
distributed under the License is distributed on an "AS IS" BASIS,
117+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
118+
See the License for the specific language governing permissions and
119+
limitations under the License.
120+
```
121+
122+
[preview]: /arts/preview.png

arts/preview.png

53.5 KB
Loading

build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
buildscript {
3+
repositories {
4+
jcenter()
5+
}
6+
dependencies {
7+
classpath 'com.android.tools.build:gradle:2.3.1'
8+
classpath 'com.novoda:bintray-release:0.5.0'
9+
}
10+
}
11+
12+
allprojects {
13+
repositories {
14+
jcenter()
15+
}
16+
}
17+
18+
task clean(type: Delete) {
19+
delete rootProject.buildDir
20+
}

compoundicontextview/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

compoundicontextview/build.gradle

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'com.novoda.bintray-release'
3+
4+
android {
5+
compileSdkVersion COMPILE_SDK_VERSION as int
6+
buildToolsVersion BUILD_TOOLS_VERSION
7+
8+
defaultConfig {
9+
minSdkVersion MIN_SDK_VERSION as int
10+
targetSdkVersion TARGET_SDK_VERSION as int
11+
versionCode LIBRARY_VERSION_CODE as int
12+
versionName LIBRARY_VERSION_NAME
13+
14+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15+
}
16+
}
17+
18+
dependencies {
19+
compile "com.android.support:appcompat-v7:$APP_COMPAT_VERSION"
20+
}
21+
22+
def getBintrayUserProperty() {
23+
return hasProperty('bintrayUser') ? bintrayUser : ""
24+
}
25+
26+
def getBintrayApiKeyProperty() {
27+
return hasProperty('bintrayApiKey') ? bintrayApiKey : ""
28+
}
29+
30+
publish {
31+
userOrg = POM_DEVELOPER_ID
32+
groupId = GROUP
33+
artifactId = ARTIFACT_ID
34+
publishVersion = LIBRARY_VERSION_NAME
35+
licences = ['Apache-2.0']
36+
desc = POM_DESCRIPTION
37+
website = POM_URL
38+
issueTracker = ISSUE_URL
39+
repository = POM_SCM_URL
40+
autoPublish = false
41+
bintrayUser = bintrayUserProperty
42+
bintrayKey = bintrayApiKeyProperty
43+
dryRun = false
44+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Applications/android-sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
18+
19+
# Uncomment this to preserve the line number information for
20+
# debugging stack traces.
21+
#-keepattributes SourceFile,LineNumberTable
22+
23+
# If you keep the line number information, uncomment this to
24+
# hide the original source file name.
25+
#-renamesourcefileattribute SourceFile
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<manifest package="com.github.aakira.compoundicontextview">
2+
3+
<application />
4+
</manifest>

0 commit comments

Comments
 (0)