diff options
Diffstat (limited to 'srcs/juloo.keyboard2/Theme.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Theme.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/srcs/juloo.keyboard2/Theme.java b/srcs/juloo.keyboard2/Theme.java index 60c9b88..af2f3d7 100644 --- a/srcs/juloo.keyboard2/Theme.java +++ b/srcs/juloo.keyboard2/Theme.java @@ -35,9 +35,9 @@ public class Theme keyDownBgPaint.setColor(res.getColor(R.color.key_down_bg)); _keyLabelPaint = initLabelPaint(Paint.Align.CENTER, null); _keySubLabelPaint = initLabelPaint(Paint.Align.LEFT, null); - Typeface specialKeysFont = ((Keyboard2)context).getSpecialKeyFont(); - _specialKeyLabelPaint = initLabelPaint(Paint.Align.CENTER, specialKeysFont); - _specialKeySubLabelPaint = initLabelPaint(Paint.Align.LEFT, specialKeysFont); + Typeface specialKeyFont = getSpecialKeyFont(context); + _specialKeyLabelPaint = initLabelPaint(Paint.Align.CENTER, specialKeyFont); + _specialKeySubLabelPaint = initLabelPaint(Paint.Align.LEFT, specialKeyFont); } public Paint labelPaint(boolean special_font) @@ -61,4 +61,15 @@ public class Theme paint.setTypeface(font); return (paint); } + + private static Typeface _specialKeyFont = null; + + static public Typeface getSpecialKeyFont(Context context) + { + if (_specialKeyFont == null) + { + _specialKeyFont = Typeface.createFromAsset(context.getAssets(), "fonts/keys.ttf"); + } + return _specialKeyFont; + } } |
