Created
July 12, 2017 07:49
-
-
Save dohaivu/cb2bc7675864b105194849faa89d583d to your computer and use it in GitHub Desktop.
[typeface in android] custom font on #android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void showPopup(View v) { | |
PopupMenu popupMenu = new PopupMenu(this, v); | |
popupMenu.inflate(R.menu.menu_user_profile); | |
for (int i = 0; i < popupMenu.getMenu().size(); i++) { | |
MenuItem item = popupMenu.getMenu().getItem(i); | |
Typeface robotoRegular = HeloTypefaceManager.TypefaceWithFontName(this, HeloTypefaceManager.ROBOTO_REGULAR); | |
SpannableString title = new SpannableString(item.getTitle()); | |
title.setSpan(new CustomTypefaceSpan("", robotoRegular), 0, title.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); | |
item.setTitle(title); | |
} | |
popupMenu.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment