1
1
Decor
2
2
======
3
3
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
5
5
without the need to extend and create a cutom view for each functionnality.
6
6
7
7
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
20
20
}
21
21
in activity class and in your layout
22
22
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
+ ```
32
32
33
+ this has the advantage of reusing these decorators in other views.
33
34
the module decorators contains some examples of useful decorators that you can start using now,
34
35
more of them will be added soon.
35
36
36
37
If you want to not apply all decorators :
37
38
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
43
79
80
+ http: // www.apache.org/licenses/LICENSE-2.0
44
81
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 .
45
87
0 commit comments