diff --git a/calculatorpp/AndroidManifest.xml b/calculatorpp/AndroidManifest.xml
index f182a0d4..be0b0f9e 100644
--- a/calculatorpp/AndroidManifest.xml
+++ b/calculatorpp/AndroidManifest.xml
@@ -22,27 +22,17 @@
-
-
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
diff --git a/calculatorpp/res/layout/about.xml b/calculatorpp/res/layout/about_fragment.xml
similarity index 96%
rename from calculatorpp/res/layout/about.xml
rename to calculatorpp/res/layout/about_fragment.xml
index d219da3d..602bab8a 100644
--- a/calculatorpp/res/layout/about.xml
+++ b/calculatorpp/res/layout/about_fragment.xml
@@ -1,47 +1,47 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/calculatorpp/res/layout/history.xml b/calculatorpp/res/layout/history_item.xml
similarity index 96%
rename from calculatorpp/res/layout/history.xml
rename to calculatorpp/res/layout/history_item.xml
index 07358118..7d7a1c27 100644
--- a/calculatorpp/res/layout/history.xml
+++ b/calculatorpp/res/layout/history_item.xml
@@ -1,40 +1,40 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/calculatorpp/res/layout/release_notes.xml b/calculatorpp/res/layout/release_notes_fragment.xml
similarity index 96%
rename from calculatorpp/res/layout/release_notes.xml
rename to calculatorpp/res/layout/release_notes_fragment.xml
index 911ff731..e01382f0 100644
--- a/calculatorpp/res/layout/release_notes.xml
+++ b/calculatorpp/res/layout/release_notes_fragment.xml
@@ -1,28 +1,28 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/calculatorpp/res/layout/saved_history.xml b/calculatorpp/res/layout/saved_history_item.xml
similarity index 96%
rename from calculatorpp/res/layout/saved_history.xml
rename to calculatorpp/res/layout/saved_history_item.xml
index f7abe10c..138c8fe8 100644
--- a/calculatorpp/res/layout/saved_history.xml
+++ b/calculatorpp/res/layout/saved_history_item.xml
@@ -1,41 +1,41 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/calculatorpp/src/main/java/org/solovyev/android/AndroidUtils2.java b/calculatorpp/src/main/java/org/solovyev/android/AndroidUtils2.java
index 1b073d4d..9abe58ae 100644
--- a/calculatorpp/src/main/java/org/solovyev/android/AndroidUtils2.java
+++ b/calculatorpp/src/main/java/org/solovyev/android/AndroidUtils2.java
@@ -1,6 +1,5 @@
package org.solovyev.android;
-import android.content.res.Configuration;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
@@ -33,11 +32,4 @@ public final class AndroidUtils2 {
dialogFragment.show(ft, fragmentTag);
}
-
- // copied from API-15
- public static boolean isLayoutSizeAtLeast(int size, @NotNull Configuration configuration) {
- int cur = configuration.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
- if (cur == Configuration.SCREENLAYOUT_SIZE_UNDEFINED) return false;
- return cur >= size;
- }
}
diff --git a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java
index f704d90c..565800ca 100644
--- a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java
+++ b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java
@@ -26,13 +26,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.solovyev.android.AndroidUtils;
import org.solovyev.android.calculator.about.CalculatorFragmentType;
-import org.solovyev.android.calculator.about.CalculatorReleaseNotesActivity;
-import org.solovyev.android.calculator.history.CalculatorHistoryFragment;
-import org.solovyev.android.calculator.history.CalculatorSavedHistoryFragment;
-import org.solovyev.android.calculator.math.edit.CalculatorFunctionsFragment;
-import org.solovyev.android.calculator.math.edit.CalculatorOperatorsFragment;
-import org.solovyev.android.calculator.math.edit.CalculatorVarsFragment;
-import org.solovyev.android.calculator.plot.CalculatorPlotFragment;
+import org.solovyev.android.calculator.about.CalculatorReleaseNotesFragment;
import org.solovyev.android.fragments.FragmentUtils;
import org.solovyev.android.prefs.Preference;
import org.solovyev.android.view.ColorButton;
@@ -78,6 +72,7 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
activityHelper.addTab(this, CalculatorFragmentType.functions, null, R.id.main_second_pane);
activityHelper.addTab(this, CalculatorFragmentType.operators, null, R.id.main_second_pane);
activityHelper.addTab(this, CalculatorFragmentType.plotter, null, R.id.main_second_pane);
+ activityHelper.addTab(this, CalculatorFragmentType.faq, null, R.id.main_second_pane);
} else {
getSupportActionBar().hide();
}
@@ -141,7 +136,7 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
if (savedVersion < appVersion) {
final boolean showReleaseNotes = CalculatorPreferences.Gui.showReleaseNotes.getPreference(preferences);
if (showReleaseNotes) {
- final String releaseNotes = CalculatorReleaseNotesActivity.getReleaseNotes(context, savedVersion + 1);
+ final String releaseNotes = CalculatorReleaseNotesFragment.getReleaseNotes(context, savedVersion + 1);
if (!StringUtils.isEmpty(releaseNotes)) {
final AlertDialog.Builder builder = new AlertDialog.Builder(context).setMessage(Html.fromHtml(releaseNotes));
builder.setPositiveButton(android.R.string.ok, null);
diff --git a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivityHelperImpl.java b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivityHelperImpl.java
index feaecb68..a704b28e 100644
--- a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivityHelperImpl.java
+++ b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivityHelperImpl.java
@@ -16,9 +16,6 @@ import org.solovyev.android.AndroidUtils;
import org.solovyev.android.calculator.about.CalculatorFragmentType;
import org.solovyev.android.sherlock.tabs.ActionBarFragmentTabListener;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* User: serso
* Date: 9/25/12
@@ -46,9 +43,6 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
private boolean homeIcon = false;
- @NotNull
- private final List fragmentTags = new ArrayList();
-
@NotNull
private CalculatorPreferences.Gui.Theme theme;
@@ -196,8 +190,6 @@ public class CalculatorActivityHelperImpl extends AbstractCalculatorHelper imple
final ActionBarFragmentTabListener listener = new ActionBarFragmentTabListener(activity, tag, fragmentClass, fragmentArgs, parentViewId);
tab.setTabListener(listener);
actionBar.addTab(tab);
-
- fragmentTags.add(tag);
}
@Override
diff --git a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivityLauncher.java b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivityLauncher.java
index f27affcb..bbbda88e 100644
--- a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivityLauncher.java
+++ b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorActivityLauncher.java
@@ -7,10 +7,9 @@ import jscl.math.Generic;
import jscl.math.function.Constant;
import org.achartengine.ChartFactory;
import org.jetbrains.annotations.NotNull;
-import org.solovyev.android.AndroidUtils2;
-import org.solovyev.android.calculator.about.CalculatorAboutTabActivity;
-import org.solovyev.android.calculator.help.CalculatorHelpTabActivity;
-import org.solovyev.android.calculator.history.CalculatorHistoryFragmentActivity;
+import org.solovyev.android.calculator.about.CalculatorAboutActivity;
+import org.solovyev.android.calculator.help.CalculatorHelpActivity;
+import org.solovyev.android.calculator.history.CalculatorHistoryActivity;
import org.solovyev.android.calculator.math.edit.*;
import org.solovyev.android.calculator.plot.CalculatorPlotActivity;
import org.solovyev.android.calculator.plot.CalculatorPlotFragment;
@@ -25,11 +24,11 @@ import org.solovyev.common.text.StringUtils;
public class CalculatorActivityLauncher {
public static void showHistory(@NotNull final Context context) {
- context.startActivity(new Intent(context, CalculatorHistoryFragmentActivity.class));
+ context.startActivity(new Intent(context, CalculatorHistoryActivity.class));
}
public static void showHelp(@NotNull final Context context) {
- context.startActivity(new Intent(context, CalculatorHelpTabActivity.class));
+ context.startActivity(new Intent(context, CalculatorHelpActivity.class));
}
public static void showSettings(@NotNull final Context context) {
@@ -37,19 +36,19 @@ public class CalculatorActivityLauncher {
}
public static void showAbout(@NotNull final Context context) {
- context.startActivity(new Intent(context, CalculatorAboutTabActivity.class));
+ context.startActivity(new Intent(context, CalculatorAboutActivity.class));
}
public static void showFunctions(@NotNull final Context context) {
- context.startActivity(new Intent(context, CalculatorFunctionsFragmentActivity.class));
+ context.startActivity(new Intent(context, CalculatorFunctionsActivity.class));
}
public static void showOperators(@NotNull final Context context) {
- context.startActivity(new Intent(context, CalculatorOperatorsFragmentActivity.class));
+ context.startActivity(new Intent(context, CalculatorOperatorsActivity.class));
}
public static void showVars(@NotNull final Context context) {
- context.startActivity(new Intent(context, CalculatorVarsFragmentActivity.class));
+ context.startActivity(new Intent(context, CalculatorVarsActivity.class));
}
public static void plotGraph(@NotNull final Context context, @NotNull Generic generic, @NotNull Constant constant){
@@ -69,7 +68,7 @@ public class CalculatorActivityLauncher {
if (context instanceof SherlockFragmentActivity) {
VarEditDialogFragment.showDialog(VarEditDialogFragment.Input.newFromValue(varValue), ((SherlockFragmentActivity) context).getSupportFragmentManager());
} else {
- final Intent intent = new Intent(context, CalculatorVarsFragmentActivity.class);
+ final Intent intent = new Intent(context, CalculatorVarsActivity.class);
intent.putExtra(CalculatorVarsFragment.CREATE_VAR_EXTRA_STRING, varValue);
context.startActivity(intent);
}
diff --git a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java
index 94478fd2..142814f3 100644
--- a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java
+++ b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorButtons.java
@@ -15,7 +15,6 @@ import jscl.NumeralBase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.solovyev.android.AndroidUtils;
-import org.solovyev.android.AndroidUtils2;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
import org.solovyev.android.calculator.view.AngleUnitsButton;
import org.solovyev.android.calculator.view.NumeralBasesButton;
@@ -66,7 +65,7 @@ public final class CalculatorButtons {
@NotNull Activity activity) {
preferences = preferences == null ? PreferenceManager.getDefaultSharedPreferences(activity) : preferences;
- final boolean large = AndroidUtils2.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE, activity.getResources().getConfiguration());
+ final boolean large = AndroidUtils.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE, activity.getResources().getConfiguration());
if (!large) {
if (AndroidUtils.getScreenOrientation(activity) == Configuration.ORIENTATION_PORTRAIT
diff --git a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorEditorFragment.java b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorEditorFragment.java
index 68acf973..9ad08131 100644
--- a/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorEditorFragment.java
+++ b/calculatorpp/src/main/java/org/solovyev/android/calculator/CalculatorEditorFragment.java
@@ -1,98 +1,64 @@
-package org.solovyev.android.calculator;
-
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import com.actionbarsherlock.app.SherlockFragment;
-import com.actionbarsherlock.view.Menu;
-import com.actionbarsherlock.view.MenuInflater;
-import com.actionbarsherlock.view.MenuItem;
-import org.jetbrains.annotations.NotNull;
-import org.solovyev.android.menu.ActivityMenu;
-import org.solovyev.android.menu.ListActivityMenu;
-import org.solovyev.android.sherlock.menu.SherlockMenuHelper;
-
-/**
- * User: Solovyev_S
- * Date: 25.09.12
- * Time: 10:49
- */
-public class CalculatorEditorFragment extends SherlockFragment {
-
- @NotNull
- private ActivityMenu