From c9dd0c0c8605eb946062d316091b5cb5e81703d0 Mon Sep 17 00:00:00 2001 From: serso Date: Tue, 9 Sep 2014 14:55:11 +0200 Subject: [PATCH] let's preserve old typeface style --- .../android/calculator/AbstractCalculatorHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android-app/src/main/java/org/solovyev/android/calculator/AbstractCalculatorHelper.java b/android-app/src/main/java/org/solovyev/android/calculator/AbstractCalculatorHelper.java index 91202a66..41bad375 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/AbstractCalculatorHelper.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/AbstractCalculatorHelper.java @@ -220,7 +220,12 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh Views.processViewsOfType(root, TextView.class, new Views.ViewProcessor() { @Override public void process(@Nonnull TextView view) { - view.setTypeface(typeFace); + int style = Typeface.NORMAL; + final Typeface oldTypeface = view.getTypeface(); + if (oldTypeface != null) { + style = oldTypeface.getStyle(); + } + view.setTypeface(typeFace, style); } }); }