Skip to content

Commit 49ebbe8

Browse files
committed
Prepare for publishing decor and decorators snapshots, Update README
1 parent e5d2bcc commit 49ebbe8

File tree

6 files changed

+68
-28
lines changed

6 files changed

+68
-28
lines changed

README.md

+57-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Decor
22
======
33

4-
Decor is a library that applies decorators to android layout with additional attributes
4+
*Decor* is a library that applies decorators to android layout with additional attributes
55
without the need to extend and create a cutom view for each functionnality.
66

77
Decor plugs into Android layout inflation and applies custom attributes to views.
@@ -20,26 +20,68 @@ have you ever written AutofitTextViewWithFont to make a textview resizes it's te
2020
}
2121
in activity class and in your layout
2222

23-
<TextView
24-
android:layout_width="match_parent"
25-
android:layout_height="wrap_content"
26-
android:text="I'm a TextView"
27-
app:decorTypefaceAsset="Ubuntu-M.ttf"
28-
app:decorAutoFit="true"
29-
app:decorAnimate="true"/>
30-
31-
this has the advantage of reusing these decorators in other views.
23+
```xml
24+
<TextView
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:text="I'm a TextView"
28+
app:decorTypefaceAsset="Ubuntu-M.ttf"
29+
app:decorAutoFit="true"
30+
app:decorAnimate="true"/>
31+
```
3232

33+
this has the advantage of reusing these decorators in other views.
3334
the module decorators contains some examples of useful decorators that you can start using now,
3435
more of them will be added soon.
3536

3637
If you want to not apply all decorators :
3738

38-
@Override
39-
protected void attachBaseContext(Context newBase) {
40-
super.attachBaseContext(DecorContextWrapper.wrap(newBase)
41-
.with(new FontDecorator());
42-
}
39+
```java
40+
@Override
41+
protected void attachBaseContext(Context newBase) {
42+
super.attachBaseContext(DecorContextWrapper.wrap(newBase)
43+
.with(new FontDecorator());
44+
}
45+
```
46+
47+
Snapshot
48+
========
49+
50+
Decor is still under heavy development but you can try it now via Maven Central snapshots.
51+
52+
Gradle:
53+
```groovy
54+
repositories {
55+
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
56+
}
57+
58+
dependencies {
59+
compile 'com.mounacheikhna:decor:0.1-SNAPSHOT@aar'
60+
compile 'com.mounacheikhn:decorators:0.1-SNAPSHOT@aar'
61+
}
62+
```
63+
64+
Want to help?
65+
=============
66+
67+
File new issues to discuss specific aspects of the API or the implementation and to propose new
68+
features or add new decorators.
69+
70+
71+
Licence
72+
=======
73+
74+
Copyright 2015 Mouna Cheikhna
75+
76+
Licensed under the Apache License, Version 2.0 (the "License");
77+
you may not use this file except in compliance with the License.
78+
You may obtain a copy of the License at
4379

80+
http://www.apache.org/licenses/LICENSE-2.0
4481

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

decor/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SubProject Library Gradle Properties
22
# See parent properties for global properties
33

4-
POM_NAME=Decor
4+
POM_NAME=Decor Main Library
55
POM_ARTIFACT_ID=decor
66
POM_PACKAGING=aar

decorators/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ dependencies {
3131
compile "com.android.support:palette-v7:${project.ANDROID_SUPPORT_VERSION}"
3232
compile "com.android.support:support-v4:${project.ANDROID_SUPPORT_VERSION}@aar"
3333
}
34+
35+
36+
apply from: '../deploy.gradle'

decorators/gradle.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
POM_NAME=Decor's Decorators
3+
POM_ARTIFACT_ID=decorators
4+
POM_PACKAGING=aar

deploy.gradle

+2-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'signing'
44

55

66
def isReleaseBuild() {
7-
project.ext.isReleaseVersion
7+
return VERSION_NAME.contains("SNAPSHOT") == false
88
}
99

1010
def getReleaseRepositoryUrl() {
@@ -23,23 +23,14 @@ def getRepositoryPassword() {
2323
return hasProperty('sonatypePassword') ? sonatypePassword : ""
2424
}
2525

26-
27-
// Debug Build or Release?
28-
if (isReleaseBuild()) {
29-
println "RELEASE BUILD $version"
30-
} else {
31-
version += "-SNAPSHOT"
32-
println "DEBUG BUILD $version"
33-
}
34-
3526
afterEvaluate { project ->
3627
uploadArchives {
3728
repositories {
3829
mavenDeployer {
3930
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
4031

4132
pom.groupId = GROUP
42-
pom.version = version
33+
pom.version = VERSION_NAME
4334
pom.artifactId = POM_ARTIFACT_ID
4435

4536
repository(url: getReleaseRepositoryUrl()) {

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# org.gradle.parallel=true
1919

2020
GROUP=com.mounacheikhna
21-
VERSION_NAME=0.1
21+
VERSION_NAME=0.1-SNAPSHOT
2222
VERSION_CODE=1
2323

2424
POM_PACKAGING=aar

0 commit comments

Comments
 (0)