ActivityLauncher

This commit is contained in:
serso 2016-02-04 17:05:25 +01:00
parent ebdfbc328c
commit 07a1608a80
13 changed files with 180 additions and 245 deletions

View File

@ -67,7 +67,7 @@
android:label="@string/c_app_settings" />
<activity
android:name=".history.CalculatorHistoryActivity"
android:name=".history.HistoryActivity"
android:label="@string/c_history" />
<activity
@ -78,7 +78,7 @@
android:theme="@style/Cpp.Theme.Translucent" />
<activity
android:name=".about.CalculatorAboutActivity"
android:name=".about.AboutActivity"
android:label="@string/c_about" />
<activity

View File

@ -23,21 +23,19 @@
package org.solovyev.android.calculator;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import jscl.math.Generic;
import jscl.math.function.Constant;
import android.support.annotation.NonNull;
import org.solovyev.android.Activities;
import org.solovyev.android.calculator.about.CalculatorAboutActivity;
import org.solovyev.android.Check;
import org.solovyev.android.calculator.about.AboutActivity;
import org.solovyev.android.calculator.functions.CppFunction;
import org.solovyev.android.calculator.functions.EditFunctionFragment;
import org.solovyev.android.calculator.functions.FunctionsActivity;
import org.solovyev.android.calculator.history.CalculatorHistoryActivity;
import org.solovyev.android.calculator.history.HistoryActivity;
import org.solovyev.android.calculator.matrix.CalculatorMatrixActivity;
import org.solovyev.android.calculator.operators.OperatorsActivity;
import org.solovyev.android.calculator.plot.CalculatorPlotter;
@ -49,73 +47,77 @@ import org.solovyev.android.calculator.variables.VariablesFragment;
import org.solovyev.common.msg.MessageType;
import org.solovyev.common.text.Strings;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Singleton;
import jscl.math.Generic;
import jscl.math.function.Constant;
@Singleton
public final class ActivityLauncher implements CalculatorEventListener {
@Inject
Application application;
@Nullable
private CalculatorActivity activity;
@Inject
public ActivityLauncher() {
}
public static void showHistory(@Nonnull final Context context) {
showHistory(context, false);
private static void showActivity(@Nonnull final Context context, @NonNull Class<? extends Activity> activity) {
showActivity(context, new Intent(context, activity));
}
public static void showHistory(@Nonnull final Context context, boolean detached) {
final Intent intent = new Intent(context, CalculatorHistoryActivity.class);
private static void showActivity(@Nonnull Context context, @NonNull Intent intent) {
final boolean detached = !(context instanceof Activity);
Activities.addIntentFlags(intent, detached, context);
context.startActivity(intent);
}
public void showHistory() {
showHistory(getContext());
}
public void showSettings() {
showSettings(getContext());
}
public void showWidgetSettings() {
final Context context = getContext();
showActivity(context, PreferencesActivity.makeIntent(context, R.xml.preferences_widget, R.string.prefs_widget_title));
}
public static void showHistory(@Nonnull final Context context) {
show(context, HistoryActivity.class);
}
private static void show(@Nonnull Context context, Class<HistoryActivity> activity) {
showActivity(context, activity);
}
public void showOperators() {
showActivity(getContext(), OperatorsActivity.class);
}
public static void showSettings(@Nonnull final Context context) {
showSettings(context, false);
}
public static void showWidgetSettings(@Nonnull final Context context, boolean detached) {
final Intent intent = PreferencesActivity.makeIntent(context, R.xml.preferences_widget, R.string.prefs_widget_title);
Activities.addIntentFlags(intent, detached, context);
context.startActivity(intent);
}
public static void showSettings(@Nonnull final Context context, boolean detached) {
final Intent intent = new Intent(context, PreferencesActivity.class);
Activities.addIntentFlags(intent, detached, context);
context.startActivity(intent);
showActivity(context, PreferencesActivity.class);
}
public static void showAbout(@Nonnull final Context context) {
context.startActivity(new Intent(context, CalculatorAboutActivity.class));
context.startActivity(new Intent(context, AboutActivity.class));
}
public static void showFunctions(@Nonnull final Context context) {
showFunctions(context, false);
showActivity(context, FunctionsActivity.class);
}
public static void showFunctions(@Nonnull final Context context, boolean detached) {
final Intent intent = new Intent(context, FunctionsActivity.class);
Activities.addIntentFlags(intent, detached, context);
context.startActivity(intent);
}
public static void showOperators(@Nonnull final Context context) {
showOperators(context, false);
}
public static void showOperators(@Nonnull final Context context, boolean detached) {
final Intent intent = new Intent(context, OperatorsActivity.class);
Activities.addIntentFlags(intent, detached, context);
context.startActivity(intent);
}
public static void showVars(@Nonnull final Context context) {
showVars(context, false);
}
public static void showVars(@Nonnull final Context context, boolean detached) {
final Intent intent = new Intent(context, VariablesActivity.class);
Activities.addIntentFlags(intent, detached, context);
context.startActivity(intent);
public static void showVariables(@Nonnull final Context context) {
showActivity(context, VariablesActivity.class);
}
public static void tryCreateVar(@Nonnull final Context context) {
@ -188,29 +190,31 @@ public final class ActivityLauncher implements CalculatorEventListener {
}
}
public static void openApp(@Nonnull Context context) {
final Intent intent = new Intent(context, CalculatorActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
public void openFacebook() {
final Uri uri = Uri.parse(application.getString(R.string.cpp_share_link));
final Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
application.startActivity(intent);
}
public static void likeButtonPressed(@Nonnull final Context context) {
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(context.getString(R.string.cpp_share_link)));
Activities.addIntentFlags(intent, false, context);
context.startActivity(intent);
public void setActivity(@Nullable CalculatorActivity activity) {
Check.isNull(this.activity);
this.activity = activity;
}
public static void showEvaluationError(@Nonnull Context context, @Nonnull final String errorMessage) {
final LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
public void clearActivity(@Nullable CalculatorActivity activity) {
Check.isNotNull(this.activity);
Check.equals(this.activity, activity);
this.activity = null;
}
final View errorMessageView = layoutInflater.inflate(R.layout.display_error_message, null);
((TextView) errorMessageView.findViewById(R.id.error_message_text_view)).setText(errorMessage);
public void show(@NonNull Class<HistoryActivity> activity) {
showActivity(getContext(), activity);
}
final AlertDialog.Builder builder = new AlertDialog.Builder(context)
.setPositiveButton(R.string.c_cancel, null)
.setView(errorMessageView);
builder.create().show();
@NonNull
private Context getContext() {
return activity == null ? application : activity;
}
@Override
@ -251,17 +255,21 @@ public final class ActivityLauncher implements CalculatorEventListener {
}
});
break;
case show_evaluation_error:
final String errorMessage = (String) data;
if (errorMessage != null) {
App.getUiThreadExecutor().execute(new Runnable() {
@Override
public void run() {
showEvaluationError(context, errorMessage);
}
});
}
break;
}
}
public void showFunctions() {
showFunctions(getContext());
}
public void showVariables() {
showVariables(getContext());
}
public void openApp() {
final Context context = getContext();
final Intent intent = new Intent(context, CalculatorActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
}
}

View File

@ -128,6 +128,8 @@ public abstract class BaseUi implements SharedPreferences.OnSharedPreferenceChan
Calculator calculator;
@Inject
PreferredPreferences preferredPreferences;
@Inject
ActivityLauncher launcher;
protected void onCreate(@Nonnull Activity activity) {
cast(activity.getApplication()).getComponent().inject(this);
@ -315,11 +317,11 @@ public abstract class BaseUi implements SharedPreferences.OnSharedPreferenceChan
}
}
private static class OperatorsDragProcessor implements SimpleDragListener.DragProcessor {
private class OperatorsDragProcessor implements SimpleDragListener.DragProcessor {
@Override
public boolean processDragEvent(@Nonnull DragDirection dragDirection, @Nonnull DragButton dragButton, @Nonnull PointF startPoint, @Nonnull MotionEvent motionEvent) {
if (dragDirection == DragDirection.down) {
Locator.getInstance().getCalculator().fireCalculatorEvent(CalculatorEventType.show_operators, null);
launcher.showOperators();
return true;
}
return false;

View File

@ -26,13 +26,10 @@ import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
import com.squareup.otto.Bus;
import com.squareup.otto.Subscribe;
import jscl.*;
import jscl.math.Generic;
import jscl.math.function.Constants;
import jscl.math.function.IConstant;
import jscl.text.ParseInterruptedException;
import org.solovyev.android.calculator.calculations.CalculationCancelledEvent;
import org.solovyev.android.calculator.calculations.CalculationFailedEvent;
import org.solovyev.android.calculator.calculations.CalculationFinishedEvent;
@ -48,11 +45,6 @@ import org.solovyev.common.text.Strings;
import org.solovyev.common.units.ConversionException;
import org.solovyev.common.units.Conversions;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -60,8 +52,23 @@ import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import jscl.JsclArithmeticException;
import jscl.JsclMathEngine;
import jscl.NumeralBase;
import jscl.NumeralBaseException;
import jscl.math.Generic;
import jscl.math.function.Constants;
import jscl.math.function.IConstant;
import jscl.text.ParseInterruptedException;
@Singleton
public class Calculator implements CalculatorEventListener, SharedPreferences.OnSharedPreferenceChangeListener {
public class Calculator implements SharedPreferences.OnSharedPreferenceChangeListener {
public static final long NO_SEQUENCE = -1;
private static final long PREFERENCE_CHECK_INTERVAL = TimeUnit.MINUTES.toMillis(15);
@ -99,7 +106,6 @@ public class Calculator implements CalculatorEventListener, SharedPreferences.On
this.ui = ui;
this.background = background;
bus.register(this);
addCalculatorEventListener(this);
preferences.registerOnSharedPreferenceChangeListener(this);
}
@ -149,14 +155,12 @@ public class Calculator implements CalculatorEventListener, SharedPreferences.On
public void evaluate() {
final EditorState state = editor.getState();
final CalculatorEventData eventData = fireCalculatorEvent(CalculatorEventType.manual_calculation_requested, state);
evaluate(JsclOperation.numeric, state.getTextString(), eventData.getSequenceId());
evaluate(JsclOperation.numeric, state.getTextString());
}
public void simplify() {
final EditorState state = editor.getState();
final CalculatorEventData eventData = fireCalculatorEvent(CalculatorEventType.manual_calculation_requested, state);
evaluate(JsclOperation.simplify, state.getTextString(), eventData.getSequenceId());
evaluate(JsclOperation.simplify, state.getTextString());
}
@Nonnull
@ -462,51 +466,6 @@ public class Calculator implements CalculatorEventListener, SharedPreferences.On
}
}
@Override
public void onCalculatorEvent(@Nonnull CalculatorEventData calculatorEventData, @Nonnull CalculatorEventType calculatorEventType, @Nullable Object data) {
switch (calculatorEventType) {
case show_history:
ActivityLauncher.showHistory(App.getApplication());
break;
case show_history_detached:
ActivityLauncher.showHistory(App.getApplication(), true);
break;
case show_functions:
ActivityLauncher.showFunctions(App.getApplication());
break;
case show_functions_detached:
ActivityLauncher.showFunctions(App.getApplication(), true);
break;
case show_operators:
ActivityLauncher.showOperators(App.getApplication());
break;
case show_operators_detached:
ActivityLauncher.showOperators(App.getApplication(), true);
break;
case show_vars:
ActivityLauncher.showVars(App.getApplication());
break;
case show_vars_detached:
ActivityLauncher.showVars(App.getApplication(), true);
break;
case show_settings:
ActivityLauncher.showSettings(App.getApplication());
break;
case show_settings_detached:
ActivityLauncher.showSettings(App.getApplication(), true);
break;
case show_settings_widget:
ActivityLauncher.showWidgetSettings(App.getApplication(), true);
break;
case show_like_dialog:
ActivityLauncher.likeButtonPressed(App.getApplication());
break;
case open_app:
ActivityLauncher.openApp(App.getApplication());
break;
}
}
@Override
public void onSharedPreferenceChanged(@Nonnull SharedPreferences prefs, @Nonnull String key) {
if (Preferences.Calculations.calculateOnFly.getKey().equals(key)) {

View File

@ -143,6 +143,9 @@ public class CalculatorActivity extends BaseActivity implements SharedPreference
@Inject
History history;
@Inject
ActivityLauncher launcher;
/**
* Called when the activity is first created.
*/
@ -221,6 +224,7 @@ public class CalculatorActivity extends BaseActivity implements SharedPreference
@Override
protected void onResume() {
super.onResume();
launcher.setActivity(this);
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
final Preferences.Gui.Layout newLayout = Preferences.Gui.layout.getPreference(preferences);
@ -236,6 +240,12 @@ public class CalculatorActivity extends BaseActivity implements SharedPreference
}
}
@Override
protected void onPause() {
launcher.clearActivity(this);
super.onPause();
}
@Override
protected void onDestroy() {
PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(this);

View File

@ -26,9 +26,10 @@ import android.content.SharedPreferences;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.util.Log;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.otto.Bus;
import jscl.MathEngine;
import org.acra.ACRA;
import org.acra.ACRAConfiguration;
import org.acra.sender.HttpSender;
@ -41,13 +42,14 @@ import org.solovyev.android.calculator.plot.AndroidCalculatorPlotter;
import org.solovyev.android.calculator.plot.CalculatorPlotterImpl;
import org.solovyev.common.msg.MessageType;
import java.util.Locale;
import java.util.concurrent.Executor;
import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.Executor;
import jscl.MathEngine;
public class CalculatorApplication extends android.app.Application implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -62,9 +64,6 @@ public class CalculatorApplication extends android.app.Application implements Sh
@Inject
Handler handler;
@Nonnull
private final List<CalculatorEventListener> listeners = new ArrayList<>();
private AppComponent component;
@Inject
@ -100,6 +99,9 @@ public class CalculatorApplication extends android.app.Application implements Sh
@Inject
PreferredPreferences preferredPreferences;
@Inject
ActivityLauncher launcher;
@Override
public void onCreate() {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
@ -131,11 +133,6 @@ public class CalculatorApplication extends android.app.Application implements Sh
new AndroidCalculatorPlotter(this, new CalculatorPlotterImpl(calculator))
);
listeners.add(new ActivityLauncher());
for (CalculatorEventListener listener : listeners) {
calculator.addCalculatorEventListener(listener);
}
calculator.init(initThread);
initThread.execute(new Runnable() {

View File

@ -31,22 +31,6 @@ import javax.annotation.Nonnull;
*/
public enum CalculatorEventType {
/*
**********************************************************************
*
* CALCULATION
* org.solovyev.android.calculator.CalculatorEvaluationEventData
*
**********************************************************************
*/
// @Nonnull CalculatorEditorViewState
manual_calculation_requested,
// @Nonnull org.solovyev.android.calculator.CalculatorFailure
calculation_failed,
/*
**********************************************************************
*
@ -76,26 +60,6 @@ public enum CalculatorEventType {
// List<Message>
calculation_messages,
show_history,
show_history_detached,
show_functions,
show_functions_detached,
show_vars,
show_vars_detached,
open_app,
show_operators,
show_operators_detached,
show_settings,
show_settings_detached,
show_settings_widget,
show_like_dialog,
show_create_var_dialog,
show_create_matrix_dialog,
show_create_function_dialog,
@ -105,10 +69,7 @@ public enum CalculatorEventType {
/**
* {@link org.solovyev.android.calculator.plot.PlotData}
*/
plot_data_changed,
//String
show_evaluation_error;
plot_data_changed;
public boolean isOfType(@Nonnull CalculatorEventType... types) {
for (CalculatorEventType type : types) {

View File

@ -22,11 +22,15 @@
package org.solovyev.android.calculator;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Application;
import android.content.Context;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.squareup.otto.Bus;
import com.squareup.otto.Subscribe;
@ -64,6 +68,8 @@ public class Display implements CalculatorEventListener, View.OnClickListener, V
Lazy<Clipboard> clipboard;
@Inject
Lazy<Notifier> notifier;
@Inject
ActivityLauncher launcher;
@Nullable
private DisplayView view;
@Nonnull
@ -194,10 +200,24 @@ public class Display implements CalculatorEventListener, View.OnClickListener, V
v.showContextMenu();
v.setOnCreateContextMenuListener(null);
} else {
Locator.getInstance().getCalculator().fireCalculatorEvent(CalculatorEventType.show_evaluation_error, state.text);
showEvaluationError(v.getContext(), state.text);
}
}
public static void showEvaluationError(@Nonnull Context context, @Nonnull final String errorMessage) {
final LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
final View errorMessageView = layoutInflater.inflate(R.layout.display_error_message, null);
((TextView) errorMessageView.findViewById(R.id.error_message_text_view)).setText(errorMessage);
final AlertDialog.Builder builder = new AlertDialog.Builder(context)
.setPositiveButton(R.string.c_cancel, null)
.setView(errorMessageView);
builder.create().show();
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
if (!state.valid) {

View File

@ -54,6 +54,8 @@ public class Keyboard {
Lazy<Clipboard> clipboard;
@Inject
Lazy<Bus> bus;
@Inject
ActivityLauncher launcher;
@Inject
public Keyboard() {
@ -119,10 +121,7 @@ public class Keyboard {
private void onSpecialButtonPressed(@NonNull CppSpecialButton button) {
switch (button) {
case history:
calculator.fireCalculatorEvent(CalculatorEventType.show_history, null);
break;
case history_detached:
calculator.fireCalculatorEvent(CalculatorEventType.show_history_detached, null);
launcher.showHistory();
break;
case cursor_right:
moveCursorRight();
@ -131,16 +130,13 @@ public class Keyboard {
moveCursorLeft();
break;
case settings:
calculator.fireCalculatorEvent(CalculatorEventType.show_settings, null);
break;
case settings_detached:
calculator.fireCalculatorEvent(CalculatorEventType.show_settings_detached, null);
launcher.showSettings();
break;
case settings_widget:
calculator.fireCalculatorEvent(CalculatorEventType.show_settings_widget, null);
launcher.showWidgetSettings();
break;
case like:
calculator.fireCalculatorEvent(CalculatorEventType.show_like_dialog, null);
launcher.openFacebook();
break;
case erase:
editor.erase();
@ -158,25 +154,16 @@ public class Keyboard {
clearButtonPressed();
break;
case functions:
calculator.fireCalculatorEvent(CalculatorEventType.show_functions, null);
break;
case functions_detached:
calculator.fireCalculatorEvent(CalculatorEventType.show_functions_detached, null);
launcher.showFunctions();
break;
case open_app:
calculator.fireCalculatorEvent(CalculatorEventType.open_app, null);
launcher.openApp();
break;
case vars:
calculator.fireCalculatorEvent(CalculatorEventType.show_vars, null);
break;
case vars_detached:
calculator.fireCalculatorEvent(CalculatorEventType.show_vars_detached, null);
launcher.showVariables();
break;
case operators:
calculator.fireCalculatorEvent(CalculatorEventType.show_operators, null);
break;
case operators_detached:
calculator.fireCalculatorEvent(CalculatorEventType.show_operators_detached, null);
launcher.showOperators();
break;
default:
Check.shouldNotHappen();

View File

@ -35,7 +35,7 @@ import javax.annotation.Nullable;
* Date: 9/16/11
* Time: 11:52 PM
*/
public class CalculatorAboutActivity extends EmptyActivity {
public class AboutActivity extends EmptyActivity {
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {

View File

@ -32,12 +32,7 @@ import javax.annotation.Nullable;
import static org.solovyev.android.calculator.buttons.CppSpecialButton.cursor_left;
import static org.solovyev.android.calculator.buttons.CppSpecialButton.cursor_right;
import static org.solovyev.android.calculator.buttons.CppSpecialButton.functions_detached;
import static org.solovyev.android.calculator.buttons.CppSpecialButton.history_detached;
import static org.solovyev.android.calculator.buttons.CppSpecialButton.open_app;
import static org.solovyev.android.calculator.buttons.CppSpecialButton.operators_detached;
import static org.solovyev.android.calculator.buttons.CppSpecialButton.settings_detached;
import static org.solovyev.android.calculator.buttons.CppSpecialButton.vars_detached;
public enum CppButton {
@ -56,18 +51,18 @@ public enum CppButton {
period(R.id.cpp_button_period, "."),
brackets(R.id.cpp_button_round_brackets, "()"),
settings(R.id.cpp_button_settings, settings_detached),
settings(R.id.cpp_button_settings, CppSpecialButton.settings),
settings_widget(R.id.cpp_button_settings_widget, CppSpecialButton.settings_widget),
like(R.id.cpp_button_like, CppSpecialButton.like),
/*last row*/
left(R.id.cpp_button_left, cursor_left),
right(R.id.cpp_button_right, cursor_right),
vars(R.id.cpp_button_vars, vars_detached),
functions(R.id.cpp_button_functions, functions_detached),
operators(R.id.cpp_button_operators, operators_detached),
vars(R.id.cpp_button_vars, CppSpecialButton.vars),
functions(R.id.cpp_button_functions, CppSpecialButton.functions),
operators(R.id.cpp_button_operators, CppSpecialButton.operators),
app(R.id.cpp_button_app, open_app),
history(R.id.cpp_button_history, history_detached),
history(R.id.cpp_button_history, CppSpecialButton.history),
/*operations*/
multiplication(R.id.cpp_button_multiplication, "*"),
@ -98,8 +93,8 @@ public enum CppButton {
this(id, button.action, buttonLong == null ? null : buttonLong.getAction());
}
CppButton(int id, @Nonnull CppSpecialButton onClickButton) {
this(id, onClickButton, null);
CppButton(int id, @Nonnull CppSpecialButton button) {
this(id, button, null);
}
CppButton(int id, @Nonnull String action, @Nullable String actionLong) {

View File

@ -33,11 +33,9 @@ import javax.annotation.Nullable;
public enum CppSpecialButton {
history("history"),
history_detached("history_detached"),
cursor_right(""),
cursor_left(""),
settings("settings"),
settings_detached("settings_detached"),
settings_widget("settings_widget"),
like("like"),
erase("erase"),
@ -46,12 +44,9 @@ public enum CppSpecialButton {
equals("="),
clear("clear"),
functions("functions"),
functions_detached("functions_detached"),
open_app("open_app"),
vars("vars"),
vars_detached("vars_detached"),
operators("operators"),
operators_detached("operators_detached");
operators("operators");
@Nonnull
private static Map<String, CppSpecialButton> buttonsByActions = new HashMap<>();

View File

@ -23,6 +23,7 @@
package org.solovyev.android.calculator.history;
import android.os.Bundle;
import org.solovyev.android.calculator.BaseActivity;
import org.solovyev.android.calculator.R;
@ -31,10 +32,10 @@ import javax.annotation.Nullable;
import static org.solovyev.android.calculator.CalculatorFragmentType.history;
import static org.solovyev.android.calculator.CalculatorFragmentType.saved_history;
public class CalculatorHistoryActivity extends BaseActivity {
public class HistoryActivity extends BaseActivity {
public CalculatorHistoryActivity() {
super(R.layout.main_empty, CalculatorHistoryActivity.class.getSimpleName());
public HistoryActivity() {
super(R.layout.main_empty, HistoryActivity.class.getSimpleName());
}
@Override