CustomFontView | Easiest way to include custom fonts in your TextView | Frontend Framework library
kandi X-RAY | CustomFontView Summary
kandi X-RAY | CustomFontView Summary
Easiest way to include custom fonts in your TextView
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates the custom font view
- Initializes the typeface
CustomFontView Key Features
CustomFontView Examples and Code Snippets
Community Discussions
Trending Discussions on CustomFontView
QUESTION
I'm writing unit tests (using robolectric 3.1
) for company's project. In a recent commit, android gradle plugin
version was updated from 2.1.0
to 2.2.3
.
This change caused tests to fail whenever a test is calling code that loads custom fonts.
Changing plugin version back to 2.1.0
fixes the issue, but I've been told that version change is required and has to stay. Anyway, our CI build environment has no problem with tests, so it seems that the issue occurs only for my local build.
I've updated JRE and SDK, both 1.8 (and set JAVA_HOME to updated JDK directory), and Android Studio, to no avail. Assets directory is correctly placed under 'main', not 'res' directory (fonts are in app/src/main/assets/fonts/). Cleaning the project and restarting IDE with cache invalidation also didn't help.
Issue persist after turning Instant Run off, so it's not the one described here https://code.google.com/p/android/issues/detail?id=213454
build.gradle:
...ANSWER
Answered 2017-Feb-15 at 13:00It's Robolectric indeed
https://github.com/robolectric/robolectric/issues/2647
Android gradle plugin internal implementation changed in 2.2 but Robolectric 3.1 is still based on old implemetation. It's fixed in Robolectric 3.2. Besides of robolectric upgrade, solution suggested on github by otbinary also works like a charm:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install CustomFontView
You can use CustomFontView like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the CustomFontView component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page