CalculatorHistory -> History
This commit is contained in:
@@ -25,12 +25,14 @@ package org.solovyev.android.calculator;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
|
||||
import org.acra.ACRA;
|
||||
import org.acra.ACRAConfiguration;
|
||||
import org.acra.sender.HttpSender;
|
||||
import org.solovyev.android.Android;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistory;
|
||||
import org.solovyev.android.calculator.history.History;
|
||||
import org.solovyev.android.calculator.language.Language;
|
||||
import org.solovyev.android.calculator.language.Languages;
|
||||
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
|
||||
@@ -40,11 +42,12 @@ import org.solovyev.android.calculator.plot.CalculatorPlotterImpl;
|
||||
import org.solovyev.android.calculator.view.EditorTextProcessor;
|
||||
import org.solovyev.common.msg.MessageType;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CalculatorApplication extends android.app.Application implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
@Nonnull
|
||||
private final List<CalculatorEventListener> listeners = new ArrayList<>();
|
||||
@@ -74,7 +77,7 @@ public class CalculatorApplication extends android.app.Application implements Sh
|
||||
new AndroidCalculatorEngine(this),
|
||||
new AndroidCalculatorClipboard(this),
|
||||
new AndroidCalculatorNotifier(this),
|
||||
new CalculatorHistory(),
|
||||
new History(),
|
||||
new AndroidCalculatorLogger(),
|
||||
new AndroidCalculatorPreferenceService(this),
|
||||
new CalculatorKeyboard(),
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import org.solovyev.android.calculator.history.CalculatorHistory;
|
||||
import org.solovyev.android.calculator.history.History;
|
||||
import org.solovyev.android.calculator.plot.CalculatorPlotter;
|
||||
import org.solovyev.android.calculator.text.TextProcessor;
|
||||
import org.solovyev.android.calculator.text.TextProcessorEditorResult;
|
||||
@@ -41,7 +41,7 @@ public interface CalculatorLocator {
|
||||
@Nonnull CalculatorEngine engine,
|
||||
@Nonnull CalculatorClipboard clipboard,
|
||||
@Nonnull CalculatorNotifier notifier,
|
||||
@Nonnull CalculatorHistory history,
|
||||
@Nonnull History history,
|
||||
@Nonnull CalculatorLogger logger,
|
||||
@Nonnull CalculatorPreferenceService preferenceService,
|
||||
@Nonnull CalculatorKeyboard keyboard,
|
||||
@@ -70,7 +70,7 @@ public interface CalculatorLocator {
|
||||
CalculatorNotifier getNotifier();
|
||||
|
||||
@Nonnull
|
||||
CalculatorHistory getHistory();
|
||||
History getHistory();
|
||||
|
||||
@Nonnull
|
||||
CalculatorLogger getLogger();
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import org.solovyev.android.calculator.history.CalculatorHistory;
|
||||
import org.solovyev.android.calculator.history.History;
|
||||
import org.solovyev.android.calculator.plot.CalculatorPlotter;
|
||||
import org.solovyev.android.calculator.text.TextProcessor;
|
||||
import org.solovyev.android.calculator.text.TextProcessorEditorResult;
|
||||
@@ -50,7 +50,7 @@ public class Locator implements CalculatorLocator {
|
||||
@Nonnull
|
||||
private CalculatorKeyboard calculatorKeyboard;
|
||||
@Nonnull
|
||||
private CalculatorHistory calculatorHistory;
|
||||
private History history;
|
||||
@Nonnull
|
||||
private CalculatorNotifier calculatorNotifier = new DummyCalculatorNotifier();
|
||||
@Nonnull
|
||||
@@ -76,7 +76,7 @@ public class Locator implements CalculatorLocator {
|
||||
@Nonnull CalculatorEngine engine,
|
||||
@Nonnull CalculatorClipboard clipboard,
|
||||
@Nonnull CalculatorNotifier notifier,
|
||||
@Nonnull CalculatorHistory history,
|
||||
@Nonnull History history,
|
||||
@Nonnull CalculatorLogger logger,
|
||||
@Nonnull CalculatorPreferenceService preferenceService,
|
||||
@Nonnull CalculatorKeyboard keyboard,
|
||||
@@ -87,7 +87,7 @@ public class Locator implements CalculatorLocator {
|
||||
this.calculatorEngine = engine;
|
||||
this.calculatorClipboard = clipboard;
|
||||
this.calculatorNotifier = notifier;
|
||||
this.calculatorHistory = history;
|
||||
this.history = history;
|
||||
this.calculatorLogger = logger;
|
||||
this.calculatorPreferenceService = preferenceService;
|
||||
this.calculatorPlotter = plotter;
|
||||
@@ -145,8 +145,8 @@ public class Locator implements CalculatorLocator {
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public CalculatorHistory getHistory() {
|
||||
return calculatorHistory;
|
||||
public History getHistory() {
|
||||
return history;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -51,7 +51,7 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class CalculatorHistory {
|
||||
public class History {
|
||||
|
||||
public static final String TAG = App.subTag("History");
|
||||
@Nonnull
|
||||
@@ -62,7 +62,7 @@ public class CalculatorHistory {
|
||||
private EditorState lastEditorState;
|
||||
private boolean initialized;
|
||||
|
||||
public CalculatorHistory() {
|
||||
public History() {
|
||||
App.getBus().register(this);
|
||||
App.getInitThread().execute(new Runnable() {
|
||||
@Override
|
@@ -121,7 +121,7 @@ public class HistoryList {
|
||||
try {
|
||||
array.put(i, state.toJson());
|
||||
} catch (JSONException e) {
|
||||
Log.e(CalculatorHistory.TAG, e.getMessage(), e);
|
||||
Log.e(History.TAG, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
return array;
|
||||
@@ -138,7 +138,7 @@ public class HistoryList {
|
||||
try {
|
||||
states.add(HistoryState.create(json));
|
||||
} catch (JSONException e) {
|
||||
Log.e(CalculatorHistory.TAG, e.getMessage(), e);
|
||||
Log.e(History.TAG, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
return states;
|
||||
|
Reference in New Issue
Block a user