本文整理了Java中android.content.res.Resources.getFont
方法的一些代码示例,展示了Resources.getFont
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resources.getFont
方法的具体详情如下:
包路径:android.content.res.Resources
类名称:Resources
方法名:getFont
暂无
代码示例来源:origin: robolectric/robolectric
@Test
@SdkSuppress(minSdkVersion = O)
@Config(minSdk = O)
public void getFontFamily() {
// Feature not supported in legacy (raw) resource mode.
assumeFalse(isRobolectricLegacyMode());
Typeface typeface = resources.getFont(R.font.vt323);
assertThat(typeface).isNotNull();
}
代码示例来源:origin: robolectric/robolectric
@Test
@SdkSuppress(minSdkVersion = O)
@Config(minSdk = O)
public void getFontFamily_downloadable() {
// Feature not supported in legacy (raw) resource mode.
assumeFalse(isRobolectricLegacyMode());
Typeface typeface = resources.getFont(R.font.downloadable);
assertThat(typeface).isNotNull();
}
代码示例来源:origin: robolectric/robolectric
@Test
@SdkSuppress(minSdkVersion = O)
@Config(minSdk = O)
public void getFont() {
// Feature not supported in legacy (raw) resource mode.
assumeFalse(isRobolectricLegacyMode());
Typeface typeface = resources.getFont(R.font.vt323_regular);
assertThat(typeface).isNotNull();
}
代码示例来源:origin: appwise-labs/NoInternetDialog
@RequiresApi(api = Build.VERSION_CODES.O)
public Builder setTitleTypeface(int titleTypefaceId) {
this.titleTypeface = context.getResources().getFont(titleTypefaceId);
return this;
}
代码示例来源:origin: appwise-labs/NoInternetDialog
@RequiresApi(api = Build.VERSION_CODES.O)
public Builder setMessageTypeface(int messageTypefaceId) {
this.messageTypeface = context.getResources().getFont(messageTypefaceId);
return this;
}
内容来源于网络,如有侵权,请联系作者删除!