Skip to content

Commit d491f69

Browse files
committed
Merge remote-tracking branch 'github/master'
2 parents d721592 + ac11dc4 commit d491f69

File tree

1 file changed

+98
-3
lines changed

1 file changed

+98
-3
lines changed

README.md

Lines changed: 98 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
**`MultiFontView`** library can be used to select custom fonts for the view dynamically in your XML. The library loads the custom fonts using a font cache.
88

9+
**Views Available**
10+
11+
`MultiFontTextView`
12+
`MultiFontEditText`
13+
`MultiFontButton`
14+
`MultiFontSwitch`
15+
`MultiFontRadioButton`
16+
`MultiFontCheckBox`
917

1018
![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot.png?raw=true)
1119

@@ -46,6 +54,29 @@ To Use MultiFont EditText, add the below dependency
4654
compile 'com.github.shashkiranr.MultiFontView-Android:multifontedittext:1.4'
4755
}
4856
```
57+
To Use MultiFont Switch, add the below dependency
58+
59+
```groovy
60+
dependencies {
61+
compile 'com.github.shashkiranr.MultiFontView-Android:multifontswitch:1.4'
62+
}
63+
```
64+
65+
To Use MultiFont CheckBox, add the below dependency
66+
67+
```groovy
68+
dependencies {
69+
compile 'com.github.shashkiranr.MultiFontView-Android:multifontcheckbox:1.4'
70+
}
71+
```
72+
73+
To Use MultiFont RadioButton, add the below dependency
74+
75+
```groovy
76+
dependencies {
77+
compile 'com.github.shashkiranr.MultiFontView-Android:multifontradiobutton:1.4'
78+
}
79+
```
4980

5081
#### *STEP 2 - copy the fonts to assets folder under fonts subfolder*
5182

@@ -54,7 +85,7 @@ To Use MultiFont EditText, add the below dependency
5485

5586
#### *STEP 3 - create an attrs.xml file (if already present then add) a declare-stylable and attribute name typeface_from_list which contains the custom fonts in form of enums - as shown below*
5687

57-
For `MultiFontTextview` the declare-styleable should be named `MultiFontTextview` and attribute should be named `typeface_from_list`
88+
For `MultiFontTextView` the declare-styleable should be named `MultiFontTextView` and attribute should be named `typeface_from_list`
5889

5990
```groovy
6091
<attr name="typeface_from_list">
@@ -64,7 +95,7 @@ For `MultiFontTextview` the declare-styleable should be named `MultiFontTextview
6495
<enum name="Shine.ttf" value="3" />
6596
<enum name="SweetSensations.ttf" value="4" />
6697
</attr>
67-
<declare-styleable name="MultiFontTextview">
98+
<declare-styleable name="MultiFontTextView">
6899
<attr name="typeface_from_list" />
69100
</declare-styleable>
70101
```
@@ -99,6 +130,51 @@ For `MultiFontEditText` the declare-styleable should be named `MultiFontEditText
99130
</declare-styleable>
100131
```
101132

133+
For `MultiFontSwitch` the declare-styleable should be named `MultiFontSwitch` and attribute should be named `typeface_from_list`
134+
135+
```groovy
136+
<attr name="typeface_from_list">
137+
<enum name="BLESSED.otf" value="0" />
138+
<enum name="Respective.ttf" value="1" />
139+
<enum name="Respective_Slanted.ttf" value="2" />
140+
<enum name="Shine.ttf" value="3" />
141+
<enum name="SweetSensations.ttf" value="4" />
142+
</attr>
143+
<declare-styleable name="MultiFontSwitch">
144+
<attr name="typeface_from_list" />
145+
</declare-styleable>
146+
```
147+
148+
For `MultiFontRadioButton` the declare-styleable should be named `MultiFontRadioButton` and attribute should be named `typeface_from_list`
149+
150+
```groovy
151+
<attr name="typeface_from_list">
152+
<enum name="BLESSED.otf" value="0" />
153+
<enum name="Respective.ttf" value="1" />
154+
<enum name="Respective_Slanted.ttf" value="2" />
155+
<enum name="Shine.ttf" value="3" />
156+
<enum name="SweetSensations.ttf" value="4" />
157+
</attr>
158+
<declare-styleable name="MultiFontRadioButton">
159+
<attr name="typeface_from_list" />
160+
</declare-styleable>
161+
```
162+
163+
For `MultiFontCheckBox` the declare-styleable should be named `MultiFontCheckBox` and attribute should be named `typeface_from_list`
164+
165+
```groovy
166+
<attr name="typeface_from_list">
167+
<enum name="BLESSED.otf" value="0" />
168+
<enum name="Respective.ttf" value="1" />
169+
<enum name="Respective_Slanted.ttf" value="2" />
170+
<enum name="Shine.ttf" value="3" />
171+
<enum name="SweetSensations.ttf" value="4" />
172+
</attr>
173+
<declare-styleable name="MultiFontCheckBox">
174+
<attr name="typeface_from_list" />
175+
</declare-styleable>
176+
```
177+
102178
If you are using `all the views` or `any two views` just one typeface_from_list is enough as shown below
103179
```groovy
104180
<attr name="typeface_from_list">
@@ -108,7 +184,7 @@ If you are using `all the views` or `any two views` just one typeface_from_list
108184
<enum name="Shine.ttf" value="3" />
109185
<enum name="SweetSensations.ttf" value="4" />
110186
</attr>
111-
<declare-styleable name="MultiFontTextview">
187+
<declare-styleable name="MultiFontTextView">
112188
<attr name="typeface_from_list" />
113189
</declare-styleable>
114190
@@ -119,6 +195,19 @@ If you are using `all the views` or `any two views` just one typeface_from_list
119195
<declare-styleable name="MultiFontEditText">
120196
<attr name="typeface_from_list" />
121197
</declare-styleable>
198+
199+
<declare-styleable name="MultiFontSwitch">
200+
<attr name="typeface_from_list" />
201+
</declare-styleable>
202+
203+
<declare-styleable name="MultiFontRadioButton">
204+
<attr name="typeface_from_list" />
205+
</declare-styleable>
206+
207+
<declare-styleable name="MultiFontCheckBox">
208+
<attr name="typeface_from_list" />
209+
</declare-styleable>
210+
122211
```
123212

124213
#### *STEP 4 - create a string array with name `customFonts` and declare all the name of the custom fonts with file extension in the `same order` as `typeface_from_list` enum- as shown below*
@@ -141,6 +230,12 @@ If you are using `all the views` or `any two views` just one typeface_from_list
141230

142231
![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultifontEditText.png?raw=true)
143232

233+
![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontSwitch.png?raw=true)
234+
235+
![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontRadioButton.png?raw=true)
236+
237+
![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontCheckBox.png?raw=true)
238+
144239
## ***Thats it !!***
145240

146241
## **License**

0 commit comments

Comments
 (0)