It is necessary to put fonts on tabs and elements of the recyclerView list.

Font: Roboto-Bold

I went to Google Guidelines, downloaded the necessary fonts with the .ttf format and threw them into assets.

ps markup or code is not particularly important here, as I guess.

It is useful to look for info, how to install this font - and in all the examples I've seen, I used a simple TextView , all the guides say something like the following:

 Open your main activity file and insert this into the onCreate() method: TextView txt = (TextView) findViewById(R.id.custom_font); Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf"); txt.setTypeface(font); 

Regarding the tabs and the list of this kind of things simply do not exist, besides they are in fragments.

As for installing these fonts directly through xml, I also did not find anything.

Are there any newer ways to install fonts under Material Design elements that I did not find?

In Material Design widgets, I did not find this method at all.

How to approach this task?

  • no font can be set via XML. - Vladyslav Matviienko

1 answer 1

You can get a tab from TabLayout like this :

 mainTab = ((ViewGroup) tabLayout.getChildAt(0)).getChildAt(desiredPosition); 

Similarly, find a TextView in it (most likely this is it) and assign it a font.

Assigning fonts to RecyclerView elements is even easier - you definitely have access to its adapter, and it definitely has a link to all its TextViews - in the adapter's onBindViewHolder method and use fonts

Similarly, you can do this for all other widgets.