diff --git a/android-app-core/AndroidManifest.xml b/android-app-core/AndroidManifest.xml
index cfe0783d..a86dbd76 100644
--- a/android-app-core/AndroidManifest.xml
+++ b/android-app-core/AndroidManifest.xml
@@ -2,4 +2,10 @@
\ No newline at end of file
+ android:versionName="1.0" >
+
+
+
+
\ No newline at end of file
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/AndroidCalculatorDisplayView.java b/android-app-core/src/main/java/org/solovyev/android/calculator/AndroidCalculatorDisplayView.java
index 3ef2c083..e2b34a16 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/AndroidCalculatorDisplayView.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/AndroidCalculatorDisplayView.java
@@ -14,13 +14,13 @@ import android.support.v4.app.FragmentActivity;
import android.text.Html;
import android.util.AttributeSet;
import android.util.TypedValue;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.solovyev.android.calculator.core.R;
import org.solovyev.android.calculator.text.TextProcessor;
import org.solovyev.android.calculator.view.TextHighlighter;
import org.solovyev.android.view.AutoResizeTextView;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -39,7 +39,7 @@ public class AndroidCalculatorDisplayView extends AutoResizeTextView implements
**********************************************************************
*/
- @NotNull
+ @Nonnull
private final static TextProcessor textHighlighter = new TextHighlighter(Color.WHITE, false);
/*
@@ -50,18 +50,18 @@ public class AndroidCalculatorDisplayView extends AutoResizeTextView implements
**********************************************************************
*/
- @NotNull
+ @Nonnull
private volatile CalculatorDisplayViewState state = CalculatorDisplayViewStateImpl.newDefaultInstance();
private volatile boolean viewStateChange = false;
- @NotNull
+ @Nonnull
private final Object lock = new Object();
- @NotNull
+ @Nonnull
private final Handler uiHandler = new Handler();
- @NotNull
+ @Nonnull
private final ExecutorService bgExecutor = Executors.newSingleThreadExecutor();
private volatile boolean initialized = false;
@@ -97,7 +97,7 @@ public class AndroidCalculatorDisplayView extends AutoResizeTextView implements
@Override
- public void setState(@NotNull final CalculatorDisplayViewState state) {
+ public void setState(@Nonnull final CalculatorDisplayViewState state) {
uiHandler.post(new Runnable() {
@Override
@@ -133,7 +133,7 @@ public class AndroidCalculatorDisplayView extends AutoResizeTextView implements
});
}
- @NotNull
+ @Nonnull
@Override
public CalculatorDisplayViewState getState() {
synchronized (lock) {
@@ -170,11 +170,11 @@ public class AndroidCalculatorDisplayView extends AutoResizeTextView implements
resizeText();
}
- public synchronized void init(@NotNull Context context) {
+ public synchronized void init(@Nonnull Context context) {
this.init(context, true);
}
- public synchronized void init(@NotNull Context context, boolean fromApp) {
+ public synchronized void init(@Nonnull Context context, boolean fromApp) {
if (!initialized) {
if (fromApp) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/AndroidCalculatorEditorView.java b/android-app-core/src/main/java/org/solovyev/android/calculator/AndroidCalculatorEditorView.java
index a8a5fb47..9ddec3e8 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/AndroidCalculatorEditorView.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/AndroidCalculatorEditorView.java
@@ -18,13 +18,14 @@ import android.util.AttributeSet;
import android.util.Log;
import android.view.ContextMenu;
import android.widget.EditText;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.solovyev.android.calculator.text.TextProcessor;
import org.solovyev.android.calculator.view.TextHighlighter;
import org.solovyev.android.prefs.BooleanPreference;
import org.solovyev.common.collections.Collections;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
/**
* User: serso
* Date: 9/17/11
@@ -32,25 +33,26 @@ import org.solovyev.common.collections.Collections;
*/
public class AndroidCalculatorEditorView extends EditText implements SharedPreferences.OnSharedPreferenceChangeListener, CalculatorEditorView {
- @NotNull
+ @Nonnull
private static final BooleanPreference colorDisplay = BooleanPreference.of("org.solovyev.android.calculator.CalculatorModel_color_display", true);
private volatile boolean initialized = false;
private boolean highlightText = true;
- @NotNull
+ @Nonnull
private final static TextProcessor textHighlighter = new TextHighlighter(Color.WHITE, false);
- @NotNull
+ @SuppressWarnings("UnusedDeclaration")
+ @Nonnull
private volatile CalculatorEditorViewState viewState = CalculatorEditorViewStateImpl.newDefaultInstance();
private volatile boolean viewStateChange = false;
- @Nullable
+ @Nonnull
private final Object viewLock = new Object();
- @NotNull
+ @Nonnull
private final Handler uiHandler = new Handler();
public AndroidCalculatorEditorView(Context context) {
@@ -97,7 +99,7 @@ public class AndroidCalculatorEditorView extends EditText implements SharedPrefe
}
@Nullable
- private CharSequence prepareText(@NotNull String text, boolean highlightText) {
+ private CharSequence prepareText(@Nonnull String text, boolean highlightText) {
CharSequence result;
if (highlightText) {
@@ -137,7 +139,7 @@ public class AndroidCalculatorEditorView extends EditText implements SharedPrefe
}
}
- public synchronized void init(@NotNull Context context) {
+ public synchronized void init(@Nonnull Context context) {
if (!initialized) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
@@ -152,57 +154,51 @@ public class AndroidCalculatorEditorView extends EditText implements SharedPrefe
}
@Override
- public void setState(@NotNull final CalculatorEditorViewState viewState) {
- if (viewLock != null) {
- synchronized (viewLock) {
+ public void setState(@Nonnull final CalculatorEditorViewState viewState) {
+ synchronized (viewLock) {
- final CharSequence text = prepareText(viewState.getText(), highlightText);
+ final CharSequence text = prepareText(viewState.getText(), highlightText);
- uiHandler.post(new Runnable() {
- @Override
- public void run() {
- final AndroidCalculatorEditorView editorView = AndroidCalculatorEditorView.this;
- synchronized (viewLock) {
- try {
- editorView.viewStateChange = true;
- editorView.viewState = viewState;
- editorView.setText(text, BufferType.EDITABLE);
- final int selection = CalculatorEditorImpl.correctSelection(viewState.getSelection(), editorView.getText());
- editorView.setSelection(selection);
- } finally {
- editorView.viewStateChange = false;
- }
+ uiHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ final AndroidCalculatorEditorView editorView = AndroidCalculatorEditorView.this;
+ synchronized (viewLock) {
+ try {
+ editorView.viewStateChange = true;
+ editorView.viewState = viewState;
+ editorView.setText(text, BufferType.EDITABLE);
+ final int selection = CalculatorEditorImpl.correctSelection(viewState.getSelection(), editorView.getText());
+ editorView.setSelection(selection);
+ } finally {
+ editorView.viewStateChange = false;
}
}
- });
- }
+ }
+ });
}
}
@Override
protected void onSelectionChanged(int selStart, int selEnd) {
- if (viewLock != null) {
- synchronized (viewLock) {
- if (!viewStateChange) {
- // external text change => need to notify editor
- super.onSelectionChanged(selStart, selEnd);
+ synchronized (viewLock) {
+ if (!viewStateChange) {
+ // external text change => need to notify editor
+ super.onSelectionChanged(selStart, selEnd);
- if (selStart == selEnd) {
- // only if cursor moving, if selection do nothing
- Locator.getInstance().getEditor().setSelection(selStart);
- }
+ if (selStart == selEnd) {
+ // only if cursor moving, if selection do nothing
+ Locator.getInstance().getEditor().setSelection(selStart);
}
}
}
}
public void handleTextChange(Editable s) {
- if (viewLock != null) {
- synchronized (viewLock) {
- if (!viewStateChange) {
- // external text change => need to notify editor
- Locator.getInstance().getEditor().setText(String.valueOf(s));
- }
+ synchronized (viewLock) {
+ if (!viewStateChange) {
+ // external text change => need to notify editor
+ Locator.getInstance().getEditor().setText(String.valueOf(s));
}
}
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorButton.java b/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorButton.java
index 3e1c2a31..ef5ce63c 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorButton.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorButton.java
@@ -1,8 +1,8 @@
package org.solovyev.android.calculator;
import android.content.Context;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.core.R;
import java.util.HashMap;
@@ -61,42 +61,42 @@ public enum CalculatorButton {
private final int buttonId;
- @NotNull
+ @Nonnull
private final String onClickText;
@Nullable
private final String onLongClickText;
- @NotNull
+ @Nonnull
private static Map buttonsByIds = new HashMap();
- CalculatorButton(int buttonId, @NotNull CalculatorSpecialButton onClickButton, @Nullable CalculatorSpecialButton onLongClickButton) {
+ CalculatorButton(int buttonId, @Nonnull CalculatorSpecialButton onClickButton, @Nullable CalculatorSpecialButton onLongClickButton) {
this(buttonId, onClickButton.getActionCode(), onLongClickButton == null ? null : onLongClickButton.getActionCode());
}
- CalculatorButton(int buttonId, @NotNull CalculatorSpecialButton onClickButton) {
+ CalculatorButton(int buttonId, @Nonnull CalculatorSpecialButton onClickButton) {
this(buttonId, onClickButton, null);
}
- CalculatorButton(int buttonId, @NotNull String onClickText, @Nullable String onLongClickText) {
+ CalculatorButton(int buttonId, @Nonnull String onClickText, @Nullable String onLongClickText) {
this.buttonId = buttonId;
this.onClickText = onClickText;
this.onLongClickText = onLongClickText;
}
- CalculatorButton(int buttonId, @NotNull String onClickText) {
+ CalculatorButton(int buttonId, @Nonnull String onClickText) {
this(buttonId, onClickText, null);
}
- public void onLongClick(@NotNull Context context) {
+ public void onLongClick(@Nonnull Context context) {
Locator.getInstance().getNotifier().showDebugMessage("Calculator++ Widget", "Button pressed: " + onLongClickText);
if (onLongClickText != null) {
Locator.getInstance().getKeyboard().buttonPressed(onLongClickText);
}
}
- public void onClick(@NotNull Context context) {
+ public void onClick(@Nonnull Context context) {
Locator.getInstance().getNotifier().showDebugMessage("Calculator++ Widget", "Button pressed: " + onClickText);
Locator.getInstance().getKeyboard().buttonPressed(onClickText);
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java b/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java
index 3f28043d..fd58e8b7 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java
@@ -13,8 +13,8 @@ import android.widget.Button;
import android.widget.RemoteViews;
import jscl.AngleUnit;
import jscl.NumeralBase;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.Views;
import org.solovyev.android.calculator.core.R;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
@@ -36,36 +36,36 @@ public final class CalculatorButtons {
}
- public static void processButtons(@NotNull CalculatorPreferences.Gui.Theme theme,
- @NotNull CalculatorPreferences.Gui.Layout layout,
- @NotNull View root) {
+ public static void processButtons(@Nonnull CalculatorPreferences.Gui.Theme theme,
+ @Nonnull CalculatorPreferences.Gui.Layout layout,
+ @Nonnull View root) {
if (layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile) {
final float textSize = root.getContext().getResources().getDimension(R.dimen.cpp_keyboard_button_text_size_mobile);
Views.processViewsOfType(root, DragButton.class, new Views.ViewProcessor() {
@Override
- public void process(@NotNull DragButton button) {
+ public void process(@Nonnull DragButton button) {
button.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize);
}
});
}
}
- static void initMultiplicationButton(@NotNull View root) {
+ static void initMultiplicationButton(@Nonnull View root) {
final View multiplicationButton = root.findViewById(R.id.cpp_button_multiplication);
if (multiplicationButton instanceof Button) {
((Button) multiplicationButton).setText(Locator.getInstance().getEngine().getMultiplicationSign());
}
}
- public static void initMultiplicationButton(@NotNull RemoteViews views) {
+ public static void initMultiplicationButton(@Nonnull RemoteViews views) {
views.setTextViewText(R.id.cpp_button_multiplication, Locator.getInstance().getEngine().getMultiplicationSign());
}
public static void toggleEqualsButton(@Nullable SharedPreferences preferences,
- @NotNull Activity activity) {
+ @Nonnull Activity activity) {
preferences = preferences == null ? PreferenceManager.getDefaultSharedPreferences(activity) : preferences;
final boolean large = Views.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE, activity.getResources().getConfiguration()) &&
@@ -97,7 +97,7 @@ public final class CalculatorButtons {
static class RoundBracketsDragProcessor implements SimpleOnDragListener.DragProcessor {
@Override
- public boolean processDragEvent(@NotNull DragDirection dragDirection, @NotNull DragButton dragButton, @NotNull Point2d startPoint2d, @NotNull MotionEvent motionEvent) {
+ public boolean processDragEvent(@Nonnull DragDirection dragDirection, @Nonnull DragButton dragButton, @Nonnull Point2d startPoint2d, @Nonnull MotionEvent motionEvent) {
final boolean result;
if (dragDirection == DragDirection.left) {
@@ -111,25 +111,25 @@ public final class CalculatorButtons {
}
}
- @NotNull
+ @Nonnull
private static CalculatorKeyboard getKeyboard() {
return Locator.getInstance().getKeyboard();
}
static class VarsDragProcessor implements SimpleOnDragListener.DragProcessor {
- @NotNull
+ @Nonnull
private Context context;
- VarsDragProcessor(@NotNull Context context) {
+ VarsDragProcessor(@Nonnull Context context) {
this.context = context;
}
@Override
- public boolean processDragEvent(@NotNull DragDirection dragDirection,
- @NotNull DragButton dragButton,
- @NotNull Point2d startPoint2d,
- @NotNull MotionEvent motionEvent) {
+ public boolean processDragEvent(@Nonnull DragDirection dragDirection,
+ @Nonnull DragButton dragButton,
+ @Nonnull Point2d startPoint2d,
+ @Nonnull MotionEvent motionEvent) {
boolean result = false;
if (dragDirection == DragDirection.up) {
@@ -146,22 +146,22 @@ public final class CalculatorButtons {
static class AngleUnitsChanger implements SimpleOnDragListener.DragProcessor {
- @NotNull
+ @Nonnull
private final DigitButtonDragProcessor processor;
- @NotNull
+ @Nonnull
private final Context context;
- AngleUnitsChanger(@NotNull Context context) {
+ AngleUnitsChanger(@Nonnull Context context) {
this.context = context;
this.processor = new DigitButtonDragProcessor(Locator.getInstance().getKeyboard());
}
@Override
- public boolean processDragEvent(@NotNull DragDirection dragDirection,
- @NotNull DragButton dragButton,
- @NotNull Point2d startPoint2d,
- @NotNull MotionEvent motionEvent) {
+ public boolean processDragEvent(@Nonnull DragDirection dragDirection,
+ @Nonnull DragButton dragButton,
+ @Nonnull Point2d startPoint2d,
+ @Nonnull MotionEvent motionEvent) {
boolean result = false;
if (dragButton instanceof AngleUnitsButton) {
@@ -195,18 +195,18 @@ public final class CalculatorButtons {
static class NumeralBasesChanger implements SimpleOnDragListener.DragProcessor {
- @NotNull
+ @Nonnull
private final Context context;
- NumeralBasesChanger(@NotNull Context context) {
+ NumeralBasesChanger(@Nonnull Context context) {
this.context = context;
}
@Override
- public boolean processDragEvent(@NotNull DragDirection dragDirection,
- @NotNull DragButton dragButton,
- @NotNull Point2d startPoint2d,
- @NotNull MotionEvent motionEvent) {
+ public boolean processDragEvent(@Nonnull DragDirection dragDirection,
+ @Nonnull DragButton dragButton,
+ @Nonnull Point2d startPoint2d,
+ @Nonnull MotionEvent motionEvent) {
boolean result = false;
if (dragButton instanceof NumeralBasesButton) {
@@ -236,18 +236,18 @@ public final class CalculatorButtons {
static class FunctionsDragProcessor implements SimpleOnDragListener.DragProcessor {
- @NotNull
+ @Nonnull
private Context context;
- FunctionsDragProcessor(@NotNull Context context) {
+ FunctionsDragProcessor(@Nonnull Context context) {
this.context = context;
}
@Override
- public boolean processDragEvent(@NotNull DragDirection dragDirection,
- @NotNull DragButton dragButton,
- @NotNull Point2d startPoint2d,
- @NotNull MotionEvent motionEvent) {
+ public boolean processDragEvent(@Nonnull DragDirection dragDirection,
+ @Nonnull DragButton dragButton,
+ @Nonnull Point2d startPoint2d,
+ @Nonnull MotionEvent motionEvent) {
boolean result = false;
if (dragDirection == DragDirection.up) {
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorDisplayMenuItem.java b/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorDisplayMenuItem.java
index e6edaef4..4b7ad8ea 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorDisplayMenuItem.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/CalculatorDisplayMenuItem.java
@@ -2,7 +2,7 @@ package org.solovyev.android.calculator;
import android.content.Context;
import jscl.math.Generic;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.core.R;
import org.solovyev.android.calculator.jscl.JsclOperation;
import org.solovyev.android.calculator.plot.CalculatorPlotter;
@@ -18,50 +18,50 @@ public enum CalculatorDisplayMenuItem implements LabeledMenuItem autoOrientation = BooleanPreference.of("autoOrientation", true);
public static final Preference hideNumeralBaseDigits = BooleanPreference.of("hideNumeralBaseDigits", true);
- @NotNull
- public static Theme getTheme(@NotNull SharedPreferences preferences) {
+ @Nonnull
+ public static Theme getTheme(@Nonnull SharedPreferences preferences) {
return theme.getPreferenceNoError(preferences);
}
- @NotNull
- public static Layout getLayout(@NotNull SharedPreferences preferences) {
+ @Nonnull
+ public static Layout getLayout(@Nonnull SharedPreferences preferences) {
return layout.getPreferenceNoError(preferences);
}
@@ -78,23 +78,23 @@ public final class CalculatorPreferences {
metro_purple_theme(ThemeType.metro, R.style.cpp_metro_purple_theme),
metro_green_theme(ThemeType.metro, R.style.cpp_metro_green_theme);
- @NotNull
+ @Nonnull
private final ThemeType themeType;
- @NotNull
+ @Nonnull
private final Integer themeId;
- Theme(@NotNull ThemeType themeType, @NotNull Integer themeId) {
+ Theme(@Nonnull ThemeType themeType, @Nonnull Integer themeId) {
this.themeType = themeType;
this.themeId = themeId;
}
- @NotNull
+ @Nonnull
public ThemeType getThemeType() {
return themeType;
}
- @NotNull
+ @Nonnull
public Integer getThemeId() {
return themeId;
}
@@ -136,7 +136,7 @@ public final class CalculatorPreferences {
}
- static void setDefaultValues(@NotNull SharedPreferences preferences) {
+ static void setDefaultValues(@Nonnull SharedPreferences preferences) {
if (!AndroidCalculatorEngine.Preferences.groupingSeparator.isSet(preferences)) {
final Locale locale = Locale.getDefault();
@@ -206,7 +206,7 @@ public final class CalculatorPreferences {
}
- private static void applyDefaultPreference(@NotNull SharedPreferences preferences, @NotNull Preference> preference) {
+ private static void applyDefaultPreference(@Nonnull SharedPreferences preferences, @Nonnull Preference> preference) {
preference.tryPutDefault(preferences);
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/ConversionMenuItem.java b/android-app-core/src/main/java/org/solovyev/android/calculator/ConversionMenuItem.java
index 8a543d07..8a034247 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/ConversionMenuItem.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/ConversionMenuItem.java
@@ -3,7 +3,7 @@ package org.solovyev.android.calculator;
import android.content.Context;
import jscl.NumeralBase;
import jscl.math.Generic;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.jscl.JsclOperation;
import org.solovyev.android.menu.AMenuItem;
@@ -18,14 +18,14 @@ enum ConversionMenuItem implements AMenuItem {
convert_to_dec(NumeralBase.dec),
convert_to_hex(NumeralBase.hex);
- @NotNull
+ @Nonnull
private final NumeralBase toNumeralBase;
- ConversionMenuItem(@NotNull NumeralBase toNumeralBase) {
+ ConversionMenuItem(@Nonnull NumeralBase toNumeralBase) {
this.toNumeralBase = toNumeralBase;
}
- protected boolean isItemVisibleFor(@NotNull Generic generic, @NotNull JsclOperation operation) {
+ protected boolean isItemVisibleFor(@Nonnull Generic generic, @Nonnull JsclOperation operation) {
boolean result = false;
if (operation == JsclOperation.numeric) {
@@ -42,7 +42,7 @@ enum ConversionMenuItem implements AMenuItem {
}
@Override
- public void onClick(@NotNull CalculatorDisplayViewState data, @NotNull Context context) {
+ public void onClick(@Nonnull CalculatorDisplayViewState data, @Nonnull Context context) {
final Generic result = data.getResult();
if (result != null) {
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/DigitButtonDragProcessor.java b/android-app-core/src/main/java/org/solovyev/android/calculator/DigitButtonDragProcessor.java
index 625af371..003f60ed 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/DigitButtonDragProcessor.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/DigitButtonDragProcessor.java
@@ -6,7 +6,7 @@
package org.solovyev.android.calculator;
import android.view.MotionEvent;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.view.drag.DirectionDragButton;
import org.solovyev.android.view.drag.DragButton;
import org.solovyev.android.view.drag.DragDirection;
@@ -20,15 +20,15 @@ import org.solovyev.common.math.Point2d;
*/
public class DigitButtonDragProcessor implements SimpleOnDragListener.DragProcessor {
- @NotNull
+ @Nonnull
private CalculatorKeyboard calculatorKeyboard;
- public DigitButtonDragProcessor(@NotNull CalculatorKeyboard calculatorKeyboard) {
+ public DigitButtonDragProcessor(@Nonnull CalculatorKeyboard calculatorKeyboard) {
this.calculatorKeyboard = calculatorKeyboard;
}
@Override
- public boolean processDragEvent(@NotNull DragDirection dragDirection, @NotNull DragButton dragButton, @NotNull Point2d startPoint2d, @NotNull MotionEvent motionEvent) {
+ public boolean processDragEvent(@Nonnull DragDirection dragDirection, @Nonnull DragButton dragButton, @Nonnull Point2d startPoint2d, @Nonnull MotionEvent motionEvent) {
assert dragButton instanceof DirectionDragButton;
calculatorKeyboard.buttonPressed(((DirectionDragButton) dragButton).getText(dragDirection));
return true;
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/FixableMessage.java b/android-app-core/src/main/java/org/solovyev/android/calculator/FixableMessage.java
index 3b692e10..d701208c 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/FixableMessage.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/FixableMessage.java
@@ -2,8 +2,8 @@ package org.solovyev.android.calculator;
import android.os.Parcel;
import android.os.Parcelable;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.common.msg.Message;
import org.solovyev.common.msg.MessageType;
@@ -16,7 +16,7 @@ public class FixableMessage implements Parcelable {
public static final Creator CREATOR = new Creator() {
@Override
- public FixableMessage createFromParcel(@NotNull Parcel in) {
+ public FixableMessage createFromParcel(@Nonnull Parcel in) {
return FixableMessage.fromParcel(in);
}
@@ -26,8 +26,8 @@ public class FixableMessage implements Parcelable {
}
};
- @NotNull
- private static FixableMessage fromParcel(@NotNull Parcel in) {
+ @Nonnull
+ private static FixableMessage fromParcel(@Nonnull Parcel in) {
final String message = in.readString();
final MessageType messageType = (MessageType) in.readSerializable();
final FixableError fixableError = (FixableError) in.readSerializable();
@@ -35,16 +35,16 @@ public class FixableMessage implements Parcelable {
return new FixableMessage(message, messageType, fixableError);
}
- @NotNull
+ @Nonnull
private final String message;
- @NotNull
+ @Nonnull
private final MessageType messageType;
@Nullable
private final FixableError fixableError;
- public FixableMessage(@NotNull Message message) {
+ public FixableMessage(@Nonnull Message message) {
this.message = message.getLocalizedMessage();
int messageLevel = message.getMessageLevel().getMessageLevel();
if (messageLevel < MessageType.info.getMessageLevel()) {
@@ -57,8 +57,8 @@ public class FixableMessage implements Parcelable {
this.fixableError = CalculatorFixableError.getErrorByMessageCode(message.getMessageCode());
}
- public FixableMessage(@NotNull String message,
- @NotNull MessageType messageType,
+ public FixableMessage(@Nonnull String message,
+ @Nonnull MessageType messageType,
@Nullable FixableError fixableError) {
this.message = message;
this.messageType = messageType;
@@ -71,18 +71,18 @@ public class FixableMessage implements Parcelable {
}
@Override
- public void writeToParcel(@NotNull Parcel out, int flags) {
+ public void writeToParcel(@Nonnull Parcel out, int flags) {
out.writeString(message);
out.writeSerializable(messageType);
out.writeSerializable(fixableError);
}
- @NotNull
+ @Nonnull
public String getMessage() {
return message;
}
- @NotNull
+ @Nonnull
public MessageType getMessageType() {
return messageType;
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/FixableMessagesDialog.java b/android-app-core/src/main/java/org/solovyev/android/calculator/FixableMessagesDialog.java
index 76f219e4..63f36d1a 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/FixableMessagesDialog.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/FixableMessagesDialog.java
@@ -14,7 +14,7 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockActivity;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.core.R;
import org.solovyev.common.msg.Message;
import org.solovyev.common.text.Strings;
@@ -32,7 +32,7 @@ public class FixableMessagesDialog extends SherlockActivity {
private static final String INPUT = "input";
- @NotNull
+ @Nonnull
private Input input = new Input(Collections.emptyList(), false);
public FixableMessagesDialog() {
@@ -70,7 +70,7 @@ public class FixableMessagesDialog extends SherlockActivity {
});
}
- private void parseIntent(@NotNull Intent intent) {
+ private void parseIntent(@Nonnull Intent intent) {
final Input input = intent.getParcelableExtra(INPUT);
if (input != null) {
this.input = input;
@@ -113,7 +113,7 @@ public class FixableMessagesDialog extends SherlockActivity {
}
@Override
- protected void onNewIntent(@NotNull Intent intent) {
+ protected void onNewIntent(@Nonnull Intent intent) {
super.onNewIntent(intent);
parseIntent(intent);
}
@@ -126,8 +126,8 @@ public class FixableMessagesDialog extends SherlockActivity {
**********************************************************************
*/
- public static void showDialogForMessages(@NotNull List messages,
- @NotNull Context context,
+ public static void showDialogForMessages(@Nonnull List messages,
+ @Nonnull Context context,
boolean showCheckbox) {
if (!messages.isEmpty()) {
final Intent intent = new Intent(context, FixableMessagesDialog.class);
@@ -139,8 +139,8 @@ public class FixableMessagesDialog extends SherlockActivity {
}
}
- public static void showDialog(@NotNull List messages,
- @NotNull Context context,
+ public static void showDialog(@Nonnull List messages,
+ @Nonnull Context context,
boolean showCheckbox) {
if (!messages.isEmpty()) {
final Intent intent = new Intent(context, FixableMessagesDialog.class);
@@ -156,7 +156,7 @@ public class FixableMessagesDialog extends SherlockActivity {
public static final Creator CREATOR = new Creator() {
@Override
- public Input createFromParcel(@NotNull Parcel in) {
+ public Input createFromParcel(@Nonnull Parcel in) {
return Input.fromParcel(in);
}
@@ -166,8 +166,8 @@ public class FixableMessagesDialog extends SherlockActivity {
}
};
- @NotNull
- private static Input fromParcel(@NotNull Parcel in) {
+ @Nonnull
+ private static Input fromParcel(@Nonnull Parcel in) {
final List messages = new ArrayList();
boolean showCheckbox = in.readInt() == 1;
in.readTypedList(messages, FixableMessage.CREATOR);
@@ -175,17 +175,17 @@ public class FixableMessagesDialog extends SherlockActivity {
}
- @NotNull
+ @Nonnull
private List messages = new ArrayList();
private boolean showCheckbox;
- private Input(@NotNull List messages, boolean showCheckbox) {
+ private Input(@Nonnull List messages, boolean showCheckbox) {
this.messages = messages;
this.showCheckbox = showCheckbox;
}
- @NotNull
+ @Nonnull
public List getMessages() {
return messages;
}
@@ -196,13 +196,13 @@ public class FixableMessagesDialog extends SherlockActivity {
}
@Override
- public void writeToParcel(@NotNull Parcel out, int flags) {
+ public void writeToParcel(@Nonnull Parcel out, int flags) {
out.writeInt(showCheckbox ? 1 : 0);
out.writeTypedList(messages);
}
- @NotNull
- public static Input fromMessages(@NotNull List messages, boolean showCheckbox) {
+ @Nonnull
+ public static Input fromMessages(@Nonnull List messages, boolean showCheckbox) {
final List stringMessages = new ArrayList(messages.size());
for (Message message : messages) {
stringMessages.add(new FixableMessage(message));
@@ -218,14 +218,14 @@ public class FixableMessagesDialog extends SherlockActivity {
private class FixErrorOnClickListener implements View.OnClickListener {
- @NotNull
+ @Nonnull
private final List messages;
- @NotNull
+ @Nonnull
private final FixableMessage currentMessage;
- public FixErrorOnClickListener(@NotNull List messages,
- @NotNull FixableMessage message) {
+ public FixErrorOnClickListener(@Nonnull List messages,
+ @Nonnull FixableMessage message) {
this.messages = messages;
this.currentMessage = message;
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableCalculatorDisplayViewState.java b/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableCalculatorDisplayViewState.java
index 30d14045..2357000d 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableCalculatorDisplayViewState.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableCalculatorDisplayViewState.java
@@ -3,8 +3,8 @@ package org.solovyev.android.calculator;
import android.os.Parcel;
import android.os.Parcelable;
import jscl.math.Generic;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.jscl.JsclOperation;
/**
@@ -16,7 +16,7 @@ public final class ParcelableCalculatorDisplayViewState implements CalculatorDis
public static final Creator CREATOR = new Creator() {
@Override
- public ParcelableCalculatorDisplayViewState createFromParcel(@NotNull Parcel in) {
+ public ParcelableCalculatorDisplayViewState createFromParcel(@Nonnull Parcel in) {
return ParcelableCalculatorDisplayViewState.fromParcel(in);
}
@@ -26,8 +26,8 @@ public final class ParcelableCalculatorDisplayViewState implements CalculatorDis
}
};
- @NotNull
- private static ParcelableCalculatorDisplayViewState fromParcel(@NotNull Parcel in) {
+ @Nonnull
+ private static ParcelableCalculatorDisplayViewState fromParcel(@Nonnull Parcel in) {
final int selection = in.readInt();
final boolean valid = in.readInt() == 1;
final String stringResult = in.readString();
@@ -44,15 +44,15 @@ public final class ParcelableCalculatorDisplayViewState implements CalculatorDis
return new ParcelableCalculatorDisplayViewState(calculatorDisplayViewState);
}
- @NotNull
+ @Nonnull
private CalculatorDisplayViewState viewState;
- public ParcelableCalculatorDisplayViewState(@NotNull CalculatorDisplayViewState viewState) {
+ public ParcelableCalculatorDisplayViewState(@Nonnull CalculatorDisplayViewState viewState) {
this.viewState = viewState;
}
@Override
- @NotNull
+ @Nonnull
public String getText() {
return viewState.getText();
}
@@ -80,7 +80,7 @@ public final class ParcelableCalculatorDisplayViewState implements CalculatorDis
}
@Override
- @NotNull
+ @Nonnull
public JsclOperation getOperation() {
return viewState.getOperation();
}
@@ -97,7 +97,7 @@ public final class ParcelableCalculatorDisplayViewState implements CalculatorDis
}
@Override
- public void writeToParcel(@NotNull Parcel out, int flags) {
+ public void writeToParcel(@Nonnull Parcel out, int flags) {
out.writeInt(viewState.getSelection());
out.writeInt(viewState.isValid() ? 1 : 0);
out.writeString(viewState.getStringResult());
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableCalculatorEditorViewState.java b/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableCalculatorEditorViewState.java
index 9d7fc79f..defa7555 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableCalculatorEditorViewState.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableCalculatorEditorViewState.java
@@ -2,7 +2,7 @@ package org.solovyev.android.calculator;
import android.os.Parcel;
import android.os.Parcelable;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
/**
* User: serso
@@ -13,7 +13,7 @@ public final class ParcelableCalculatorEditorViewState implements CalculatorEdit
public static final Creator CREATOR = new Creator() {
@Override
- public ParcelableCalculatorEditorViewState createFromParcel(@NotNull Parcel in) {
+ public ParcelableCalculatorEditorViewState createFromParcel(@Nonnull Parcel in) {
return ParcelableCalculatorEditorViewState.fromParcel(in);
}
@@ -23,22 +23,22 @@ public final class ParcelableCalculatorEditorViewState implements CalculatorEdit
}
};
- @NotNull
+ @Nonnull
private CalculatorEditorViewState viewState;
- public ParcelableCalculatorEditorViewState(@NotNull CalculatorEditorViewState viewState) {
+ public ParcelableCalculatorEditorViewState(@Nonnull CalculatorEditorViewState viewState) {
this.viewState = viewState;
}
- @NotNull
- private static ParcelableCalculatorEditorViewState fromParcel(@NotNull Parcel in) {
+ @Nonnull
+ private static ParcelableCalculatorEditorViewState fromParcel(@Nonnull Parcel in) {
final String text = in.readString();
final int selection = in.readInt();
return new ParcelableCalculatorEditorViewState(CalculatorEditorViewStateImpl.newInstance(text, selection));
}
@Override
- @NotNull
+ @Nonnull
public String getText() {
return viewState.getText();
}
@@ -54,7 +54,7 @@ public final class ParcelableCalculatorEditorViewState implements CalculatorEdit
}
@Override
- public void writeToParcel(@NotNull Parcel out, int flags) {
+ public void writeToParcel(@Nonnull Parcel out, int flags) {
out.writeString(viewState.getText());
out.writeInt(viewState.getSelection());
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableDialogData.java b/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableDialogData.java
index 3318e63d..87ce397e 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableDialogData.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/ParcelableDialogData.java
@@ -2,8 +2,8 @@ package org.solovyev.android.calculator;
import android.os.Parcel;
import android.os.Parcelable;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.common.msg.MessageLevel;
import org.solovyev.common.msg.MessageType;
@@ -24,7 +24,7 @@ public final class ParcelableDialogData implements DialogData, Parcelable {
public final static Creator CREATOR = new Creator() {
@Override
- public ParcelableDialogData createFromParcel(@NotNull Parcel in) {
+ public ParcelableDialogData createFromParcel(@Nonnull Parcel in) {
return fromParcel(in);
}
@@ -42,7 +42,7 @@ public final class ParcelableDialogData implements DialogData, Parcelable {
**********************************************************************
*/
- @NotNull
+ @Nonnull
private DialogData nestedData;
/*
@@ -53,12 +53,12 @@ public final class ParcelableDialogData implements DialogData, Parcelable {
**********************************************************************
*/
- public ParcelableDialogData(@NotNull DialogData nestedData) {
+ public ParcelableDialogData(@Nonnull DialogData nestedData) {
this.nestedData = nestedData;
}
- @NotNull
- public static ParcelableDialogData wrap(@NotNull DialogData nestedData) {
+ @Nonnull
+ public static ParcelableDialogData wrap(@Nonnull DialogData nestedData) {
if (nestedData instanceof ParcelableDialogData) {
return ((ParcelableDialogData) nestedData);
} else {
@@ -66,21 +66,21 @@ public final class ParcelableDialogData implements DialogData, Parcelable {
}
}
- @NotNull
- public static ParcelableDialogData fromParcel(@NotNull Parcel in) {
+ @Nonnull
+ public static ParcelableDialogData fromParcel(@Nonnull Parcel in) {
final String message = in.readString();
final MessageType messageType = MessageType.values()[in.readInt()];
final String title = in.readString();
return wrap(StringDialogData.newInstance(message, messageType, title));
}
- @NotNull
+ @Nonnull
@Override
public String getMessage() {
return nestedData.getMessage();
}
- @NotNull
+ @Nonnull
@Override
public MessageLevel getMessageLevel() {
return nestedData.getMessageLevel();
@@ -98,7 +98,7 @@ public final class ParcelableDialogData implements DialogData, Parcelable {
}
@Override
- public void writeToParcel(@NotNull Parcel out, int flags) {
+ public void writeToParcel(@Nonnull Parcel out, int flags) {
out.writeString(this.getMessage());
out.writeInt(this.getMessageLevel().getMessageLevel());
out.writeString(this.getTitle());
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/external/AndroidExternalListenersContainer.java b/android-app-core/src/main/java/org/solovyev/android/calculator/external/AndroidExternalListenersContainer.java
index e0c03976..adabf4c9 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/external/AndroidExternalListenersContainer.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/external/AndroidExternalListenersContainer.java
@@ -3,11 +3,11 @@ package org.solovyev.android.calculator.external;
import android.content.Context;
import android.content.Intent;
import android.os.Parcelable;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.solovyev.android.App;
import org.solovyev.android.calculator.*;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.HashSet;
import java.util.Set;
@@ -39,19 +39,19 @@ public class AndroidExternalListenersContainer implements CalculatorExternalList
private static final String TAG = "Calculator++ External Listener Helper";
- @NotNull
+ @Nonnull
private final Set> externalListeners = new HashSet>();
- @NotNull
+ @Nonnull
private final CalculatorEventHolder lastEvent = new CalculatorEventHolder(CalculatorUtils.createFirstEventDataId());
- public AndroidExternalListenersContainer(@NotNull Calculator calculator) {
+ public AndroidExternalListenersContainer(@Nonnull Calculator calculator) {
calculator.addCalculatorEventListener(this);
}
- public void onEditorStateChanged(@NotNull Context context,
- @NotNull CalculatorEventData calculatorEventData,
- @NotNull CalculatorEditorViewState editorViewState) {
+ public void onEditorStateChanged(@Nonnull Context context,
+ @Nonnull CalculatorEventData calculatorEventData,
+ @Nonnull CalculatorEditorViewState editorViewState) {
for (Class> externalListener : getExternalListenersSync()) {
final Intent intent = new Intent(EDITOR_STATE_CHANGED_ACTION);
@@ -63,9 +63,9 @@ public class AndroidExternalListenersContainer implements CalculatorExternalList
}
}
- private void onDisplayStateChanged(@NotNull Context context,
- @NotNull CalculatorEventData calculatorEventData,
- @NotNull CalculatorDisplayViewState displayViewState) {
+ private void onDisplayStateChanged(@Nonnull Context context,
+ @Nonnull CalculatorEventData calculatorEventData,
+ @Nonnull CalculatorDisplayViewState displayViewState) {
for (Class> externalListener : getExternalListenersSync()) {
final Intent intent = new Intent(DISPLAY_STATE_CHANGED_ACTION);
intent.setClass(context, externalListener);
@@ -76,7 +76,7 @@ public class AndroidExternalListenersContainer implements CalculatorExternalList
}
}
- @NotNull
+ @Nonnull
private Set> getExternalListenersSync() {
synchronized (externalListeners) {
return new HashSet>(externalListeners);
@@ -84,21 +84,21 @@ public class AndroidExternalListenersContainer implements CalculatorExternalList
}
@Override
- public void addExternalListener(@NotNull Class> externalCalculatorClass) {
+ public void addExternalListener(@Nonnull Class> externalCalculatorClass) {
synchronized (externalListeners) {
externalListeners.add(externalCalculatorClass);
}
}
@Override
- public boolean removeExternalListener(@NotNull Class> externalCalculatorClass) {
+ public boolean removeExternalListener(@Nonnull Class> externalCalculatorClass) {
synchronized (externalListeners) {
return externalListeners.remove(externalCalculatorClass);
}
}
@Override
- public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
+ public void onCalculatorEvent(@Nonnull CalculatorEventData calculatorEventData, @Nonnull CalculatorEventType calculatorEventType, @Nullable Object data) {
final CalculatorEventHolder.Result result = lastEvent.apply(calculatorEventData);
if (result.isNewAfter()) {
switch (calculatorEventType) {
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/external/DefaultExternalCalculatorIntentHandler.java b/android-app-core/src/main/java/org/solovyev/android/calculator/external/DefaultExternalCalculatorIntentHandler.java
index 4e61fc78..28ede99d 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/external/DefaultExternalCalculatorIntentHandler.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/external/DefaultExternalCalculatorIntentHandler.java
@@ -3,7 +3,7 @@ package org.solovyev.android.calculator.external;
import android.content.Context;
import android.content.Intent;
import android.os.Parcelable;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.CalculatorDisplayViewState;
import org.solovyev.android.calculator.CalculatorEditorViewState;
import org.solovyev.android.calculator.Locator;
@@ -18,21 +18,21 @@ public class DefaultExternalCalculatorIntentHandler implements ExternalCalculato
private static final String TAG = ExternalCalculatorIntentHandler.class.getSimpleName();
- @NotNull
+ @Nonnull
private final MutableObject lastDisplayEventId = new MutableObject(0L);
- @NotNull
+ @Nonnull
private final MutableObject lastEditorEventId = new MutableObject(0L);
- @NotNull
+ @Nonnull
private final ExternalCalculatorStateUpdater stateUpdater;
- public DefaultExternalCalculatorIntentHandler(@NotNull ExternalCalculatorStateUpdater stateUpdater) {
+ public DefaultExternalCalculatorIntentHandler(@Nonnull ExternalCalculatorStateUpdater stateUpdater) {
this.stateUpdater = stateUpdater;
}
@Override
- public void onIntent(@NotNull Context context, @NotNull Intent intent) {
+ public void onIntent(@Nonnull Context context, @Nonnull Intent intent) {
if (AndroidExternalListenersContainer.EDITOR_STATE_CHANGED_ACTION.equals(intent.getAction())) {
Locator.getInstance().getNotifier().showDebugMessage(TAG, "Editor state changed broadcast received!");
@@ -76,17 +76,17 @@ public class DefaultExternalCalculatorIntentHandler implements ExternalCalculato
}
}
- protected void updateState(@NotNull Context context,
- @NotNull CalculatorEditorViewState editorViewState,
- @NotNull CalculatorDisplayViewState displayViewState) {
+ protected void updateState(@Nonnull Context context,
+ @Nonnull CalculatorEditorViewState editorViewState,
+ @Nonnull CalculatorDisplayViewState displayViewState) {
stateUpdater.updateState(context, editorViewState, displayViewState);
}
- protected void onDisplayStateChanged(@NotNull Context context, @NotNull CalculatorDisplayViewState displayViewState) {
+ protected void onDisplayStateChanged(@Nonnull Context context, @Nonnull CalculatorDisplayViewState displayViewState) {
updateState(context, Locator.getInstance().getEditor().getViewState(), displayViewState);
}
- protected void onEditorStateChanged(@NotNull Context context, @NotNull CalculatorEditorViewState editorViewState) {
+ protected void onEditorStateChanged(@Nonnull Context context, @Nonnull CalculatorEditorViewState editorViewState) {
updateState(context, editorViewState, Locator.getInstance().getDisplay().getViewState());
}
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/external/ExternalCalculatorIntentHandler.java b/android-app-core/src/main/java/org/solovyev/android/calculator/external/ExternalCalculatorIntentHandler.java
index fa3768e5..e8e752c5 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/external/ExternalCalculatorIntentHandler.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/external/ExternalCalculatorIntentHandler.java
@@ -2,7 +2,7 @@ package org.solovyev.android.calculator.external;
import android.content.Context;
import android.content.Intent;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
/**
* User: serso
@@ -11,5 +11,5 @@ import org.jetbrains.annotations.NotNull;
*/
public interface ExternalCalculatorIntentHandler {
- void onIntent(@NotNull Context context, @NotNull Intent intent);
+ void onIntent(@Nonnull Context context, @Nonnull Intent intent);
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/external/ExternalCalculatorStateUpdater.java b/android-app-core/src/main/java/org/solovyev/android/calculator/external/ExternalCalculatorStateUpdater.java
index 83c5c402..b827754e 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/external/ExternalCalculatorStateUpdater.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/external/ExternalCalculatorStateUpdater.java
@@ -1,7 +1,7 @@
package org.solovyev.android.calculator.external;
import android.content.Context;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.CalculatorDisplayViewState;
import org.solovyev.android.calculator.CalculatorEditorViewState;
@@ -12,7 +12,7 @@ import org.solovyev.android.calculator.CalculatorEditorViewState;
*/
public interface ExternalCalculatorStateUpdater {
- void updateState(@NotNull Context context,
- @NotNull CalculatorEditorViewState editorState,
- @NotNull CalculatorDisplayViewState displayState);
+ void updateState(@Nonnull Context context,
+ @Nonnull CalculatorEditorViewState editorState,
+ @Nonnull CalculatorDisplayViewState displayState);
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/model/AndroidCalculatorEngine.java b/android-app-core/src/main/java/org/solovyev/android/calculator/model/AndroidCalculatorEngine.java
index dcc3232a..5067d563 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/model/AndroidCalculatorEngine.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/model/AndroidCalculatorEngine.java
@@ -16,7 +16,7 @@ import jscl.NumeralBase;
import jscl.math.function.Function;
import jscl.math.function.IConstant;
import jscl.math.operator.Operator;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.core.R;
import org.solovyev.android.prefs.BooleanPreference;
@@ -85,22 +85,22 @@ public class AndroidCalculatorEngine implements CalculatorEngine, SharedPreferen
preferenceKeys.add(maxCalculationTime.getKey());
}
- @NotNull
+ @Nonnull
public static List getPreferenceKeys() {
return Collections.unmodifiableList(preferenceKeys);
}
}
- @NotNull
+ @Nonnull
private final Context context;
- @NotNull
+ @Nonnull
private final CalculatorEngine calculatorEngine;
- @NotNull
+ @Nonnull
private final Object lock;
- public AndroidCalculatorEngine(@NotNull Application application) {
+ public AndroidCalculatorEngine(@Nonnull Application application) {
this.context = application;
PreferenceManager.getDefaultSharedPreferences(application).registerOnSharedPreferenceChangeListener(this);
@@ -117,42 +117,42 @@ public class AndroidCalculatorEngine implements CalculatorEngine, SharedPreferen
}
@Override
- @NotNull
+ @Nonnull
public CalculatorMathRegistry getVarsRegistry() {
return calculatorEngine.getVarsRegistry();
}
@Override
- @NotNull
+ @Nonnull
public CalculatorMathRegistry getFunctionsRegistry() {
return calculatorEngine.getFunctionsRegistry();
}
@Override
- @NotNull
+ @Nonnull
public CalculatorMathRegistry getOperatorsRegistry() {
return calculatorEngine.getOperatorsRegistry();
}
@Override
- @NotNull
+ @Nonnull
public CalculatorMathRegistry getPostfixFunctionsRegistry() {
return calculatorEngine.getPostfixFunctionsRegistry();
}
@Override
- @NotNull
+ @Nonnull
public CalculatorMathEngine getMathEngine() {
return calculatorEngine.getMathEngine();
}
- @NotNull
+ @Nonnull
@Override
public MathEngine getMathEngine0() {
return calculatorEngine.getMathEngine0();
}
- @NotNull
+ @Nonnull
@Override
public NumeralBase getNumeralBase() {
return calculatorEngine.getNumeralBase();
@@ -196,47 +196,47 @@ public class AndroidCalculatorEngine implements CalculatorEngine, SharedPreferen
}
@Override
- public void setPrecision(@NotNull Integer precision) {
+ public void setPrecision(@Nonnull Integer precision) {
calculatorEngine.setPrecision(precision);
}
@Override
- public void setRoundResult(@NotNull Boolean round) {
+ public void setRoundResult(@Nonnull Boolean round) {
calculatorEngine.setRoundResult(round);
}
- @NotNull
+ @Nonnull
@Override
public AngleUnit getAngleUnits() {
return calculatorEngine.getAngleUnits();
}
@Override
- public void setAngleUnits(@NotNull AngleUnit angleUnits) {
+ public void setAngleUnits(@Nonnull AngleUnit angleUnits) {
calculatorEngine.setAngleUnits(angleUnits);
}
@Override
- public void setNumeralBase(@NotNull NumeralBase numeralBase) {
+ public void setNumeralBase(@Nonnull NumeralBase numeralBase) {
calculatorEngine.setNumeralBase(numeralBase);
}
@Override
- public void setMultiplicationSign(@NotNull String multiplicationSign) {
+ public void setMultiplicationSign(@Nonnull String multiplicationSign) {
calculatorEngine.setMultiplicationSign(multiplicationSign);
}
@Override
- public void setScienceNotation(@NotNull Boolean scienceNotation) {
+ public void setScienceNotation(@Nonnull Boolean scienceNotation) {
calculatorEngine.setScienceNotation(scienceNotation);
}
@Override
- public void setTimeout(@NotNull Integer timeout) {
+ public void setTimeout(@Nonnull Integer timeout) {
calculatorEngine.setTimeout(timeout);
}
- private void softReset(@NotNull SharedPreferences preferences) {
+ private void softReset(@Nonnull SharedPreferences preferences) {
this.setPrecision(Preferences.precision.getPreference(preferences));
this.setRoundResult(Preferences.roundResult.getPreference(preferences));
this.setAngleUnits(getAngleUnitsFromPrefs(preferences));
@@ -254,23 +254,23 @@ public class AndroidCalculatorEngine implements CalculatorEngine, SharedPreferen
}
}
- @NotNull
- public NumeralBase getNumeralBaseFromPrefs(@NotNull SharedPreferences preferences) {
+ @Nonnull
+ public NumeralBase getNumeralBaseFromPrefs(@Nonnull SharedPreferences preferences) {
return Preferences.numeralBase.getPreference(preferences);
}
- @NotNull
- public AngleUnit getAngleUnitsFromPrefs(@NotNull SharedPreferences preferences) {
+ @Nonnull
+ public AngleUnit getAngleUnitsFromPrefs(@Nonnull SharedPreferences preferences) {
return Preferences.angleUnit.getPreference(preferences);
}
//for tests only
- public void setDecimalGroupSymbols(@NotNull DecimalFormatSymbols decimalGroupSymbols) {
+ public void setDecimalGroupSymbols(@Nonnull DecimalFormatSymbols decimalGroupSymbols) {
this.calculatorEngine.setDecimalGroupSymbols(decimalGroupSymbols);
}
@Override
- @NotNull
+ @Nonnull
public String getMultiplicationSign() {
return calculatorEngine.getMultiplicationSign();
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/model/AndroidMathEntityDao.java b/android-app-core/src/main/java/org/solovyev/android/calculator/model/AndroidMathEntityDao.java
index 56c6b096..5a49e4cb 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/model/AndroidMathEntityDao.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/model/AndroidMathEntityDao.java
@@ -5,8 +5,8 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import org.solovyev.android.App;
@@ -23,20 +23,20 @@ import java.io.StringWriter;
*/
public class AndroidMathEntityDao implements MathEntityDao {
- @NotNull
+ @Nonnull
private static final String TAG = AndroidMathEntityDao.class.getSimpleName();
@Nullable
private final Integer preferenceStringId;
- @NotNull
+ @Nonnull
private final Context context;
@Nullable
private final Class extends MathEntityPersistenceContainer> persistenceContainerClass;
public AndroidMathEntityDao(@Nullable Integer preferenceStringId,
- @NotNull Application application,
+ @Nonnull Application application,
@Nullable Class extends MathEntityPersistenceContainer> persistenceContainerClass) {
this.preferenceStringId = preferenceStringId;
this.context = application;
@@ -44,7 +44,7 @@ public class AndroidMathEntityDao implements Ma
}
@Override
- public void save(@NotNull MathEntityPersistenceContainer container) {
+ public void save(@Nonnull MathEntityPersistenceContainer container) {
if (preferenceStringId != null) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
final SharedPreferences.Editor editor = settings.edit();
@@ -86,7 +86,7 @@ public class AndroidMathEntityDao implements Ma
}
@Nullable
- public String getDescription(@NotNull String descriptionId) {
+ public String getDescription(@Nonnull String descriptionId) {
final Resources resources = context.getResources();
final int stringId = resources.getIdentifier(descriptionId, "string", App.getApplication().getClass().getPackage().getName());
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/plot/AndroidCalculatorPlotter.java b/android-app-core/src/main/java/org/solovyev/android/calculator/plot/AndroidCalculatorPlotter.java
index 37e3e782..041172c3 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/plot/AndroidCalculatorPlotter.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/plot/AndroidCalculatorPlotter.java
@@ -4,8 +4,8 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import jscl.math.Generic;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorPreferences;
import java.util.List;
@@ -17,11 +17,11 @@ import java.util.List;
*/
public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPreferences.OnSharedPreferenceChangeListener {
- @NotNull
+ @Nonnull
private final CalculatorPlotter plotter;
- public AndroidCalculatorPlotter(@NotNull Context context,
- @NotNull CalculatorPlotter plotter) {
+ public AndroidCalculatorPlotter(@Nonnull Context context,
+ @Nonnull CalculatorPlotter plotter) {
this.plotter = plotter;
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
@@ -31,72 +31,72 @@ public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPrefer
}
@Override
- @NotNull
+ @Nonnull
public PlotData getPlotData() {
return plotter.getPlotData();
}
@Override
- public boolean addFunction(@NotNull Generic expression) {
+ public boolean addFunction(@Nonnull Generic expression) {
return plotter.addFunction(expression);
}
@Override
- public boolean addFunction(@NotNull PlotFunction plotFunction) {
+ public boolean addFunction(@Nonnull PlotFunction plotFunction) {
return plotter.addFunction(plotFunction);
}
@Override
- public boolean addFunction(@NotNull XyFunction xyFunction) {
+ public boolean addFunction(@Nonnull XyFunction xyFunction) {
return plotter.addFunction(xyFunction);
}
@Override
- public boolean addFunction(@NotNull XyFunction xyFunction, @NotNull PlotLineDef functionLineDef) {
+ public boolean addFunction(@Nonnull XyFunction xyFunction, @Nonnull PlotLineDef functionLineDef) {
return plotter.addFunction(xyFunction, functionLineDef);
}
@Override
- public boolean updateFunction(@NotNull PlotFunction newFunction) {
+ public boolean updateFunction(@Nonnull PlotFunction newFunction) {
return plotter.updateFunction(newFunction);
}
@Override
- public boolean updateFunction(@NotNull XyFunction xyFunction, @NotNull PlotLineDef functionLineDef) {
+ public boolean updateFunction(@Nonnull XyFunction xyFunction, @Nonnull PlotLineDef functionLineDef) {
return plotter.updateFunction(xyFunction, functionLineDef);
}
@Override
- public boolean removeFunction(@NotNull PlotFunction plotFunction) {
+ public boolean removeFunction(@Nonnull PlotFunction plotFunction) {
return plotter.removeFunction(plotFunction);
}
@Override
- public boolean removeFunction(@NotNull XyFunction xyFunction) {
+ public boolean removeFunction(@Nonnull XyFunction xyFunction) {
return plotter.removeFunction(xyFunction);
}
- @NotNull
+ @Nonnull
@Override
- public PlotFunction pin(@NotNull PlotFunction plotFunction) {
+ public PlotFunction pin(@Nonnull PlotFunction plotFunction) {
return plotter.pin(plotFunction);
}
- @NotNull
+ @Nonnull
@Override
- public PlotFunction unpin(@NotNull PlotFunction plotFunction) {
+ public PlotFunction unpin(@Nonnull PlotFunction plotFunction) {
return plotter.unpin(plotFunction);
}
- @NotNull
+ @Nonnull
@Override
- public PlotFunction show(@NotNull PlotFunction plotFunction) {
+ public PlotFunction show(@Nonnull PlotFunction plotFunction) {
return plotter.show(plotFunction);
}
- @NotNull
+ @Nonnull
@Override
- public PlotFunction hide(@NotNull PlotFunction plotFunction) {
+ public PlotFunction hide(@Nonnull PlotFunction plotFunction) {
return plotter.hide(plotFunction);
}
@@ -107,18 +107,18 @@ public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPrefer
@Nullable
@Override
- public PlotFunction getFunctionById(@NotNull String functionId) {
+ public PlotFunction getFunctionById(@Nonnull String functionId) {
return plotter.getFunctionById(functionId);
}
@Override
- @NotNull
+ @Nonnull
public List getFunctions() {
return plotter.getFunctions();
}
@Override
- @NotNull
+ @Nonnull
public List getVisibleFunctions() {
return plotter.getVisibleFunctions();
}
@@ -129,7 +129,7 @@ public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPrefer
}
@Override
- public void plot(@NotNull Generic expression) {
+ public void plot(@Nonnull Generic expression) {
plotter.plot(expression);
}
@@ -139,7 +139,7 @@ public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPrefer
}
@Override
- public boolean isPlotPossibleFor(@NotNull Generic expression) {
+ public boolean isPlotPossibleFor(@Nonnull Generic expression) {
return plotter.isPlotPossibleFor(expression);
}
@@ -159,12 +159,12 @@ public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPrefer
}
@Override
- public void savePlotBoundaries(@NotNull PlotBoundaries plotBoundaries) {
+ public void savePlotBoundaries(@Nonnull PlotBoundaries plotBoundaries) {
plotter.savePlotBoundaries(plotBoundaries);
}
@Override
- public void setPlotBoundaries(@NotNull PlotBoundaries plotBoundaries) {
+ public void setPlotBoundaries(@Nonnull PlotBoundaries plotBoundaries) {
plotter.setPlotBoundaries(plotBoundaries);
}
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/plot/AndroidPlotLineStyle.java b/android-app-core/src/main/java/org/solovyev/android/calculator/plot/AndroidPlotLineStyle.java
index e741451c..0685d190 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/plot/AndroidPlotLineStyle.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/plot/AndroidPlotLineStyle.java
@@ -2,8 +2,8 @@ package org.solovyev.android.calculator.plot;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
/**
* User: serso
@@ -14,43 +14,43 @@ public enum AndroidPlotLineStyle {
solid(PlotLineStyle.solid) {
@Override
- public void applyToPaint(@NotNull Paint paint) {
+ public void applyToPaint(@Nonnull Paint paint) {
paint.setPathEffect(null);
}
},
dashed(PlotLineStyle.dashed) {
@Override
- public void applyToPaint(@NotNull Paint paint) {
+ public void applyToPaint(@Nonnull Paint paint) {
paint.setPathEffect(new DashPathEffect(new float[]{10, 20}, 0));
}
},
dotted(PlotLineStyle.dotted) {
@Override
- public void applyToPaint(@NotNull Paint paint) {
+ public void applyToPaint(@Nonnull Paint paint) {
paint.setPathEffect(new DashPathEffect(new float[]{5, 1}, 0));
}
},
dash_dotted(PlotLineStyle.dash_dotted) {
@Override
- public void applyToPaint(@NotNull Paint paint) {
+ public void applyToPaint(@Nonnull Paint paint) {
paint.setPathEffect(new DashPathEffect(new float[]{10, 20, 5, 1}, 0));
}
};
- @NotNull
+ @Nonnull
private final PlotLineStyle plotLineStyle;
- AndroidPlotLineStyle(@NotNull PlotLineStyle plotLineStyle) {
+ AndroidPlotLineStyle(@Nonnull PlotLineStyle plotLineStyle) {
this.plotLineStyle = plotLineStyle;
}
- public abstract void applyToPaint(@NotNull Paint paint);
+ public abstract void applyToPaint(@Nonnull Paint paint);
@Nullable
- public static AndroidPlotLineStyle valueOf(@NotNull PlotLineStyle plotLineStyle) {
+ public static AndroidPlotLineStyle valueOf(@Nonnull PlotLineStyle plotLineStyle) {
for (AndroidPlotLineStyle androidPlotLineStyle : values()) {
if (androidPlotLineStyle.plotLineStyle == plotLineStyle) {
return androidPlotLineStyle;
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java b/android-app-core/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java
index 4a17cda2..8c82eed1 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java
@@ -11,7 +11,7 @@ import android.content.res.Resources;
import android.graphics.Paint;
import android.text.TextPaint;
import android.util.AttributeSet;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.core.R;
import org.solovyev.android.view.drag.DirectionDragButton;
@@ -23,14 +23,14 @@ import org.solovyev.android.view.drag.DirectionDragButton;
*/
public class AngleUnitsButton extends DirectionDragButton {
- public AngleUnitsButton(Context context, @NotNull AttributeSet attrs) {
+ public AngleUnitsButton(Context context, @Nonnull AttributeSet attrs) {
super(context, attrs);
}
@Override
- protected void initDirectionTextPaint(@NotNull Paint basePaint,
- @NotNull DirectionTextData directionTextData,
- @NotNull Resources resources) {
+ protected void initDirectionTextPaint(@Nonnull Paint basePaint,
+ @Nonnull DirectionTextData directionTextData,
+ @Nonnull Resources resources) {
super.initDirectionTextPaint(basePaint, directionTextData, resources);
final TextPaint directionTextPaint = directionTextData.getPaint();
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/view/NumeralBaseConverterDialog.java b/android-app-core/src/main/java/org/solovyev/android/calculator/view/NumeralBaseConverterDialog.java
index 1b3dc5ac..73fd0067 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/view/NumeralBaseConverterDialog.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/view/NumeralBaseConverterDialog.java
@@ -4,8 +4,8 @@ import android.app.AlertDialog;
import android.content.Context;
import android.view.View;
import android.view.WindowManager;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorParseException;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.ToJsclTextProcessor;
@@ -32,7 +32,7 @@ public class NumeralBaseConverterDialog {
this.initialFromValue = initialFromValue;
}
- public void show(@NotNull Context context) {
+ public void show(@Nonnull Context context) {
final UnitConverterViewBuilder b = new UnitConverterViewBuilder();
b.setFromUnitTypes(Arrays.asList(CalculatorNumeralBase.values()));
b.setToUnitTypes(Arrays.asList(CalculatorNumeralBase.values()));
@@ -64,7 +64,7 @@ public class NumeralBaseConverterDialog {
b.setCustomButtonData(new UnitConverterViewBuilder.CustomButtonData(context.getString(R.string.c_use_short), new UnitConverterViewBuilder.CustomButtonOnClickListener() {
@Override
- public void onClick(@NotNull Unit fromUnits, @NotNull Unit toUnits) {
+ public void onClick(@Nonnull Unit fromUnits, @Nonnull Unit toUnits) {
String toUnitsValue = toUnits.getValue();
if (!toUnits.getUnitType().equals(CalculatorNumeralBase.valueOf(Locator.getInstance().getEngine().getNumeralBase()))) {
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/view/NumeralBasesButton.java b/android-app-core/src/main/java/org/solovyev/android/calculator/view/NumeralBasesButton.java
index fca46c6c..753ea367 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/view/NumeralBasesButton.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/view/NumeralBasesButton.java
@@ -11,7 +11,7 @@ import android.content.res.Resources;
import android.graphics.Paint;
import android.text.TextPaint;
import android.util.AttributeSet;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.core.R;
import org.solovyev.android.view.drag.DirectionDragButton;
@@ -23,14 +23,14 @@ import org.solovyev.android.view.drag.DirectionDragButton;
*/
public class NumeralBasesButton extends DirectionDragButton {
- public NumeralBasesButton(Context context, @NotNull AttributeSet attrs) {
+ public NumeralBasesButton(Context context, @Nonnull AttributeSet attrs) {
super(context, attrs);
}
@Override
- protected void initDirectionTextPaint(@NotNull Paint basePaint,
- @NotNull DirectionTextData directionTextData,
- @NotNull Resources resources) {
+ protected void initDirectionTextPaint(@Nonnull Paint basePaint,
+ @Nonnull DirectionTextData directionTextData,
+ @Nonnull Resources resources) {
super.initDirectionTextPaint(basePaint, directionTextData, resources);
final TextPaint directionTextPaint = directionTextData.getPaint();
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/view/TextHighlighter.java b/android-app-core/src/main/java/org/solovyev/android/calculator/view/TextHighlighter.java
index bb0240a6..baa8877e 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/view/TextHighlighter.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/view/TextHighlighter.java
@@ -6,8 +6,8 @@
package org.solovyev.android.calculator.view;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.math.MathType;
import org.solovyev.android.calculator.text.TextProcessor;
@@ -31,7 +31,7 @@ public class TextHighlighter implements TextProcessor tagAttributes) {
+ private int processHighlightedText(@Nonnull StringBuilder result, int i, @Nonnull String match, @Nonnull String tag, @Nullable Map tagAttributes) {
result.append("<").append(tag);
if (tagAttributes != null && !tagAttributes.entrySet().isEmpty()) {
@@ -203,7 +203,7 @@ public class TextHighlighter implements TextProcessor");
diff --git a/android-app-core/src/main/java/org/solovyev/android/calculator/view/UnitConverterViewBuilder.java b/android-app-core/src/main/java/org/solovyev/android/calculator/view/UnitConverterViewBuilder.java
index e9f8e75a..a55dc126 100644
--- a/android-app-core/src/main/java/org/solovyev/android/calculator/view/UnitConverterViewBuilder.java
+++ b/android-app-core/src/main/java/org/solovyev/android/calculator/view/UnitConverterViewBuilder.java
@@ -8,8 +8,8 @@ import android.text.TextWatcher;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.core.R;
import org.solovyev.android.view.ViewBuilder;
import org.solovyev.android.view.ViewFromLayoutBuilder;
@@ -25,16 +25,16 @@ import java.util.List;
*/
public class UnitConverterViewBuilder implements ViewBuilder {
- @NotNull
+ @Nonnull
private List extends UnitType> fromUnitTypes = Collections.emptyList();
- @NotNull
+ @Nonnull
private List extends UnitType> toUnitTypes = Collections.emptyList();
@Nullable
private Unit fromValue;
- @NotNull
+ @Nonnull
private UnitConverter converter = UnitConverter.Dummy.getInstance();
@Nullable
@@ -43,11 +43,11 @@ public class UnitConverterViewBuilder implements ViewBuilder {
@Nullable
private CustomButtonData customButtonData;
- public void setFromUnitTypes(@NotNull List extends UnitType> fromUnitTypes) {
+ public void setFromUnitTypes(@Nonnull List extends UnitType> fromUnitTypes) {
this.fromUnitTypes = fromUnitTypes;
}
- public void setToUnitTypes(@NotNull List extends UnitType> toUnitTypes) {
+ public void setToUnitTypes(@Nonnull List extends UnitType> toUnitTypes) {
this.toUnitTypes = toUnitTypes;
}
@@ -55,7 +55,7 @@ public class UnitConverterViewBuilder implements ViewBuilder {
this.fromValue = fromValue;
}
- public void setConverter(@NotNull UnitConverter converter) {
+ public void setConverter(@Nonnull UnitConverter converter) {
this.converter = converter;
}
@@ -67,9 +67,9 @@ public class UnitConverterViewBuilder implements ViewBuilder {
this.customButtonData = customButtonData;
}
- @NotNull
+ @Nonnull
@Override
- public View build(@NotNull final Context context) {
+ public View build(@Nonnull final Context context) {
final View main = ViewFromLayoutBuilder.newInstance(R.layout.cpp_unit_converter).build(context);
final Spinner fromSpinner = (Spinner) main.findViewById(R.id.unit_types_from);
@@ -137,10 +137,10 @@ public class UnitConverterViewBuilder implements ViewBuilder {
return main;
}
- private void fillSpinner(@NotNull final View main,
- @NotNull final Context context,
+ private void fillSpinner(@Nonnull final View main,
+ @Nonnull final Context context,
final int spinnerId,
- @NotNull List extends UnitType> unitTypes) {
+ @Nonnull List extends UnitType> unitTypes) {
final Spinner spinner = (Spinner) main.findViewById(spinnerId);
final ArrayAdapter> adapter = new ArrayAdapter>(context, android.R.layout.simple_spinner_item);
@@ -161,7 +161,7 @@ public class UnitConverterViewBuilder implements ViewBuilder {
spinner.setAdapter(adapter);
}
- private static void doConversion(@NotNull View main, @NotNull Context context, @NotNull UnitConverter converter) {
+ private static void doConversion(@Nonnull View main, @Nonnull Context context, @Nonnull UnitConverter converter) {
final EditText fromEditText = (EditText) main.findViewById(R.id.units_from);
final EditText toEditText = (EditText) main.findViewById(R.id.units_to);
@@ -174,46 +174,46 @@ public class UnitConverterViewBuilder implements ViewBuilder {
}
}
- @NotNull
- private static Unit getToUnit(@NotNull View main) {
+ @Nonnull
+ private static Unit getToUnit(@Nonnull View main) {
final EditText toUnits = (EditText) main.findViewById(R.id.units_to);
return UnitImpl.newInstance(toUnits.getText().toString(), getToUnitType(main));
}
- @NotNull
- private static UnitType getToUnitType(@NotNull View main) {
+ @Nonnull
+ private static UnitType getToUnitType(@Nonnull View main) {
final Spinner toSpinner = (Spinner) main.findViewById(R.id.unit_types_to);
return (UnitType) toSpinner.getSelectedItem();
}
- @NotNull
- private static Unit getFromUnit(@NotNull View main) {
+ @Nonnull
+ private static Unit getFromUnit(@Nonnull View main) {
final EditText fromUnits = (EditText) main.findViewById(R.id.units_from);
return UnitImpl.newInstance(fromUnits.getText().toString(), getFromUnitType(main));
}
- @NotNull
- private static UnitType getFromUnitType(@NotNull View main) {
+ @Nonnull
+ private static UnitType getFromUnitType(@Nonnull View main) {
final Spinner fromSpinner = (Spinner) main.findViewById(R.id.unit_types_from);
return (UnitType) fromSpinner.getSelectedItem();
}
public static class CustomButtonData {
- @NotNull
+ @Nonnull
private String text;
- @NotNull
+ @Nonnull
private CustomButtonOnClickListener clickListener;
- public CustomButtonData(@NotNull String text, @NotNull CustomButtonOnClickListener clickListener) {
+ public CustomButtonData(@Nonnull String text, @Nonnull CustomButtonOnClickListener clickListener) {
this.text = text;
this.clickListener = clickListener;
}
}
public static interface CustomButtonOnClickListener {
- void onClick(@NotNull Unit fromUnits, @NotNull Unit toUnits);
+ void onClick(@Nonnull Unit fromUnits, @Nonnull Unit toUnits);
}
}
diff --git a/android-app-onscreen/AndroidManifest.xml b/android-app-onscreen/AndroidManifest.xml
index c93288ba..8b799d51 100644
--- a/android-app-onscreen/AndroidManifest.xml
+++ b/android-app-onscreen/AndroidManifest.xml
@@ -2,4 +2,10 @@
\ No newline at end of file
+ android:versionName="1.0">
+
+
+
+
\ No newline at end of file
diff --git a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenBroadcastReceiver.java b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenBroadcastReceiver.java
index 47b61fcf..6f8c74bb 100644
--- a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenBroadcastReceiver.java
+++ b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenBroadcastReceiver.java
@@ -5,7 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.CalculatorPreferences;
/**
@@ -19,8 +19,8 @@ public final class CalculatorOnscreenBroadcastReceiver extends BroadcastReceiver
}
@Override
- public void onReceive(@NotNull Context context,
- @NotNull Intent intent) {
+ public void onReceive(@Nonnull Context context,
+ @Nonnull Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (CalculatorPreferences.OnscreenCalculator.startOnBoot.getPreferenceNoError(preferences)) {
diff --git a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenService.java b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenService.java
index 74f98451..8ac2e5d6 100644
--- a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenService.java
+++ b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenService.java
@@ -9,8 +9,8 @@ import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
import android.util.DisplayMetrics;
import android.view.WindowManager;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.Views;
import org.solovyev.android.calculator.CalculatorDisplayViewState;
import org.solovyev.android.calculator.CalculatorEditorViewState;
@@ -29,14 +29,14 @@ public class CalculatorOnscreenService extends Service implements ExternalCalcul
private static final int NOTIFICATION_ID = 9031988; // my birthday =)
- @NotNull
+ @Nonnull
private final ExternalCalculatorIntentHandler intentHandler = new DefaultExternalCalculatorIntentHandler(this);
public static final Class INTENT_LISTENER_CLASS = CalculatorOnscreenBroadcastReceiver.class;
@Nullable
private static String cursorColor;
- @NotNull
+ @Nonnull
private CalculatorOnscreenView view;
private boolean compatibilityStart = true;
@@ -89,7 +89,7 @@ public class CalculatorOnscreenService extends Service implements ExternalCalcul
Locator.getInstance().getExternalListenersContainer().addExternalListener(getIntentListenerClass());
}
- @NotNull
+ @Nonnull
private static Class> getIntentListenerClass() {
return INTENT_LISTENER_CLASS;
}
@@ -108,13 +108,13 @@ public class CalculatorOnscreenService extends Service implements ExternalCalcul
}
@Override
- public void updateState(@NotNull Context context, @NotNull CalculatorEditorViewState editorState, @NotNull CalculatorDisplayViewState displayState) {
+ public void updateState(@Nonnull Context context, @Nonnull CalculatorEditorViewState editorState, @Nonnull CalculatorDisplayViewState displayState) {
view.updateDisplayState(displayState);
view.updateEditorState(editorState);
}
- @NotNull
- private static String getCursorColor(@NotNull Context context) {
+ @Nonnull
+ private static String getCursorColor(@Nonnull Context context) {
if (cursorColor == null) {
cursorColor = Integer.toHexString(context.getResources().getColor(R.color.cpp_onscreen_cursor_color)).substring(2);
}
@@ -166,7 +166,7 @@ public class CalculatorOnscreenService extends Service implements ExternalCalcul
}
}
- private boolean isInitIntent(@NotNull Intent intent) {
+ private boolean isInitIntent(@Nonnull Intent intent) {
return intent.getAction().equals(AndroidExternalListenersContainer.INIT_ACTION);
}
@@ -200,19 +200,19 @@ public class CalculatorOnscreenService extends Service implements ExternalCalcul
nm.notify(NOTIFICATION_ID, builder.getNotification());
}
- public static void showNotification(@NotNull Context context) {
+ public static void showNotification(@Nonnull Context context) {
final Intent intent = new Intent(AndroidExternalListenersContainer.INIT_ACTION);
intent.setClass(context, getIntentListenerClass());
context.sendBroadcast(intent);
}
- public static void showOnscreenView(@NotNull Context context) {
+ public static void showOnscreenView(@Nonnull Context context) {
final Intent intent = createShowOnscreenViewIntent(context);
context.sendBroadcast(intent);
}
- @NotNull
- private static Intent createShowOnscreenViewIntent(@NotNull Context context) {
+ @Nonnull
+ private static Intent createShowOnscreenViewIntent(@Nonnull Context context) {
final Intent intent = new Intent(AndroidExternalListenersContainer.INIT_ACTION);
intent.setClass(context, getIntentListenerClass());
intent.putExtra(AndroidExternalListenersContainer.INIT_ACTION_CREATE_VIEW_EXTRA, true);
diff --git a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenStartActivity.java b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenStartActivity.java
index 1079ba3a..ed93e069 100644
--- a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenStartActivity.java
+++ b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenStartActivity.java
@@ -5,7 +5,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.Android;
import org.solovyev.android.App;
import org.solovyev.android.calculator.AbstractFixableError;
@@ -38,7 +38,7 @@ public class CalculatorOnscreenStartActivity extends Activity {
public static class RemoveIconFixableError extends AbstractFixableError {
- public RemoveIconFixableError(@NotNull Context context) {
+ public RemoveIconFixableError(@Nonnull Context context) {
super(context.getString(R.string.cpp_onscreen_remove_icon_button_text));
}
diff --git a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenView.java b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenView.java
index 2aaeea03..8f6b629b 100644
--- a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenView.java
+++ b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenView.java
@@ -11,8 +11,8 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.prefs.Preference;
@@ -50,28 +50,28 @@ public class CalculatorOnscreenView {
**********************************************************************
*/
- @NotNull
+ @Nonnull
private View root;
- @NotNull
+ @Nonnull
private View content;
- @NotNull
+ @Nonnull
private View header;
- @NotNull
+ @Nonnull
private AndroidCalculatorEditorView editorView;
- @NotNull
+ @Nonnull
private AndroidCalculatorDisplayView displayView;
- @NotNull
+ @Nonnull
private Context context;
- @NotNull
+ @Nonnull
private CalculatorOnscreenViewState state = CalculatorOnscreenViewState.newDefaultState();
- @NotNull
+ @Nonnull
private String cursorColor;
@Nullable
@@ -107,9 +107,9 @@ public class CalculatorOnscreenView {
private CalculatorOnscreenView() {
}
- public static CalculatorOnscreenView newInstance(@NotNull Context context,
- @NotNull CalculatorOnscreenViewState state,
- @NotNull String cursorColor,
+ public static CalculatorOnscreenView newInstance(@Nonnull Context context,
+ @Nonnull CalculatorOnscreenViewState state,
+ @Nonnull String cursorColor,
@Nullable OnscreenViewListener viewListener) {
final CalculatorOnscreenView result = new CalculatorOnscreenView();
@@ -136,12 +136,12 @@ public class CalculatorOnscreenView {
**********************************************************************
*/
- public void updateDisplayState(@NotNull CalculatorDisplayViewState displayState) {
+ public void updateDisplayState(@Nonnull CalculatorDisplayViewState displayState) {
checkInit();
displayView.setState(displayState);
}
- public void updateEditorState(@NotNull CalculatorEditorViewState editorState) {
+ public void updateEditorState(@Nonnull CalculatorEditorViewState editorState) {
checkInit();
editorView.setState(editorState);
}
@@ -312,13 +312,13 @@ public class CalculatorOnscreenView {
}
}
- public static void persistState(@NotNull Context context, @NotNull CalculatorOnscreenViewState state) {
+ public static void persistState(@Nonnull Context context, @Nonnull CalculatorOnscreenViewState state) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
viewStatePreference.putPreference(preferences, state);
}
@Nullable
- public static CalculatorOnscreenViewState readState(@NotNull Context context) {
+ public static CalculatorOnscreenViewState readState(@Nonnull Context context) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (viewStatePreference.isSet(preferences)) {
return viewStatePreference.getPreference(preferences);
@@ -344,12 +344,12 @@ public class CalculatorOnscreenView {
}
}
- @NotNull
+ @Nonnull
private WindowManager getWindowManager() {
return ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE));
}
- @NotNull
+ @Nonnull
public CalculatorOnscreenViewState getCurrentState(boolean useRealSize) {
final WindowManager.LayoutParams params = (WindowManager.LayoutParams) root.getLayoutParams();
if (useRealSize) {
@@ -389,7 +389,7 @@ public class CalculatorOnscreenView {
**********************************************************************
*/
- @NotNull
+ @Nonnull
private final WindowManager wm;
private int orientation;
@@ -400,7 +400,7 @@ public class CalculatorOnscreenView {
private long time = 0;
- @NotNull
+ @Nonnull
private final View view;
private int displayWidth;
@@ -415,8 +415,8 @@ public class CalculatorOnscreenView {
**********************************************************************
*/
- public WindowDragTouchListener(@NotNull WindowManager wm,
- @NotNull View view) {
+ public WindowDragTouchListener(@Nonnull WindowManager wm,
+ @Nonnull View view) {
this.wm = wm;
this.view = view;
initDisplayParams();
@@ -503,7 +503,7 @@ public class CalculatorOnscreenView {
return δx >= DIST_EPS && δx < DIST_MAX;
}
- @NotNull
+ @Nonnull
private static String toString(float x, float y) {
return "(" + formatFloat(x) + ", " + formatFloat(y) + ")";
}
diff --git a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenViewState.java b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenViewState.java
index 103224d6..dac8482b 100644
--- a/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenViewState.java
+++ b/android-app-onscreen/src/main/java/org/solovyev/android/calculator/onscreen/CalculatorOnscreenViewState.java
@@ -4,8 +4,8 @@ import android.content.SharedPreferences;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.json.JSONException;
import org.json.JSONObject;
import org.solovyev.android.prefs.AbstractPreference;
@@ -23,7 +23,7 @@ public class CalculatorOnscreenViewState implements Parcelable {
private static final String TAG = CalculatorOnscreenViewState.class.getSimpleName();
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
- public CalculatorOnscreenViewState createFromParcel(@NotNull Parcel in) {
+ public CalculatorOnscreenViewState createFromParcel(@Nonnull Parcel in) {
return CalculatorOnscreenViewState.fromParcel(in);
}
@@ -43,8 +43,8 @@ public class CalculatorOnscreenViewState implements Parcelable {
private CalculatorOnscreenViewState() {
}
- @NotNull
- private static CalculatorOnscreenViewState fromParcel(@NotNull Parcel in) {
+ @Nonnull
+ private static CalculatorOnscreenViewState fromParcel(@Nonnull Parcel in) {
final CalculatorOnscreenViewState result = new CalculatorOnscreenViewState();
result.width = in.readInt();
result.height = in.readInt();
@@ -53,12 +53,12 @@ public class CalculatorOnscreenViewState implements Parcelable {
return result;
}
- @NotNull
+ @Nonnull
public static CalculatorOnscreenViewState newDefaultState() {
return newInstance(200, 400, 0, 0);
}
- @NotNull
+ @Nonnull
public static CalculatorOnscreenViewState newInstance(int width, int height, int x, int y) {
final CalculatorOnscreenViewState result = new CalculatorOnscreenViewState();
result.width = width;
@@ -106,7 +106,7 @@ public class CalculatorOnscreenViewState implements Parcelable {
}
@Override
- public void writeToParcel(@NotNull Parcel out, int flags) {
+ public void writeToParcel(@Nonnull Parcel out, int flags) {
out.writeInt(width);
out.writeInt(height);
out.writeInt(x);
@@ -125,13 +125,13 @@ public class CalculatorOnscreenViewState implements Parcelable {
public static class Preference extends AbstractPreference {
- public Preference(@NotNull String key, @Nullable CalculatorOnscreenViewState defaultValue) {
+ public Preference(@Nonnull String key, @Nullable CalculatorOnscreenViewState defaultValue) {
super(key, defaultValue);
}
@Nullable
@Override
- protected CalculatorOnscreenViewState getPersistedValue(@NotNull SharedPreferences preferences) {
+ protected CalculatorOnscreenViewState getPersistedValue(@Nonnull SharedPreferences preferences) {
try {
final CalculatorOnscreenViewState result = new CalculatorOnscreenViewState();
final JSONObject jsonObject = new JSONObject(preferences.getString(getKey(), "{}"));
@@ -149,7 +149,7 @@ public class CalculatorOnscreenViewState implements Parcelable {
}
@Override
- protected void putPersistedValue(@NotNull SharedPreferences.Editor editor, @NotNull CalculatorOnscreenViewState value) {
+ protected void putPersistedValue(@Nonnull SharedPreferences.Editor editor, @Nonnull CalculatorOnscreenViewState value) {
final Map properties = new HashMap();
properties.put("width", value.getWidth());
properties.put("height", value.getHeight());
diff --git a/android-app-widget/AndroidManifest.xml b/android-app-widget/AndroidManifest.xml
index 49f99a51..19a41354 100644
--- a/android-app-widget/AndroidManifest.xml
+++ b/android-app-widget/AndroidManifest.xml
@@ -2,4 +2,10 @@
\ No newline at end of file
+ android:versionName="1.0">
+
+
+
+
\ No newline at end of file
diff --git a/android-app-widget/src/main/java/org/solovyev/android/calculator/widget/AbstractCalculatorWidgetProvider.java b/android-app-widget/src/main/java/org/solovyev/android/calculator/widget/AbstractCalculatorWidgetProvider.java
index 8172e9b5..30d56805 100644
--- a/android-app-widget/src/main/java/org/solovyev/android/calculator/widget/AbstractCalculatorWidgetProvider.java
+++ b/android-app-widget/src/main/java/org/solovyev/android/calculator/widget/AbstractCalculatorWidgetProvider.java
@@ -8,12 +8,13 @@ import android.content.Context;
import android.content.Intent;
import android.text.Html;
import android.widget.RemoteViews;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.external.ExternalCalculatorIntentHandler;
import org.solovyev.android.calculator.external.ExternalCalculatorStateUpdater;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
/**
* User: Solovyev_S
* Date: 19.10.12
@@ -37,7 +38,7 @@ abstract class AbstractCalculatorWidgetProvider extends AppWidgetProvider implem
@Nullable
private String cursorColor;
- @NotNull
+ @Nonnull
private ExternalCalculatorIntentHandler intentHandler = new CalculatorWidgetIntentHandler(this);
@@ -70,8 +71,8 @@ abstract class AbstractCalculatorWidgetProvider extends AppWidgetProvider implem
getCursorColor(context);
}
- @NotNull
- private String getCursorColor(@NotNull Context context) {
+ @Nonnull
+ private String getCursorColor(@Nonnull Context context) {
if (cursorColor == null) {
cursorColor = Integer.toHexString(context.getResources().getColor(R.color.cpp_widget_cursor_color)).substring(2);
}
@@ -79,34 +80,34 @@ abstract class AbstractCalculatorWidgetProvider extends AppWidgetProvider implem
}
@Override
- public void onUpdate(@NotNull Context context,
- @NotNull AppWidgetManager appWidgetManager,
- @NotNull int[] appWidgetIds) {
+ public void onUpdate(@Nonnull Context context,
+ @Nonnull AppWidgetManager appWidgetManager,
+ @Nonnull int[] appWidgetIds) {
super.onUpdate(context, appWidgetManager, appWidgetIds);
updateWidget(context, appWidgetManager, appWidgetIds, Locator.getInstance().getEditor().getViewState(), Locator.getInstance().getDisplay().getViewState());
}
@Override
- public void updateState(@NotNull Context context,
- @NotNull CalculatorEditorViewState editorState,
- @NotNull CalculatorDisplayViewState displayState) {
+ public void updateState(@Nonnull Context context,
+ @Nonnull CalculatorEditorViewState editorState,
+ @Nonnull CalculatorDisplayViewState displayState) {
final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
final int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, getComponentClass()));
updateWidget(context, appWidgetManager, appWidgetIds, editorState, displayState);
}
- @NotNull
+ @Nonnull
protected Class extends AbstractCalculatorWidgetProvider> getComponentClass() {
return this.getClass();
}
- private void updateWidget(@NotNull Context context,
- @NotNull AppWidgetManager appWidgetManager,
- @NotNull int[] appWidgetIds,
- @NotNull CalculatorEditorViewState editorState,
- @NotNull CalculatorDisplayViewState displayState) {
+ private void updateWidget(@Nonnull Context context,
+ @Nonnull AppWidgetManager appWidgetManager,
+ @Nonnull int[] appWidgetIds,
+ @Nonnull CalculatorEditorViewState editorState,
+ @Nonnull CalculatorDisplayViewState displayState) {
for (int appWidgetId : appWidgetIds) {
final RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout);
@@ -136,7 +137,7 @@ abstract class AbstractCalculatorWidgetProvider extends AppWidgetProvider implem
this.intentHandler.onIntent(context, intent);
}
- private void updateDisplayState(@NotNull Context context, @NotNull RemoteViews views, @NotNull CalculatorDisplayViewState displayState) {
+ private void updateDisplayState(@Nonnull Context context, @Nonnull RemoteViews views, @Nonnull CalculatorDisplayViewState displayState) {
if (displayState.isValid()) {
views.setTextViewText(R.id.calculator_display, displayState.getText());
views.setTextColor(R.id.calculator_display, context.getResources().getColor(R.color.cpp_default_text_color));
@@ -145,7 +146,7 @@ abstract class AbstractCalculatorWidgetProvider extends AppWidgetProvider implem
}
}
- private void updateEditorState(@NotNull Context context, @NotNull RemoteViews views, @NotNull CalculatorEditorViewState editorState) {
+ private void updateEditorState(@Nonnull Context context, @Nonnull RemoteViews views, @Nonnull CalculatorEditorViewState editorState) {
String text = editorState.getText();
CharSequence newText = text;
diff --git a/android-app-widget/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetIntentHandler.java b/android-app-widget/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetIntentHandler.java
index 9508f642..a1e195dc 100644
--- a/android-app-widget/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetIntentHandler.java
+++ b/android-app-widget/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidgetIntentHandler.java
@@ -2,7 +2,7 @@ package org.solovyev.android.calculator.widget;
import android.content.Context;
import android.content.Intent;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import org.solovyev.android.calculator.CalculatorButton;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.external.DefaultExternalCalculatorIntentHandler;
@@ -15,12 +15,12 @@ import org.solovyev.android.calculator.external.ExternalCalculatorStateUpdater;
*/
public class CalculatorWidgetIntentHandler extends DefaultExternalCalculatorIntentHandler {
- public CalculatorWidgetIntentHandler(@NotNull ExternalCalculatorStateUpdater stateUpdater) {
+ public CalculatorWidgetIntentHandler(@Nonnull ExternalCalculatorStateUpdater stateUpdater) {
super(stateUpdater);
}
@Override
- public void onIntent(@NotNull Context context, @NotNull Intent intent) {
+ public void onIntent(@Nonnull Context context, @Nonnull Intent intent) {
super.onIntent(context, intent);
if (AbstractCalculatorWidgetProvider.BUTTON_PRESSED_ACTION.equals(intent.getAction())) {
diff --git a/android-app/AndroidManifest.xml b/android-app/AndroidManifest.xml
index 46e3c58d..6f08b92d 100644
--- a/android-app/AndroidManifest.xml
+++ b/android-app/AndroidManifest.xml
@@ -1,277 +1,176 @@
-
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/android-app/pom.xml b/android-app/pom.xml
index acc0b41e..602c23aa 100644
--- a/android-app/pom.xml
+++ b/android-app/pom.xml
@@ -122,15 +122,10 @@
test
-
- com.intellij
- annotations
-
-
com.pivotallabs
robolectric
- 1.1
+ 1.2
test
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 b94855d4..aca8589d 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
@@ -9,8 +9,8 @@ import android.preference.PreferenceManager;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.history.CalculatorHistoryState;
import org.solovyev.android.calculator.view.AngleUnitsButton;
import org.solovyev.android.calculator.view.NumeralBasesButton;
@@ -33,29 +33,29 @@ import java.util.List;
*/
public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSharedPreferenceChangeListener {
- @NotNull
+ @Nonnull
private CalculatorPreferences.Gui.Layout layout;
- @NotNull
+ @Nonnull
private CalculatorPreferences.Gui.Theme theme;
@Nullable
private Vibrator vibrator;
- @NotNull
+ @Nonnull
private final JListeners dpclRegister = Listeners.newHardRefListeners();
- @NotNull
+ @Nonnull
private String logTag = "CalculatorActivity";
protected AbstractCalculatorHelper() {
}
- protected AbstractCalculatorHelper(@NotNull String logTag) {
+ protected AbstractCalculatorHelper(@Nonnull String logTag) {
this.logTag = logTag;
}
- protected void onCreate(@NotNull Activity activity) {
+ protected void onCreate(@Nonnull Activity activity) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
vibrator = (Vibrator) activity.getSystemService(Activity.VIBRATOR_SERVICE);
@@ -71,15 +71,15 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh
}
}
- public void logDebug(@NotNull String message) {
+ public void logDebug(@Nonnull String message) {
Log.d(logTag, message);
}
- public void logError(@NotNull String message) {
+ public void logError(@Nonnull String message) {
Log.e(logTag, message);
}
- public void processButtons(@NotNull final Activity activity, @NotNull View root) {
+ public void processButtons(@Nonnull final Activity activity, @Nonnull View root) {
dpclRegister.removeListeners();
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
@@ -97,7 +97,7 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh
if (subtractionButton != null) {
subtractionButton.setOnDragListener(new OnDragListenerVibrator(newOnDragListener(new SimpleOnDragListener.DragProcessor() {
@Override
- public boolean processDragEvent(@NotNull DragDirection dragDirection, @NotNull DragButton dragButton, @NotNull Point2d startPoint2d, @NotNull MotionEvent motionEvent) {
+ public boolean processDragEvent(@Nonnull DragDirection dragDirection, @Nonnull DragButton dragButton, @Nonnull Point2d startPoint2d, @Nonnull MotionEvent motionEvent) {
if (dragDirection == DragDirection.down) {
Locator.getInstance().getCalculator().fireCalculatorEvent(CalculatorEventType.show_operators, null);
return true;
@@ -175,7 +175,7 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh
NumeralBaseButtons.toggleNumericDigits(activity, preferences);
}
- private void toggleButtonDirectionText(@NotNull View root, int id, boolean showDirectionText, @NotNull DragDirection... dragDirections) {
+ private void toggleButtonDirectionText(@Nonnull View root, int id, boolean showDirectionText, @Nonnull DragDirection... dragDirections) {
final View v = getButton(root, id);
if (v instanceof DirectionDragButton) {
final DirectionDragButton button = (DirectionDragButton) v;
@@ -185,13 +185,13 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh
}
}
- @NotNull
+ @Nonnull
private Calculator getCalculator() {
return Locator.getInstance().getCalculator();
}
- private void setOnDragListeners(@NotNull View root, @NotNull SimpleOnDragListener.Preferences dragPreferences, @NotNull SharedPreferences preferences) {
+ private void setOnDragListeners(@Nonnull View root, @Nonnull SimpleOnDragListener.Preferences dragPreferences, @Nonnull SharedPreferences preferences) {
final OnDragListener onDragListener = new OnDragListenerVibrator(newOnDragListener(new DigitButtonDragProcessor(getKeyboard()), dragPreferences), vibrator, preferences);
final List dragButtonIds = new ArrayList();
@@ -219,19 +219,19 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh
}
}
- @NotNull
+ @Nonnull
private CalculatorKeyboard getKeyboard() {
return Locator.getInstance().getKeyboard();
}
@Nullable
- private T getButton(@NotNull View root, int buttonId) {
+ private T getButton(@Nonnull View root, int buttonId) {
return (T) root.findViewById(buttonId);
}
- @NotNull
- private SimpleOnDragListener newOnDragListener(@NotNull SimpleOnDragListener.DragProcessor dragProcessor,
- @NotNull SimpleOnDragListener.Preferences dragPreferences) {
+ @Nonnull
+ private SimpleOnDragListener newOnDragListener(@Nonnull SimpleOnDragListener.DragProcessor dragProcessor,
+ @Nonnull SimpleOnDragListener.Preferences dragPreferences) {
final SimpleOnDragListener onDragListener = new SimpleOnDragListener(dragProcessor, dragPreferences);
dpclRegister.addListener(onDragListener);
return onDragListener;
@@ -247,7 +247,7 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh
}
}
- public void onDestroy(@NotNull Activity activity) {
+ public void onDestroy(@Nonnull Activity activity) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
preferences.unregisterOnSharedPreferenceChangeListener(this);
diff --git a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculator.java b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculator.java
index b8d64497..caa9819d 100644
--- a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculator.java
+++ b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculator.java
@@ -7,8 +7,8 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import jscl.NumeralBase;
import jscl.math.Generic;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.calculator.history.CalculatorHistoryState;
import org.solovyev.android.calculator.jscl.JsclOperation;
import org.solovyev.common.history.HistoryAction;
@@ -23,40 +23,40 @@ import java.util.List;
*/
public class AndroidCalculator implements Calculator, CalculatorEventListener, SharedPreferences.OnSharedPreferenceChangeListener {
- @NotNull
+ @Nonnull
private final CalculatorImpl calculator = new CalculatorImpl();
- @NotNull
+ @Nonnull
private final Application context;
- public AndroidCalculator(@NotNull Application application) {
+ public AndroidCalculator(@Nonnull Application application) {
this.context = application;
this.calculator.addCalculatorEventListener(this);
PreferenceManager.getDefaultSharedPreferences(application).registerOnSharedPreferenceChangeListener(this);
}
- public void init(@NotNull final Activity activity) {
+ public void init(@Nonnull final Activity activity) {
setEditor(activity);
setDisplay(activity);
}
- public void setDisplay(@NotNull Activity activity) {
+ public void setDisplay(@Nonnull Activity activity) {
final AndroidCalculatorDisplayView displayView = (AndroidCalculatorDisplayView) activity.findViewById(R.id.calculator_display);
setDisplay(activity, displayView);
}
- public void setDisplay(@NotNull Context context, @NotNull AndroidCalculatorDisplayView displayView) {
+ public void setDisplay(@Nonnull Context context, @Nonnull AndroidCalculatorDisplayView displayView) {
displayView.init(context);
Locator.getInstance().getDisplay().setView(displayView);
}
- public void setEditor(@NotNull Activity activity) {
+ public void setEditor(@Nonnull Activity activity) {
final AndroidCalculatorEditorView editorView = (AndroidCalculatorEditorView) activity.findViewById(R.id.calculator_editor);
setEditor(activity, editorView);
}
- public void setEditor(@NotNull Context context, @NotNull AndroidCalculatorEditorView editorView) {
+ public void setEditor(@Nonnull Context context, @Nonnull AndroidCalculatorEditorView editorView) {
editorView.init(context);
Locator.getInstance().getEditor().setView(editorView);
}
@@ -71,49 +71,49 @@ public class AndroidCalculator implements Calculator, CalculatorEventListener, S
*/
@Override
- @NotNull
- public CalculatorEventData evaluate(@NotNull JsclOperation operation, @NotNull String expression) {
+ @Nonnull
+ public CalculatorEventData evaluate(@Nonnull JsclOperation operation, @Nonnull String expression) {
return calculator.evaluate(operation, expression);
}
@Override
- @NotNull
- public CalculatorEventData evaluate(@NotNull JsclOperation operation, @NotNull String expression, @NotNull Long sequenceId) {
+ @Nonnull
+ public CalculatorEventData evaluate(@Nonnull JsclOperation operation, @Nonnull String expression, @Nonnull Long sequenceId) {
return calculator.evaluate(operation, expression, sequenceId);
}
@Override
- public boolean isConversionPossible(@NotNull Generic generic, @NotNull NumeralBase from, @NotNull NumeralBase to) {
+ public boolean isConversionPossible(@Nonnull Generic generic, @Nonnull NumeralBase from, @Nonnull NumeralBase to) {
return calculator.isConversionPossible(generic, from, to);
}
@Override
- @NotNull
- public CalculatorEventData convert(@NotNull Generic generic, @NotNull NumeralBase to) {
+ @Nonnull
+ public CalculatorEventData convert(@Nonnull Generic generic, @Nonnull NumeralBase to) {
return calculator.convert(generic, to);
}
@Override
- @NotNull
- public CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
+ @Nonnull
+ public CalculatorEventData fireCalculatorEvent(@Nonnull CalculatorEventType calculatorEventType, @Nullable Object data) {
return calculator.fireCalculatorEvent(calculatorEventType, data);
}
- @NotNull
+ @Nonnull
@Override
- public CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data, @NotNull Object source) {
+ public CalculatorEventData fireCalculatorEvent(@Nonnull CalculatorEventType calculatorEventType, @Nullable Object data, @Nonnull Object source) {
return calculator.fireCalculatorEvent(calculatorEventType, data, source);
}
@Override
- @NotNull
- public CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data, @NotNull Long sequenceId) {
+ @Nonnull
+ public CalculatorEventData fireCalculatorEvent(@Nonnull CalculatorEventType calculatorEventType, @Nullable Object data, @Nonnull Long sequenceId) {
return calculator.fireCalculatorEvent(calculatorEventType, data, sequenceId);
}
- @NotNull
+ @Nonnull
@Override
- public PreparedExpression prepareExpression(@NotNull String expression) throws CalculatorParseException {
+ public PreparedExpression prepareExpression(@Nonnull String expression) throws CalculatorParseException {
return calculator.prepareExpression(expression);
}
@@ -126,37 +126,37 @@ public class AndroidCalculator implements Calculator, CalculatorEventListener, S
}
@Override
- public void addCalculatorEventListener(@NotNull CalculatorEventListener calculatorEventListener) {
+ public void addCalculatorEventListener(@Nonnull CalculatorEventListener calculatorEventListener) {
calculator.addCalculatorEventListener(calculatorEventListener);
}
@Override
- public void removeCalculatorEventListener(@NotNull CalculatorEventListener calculatorEventListener) {
+ public void removeCalculatorEventListener(@Nonnull CalculatorEventListener calculatorEventListener) {
calculator.removeCalculatorEventListener(calculatorEventListener);
}
@Override
- public void fireCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
+ public void fireCalculatorEvent(@Nonnull CalculatorEventData calculatorEventData, @Nonnull CalculatorEventType calculatorEventType, @Nullable Object data) {
calculator.fireCalculatorEvent(calculatorEventData, calculatorEventType, data);
}
@Override
- public void fireCalculatorEvents(@NotNull List calculatorEvents) {
+ public void fireCalculatorEvents(@Nonnull List calculatorEvents) {
calculator.fireCalculatorEvents(calculatorEvents);
}
@Override
- public void doHistoryAction(@NotNull HistoryAction historyAction) {
+ public void doHistoryAction(@Nonnull HistoryAction historyAction) {
calculator.doHistoryAction(historyAction);
}
@Override
- public void setCurrentHistoryState(@NotNull CalculatorHistoryState editorHistoryState) {
+ public void setCurrentHistoryState(@Nonnull CalculatorHistoryState editorHistoryState) {
calculator.setCurrentHistoryState(editorHistoryState);
}
@Override
- @NotNull
+ @Nonnull
public CalculatorHistoryState getCurrentHistoryState() {
return calculator.getCurrentHistoryState();
}
@@ -167,7 +167,7 @@ public class AndroidCalculator implements Calculator, CalculatorEventListener, S
}
@Override
- public void evaluate(@NotNull Long sequenceId) {
+ public void evaluate(@Nonnull Long sequenceId) {
calculator.evaluate(sequenceId);
}
@@ -177,7 +177,7 @@ public class AndroidCalculator implements Calculator, CalculatorEventListener, S
}
@Override
- public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
+ public void onCalculatorEvent(@Nonnull CalculatorEventData calculatorEventData, @Nonnull CalculatorEventType calculatorEventType, @Nullable Object data) {
switch (calculatorEventType) {
case calculation_messages:
CalculatorActivityLauncher.showCalculationMessagesDialog(CalculatorApplication.getInstance(), (List) data);
@@ -222,7 +222,7 @@ public class AndroidCalculator implements Calculator, CalculatorEventListener, S
}
@Override
- public void onSharedPreferenceChanged(@NotNull SharedPreferences prefs, @NotNull String key) {
+ public void onSharedPreferenceChanged(@Nonnull SharedPreferences prefs, @Nonnull String key) {
if (CalculatorPreferences.Calculations.calculateOnFly.getKey().equals(key)) {
this.calculator.setCalculateOnFly(CalculatorPreferences.Calculations.calculateOnFly.getPreference(prefs));
}
diff --git a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorClipboard.java b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorClipboard.java
index acd89890..493f044f 100644
--- a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorClipboard.java
+++ b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorClipboard.java
@@ -3,7 +3,7 @@ package org.solovyev.android.calculator;
import android.app.Application;
import android.content.Context;
import android.text.ClipboardManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
/**
* User: serso
@@ -12,10 +12,10 @@ import org.jetbrains.annotations.NotNull;
*/
public class AndroidCalculatorClipboard implements CalculatorClipboard {
- @NotNull
+ @Nonnull
private final Context context;
- public AndroidCalculatorClipboard(@NotNull Application application) {
+ public AndroidCalculatorClipboard(@Nonnull Application application) {
this.context = application;
}
@@ -30,13 +30,13 @@ public class AndroidCalculatorClipboard implements CalculatorClipboard {
}
@Override
- public void setText(@NotNull String text) {
+ public void setText(@Nonnull String text) {
final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(text);
}
@Override
- public void setText(@NotNull CharSequence text) {
+ public void setText(@Nonnull CharSequence text) {
final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(text);
}
diff --git a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorKeyboard.java b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorKeyboard.java
index 1f436caf..dfe030ec 100644
--- a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorKeyboard.java
+++ b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorKeyboard.java
@@ -6,8 +6,8 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.os.Vibrator;
import android.preference.PreferenceManager;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.view.VibratorContainer;
/**
@@ -17,16 +17,16 @@ import org.solovyev.android.view.VibratorContainer;
*/
public class AndroidCalculatorKeyboard implements CalculatorKeyboard {
- @NotNull
+ @Nonnull
private final CalculatorKeyboard calculatorKeyboard;
- @NotNull
+ @Nonnull
private final Context context;
private VibratorContainer vibrator;
- public AndroidCalculatorKeyboard(@NotNull Application application,
- @NotNull CalculatorKeyboard calculatorKeyboard) {
+ public AndroidCalculatorKeyboard(@Nonnull Application application,
+ @Nonnull CalculatorKeyboard calculatorKeyboard) {
this.context = application;
this.calculatorKeyboard = calculatorKeyboard;
}
diff --git a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorLogger.java b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorLogger.java
index e9cdbf8d..7f227e1f 100644
--- a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorLogger.java
+++ b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorLogger.java
@@ -1,8 +1,8 @@
package org.solovyev.android.calculator;
import android.util.Log;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
/**
* User: serso
@@ -11,26 +11,26 @@ import org.jetbrains.annotations.Nullable;
*/
public class AndroidCalculatorLogger implements CalculatorLogger {
- @NotNull
+ @Nonnull
private static final String TAG = "Calculatorpp";
@Override
- public void debug(@Nullable String tag, @NotNull String message) {
+ public void debug(@Nullable String tag, @Nonnull String message) {
Log.d(getTag(tag), message);
}
- @NotNull
+ @Nonnull
private String getTag(@Nullable String tag) {
return tag != null ? TAG + "/" + tag : TAG;
}
@Override
- public void debug(@Nullable String tag, @Nullable String message, @NotNull Throwable e) {
+ public void debug(@Nullable String tag, @Nullable String message, @Nonnull Throwable e) {
Log.d(getTag(tag), message, e);
}
@Override
- public void error(@Nullable String tag, @Nullable String message, @NotNull Throwable e) {
+ public void error(@Nullable String tag, @Nullable String message, @Nonnull Throwable e) {
Log.e(getTag(tag), message, e);
}
diff --git a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorNotifier.java b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorNotifier.java
index 49bf3561..ffcdd8dc 100644
--- a/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorNotifier.java
+++ b/android-app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorNotifier.java
@@ -3,8 +3,8 @@ package org.solovyev.android.calculator;
import android.app.Application;
import android.os.Handler;
import android.widget.Toast;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.solovyev.android.Threads;
import org.solovyev.android.msg.AndroidMessage;
import org.solovyev.common.msg.Message;
@@ -19,19 +19,19 @@ import java.util.List;
*/
public class AndroidCalculatorNotifier implements CalculatorNotifier {
- @NotNull
+ @Nonnull
private final Application application;
- @NotNull
+ @Nonnull
private final Handler uiHandler = new Handler();
private final boolean showDebugMessages;
- public AndroidCalculatorNotifier(@NotNull Application application) {
+ public AndroidCalculatorNotifier(@Nonnull Application application) {
this(application, false);
}
- public AndroidCalculatorNotifier(@NotNull Application application, boolean showDebugMessages) {
+ public AndroidCalculatorNotifier(@Nonnull Application application, boolean showDebugMessages) {
assert Threads.isUiThread();
this.application = application;
@@ -39,28 +39,28 @@ public class AndroidCalculatorNotifier implements CalculatorNotifier {
}
@Override
- public void showMessage(@NotNull Message message) {
+ public void showMessage(@Nonnull Message message) {
showMessageInUiThread(message.getLocalizedMessage());
}
@Override
- public void showMessage(@NotNull Integer messageCode, @NotNull MessageType messageType, @NotNull List