From 5f4d545511e3781df77698b805a79098e1e708fe Mon Sep 17 00:00:00 2001 From: serso Date: Sun, 31 Jan 2016 10:37:42 +0100 Subject: [PATCH] Remove unused classes --- app/src/main/AndroidManifest.xml | 4 - .../CalculatorActivityLauncher.java | 12 -- .../calculator/CalculatorDialogActivity.java | 151 ------------------ .../calculator/CalculatorEventType.java | 5 - .../calculator/CalculatorFragmentType.java | 2 - .../android/calculator/DialogData.java | 45 ------ .../android/calculator/MessageDialogData.java | 71 -------- .../calculator/ParcelableDialogData.java | 130 --------------- .../android/calculator/StringDialogData.java | 74 --------- .../calculator/CalculatorTestUtils.java | 21 +-- 10 files changed, 6 insertions(+), 509 deletions(-) delete mode 100644 app/src/main/java/org/solovyev/android/calculator/CalculatorDialogActivity.java delete mode 100644 app/src/main/java/org/solovyev/android/calculator/DialogData.java delete mode 100644 app/src/main/java/org/solovyev/android/calculator/MessageDialogData.java delete mode 100644 app/src/main/java/org/solovyev/android/calculator/ParcelableDialogData.java delete mode 100644 app/src/main/java/org/solovyev/android/calculator/StringDialogData.java diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 42fe7268..2a09e020 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -125,10 +125,6 @@ android:label="@string/cpp_purchase_title" android:theme="@style/Cpp.Theme.Material.Dialog" /> - - CREATOR = new Creator() { - @Override - public ParcelableDialogData createFromParcel(@Nonnull Parcel in) { - return fromParcel(in); - } - - @Override - public ParcelableDialogData[] newArray(int size) { - return new ParcelableDialogData[size]; - } - }; - - /* - ********************************************************************** - * - * FIELDS - * - ********************************************************************** - */ - - @Nonnull - private DialogData nestedData; - - /* - ********************************************************************** - * - * CONSTRUCTORS - * - ********************************************************************** - */ - - public ParcelableDialogData(@Nonnull DialogData nestedData) { - this.nestedData = nestedData; - } - - @Nonnull - public static ParcelableDialogData wrap(@Nonnull DialogData nestedData) { - if (nestedData instanceof ParcelableDialogData) { - return ((ParcelableDialogData) nestedData); - } else { - return new ParcelableDialogData(nestedData); - } - } - - @Nonnull - public static ParcelableDialogData fromParcel(@Nonnull Parcel in) { - final String message = in.readString(); - final MessageType messageType = CalculatorMessages.toMessageType(in.readInt()); - final String title = in.readString(); - return wrap(StringDialogData.newInstance(message, messageType, title)); - } - - @Nonnull - @Override - public String getMessage() { - return nestedData.getMessage(); - } - - @Nonnull - @Override - public MessageLevel getMessageLevel() { - return nestedData.getMessageLevel(); - } - - @Nullable - @Override - public String getTitle() { - return nestedData.getTitle(); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(@Nonnull Parcel out, int flags) { - out.writeString(this.getMessage()); - out.writeInt(this.getMessageLevel().getMessageLevel()); - out.writeString(this.getTitle()); - } -} diff --git a/app/src/main/java/org/solovyev/android/calculator/StringDialogData.java b/app/src/main/java/org/solovyev/android/calculator/StringDialogData.java deleted file mode 100644 index e8d6d3a2..00000000 --- a/app/src/main/java/org/solovyev/android/calculator/StringDialogData.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2013 serso aka se.solovyev - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Contact details - * - * Email: se.solovyev@gmail.com - * Site: http://se.solovyev.org - */ - -package org.solovyev.android.calculator; - -import org.solovyev.common.msg.MessageType; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * User: serso - * Date: 1/20/13 - * Time: 1:01 PM - */ -public class StringDialogData implements DialogData { - - @Nonnull - private final String message; - - @Nonnull - private final MessageType messageType; - - @Nullable - private final String title; - - private StringDialogData(@Nonnull String message, @Nonnull MessageType messageType, @Nullable String title) { - this.message = message; - this.messageType = messageType; - this.title = title; - } - - @Nonnull - public static DialogData newInstance(@Nonnull String message, @Nonnull MessageType messageType, @Nullable String title) { - return new StringDialogData(message, messageType, title); - } - - @Nonnull - @Override - public String getMessage() { - return message; - } - - @Nonnull - @Override - public MessageType getMessageLevel() { - return messageType; - } - - @Nullable - @Override - public String getTitle() { - return title; - } -} diff --git a/app/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java b/app/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java index 8a2019ce..61290c0e 100644 --- a/app/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java +++ b/app/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java @@ -23,9 +23,8 @@ package org.solovyev.android.calculator; import android.content.Context; - import com.squareup.otto.Bus; - +import jscl.JsclMathEngine; import org.junit.Assert; import org.mockito.Mockito; import org.robolectric.fakes.RoboSharedPreferences; @@ -36,12 +35,9 @@ import org.solovyev.android.calculator.operators.OperatorsRegistry; import org.solovyev.android.calculator.operators.PostfixFunctionsRegistry; import org.solovyev.android.calculator.plot.CalculatorPlotter; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.io.*; import java.text.DecimalFormatSymbols; import java.util.HashMap; import java.util.Map; @@ -49,11 +45,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -import jscl.JsclMathEngine; - /** * User: serso * Date: 10/7/12 @@ -105,8 +96,8 @@ public class CalculatorTestUtils { final VariablesRegistry variablesRegistry = new VariablesRegistry(jsclEngine); final FunctionsRegistry functionsRegistry = new FunctionsRegistry(jsclEngine); - final OperatorsRegistry operatorsRegistry = new OperatorsRegistry(jsclEngine.getOperatorsRegistry()); - final PostfixFunctionsRegistry postfixFunctionsRegistry = new PostfixFunctionsRegistry(jsclEngine.getPostfixFunctionsRegistry()); + final OperatorsRegistry operatorsRegistry = new OperatorsRegistry(jsclEngine); + final PostfixFunctionsRegistry postfixFunctionsRegistry = new PostfixFunctionsRegistry(jsclEngine); return new Engine(jsclEngine, variablesRegistry, functionsRegistry, operatorsRegistry, postfixFunctionsRegistry); }