├── app ├── .gitignore ├── src │ ├── main │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── KGTF.ttf │ │ │ │ ├── BLESSED.otf │ │ │ │ ├── Carre.ttf │ │ │ │ ├── Crasns.ttf │ │ │ │ ├── Shine.ttf │ │ │ │ ├── Respective.ttf │ │ │ │ ├── SweetSensations.ttf │ │ │ │ └── Respective_Slanted.ttf │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── fyi │ │ │ │ └── multifontview │ │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── fyi │ │ │ └── multifontview │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── fyi │ │ └── multifontview │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── multifontbutton ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontbutton │ │ │ ├── FontLoader.java │ │ │ └── MultiFontButton.java │ ├── test │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontbutton │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── fyi │ │ └── library │ │ └── multifontbutton │ │ └── ExampleInstrumentedTest.java ├── build.gradle └── proguard-rules.pro ├── multifontswitch ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontswitch │ │ │ ├── FontLoader.java │ │ │ └── MultiFontSwitch.java │ ├── test │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontswitch │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── fyi │ │ └── library │ │ └── multifontswitch │ │ └── ExampleInstrumentedTest.java ├── build.gradle └── proguard-rules.pro ├── multifontcheckbox ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontcheckbox │ │ │ ├── FontLoader.java │ │ │ └── MultiFontCheckBox.java │ ├── test │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontcheckbox │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── fyi │ │ └── library │ │ └── multifontcheckbox │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── multifontedittext ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontedittext │ │ │ ├── FontLoader.java │ │ │ └── MultiFontEditText.java │ ├── test │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontedittext │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── fyi │ │ └── library │ │ └── multifontedittext │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── multifontradiobutton ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontradiobutton │ │ │ ├── FontLoader.java │ │ │ └── MultiFontRadioButton.java │ ├── test │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifontradiobutton │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── fyi │ │ └── library │ │ └── multifontradiobutton │ │ └── ExampleInstrumentedTest.java ├── build.gradle └── proguard-rules.pro ├── multifonttextclock ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifonttextclock │ │ │ ├── FontLoader.java │ │ │ └── MultiFontTextClock.java │ ├── test │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── multifonttextclock │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── fyi │ │ └── library │ │ └── multifonttextclock │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── multifonttextview ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── mutifonttextview │ │ │ ├── FontLoader.java │ │ │ └── MultiFontTextView.java │ ├── test │ │ └── java │ │ │ └── fyi │ │ │ └── library │ │ │ └── mutifonttextview │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── fyi │ │ └── library │ │ └── mutifonttextview │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── Screenshot.png ├── Screenshot - assets.png ├── .idea ├── copyright │ └── profiles_settings.xml ├── markdown-navigator │ └── profiles_settings.xml ├── vcs.xml ├── markdown-exported-files.xml ├── runConfigurations.xml ├── compiler.xml ├── gradle.xml ├── modules.xml ├── misc.xml └── markdown-navigator.xml ├── Screenshot MultiFontButton.png ├── Screenshot MultiFontCheckBox.png ├── Screenshot MultiFontSwitch.png ├── Screenshot MultiFontTextview.png ├── Screenshot MultifontEditText.png ├── Screenshot MultiFontTextClock.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── Screenshot MultiFontRadioButton.png ├── .gitignore ├── settings.gradle ├── gradle.properties ├── LICENSE ├── gradlew.bat ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /multifontbutton/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /multifontswitch/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /multifontcheckbox/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /multifontedittext/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /multifontradiobutton/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /multifonttextclock/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /multifonttextview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot.png -------------------------------------------------------------------------------- /Screenshot - assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot - assets.png -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Screenshot MultiFontButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot MultiFontButton.png -------------------------------------------------------------------------------- /Screenshot MultiFontCheckBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot MultiFontCheckBox.png -------------------------------------------------------------------------------- /Screenshot MultiFontSwitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot MultiFontSwitch.png -------------------------------------------------------------------------------- /Screenshot MultiFontTextview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot MultiFontTextview.png -------------------------------------------------------------------------------- /Screenshot MultifontEditText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot MultifontEditText.png -------------------------------------------------------------------------------- /Screenshot MultiFontTextClock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot MultiFontTextClock.png -------------------------------------------------------------------------------- /app/src/main/assets/fonts/KGTF.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/assets/fonts/KGTF.ttf -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Screenshot MultiFontRadioButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/Screenshot MultiFontRadioButton.png -------------------------------------------------------------------------------- /app/src/main/assets/fonts/BLESSED.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/assets/fonts/BLESSED.otf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Carre.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/assets/fonts/Carre.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Crasns.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/assets/fonts/Crasns.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Shine.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/assets/fonts/Shine.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Respective.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/assets/fonts/Respective.ttf -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/assets/fonts/SweetSensations.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/assets/fonts/SweetSensations.ttf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Respective_Slanted.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/assets/fonts/Respective_Slanted.ttf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shashkiranr/MultiFontView-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':multifonttextview', ':multifontbutton', ':multifontedittext', ':multifontswitch', ':multifontradiobutton', ':multifontcheckbox', ':multifonttextclock' 2 | -------------------------------------------------------------------------------- /multifontbutton/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | multifontbutton 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /multifontswitch/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | multifontswitch 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /multifontcheckbox/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | multifontcheckbox 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /multifontedittext/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | multifontedittext 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /multifonttextview/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Mutifont Textview 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /multifontradiobutton/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | multifontradiobutton 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /multifonttextclock/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | multifonttextclock 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/markdown-exported-files.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 28 02:10:56 EDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /multifontbutton/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /multifontswitch/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /multifontcheckbox/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /multifontedittext/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /multifonttextclock/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /multifonttextview/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /multifontradiobutton/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /multifontbutton/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /multifontswitch/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /multifonttextview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /multifontcheckbox/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /multifontedittext/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /multifonttextclock/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /multifontradiobutton/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/fyi/multifontview/MainActivity.java: -------------------------------------------------------------------------------- 1 | package fyi.multifontview; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | public class MainActivity extends AppCompatActivity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | setContentView(R.layout.activity_main); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/fyi/multifontview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package fyi.multifontview; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /multifontbutton/src/test/java/fyi/library/multifontbutton/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontbutton; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /multifontswitch/src/test/java/fyi/library/multifontswitch/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontswitch; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /multifonttextview/src/test/java/fyi/library/mutifonttextview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.mutifonttextview; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /multifontcheckbox/src/test/java/fyi/library/multifontcheckbox/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontcheckbox; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /multifontedittext/src/test/java/fyi/library/multifontedittext/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontedittext; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /multifonttextclock/src/test/java/fyi/library/multifonttextclock/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifonttextclock; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /multifontradiobutton/src/test/java/fyi/library/multifontradiobutton/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontradiobutton; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MultiFontView 3 | Name 4 | Click Button 5 | Hello World! 6 | Switch 7 | RadioButton 8 | CheckBox 9 | 10 | BLESSED.otf 11 | Respective.ttf 12 | Respective_Slanted.ttf 13 | Shine.ttf 14 | SweetSensations.ttf 15 | Crasns.ttf 16 | Carre.ttf 17 | KGTF.ttf 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/androidTest/java/fyi/multifontview/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package fyi.multifontview; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("fyi.multifontview", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /multifontbutton/src/androidTest/java/fyi/library/multifontbutton/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontbutton; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("fyi.library.multifontbutton.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /multifontswitch/src/androidTest/java/fyi/library/multifontswitch/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontswitch; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("fyi.library.multifontswitch.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /multifonttextview/src/androidTest/java/fyi/library/mutifonttextview/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.mutifonttextview; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("fyi.mutifonttextview.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /multifontcheckbox/src/androidTest/java/fyi/library/multifontcheckbox/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontcheckbox; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("fyi.library.multifontcheckbox.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /multifontedittext/src/androidTest/java/fyi/library/multifontedittext/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontedittext; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("fyi.library.multifontedittext.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /multifonttextclock/src/androidTest/java/fyi/library/multifonttextclock/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifonttextclock; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("fyi.library.multifonttextclock.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /multifontradiobutton/src/androidTest/java/fyi/library/multifontradiobutton/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontradiobutton; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("fyi.library.multifontradiobutton.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/shashi/Library/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 26 | -------------------------------------------------------------------------------- /multifonttextview/src/main/java/fyi/library/mutifonttextview/FontLoader.java: -------------------------------------------------------------------------------- 1 | package fyi.library.mutifonttextview; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Typeface; 6 | 7 | import java.util.HashMap; 8 | /* 9 | This font loader class is obtained from Future Studio - "Custom Fonts on Android — Extending TextView" 10 | for more info please visit https://futurestud.io 11 | * 12 | * */ 13 | public class FontLoader { 14 | private static HashMap fontMapCache = new HashMap<>(); 15 | 16 | public static Typeface getTypeface(Context context, String fontname) { 17 | Typeface typeface = fontMapCache.get(fontname); 18 | 19 | if (typeface == null) { 20 | try { 21 | typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontname); 22 | } catch (Exception e) { 23 | return null; 24 | } 25 | 26 | fontMapCache.put(fontname, typeface); 27 | } 28 | 29 | return typeface; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /multifontbutton/src/main/java/fyi/library/multifontbutton/FontLoader.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontbutton; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Typeface; 6 | 7 | import java.util.HashMap; 8 | 9 | /* 10 | This font loader class is obtained from Future Studio - "Custom Fonts on Android — Extending TextView" 11 | for more info please visit https://futurestud.io 12 | * 13 | * */ 14 | public class FontLoader { 15 | private static HashMap fontMapCache = new HashMap<>(); 16 | 17 | public static Typeface getTypeface(Context context, String fontname) { 18 | Typeface typeface = fontMapCache.get(fontname); 19 | 20 | if (typeface == null) { 21 | try { 22 | typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontname); 23 | } catch (Exception e) { 24 | return null; 25 | } 26 | 27 | fontMapCache.put(fontname, typeface); 28 | } 29 | 30 | return typeface; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /multifontswitch/src/main/java/fyi/library/multifontswitch/FontLoader.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontswitch; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Typeface; 6 | 7 | import java.util.HashMap; 8 | 9 | /* 10 | This font loader class is obtained from Future Studio - "Custom Fonts on Android — Extending TextView" 11 | for more info please visit https://futurestud.io 12 | * 13 | * */ 14 | public class FontLoader { 15 | private static HashMap fontMapCache = new HashMap<>(); 16 | 17 | public static Typeface getTypeface(Context context, String fontname) { 18 | Typeface typeface = fontMapCache.get(fontname); 19 | 20 | if (typeface == null) { 21 | try { 22 | typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontname); 23 | } catch (Exception e) { 24 | return null; 25 | } 26 | 27 | fontMapCache.put(fontname, typeface); 28 | } 29 | 30 | return typeface; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /multifontcheckbox/src/main/java/fyi/library/multifontcheckbox/FontLoader.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontcheckbox; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Typeface; 6 | 7 | import java.util.HashMap; 8 | 9 | /* 10 | This font loader class is obtained from Future Studio - "Custom Fonts on Android — Extending TextView" 11 | for more info please visit https://futurestud.io 12 | * 13 | * */ 14 | public class FontLoader { 15 | private static HashMap fontMapCache = new HashMap<>(); 16 | 17 | public static Typeface getTypeface(Context context, String fontname) { 18 | Typeface typeface = fontMapCache.get(fontname); 19 | 20 | if (typeface == null) { 21 | try { 22 | typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontname); 23 | } catch (Exception e) { 24 | return null; 25 | } 26 | 27 | fontMapCache.put(fontname, typeface); 28 | } 29 | 30 | return typeface; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /multifontedittext/src/main/java/fyi/library/multifontedittext/FontLoader.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontedittext; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Typeface; 6 | 7 | import java.util.HashMap; 8 | 9 | /* 10 | This font loader class is obtained from Future Studio - "Custom Fonts on Android — Extending TextView" 11 | for more info please visit https://futurestud.io 12 | * 13 | * */ 14 | public class FontLoader { 15 | private static HashMap fontMapCache = new HashMap<>(); 16 | 17 | public static Typeface getTypeface(Context context, String fontname) { 18 | Typeface typeface = fontMapCache.get(fontname); 19 | 20 | if (typeface == null) { 21 | try { 22 | typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontname); 23 | } catch (Exception e) { 24 | return null; 25 | } 26 | 27 | fontMapCache.put(fontname, typeface); 28 | } 29 | 30 | return typeface; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /multifonttextclock/src/main/java/fyi/library/multifonttextclock/FontLoader.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifonttextclock; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Typeface; 6 | 7 | import java.util.HashMap; 8 | 9 | /* 10 | This font loader class is obtained from Future Studio - "Custom Fonts on Android — Extending TextView" 11 | for more info please visit https://futurestud.io 12 | * 13 | * */ 14 | public class FontLoader { 15 | private static HashMap fontMapCache = new HashMap<>(); 16 | 17 | public static Typeface getTypeface(Context context, String fontname) { 18 | Typeface typeface = fontMapCache.get(fontname); 19 | 20 | if (typeface == null) { 21 | try { 22 | typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontname); 23 | } catch (Exception e) { 24 | return null; 25 | } 26 | 27 | fontMapCache.put(fontname, typeface); 28 | } 29 | 30 | return typeface; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /multifontbutton/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group = 'com.github.shashkiranr' 4 | 5 | android { 6 | compileSdkVersion 26 7 | buildToolsVersion "26.0.1" 8 | 9 | defaultConfig { 10 | minSdkVersion 16 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | compile 'com.android.support:appcompat-v7:26.+' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /multifontbutton/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/shashi/Library/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 26 | -------------------------------------------------------------------------------- /multifontcheckbox/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/shashi/Library/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 26 | -------------------------------------------------------------------------------- /multifontedittext/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/shashi/Library/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 26 | -------------------------------------------------------------------------------- /multifontswitch/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group = 'com.github.shashkiranr' 4 | 5 | android { 6 | compileSdkVersion 26 7 | buildToolsVersion "26.0.1" 8 | 9 | defaultConfig { 10 | minSdkVersion 16 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | compile 'com.android.support:appcompat-v7:26.+' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /multifontswitch/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/shashi/Library/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 26 | -------------------------------------------------------------------------------- /multifonttextclock/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/shashi/Library/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 26 | -------------------------------------------------------------------------------- /multifonttextview/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/shashi/Library/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 26 | -------------------------------------------------------------------------------- /multifontcheckbox/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group = 'com.github.shashkiranr' 4 | 5 | android { 6 | compileSdkVersion 26 7 | buildToolsVersion "26.0.1" 8 | 9 | defaultConfig { 10 | minSdkVersion 16 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | compile 'com.android.support:appcompat-v7:26.+' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /multifontedittext/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group = 'com.github.shashkiranr' 4 | 5 | android { 6 | compileSdkVersion 26 7 | buildToolsVersion "26.0.1" 8 | 9 | defaultConfig { 10 | minSdkVersion 16 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | compile 'com.android.support:appcompat-v7:26.+' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /multifontradiobutton/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group = 'com.github.shashkiranr' 4 | 5 | android { 6 | compileSdkVersion 26 7 | buildToolsVersion "26.0.1" 8 | 9 | defaultConfig { 10 | minSdkVersion 16 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | compile 'com.android.support:appcompat-v7:26.+' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /multifontradiobutton/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/shashi/Library/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 26 | -------------------------------------------------------------------------------- /multifontradiobutton/src/main/java/fyi/library/multifontradiobutton/FontLoader.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontradiobutton; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Typeface; 6 | 7 | import java.util.HashMap; 8 | 9 | /* 10 | This font loader class is obtained from Future Studio - "Custom Fonts on Android — Extending TextView" 11 | for more info please visit https://futurestud.io 12 | * 13 | * */ 14 | public class FontLoader { 15 | private static HashMap fontMapCache = new HashMap<>(); 16 | 17 | public static Typeface getTypeface(Context context, String fontname) { 18 | Typeface typeface = fontMapCache.get(fontname); 19 | 20 | if (typeface == null) { 21 | try { 22 | typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontname); 23 | } catch (Exception e) { 24 | return null; 25 | } 26 | 27 | fontMapCache.put(fontname, typeface); 28 | } 29 | 30 | return typeface; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /multifonttextclock/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group = 'com.github.shashkiranr' 4 | 5 | android { 6 | compileSdkVersion 26 7 | buildToolsVersion "26.0.1" 8 | 9 | defaultConfig { 10 | minSdkVersion 17 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | compile 'com.android.support:appcompat-v7:26.+' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /multifonttextview/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group = 'com.github.shashkiranr' 4 | 5 | android { 6 | compileSdkVersion 26 7 | buildToolsVersion "26.0.1" 8 | 9 | defaultConfig { 10 | minSdkVersion 16 11 | targetSdkVersion 26 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | compile 'com.android.support:appcompat-v7:26.+' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 shashkiranr 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.1" 6 | defaultConfig { 7 | applicationId "fyi.multifontview" 8 | minSdkVersion 17 9 | targetSdkVersion 26 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:26.+' 28 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 29 | testCompile 'junit:junit:4.12' 30 | compile project(':multifonttextview') 31 | compile project(':multifontbutton') 32 | compile project(':multifontedittext') 33 | compile project(':multifontswitch') 34 | compile project(':multifontradiobutton') 35 | compile project(':multifontcheckbox') 36 | compile project(':multifonttextclock') 37 | } 38 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /multifontbutton/src/main/java/fyi/library/multifontbutton/MultiFontButton.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontbutton; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.res.TypedArray; 6 | import android.graphics.Typeface; 7 | import android.util.AttributeSet; 8 | import android.util.Log; 9 | 10 | 11 | public class MultiFontButton extends android.support.v7.widget.AppCompatButton{ 12 | 13 | private static final String LOG_TAG = "MultiFontButton"; 14 | 15 | public MultiFontButton(Context context) { 16 | super(context); 17 | } 18 | 19 | public MultiFontButton(Context context, AttributeSet attrs) { 20 | super(context, attrs); 21 | initializeCustomTypeface(attrs, context); 22 | } 23 | 24 | public MultiFontButton(Context context, AttributeSet attrs, int defStyleAttr) { 25 | super(context, attrs, defStyleAttr); 26 | initializeCustomTypeface(attrs, context); 27 | } 28 | 29 | private void initializeCustomTypeface(AttributeSet attrs, Context context) { 30 | if (attrs != null) { 31 | 32 | TypedArray attributesArray = context.obtainStyledAttributes(attrs, 33 | R.styleable.MultiFontButton); 34 | int fontID = attributesArray.getInt(R.styleable.MultiFontButton_typeface_from_list, -1); 35 | String[] fontStringArray = context.getResources().getStringArray(R.array.customFonts); 36 | 37 | //if a typeface is selected for the Button and if the font names are declared in the 38 | // string array customFonts then load that typeface from cache 39 | if ((fontID != -1) && (fontStringArray.length != 0)) { 40 | try { 41 | Typeface myTypeface = FontLoader.getTypeface(context, fontStringArray[fontID]); 42 | setTypeface(myTypeface); 43 | } catch (Exception e) { 44 | e.printStackTrace(); 45 | } 46 | } else { 47 | Log.e(LOG_TAG, "Either of the string array CustomFonts or" + 48 | " attribute typeface_from_list is not present" + fontID); 49 | } 50 | attributesArray.recycle(); 51 | } 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /multifontswitch/src/main/java/fyi/library/multifontswitch/MultiFontSwitch.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontswitch; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Typeface; 6 | import android.util.AttributeSet; 7 | import android.util.Log; 8 | import android.widget.Switch; 9 | 10 | 11 | 12 | public class MultiFontSwitch extends Switch { 13 | 14 | private static final String LOG_TAG = "MultiFontSwitch"; 15 | 16 | public MultiFontSwitch(Context context) { 17 | super(context); 18 | } 19 | 20 | public MultiFontSwitch(Context context, AttributeSet attrs) { 21 | super(context, attrs); 22 | initializeCustomTypeface(attrs, context); 23 | } 24 | 25 | public MultiFontSwitch(Context context, AttributeSet attrs, int defStyleAttr) { 26 | super(context, attrs, defStyleAttr); 27 | initializeCustomTypeface(attrs, context); 28 | } 29 | 30 | private void initializeCustomTypeface(AttributeSet attrs, Context context) { 31 | if (attrs != null) { 32 | 33 | TypedArray attributesArray = context.obtainStyledAttributes(attrs, 34 | R.styleable.MultiFontSwitch); 35 | int fontID = attributesArray.getInt(R.styleable.MultiFontSwitch_typeface_from_list, -1); 36 | String[] fontStringArray = context.getResources().getStringArray(R.array.customFonts); 37 | 38 | //if a typeface is selected for the Switch and if the font names are declared in the 39 | // string array customFonts then load that typeface from cache 40 | if ((fontID != -1) && (fontStringArray.length != 0)) { 41 | try { 42 | Typeface myTypeface = FontLoader.getTypeface(context, fontStringArray[fontID]); 43 | setTypeface(myTypeface); 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | } else { 48 | Log.e(LOG_TAG, "Either of the string array CustomFonts or" + 49 | " attribute typeface_from_list is not present" + fontID); 50 | } 51 | attributesArray.recycle(); 52 | } 53 | 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /multifontcheckbox/src/main/java/fyi/library/multifontcheckbox/MultiFontCheckBox.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontcheckbox; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Typeface; 6 | import android.util.AttributeSet; 7 | import android.util.Log; 8 | 9 | 10 | public class MultiFontCheckBox extends android.support.v7.widget.AppCompatCheckBox { 11 | 12 | private static final String LOG_TAG = "MultiFontCheckBox"; 13 | 14 | public MultiFontCheckBox(Context context) { 15 | super(context); 16 | } 17 | 18 | public MultiFontCheckBox(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | initializeCustomTypeface(attrs, context); 21 | } 22 | 23 | public MultiFontCheckBox(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | initializeCustomTypeface(attrs, context); 26 | } 27 | 28 | private void initializeCustomTypeface(AttributeSet attrs, Context context) { 29 | if (attrs != null) { 30 | 31 | TypedArray attributesArray = context.obtainStyledAttributes(attrs, 32 | R.styleable.MultiFontCheckBox); 33 | int fontID = attributesArray.getInt(R.styleable.MultiFontCheckBox_typeface_from_list, -1); 34 | String[] fontStringArray = context.getResources().getStringArray(R.array.customFonts); 35 | 36 | //if a typeface is selected for the Button and if the font names are declared in the 37 | // string array customFonts then load that typeface from cache 38 | if ((fontID != -1) && (fontStringArray.length != 0)) { 39 | try { 40 | Typeface myTypeface = FontLoader.getTypeface(context, fontStringArray[fontID]); 41 | setTypeface(myTypeface); 42 | } catch (Exception e) { 43 | e.printStackTrace(); 44 | } 45 | } else { 46 | Log.e(LOG_TAG, "Either of the string array CustomFonts or" + 47 | " attribute typeface_from_list is not present" + fontID); 48 | } 49 | attributesArray.recycle(); 50 | } 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /multifontedittext/src/main/java/fyi/library/multifontedittext/MultiFontEditText.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontedittext; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.res.TypedArray; 6 | import android.graphics.Typeface; 7 | import android.util.AttributeSet; 8 | import android.util.Log; 9 | 10 | public class MultiFontEditText extends android.support.v7.widget.AppCompatEditText{ 11 | 12 | private static final String LOG_TAG = "MultiFontEditText"; 13 | 14 | public MultiFontEditText(Context context) { 15 | super(context); 16 | } 17 | 18 | public MultiFontEditText(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | initializeCustomTypeface(attrs, context); 21 | } 22 | 23 | public MultiFontEditText(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | initializeCustomTypeface(attrs, context); 26 | } 27 | 28 | private void initializeCustomTypeface(AttributeSet attrs, Context context) { 29 | if (attrs != null) { 30 | 31 | TypedArray attributesArray = context.obtainStyledAttributes(attrs, 32 | R.styleable.MultiFontEditText); 33 | int fontID = attributesArray.getInt(R.styleable.MultiFontEditText_typeface_from_list, -1); 34 | String[] fontStringArray = context.getResources().getStringArray(R.array.customFonts); 35 | 36 | //if a typeface is selected for the Edittext and if the font names are declared in the 37 | // string array customFonts then load that typeface from cache 38 | if ((fontID != -1) && (fontStringArray.length != 0)) { 39 | try { 40 | Typeface myTypeface = FontLoader.getTypeface(context, fontStringArray[fontID]); 41 | setTypeface(myTypeface); 42 | } catch (Exception e) { 43 | e.printStackTrace(); 44 | } 45 | } else { 46 | Log.e(LOG_TAG, "Either of the string array CustomFonts or" + 47 | " attribute typeface_from_list is not present" + fontID); 48 | } 49 | attributesArray.recycle(); 50 | } 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /multifonttextview/src/main/java/fyi/library/mutifonttextview/MultiFontTextView.java: -------------------------------------------------------------------------------- 1 | package fyi.library.mutifonttextview; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Typeface; 6 | import android.util.AttributeSet; 7 | import android.util.Log; 8 | 9 | 10 | public class MultiFontTextView extends android.support.v7.widget.AppCompatTextView { 11 | 12 | private static final String LOG_TAG = "MultiFontTextView"; 13 | 14 | public MultiFontTextView(Context context) { 15 | super(context); 16 | } 17 | 18 | public MultiFontTextView(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | initializeCustomTypeface(attrs, context); 21 | } 22 | 23 | public MultiFontTextView(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | initializeCustomTypeface(attrs, context); 26 | } 27 | 28 | private void initializeCustomTypeface(AttributeSet attrs, Context context) { 29 | if (attrs != null) { 30 | 31 | TypedArray attributesArray = context.obtainStyledAttributes(attrs, 32 | R.styleable.MultiFontTextView); 33 | int fontID = attributesArray.getInt(R.styleable.MultiFontTextView_typeface_from_list, -1); 34 | String[] fontStringArray = context.getResources().getStringArray(R.array.customFonts); 35 | 36 | //if a typeface is selected for the textview and if the font names are declared in the 37 | // string array customFonts then load that typeface from cache 38 | if ((fontID != -1) && (fontStringArray.length != 0)) { 39 | try { 40 | Typeface myTypeface = FontLoader.getTypeface(context, fontStringArray[fontID]); 41 | setTypeface(myTypeface); 42 | } catch (Exception e) { 43 | e.printStackTrace(); 44 | } 45 | } else { 46 | Log.e(LOG_TAG, "Either of the string array CustomFonts or" + 47 | " attribute typeface_from_list is not present" + fontID); 48 | } 49 | attributesArray.recycle(); 50 | } 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /multifonttextclock/src/main/java/fyi/library/multifonttextclock/MultiFontTextClock.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifonttextclock; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Typeface; 6 | import android.util.AttributeSet; 7 | import android.util.Log; 8 | import android.widget.TextClock; 9 | 10 | 11 | public class MultiFontTextClock extends TextClock { 12 | 13 | private static final String LOG_TAG = "MultiFontTextClock"; 14 | 15 | public MultiFontTextClock(Context context) { 16 | super(context); 17 | } 18 | 19 | public MultiFontTextClock(Context context, AttributeSet attrs) { 20 | super(context, attrs); 21 | initializeCustomTypeface(attrs, context); 22 | } 23 | 24 | public MultiFontTextClock(Context context, AttributeSet attrs, int defStyleAttr) { 25 | super(context, attrs, defStyleAttr); 26 | initializeCustomTypeface(attrs, context); 27 | } 28 | 29 | private void initializeCustomTypeface(AttributeSet attrs, Context context) { 30 | if (attrs != null) { 31 | 32 | TypedArray attributesArray = context.obtainStyledAttributes(attrs, 33 | R.styleable.MultiFontTextClock); 34 | int fontID = attributesArray.getInt(R.styleable.MultiFontTextClock_typeface_from_list, -1); 35 | String[] fontStringArray = context.getResources().getStringArray(R.array.customFonts); 36 | 37 | //if a typeface is selected for the TextClock and if the font names are declared in the 38 | // string array customFonts then load that typeface from cache 39 | if ((fontID != -1) && (fontStringArray.length != 0)) { 40 | try { 41 | Typeface myTypeface = FontLoader.getTypeface(context, fontStringArray[fontID]); 42 | setTypeface(myTypeface); 43 | } catch (Exception e) { 44 | e.printStackTrace(); 45 | } 46 | } else { 47 | Log.e(LOG_TAG, "Either of the string array CustomFonts or" + 48 | " attribute typeface_from_list is not present" + fontID); 49 | } 50 | attributesArray.recycle(); 51 | } 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /multifontradiobutton/src/main/java/fyi/library/multifontradiobutton/MultiFontRadioButton.java: -------------------------------------------------------------------------------- 1 | package fyi.library.multifontradiobutton; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Typeface; 6 | import android.util.AttributeSet; 7 | import android.util.Log; 8 | 9 | 10 | public class MultiFontRadioButton extends android.support.v7.widget.AppCompatRadioButton { 11 | 12 | private static final String LOG_TAG = "MultiFontRadioButton"; 13 | 14 | public MultiFontRadioButton(Context context) { 15 | super(context); 16 | } 17 | 18 | public MultiFontRadioButton(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | initializeCustomTypeface(attrs, context); 21 | } 22 | 23 | public MultiFontRadioButton(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | initializeCustomTypeface(attrs, context); 26 | } 27 | 28 | private void initializeCustomTypeface(AttributeSet attrs, Context context) { 29 | if (attrs != null) { 30 | 31 | TypedArray attributesArray = context.obtainStyledAttributes(attrs, 32 | R.styleable.MultiFontRadioButton); 33 | int fontID = attributesArray.getInt(R.styleable.MultiFontRadioButton_typeface_from_list, -1); 34 | String[] fontStringArray = context.getResources().getStringArray(R.array.customFonts); 35 | 36 | //if a typeface is selected for the Edittext and if the font names are declared in the 37 | // string array customFonts then load that typeface from cache 38 | if ((fontID != -1) && (fontStringArray.length != 0)) { 39 | try { 40 | Typeface myTypeface = FontLoader.getTypeface(context, fontStringArray[fontID]); 41 | setTypeface(myTypeface); 42 | } catch (Exception e) { 43 | e.printStackTrace(); 44 | } 45 | } else { 46 | Log.e(LOG_TAG, "Either of the string array CustomFonts or" + 47 | " attribute typeface_from_list is not present" + fontID); 48 | } 49 | attributesArray.recycle(); 50 | } 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 36 | 37 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## **MultiFontView** 3 | 4 | [![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16) 5 | [![](https://jitpack.io/v/shashkiranr/MultiFontView-Android.svg)](https://jitpack.io/#shashkiranr/MultiFontView-Android) 6 | 7 | **`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. 8 | 9 | **Views Available** 10 | 11 | `MultiFontTextView` 12 | `MultiFontEditText` 13 | `MultiFontButton` 14 | `MultiFontSwitch` 15 | `MultiFontRadioButton` 16 | `MultiFontCheckBox` 17 | `MultiFontTextClock[API 17+]` 18 | 19 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot.png?raw=true) 20 | 21 | ## **How to Use** 22 | 23 | #### *STEP 1 - Declare dependencies in your project* 24 | 25 | To add any `MultiFontView` to your project, first make sure in root `build.gradle` you have specified the following repository: 26 | ```groovy 27 | allprojects { 28 | repositories { 29 | ... 30 | maven { url 'https://jitpack.io' } 31 | } 32 | } 33 | ``` 34 | 35 | To Use MultiFont Textview, add the below dependency 36 | 37 | ```groovy 38 | dependencies { 39 | compile 'com.github.shashkiranr.MultiFontView-Android:multifonttextview:1.7' 40 | } 41 | ``` 42 | 43 | To Use MultiFont Button, add the below dependency 44 | 45 | ```groovy 46 | dependencies { 47 | compile 'com.github.shashkiranr.MultiFontView-Android:multifontbutton:1.7' 48 | } 49 | ``` 50 | 51 | To Use MultiFont EditText, add the below dependency 52 | 53 | ```groovy 54 | dependencies { 55 | compile 'com.github.shashkiranr.MultiFontView-Android:multifontedittext:1.7' 56 | } 57 | ``` 58 | To Use MultiFont Switch, add the below dependency 59 | 60 | ```groovy 61 | dependencies { 62 | compile 'com.github.shashkiranr.MultiFontView-Android:multifontswitch:1.7' 63 | } 64 | ``` 65 | 66 | To Use MultiFont CheckBox, add the below dependency 67 | 68 | ```groovy 69 | dependencies { 70 | compile 'com.github.shashkiranr.MultiFontView-Android:multifontcheckbox:1.7' 71 | } 72 | ``` 73 | 74 | To Use MultiFont RadioButton, add the below dependency 75 | 76 | ```groovy 77 | dependencies { 78 | compile 'com.github.shashkiranr.MultiFontView-Android:multifontradiobutton:1.7' 79 | } 80 | ``` 81 | 82 | To Use MultiFont TextClock, add the below dependency 83 | 84 | ```groovy 85 | dependencies { 86 | compile 'com.github.shashkiranr.MultiFontView-Android:multifonttextclock:1.7' 87 | } 88 | ``` 89 | 90 | #### *STEP 2 - copy the fonts to assets folder under fonts subfolder* 91 | 92 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20-%20assets.png?raw=true) 93 | 94 | 95 | #### *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* 96 | 97 | For `MultiFontTextView` the declare-styleable should be named `MultiFontTextView` and attribute should be named `typeface_from_list` 98 | 99 | ```groovy 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | ``` 111 | 112 | For `MultiFontButton` the declare-styleable should be named `MultiFontButton` and attribute should be named `typeface_from_list` 113 | 114 | ```groovy 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | ``` 126 | 127 | For `MultiFontEditText` the declare-styleable should be named `MultiFontEditText` and attribute should be named `typeface_from_list` 128 | 129 | ```groovy 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | ``` 141 | 142 | For `MultiFontSwitch` the declare-styleable should be named `MultiFontSwitch` and attribute should be named `typeface_from_list` 143 | 144 | ```groovy 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | ``` 156 | 157 | For `MultiFontRadioButton` the declare-styleable should be named `MultiFontRadioButton` and attribute should be named `typeface_from_list` 158 | 159 | ```groovy 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | ``` 171 | 172 | For `MultiFontCheckBox` the declare-styleable should be named `MultiFontCheckBox` and attribute should be named `typeface_from_list` 173 | 174 | ```groovy 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | ``` 186 | 187 | For `MultiFontTextClock` the declare-styleable should be named `MultiFontCheckBox` and attribute should be named `typeface_from_list` 188 | 189 | ```groovy 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | ``` 201 | 202 | If you are using `all the views` or `any two views` just one typeface_from_list is enough as shown below 203 | ```groovy 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | ``` 240 | 241 | #### *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* 242 | 243 | ```groovy 244 | 245 | BLESSED.otf 246 | Respective.ttf 247 | Respective_Slanted.ttf 248 | Shine.ttf 249 | SweetSensations.ttf 250 | 251 | ``` 252 | 253 | #### *STEP 5 - Add the custom view in your layout. The property `typeface_from_list` should apper and the font names should display as values as shown below* 254 | 255 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontTextview.png?raw=true) 256 | 257 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontButton.png?raw=true) 258 | 259 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultifontEditText.png?raw=true) 260 | 261 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontSwitch.png?raw=true) 262 | 263 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontRadioButton.png?raw=true) 264 | 265 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontCheckBox.png?raw=true) 266 | 267 | ![](https://github.com/shashkiranr/MultiFontView-Android/blob/master/Screenshot%20MultiFontTextClock.png?raw=true) 268 | 269 | 270 | 271 | ## ***Thats it !!*** 272 | 273 | ## **License** 274 | 275 | MIT License 276 | 277 | Copyright (c) 2017 shashkiranr 278 | 279 | Permission is hereby granted, free of charge, to any person obtaining a copy 280 | of this software and associated documentation files (the "Software"), to deal 281 | in the Software without restriction, including without limitation the rights 282 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 283 | copies of the Software, and to permit persons to whom the Software is 284 | furnished to do so, subject to the following conditions: 285 | 286 | The above copyright notice and this permission notice shall be included in all 287 | copies or substantial portions of the Software. 288 | 289 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 290 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 291 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 292 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 293 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 294 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 295 | SOFTWARE. 296 | 297 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 26 | 27 | 44 | 45 | 61 | 62 | 78 | 79 | 97 | 98 | 116 | 117 | 134 | 135 | 151 | 152 | 168 | 169 | 185 | 186 | 202 | 203 | 220 | 221 | 236 | 237 | 252 | 253 | 254 | 255 | --------------------------------------------------------------------------------