New architecture

This commit is contained in:
Sergey Solovyev
2012-09-23 19:25:05 +04:00
parent bb2bf70cc2
commit b2fe1d43c9
14 changed files with 36 additions and 221 deletions

View File

@@ -95,8 +95,10 @@ public class AndroidCalculatorDisplayView extends AutoResizeTextView implements
redraw();
} else {
setTextColor(getResources().getColor(R.color.display_error_text_color));
setText(state.getErrorMessage());
redraw();
// error messages are never shown -> just greyed out text (error message will be shown on click)
//setText(state.getErrorMessage());
//redraw();
}
}
}

View File

@@ -7,11 +7,10 @@ package org.solovyev.android.calculator;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.*;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.text.Html;
@@ -32,7 +31,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.solovyev.android.AndroidUtils;
import org.solovyev.android.FontSizeAdjuster;
import org.solovyev.android.LocalBinder;
import org.solovyev.android.calculator.about.CalculatorReleaseNotesActivity;
import org.solovyev.android.calculator.history.CalculatorHistoryState;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
@@ -57,7 +55,7 @@ import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
public class CalculatorActivity extends Activity implements FontSizeAdjuster, SharedPreferences.OnSharedPreferenceChangeListener, ServiceConnection {
public class CalculatorActivity extends Activity implements FontSizeAdjuster, SharedPreferences.OnSharedPreferenceChangeListener {
@NotNull
public static final String TAG = "Calculator++";
@@ -67,9 +65,6 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
@Nullable
private IBillingObserver billingObserver;
@Nullable
private ICalculationService calculationService;
@NotNull
private final Announcer<DragPreferencesChangeListener> dpclRegister = new Announcer<DragPreferencesChangeListener>(DragPreferencesChangeListener.class);
@@ -110,8 +105,6 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
super.onCreate(savedInstanceState);
setLayout(preferences);
bindService(new Intent(this, CalculationServiceImpl.class), this, Context.BIND_AUTO_CREATE);
if (customTitleSupported) {
try {
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.calc_title);
@@ -421,17 +414,6 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
return onDragListener;
}
@Override
public void onServiceConnected(ComponentName componentName, IBinder binder) {
if (binder instanceof LocalBinder) {
calculationService = (ICalculationService)((LocalBinder) binder).getService();
}
}
@Override
public void onServiceDisconnected(ComponentName componentName) {
}
private synchronized void setLayout(@NotNull SharedPreferences preferences) {
layout = CalculatorPreferences.Gui.layout.getPreferenceNoError(preferences);