android.content.res.Resources.getFont()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(288)

本文整理了Java中android.content.res.Resources.getFont方法的一些代码示例,展示了Resources.getFont的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resources.getFont方法的具体详情如下:
包路径:android.content.res.Resources
类名称:Resources
方法名:getFont

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;
}

相关文章

微信公众号

最新文章

更多