Custom font not applied to Views contained in ViewPager
See original GitHub issueI 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 com.android.support:appcompat-v7:24.2.0, if that helps.
PS: Love the work on the lib.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@v-singhal @chrisjenx @njwandroid This issue depends on the
Context
used to get the LayoutInflater instance. In MyPagerAdapter
I was injectingContext
via Dagger2 which wasApplicationContext
, and I instantiated LayoutInflater in constructor using thatContext
and Calligraphy had no impact there. When I removed that instantiation and did it on the instantiateItem method likeLayoutInflater.from(container.getContext())
, Calligraphy was working as expected. Hope it helps to resolve the issue.Thanks guys, that makes sense