| Index: ui/android/java/src/org/chromium/ui/UiUtils.java
|
| diff --git a/ui/android/java/src/org/chromium/ui/UiUtils.java b/ui/android/java/src/org/chromium/ui/UiUtils.java
|
| index 861320dc937b182675f8b8142030c5f0f5be906f..3a55ab979b14f9f9ad497167185e9fa5d9668fcf 100644
|
| --- a/ui/android/java/src/org/chromium/ui/UiUtils.java
|
| +++ b/ui/android/java/src/org/chromium/ui/UiUtils.java
|
| @@ -8,6 +8,7 @@ import android.content.Context;
|
| import android.graphics.Bitmap;
|
| import android.graphics.Canvas;
|
| import android.graphics.Rect;
|
| +import android.graphics.Typeface;
|
| import android.os.Build;
|
| import android.os.Environment;
|
| import android.os.Handler;
|
| @@ -395,4 +396,19 @@ public class UiUtils {
|
| if (parent == null) return;
|
| parent.removeView(view);
|
| }
|
| +
|
| + /**
|
| + * Creates a {@link Typeface} that represents medium-weighted text. This function returns
|
| + * Roboto Medium when it is available (Lollipop and up) and Roboto Bold where it isn't.
|
| + *
|
| + * @return Typeface that can be applied to a View.
|
| + */
|
| + public static Typeface createRobotoMediumTypeface() {
|
| + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
| + // Roboto Medium, regular.
|
| + return Typeface.create("sans-serif-medium", Typeface.NORMAL);
|
| + } else {
|
| + return Typeface.create("sans-serif", Typeface.BOLD);
|
| + }
|
| + }
|
| }
|
|
|