Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[delivers #173907701] added font customisation to the customisation.md doc file #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions _includes/fonts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<figure>
<pre><code class="xml" data-lang="xml">
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Replacer replacer = HoverFontReplacer.Build(getApplicationContext());
replacer.setDefaultFont("Gibson-Regular.otf");
replacer.setBoldFont("Gibson-Bold.otf");
replacer.setItalicFont("Gibson-SemiBoldItalic.otf");
...
replacer.applyFont();
}
}
</code></pre>
</figure>

Binary file added assets/images/font_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,13 @@ If you wish to change the text that appears when a user goes to the Accessibilit

You can translate the strings that are part of Hover's UI components. The list of string resources to translate are in the root folder of the Hover SDK's aar packaging called `public.txt` you can find the current english value of those strings in `/res/values/values.xml`

#### Font customisation
Font customization allows you to have a uniform font look through your app including when calling the Hover SDK.

To achieve this, you’d need to use the inbuilt Hovers Font method. First, you need to put your fonts in the assets folder. Then add it to your ApplicationInstance.java or singleton class.java

<div><img src="/assets/images/font_screenshot.png"></div>

{% include fonts.html %}

[Next: Hover Tester](/hover-tester)