From 8a2456d9a48a579786cafc6f44554de1f5fde1bb Mon Sep 17 00:00:00 2001 From: serso Date: Sun, 28 Feb 2016 13:55:38 +0100 Subject: [PATCH] Remove dep from AngleUnitButton --- .../org/solovyev/android/calculator/keyboard/KeyboardUi.java | 1 + .../solovyev/android/calculator/view/AngleUnitsButton.java | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/keyboard/KeyboardUi.java b/app/src/main/java/org/solovyev/android/calculator/keyboard/KeyboardUi.java index 04dd2b05..365fdd54 100644 --- a/app/src/main/java/org/solovyev/android/calculator/keyboard/KeyboardUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/keyboard/KeyboardUi.java @@ -139,6 +139,7 @@ public class KeyboardUi extends BaseKeyboardUi { prepareButton(button4); prepareButton(button5); prepareButton(button6); + button6.setAngleUnit(angleUnit.getPreference(preferences)); prepareButton(button7); prepareButton(button8); prepareButton(button9); diff --git a/app/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java b/app/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java index 1bbd7047..c726741f 100644 --- a/app/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java +++ b/app/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java @@ -28,7 +28,6 @@ import android.support.v4.content.ContextCompat; import android.text.TextPaint; import android.util.AttributeSet; import jscl.AngleUnit; -import org.solovyev.android.calculator.Locator; import org.solovyev.android.calculator.R; import org.solovyev.android.views.dragbutton.DirectionDragButton; @@ -37,11 +36,10 @@ import javax.annotation.Nonnull; public class AngleUnitsButton extends DirectionDragButton { @Nonnull - private AngleUnit angleUnit; + private AngleUnit angleUnit = AngleUnit.deg; public AngleUnitsButton(Context context, @Nonnull AttributeSet attrs) { super(context, attrs); - this.angleUnit = Locator.getInstance().getEngine().getMathEngine().getAngleUnits(); } @Override