From fa0357a0b434ed4743e21bb10f1c6a45b3432ed0 Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Fri, 26 Oct 2012 21:36:12 +0400 Subject: [PATCH] Multiplication button for widget --- .../org/solovyev/android/calculator/CalculatorButtons.java | 4 ++++ .../android/calculator/widget/CalculatorWidgetProvider.java | 2 ++ 2 files changed, 6 insertions(+) diff --git a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java index 27ae4778..300b2c8e 100644 --- a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java +++ b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java @@ -9,6 +9,7 @@ import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.widget.Button; +import android.widget.RemoteViews; import android.widget.Toast; import jscl.AngleUnit; import jscl.NumeralBase; @@ -59,6 +60,9 @@ public final class CalculatorButtons { } } + public static void initMultiplicationButton(@NotNull RemoteViews views) { + views.setTextViewText(R.id.multiplicationButton, CalculatorLocatorImpl.getInstance().getEngine().getMultiplicationSign()); + } public static void toggleEqualsButton(@Nullable SharedPreferences preferences, diff --git a/calculatorpp/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetProvider.java b/calculatorpp/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetProvider.java index 70246a59..9b5d7700 100644 --- a/calculatorpp/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetProvider.java +++ b/calculatorpp/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetProvider.java @@ -120,6 +120,8 @@ public class CalculatorWidgetProvider extends AppWidgetProvider { updateEditorState(context, views, editorState); updateDisplayState(context, views, displayState); + CalculatorButtons.initMultiplicationButton(views); + appWidgetManager.updateAppWidget(appWidgetId, views); } }