Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom font not applied to Views contained in ViewPager

See original GitHub issue

I am inflating views and not fragments in my ViewPager. Upon doing so, the custom fonts aren’t being applied. When the said views are used outside of the ViewPager, they work perfectly fine. Not really sure as to cause of the issue. Also I am using, if that helps.

PS: Love the work on the lib.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

anoop44commented, Mar 2, 2017

@v-singhal @chrisjenx @njwandroid This issue depends on the Context used to get the LayoutInflater instance. In My PagerAdapter I was injecting Context via Dagger2 which was ApplicationContext, and I instantiated LayoutInflater in constructor using that Context and Calligraphy had no impact there. When I removed that instantiation and did it on the instantiateItem method like LayoutInflater.from(container.getContext()), Calligraphy was working as expected. Hope it helps to resolve the issue.

redevillcommented, Mar 30, 2017

Thanks guys, that makes sense

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom font inside viewPager - android - Stack Overflow
I am trying to use a custom font on my viewPager (custom font for the tabs titles). Below is the code I am...
Read more >
Fonts in XML - Android Developers
Expand the textAppearance property, and then select the font from the fontFamily list. Selecting the font from Properties. Figure 4. Selecting ...
Read more >
Android ViewPager Example Tutorial - DigitalOcean
Android ViewPager widget is found in the support library and it allows ... android:layout_height="wrap_content" android:text="Second View" ...
Read more >
ViewPager with FragmentPagerAdapter - CodePath Cliffnotes
Usage · Layout ViewPager · Define Fragments · Setup FragmentPagerAdapter · Apply the Adapter · Selecting or Getting the Page · Setup OnPageChangeListener....
Read more >
ViewPager with Views - Xamarin - Microsoft Learn
Because the implementation details of TreeCatalog are not relevant to understanding ViewPager , the TreeCatalog code is not listed here.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found