當前位置: 首頁>>代碼示例>>Java>>正文


Java Typeface.DEFAULT_BOLD屬性代碼示例

本文整理匯總了Java中android.graphics.Typeface.DEFAULT_BOLD屬性的典型用法代碼示例。如果您正苦於以下問題:Java Typeface.DEFAULT_BOLD屬性的具體用法?Java Typeface.DEFAULT_BOLD怎麽用?Java Typeface.DEFAULT_BOLD使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.graphics.Typeface的用法示例。


在下文中一共展示了Typeface.DEFAULT_BOLD屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTypeface

private Typeface getTypeface() {
    String textTypeface = PreferenceManager.getDefaultSharedPreferences(getBaseContext()).getString("textTypeface", "1");

    switch (Integer.parseInt(textTypeface)) {
        default:
            return Typeface.DEFAULT;
        case 2:
            return Typeface.DEFAULT_BOLD;
        case 3:
            return Typeface.MONOSPACE;
        case 4:
            return Typeface.SANS_SERIF;
        case 5:
            return Typeface.SERIF;
    }
}
 
開發者ID:jajasuperman,項目名稱:HexColorTime,代碼行數:16,代碼來源:Wallpaper.java

示例2: aktivitetOnCreate

public void aktivitetOnCreate(Basisaktivitet ctx) {
  ctx.getResources().updateConfiguration(App.sprogKonfig, null);

  // Forgrundsinitialisering der skal ske før app'en bliver synlig første gang
  // - muligvis aldrig hvis app'en kun betjenes via levende ikon, eller kun er aktiv i baggrunden

  if (App.color!=null) return; // initialisering allerede sket
  App.color = new DRFarver();
  accessibilityManager = (AccessibilityManager) ctx.getSystemService(Context.ACCESSIBILITY_SERVICE); // tager tid i test

  skrift_gibson = Typeface.DEFAULT;
  skrift_gibson_fed = Typeface.DEFAULT_BOLD;
  skrift_georgia = Typeface.SERIF;
  skrift_gibson_fed_span = new EgenTypefaceSpan("Gibson fed", App.skrift_gibson_fed);

  AppOpdatering.APK_URL = res.getString(R.string.AppOpdatering_APK_URL);
  if (!EMULATOR) AppOpdatering.tjekForNyAPK(ctx);
  Log.d("onCreate tog " + (System.currentTimeMillis() - TIDSSTEMPEL_VED_OPSTART) + " ms");
}
 
開發者ID:nordfalk,項目名稱:EsperantoRadio,代碼行數:19,代碼來源:App.java

示例3: getCharGeometryCacheKey

private static int getCharGeometryCacheKey(final char referenceChar, final Paint paint) {
    final int labelSize = (int)paint.getTextSize();
    final Typeface face = paint.getTypeface();
    final int codePointOffset = referenceChar << 15;
    if (face == Typeface.DEFAULT) {
        return codePointOffset + labelSize;
    } else if (face == Typeface.DEFAULT_BOLD) {
        return codePointOffset + labelSize + 0x1000;
    } else if (face == Typeface.MONOSPACE) {
        return codePointOffset + labelSize + 0x2000;
    } else {
        return codePointOffset + labelSize;
    }
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:14,代碼來源:TypefaceUtils.java

示例4: selectPreviewTypeface

@NonNull
public Typeface selectPreviewTypeface(final KeyDrawParams params) {
    if (previewHasLetterSize()) {
        return selectTypeface(params);
    }
    return Typeface.DEFAULT_BOLD;
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:7,代碼來源:Key.java

示例5: createPaint

private Paint createPaint(final boolean bold, final int fontSize) {
    final Typeface typeface = (bold) ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT;

    return new Paint()
    {{
        setARGB(255, 255, 255, 255);
        setTextSize(fontSize);
        setTypeface(typeface);
        setAntiAlias(true);
    }};
}
 
開發者ID:PacktPublishing,項目名稱:Android-Wear-Projects,代碼行數:11,代碼來源:PacktWatchFace.java

示例6: selectPreviewTypeface

@Nonnull
public Typeface selectPreviewTypeface(final KeyDrawParams params) {
    if (previewHasLetterSize()) {
        return selectTypeface(params);
    }
    return Typeface.DEFAULT_BOLD;
}
 
開發者ID:sergeychilingaryan,項目名稱:AOSP-Kayboard-7.1.2,代碼行數:7,代碼來源:Key.java

示例7: getTextTypeface

private static Typeface getTextTypeface(@Nullable final CharSequence text) {
    return hasStyleSpan(text, BOLD_SPAN) ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT;
}
 
開發者ID:sergeychilingaryan,項目名稱:AOSP-Kayboard-7.1.2,代碼行數:3,代碼來源:SuggestionStripLayoutHelper.java


注:本文中的android.graphics.Typeface.DEFAULT_BOLD屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。