Library update
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>calculatorpp-parent</artifactId>
|
||||
<version>1.2.34</version>
|
||||
<version>1.3.1</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -15,6 +15,7 @@
|
||||
<artifactId>calculatorpp-service</artifactId>
|
||||
<version>0.1</version>
|
||||
<packaging>apklib</packaging>
|
||||
<name>Calculator++ Service</name>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
@ -6,13 +6,14 @@
|
||||
<parent>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>calculatorpp-parent</artifactId>
|
||||
<version>1.2.34</version>
|
||||
<version>1.3.1</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>calculatorpp-test</artifactId>
|
||||
<name>Calculator++ Application (Test)</name>
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="81" android:versionName="1.2.34" package="org.solovyev.android.calculator">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="81" android:versionName="1.3.1" package="org.solovyev.android.calculator">
|
||||
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8"/>
|
||||
|
||||
<application android:debuggable="false" android:hardwareAccelerated="false" android:icon="@drawable/icon" android:label="@string/c_app_name" android:name=".CalculatorApplication">
|
||||
<application android:debuggable="true" android:hardwareAccelerated="false" android:icon="@drawable/icon" android:label="@string/c_app_name" android:name=".CalculatorApplication">
|
||||
|
||||
<activity android:label="@string/c_app_name" android:name=".CalculatorActivity" android:windowSoftInputMode="adjustPan">
|
||||
|
||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>calculatorpp-parent</artifactId>
|
||||
<version>1.2.34</version>
|
||||
<version>1.3.1</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -14,39 +14,54 @@
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>calculatorpp</artifactId>
|
||||
<packaging>apk</packaging>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>congrace.de</id>
|
||||
<name>releases</name>
|
||||
<url>http://nexus.congrace.de/nexus/content/repositories/releases/</url>
|
||||
<layout>default</layout>
|
||||
</repository>
|
||||
</repositories>
|
||||
<name>Calculator++ Application</name>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- OWN -->
|
||||
<dependency>
|
||||
<groupId>com.google.android</groupId>
|
||||
<artifactId>android</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.2</version>
|
||||
<scope>test</scope>
|
||||
<groupId>org.solovyev</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.solovyev</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<artifactId>common-text</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<artifactId>android-common-core</artifactId>
|
||||
<type>apklib</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>android-common-ads</artifactId>
|
||||
<type>apklib</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>android-common-view</artifactId>
|
||||
<type>apklib</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>android-common-preferences</artifactId>
|
||||
<type>apklib</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>android-common-other</artifactId>
|
||||
<type>apklib</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.solovyev.android</groupId>
|
||||
<artifactId>android-common-menu</artifactId>
|
||||
<type>apklib</type>
|
||||
</dependency>
|
||||
|
||||
@ -69,6 +84,21 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!--OTHER-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.android</groupId>
|
||||
<artifactId>android</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sf.opencsv</groupId>
|
||||
<artifactId>opencsv</artifactId>
|
||||
@ -101,7 +131,7 @@
|
||||
<dependency>
|
||||
<groupId>admob</groupId>
|
||||
<artifactId>admob</artifactId>
|
||||
<version>6.0.0</version>
|
||||
<version>6.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -127,13 +157,26 @@
|
||||
|
||||
<build>
|
||||
|
||||
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
|
||||
<artifactId>android-maven-plugin</artifactId>
|
||||
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<manifest>
|
||||
<debuggable>true</debuggable>
|
||||
</manifest>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>manifestUpdate</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>manifest-update</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>alignApk</id>
|
||||
<phase>package</phase>
|
||||
@ -142,26 +185,6 @@
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>properties-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>read-project-properties</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<files>
|
||||
<file>${project.basedir}/src/misc/env/jarsigner.properties</file>
|
||||
</files>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
@ -170,27 +193,6 @@
|
||||
|
||||
<profiles>
|
||||
|
||||
<profile>
|
||||
<id>development</id>
|
||||
<!-- using this since activeByDefault does not work well with multiple profiles -->
|
||||
<activation>
|
||||
<property>
|
||||
<name>environment</name>
|
||||
<value>!production</value>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<deployment.stage>In Development</deployment.stage>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>production</id>
|
||||
<properties>
|
||||
<deployment.stage>In Production</deployment.stage>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<!-- via this activation the profile is automatically used when the release is done with the maven release
|
||||
@ -205,6 +207,41 @@
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
|
||||
<artifactId>android-maven-plugin</artifactId>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>alignApk</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>zipalign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>properties-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>read-project-properties</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<files>
|
||||
<file>${project.basedir}/misc/env/jarsigner.properties</file>
|
||||
</files>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jarsigner-plugin</artifactId>
|
||||
|
56
calculatorpp/proguard.cfg
Normal file
@ -0,0 +1,56 @@
|
||||
-target 1.6
|
||||
-dontusemixedcaseclassnames
|
||||
-dontskipnonpubliclibraryclasses
|
||||
-dontpreverify
|
||||
-repackageclasses ''
|
||||
-allowaccessmodification
|
||||
-optimizations !code/simplification/arithmetic
|
||||
-keepattributes *Annotation*
|
||||
|
||||
-keep public class * extends android.app.Activity
|
||||
-keep public class * extends android.app.Application
|
||||
-keep public class * extends android.app.Service
|
||||
-keep public class * extends android.content.BroadcastReceiver
|
||||
-keep public class * extends android.content.ContentProvider
|
||||
|
||||
-keep public class * extends android.view.View {
|
||||
public <init>(android.content.Context);
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
public void set*(...);
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
|
||||
-keepclassmembers class * extends android.content.Context {
|
||||
public void *(android.view.View);
|
||||
public void *(android.view.MenuItem);
|
||||
}
|
||||
|
||||
-keepclassmembers class * implements android.os.Parcelable {
|
||||
static android.os.Parcelable$Creator CREATOR;
|
||||
}
|
||||
|
||||
-keepclassmembers class **.R$* {
|
||||
public static <fields>;
|
||||
}
|
||||
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
|
||||
-dontwarn javax.xml.stream.**
|
||||
-dontwarn com.bea.xml.stream.**
|
||||
-dontwarn sun.misc.Unsafe
|
||||
-dontwarn android.annotation.TargetApi
|
||||
|
||||
-keep class org.simpleframework.xml.** { *; }
|
||||
-keep class com.actionbarsherlock.** { *; }
|
||||
-keep class * implements org.solovyev.android.calculator.model.MathPersistenceEntity
|
@ -9,6 +9,11 @@
|
||||
|
||||
# Project target.
|
||||
target=android-15
|
||||
android.library.reference.1=../calculatorpp-service
|
||||
android.library.reference.2=gen-external-apklibs/org.solovyev.android_common_0.1.
|
||||
android.library.reference.1=gen-external-apklibs/org.solovyev.android_android-common-core_1.0.0
|
||||
android.library.reference.2=gen-external-apklibs/org.solovyev.android_android-common-ads_1.0.0
|
||||
android.library.reference.3=gen-external-apklibs/org.solovyev.android_android-common-view_1.0.0
|
||||
android.library.reference.4=gen-external-apklibs/org.solovyev.android_android-common-preferences_1.0.0
|
||||
android.library.reference.5=gen-external-apklibs/org.solovyev.android_android-common-other_1.0.0
|
||||
android.library.reference.6=gen-external-apklibs/org.solovyev.android_android-common-menu_1.0.0
|
||||
|
||||
|
||||
|
@ -116,7 +116,7 @@
|
||||
a:summary="@string/c_swipe_distance_summary"
|
||||
a:text=" pxs"
|
||||
a:defaultValue="35;350"
|
||||
range:steps="10"
|
||||
range:step="10"
|
||||
range:boundaries="10;500"/>
|
||||
|
||||
<!-- <org.solovyev.android.prefs.FloatRangeSeekBarPreference
|
||||
|
@ -46,11 +46,11 @@ import org.solovyev.android.menu.LayoutActivityMenu;
|
||||
import org.solovyev.android.prefs.Preference;
|
||||
import org.solovyev.android.view.ColorButton;
|
||||
import org.solovyev.android.view.drag.*;
|
||||
import org.solovyev.common.utils.Announcer;
|
||||
import org.solovyev.common.utils.EqualsTool;
|
||||
import org.solovyev.common.utils.Point2d;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.utils.history.HistoryAction;
|
||||
import org.solovyev.common.Announcer;
|
||||
import org.solovyev.common.equals.EqualsTool;
|
||||
import org.solovyev.common.math.Point2d;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
import org.solovyev.common.history.HistoryAction;
|
||||
|
||||
public class CalculatorActivity extends Activity implements FontSizeAdjuster, SharedPreferences.OnSharedPreferenceChangeListener, ServiceConnection {
|
||||
|
||||
@ -469,7 +469,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh
|
||||
dialogShown = showSpecialWindow(preferences, CalculatorPreferences.Gui.notesppAnnounceShown, R.layout.notespp_announce, R.id.notespp_announce);
|
||||
}
|
||||
|
||||
ResourceCache.instance.init(R.id.class, this);
|
||||
ResourceCache.instance.initCaptions(this, R.id.class);
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import org.solovyev.android.calculator.math.edit.CalculatorOperatorsActivity;
|
||||
import org.solovyev.android.calculator.math.edit.CalculatorVarsTabActivity;
|
||||
import org.solovyev.android.calculator.math.edit.CalculatorVarsActivity;
|
||||
import org.solovyev.android.calculator.plot.CalculatorPlotActivity;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
@ -27,8 +27,8 @@ import org.solovyev.android.calculator.view.UnitConverterViewBuilder;
|
||||
import org.solovyev.android.menu.AMenuItem;
|
||||
import org.solovyev.android.menu.LabeledMenuItem;
|
||||
import org.solovyev.android.view.AutoResizeTextView;
|
||||
import org.solovyev.common.utils.CollectionsUtils;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.collections.CollectionsUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
@ -19,7 +19,7 @@ import org.solovyev.android.calculator.model.CalculatorEngine;
|
||||
import org.solovyev.android.calculator.model.CalculatorParseException;
|
||||
import org.solovyev.android.calculator.model.TextProcessor;
|
||||
import org.solovyev.android.calculator.view.TextHighlighter;
|
||||
import org.solovyev.common.utils.CollectionsUtils;
|
||||
import org.solovyev.common.collections.CollectionsUtils;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
@ -13,7 +13,7 @@ import org.solovyev.android.menu.IdentifiableMenuItem;
|
||||
* Date: 4/23/12
|
||||
* Time: 2:25 PM
|
||||
*/
|
||||
enum CalculatorMenu implements IdentifiableMenuItem {
|
||||
enum CalculatorMenu implements IdentifiableMenuItem<MenuItem> {
|
||||
|
||||
settings(R.id.main_menu_item_settings){
|
||||
@Override
|
||||
|
@ -31,10 +31,10 @@ import org.solovyev.android.calculator.model.CalculatorParseException;
|
||||
import org.solovyev.android.history.HistoryControl;
|
||||
import org.solovyev.android.menu.AMenuBuilder;
|
||||
import org.solovyev.android.menu.MenuImpl;
|
||||
import org.solovyev.common.MutableObject;
|
||||
import org.solovyev.common.history.HistoryAction;
|
||||
import org.solovyev.common.msg.Message;
|
||||
import org.solovyev.common.utils.MutableObject;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.utils.history.HistoryAction;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -329,19 +329,19 @@ public enum CalculatorModel implements CursorControl, HistoryControl<CalculatorH
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doHistoryAction(@NotNull HistoryAction historyAction) {
|
||||
synchronized (CalculatorHistory.instance) {
|
||||
if (CalculatorHistory.instance.isActionAvailable(historyAction)) {
|
||||
final CalculatorHistoryState newState = CalculatorHistory.instance.doAction(historyAction, getCurrentHistoryState());
|
||||
if (newState != null) {
|
||||
setCurrentHistoryState(newState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void doHistoryAction(@NotNull HistoryAction historyAction) {
|
||||
synchronized (CalculatorHistory.instance) {
|
||||
if (CalculatorHistory.instance.isActionAvailable(historyAction)) {
|
||||
final CalculatorHistoryState newState = CalculatorHistory.instance.doAction(historyAction, getCurrentHistoryState());
|
||||
if (newState != null) {
|
||||
setCurrentHistoryState(newState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void setCurrentHistoryState(@NotNull CalculatorHistoryState editorHistoryState) {
|
||||
synchronized (CalculatorHistory.instance) {
|
||||
Log.d(this.getClass().getName(), "Saved history found: " + editorHistoryState);
|
||||
|
@ -8,14 +8,14 @@ package org.solovyev.android.calculator;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.common.utils.Finder;
|
||||
import org.solovyev.common.JPredicate;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 10/3/11
|
||||
* Time: 12:54 AM
|
||||
*/
|
||||
public class CharacterAtPositionFinder implements Finder<Character> {
|
||||
public class CharacterAtPositionFinder implements JPredicate<Character> {
|
||||
|
||||
private int i;
|
||||
|
||||
@ -28,7 +28,7 @@ public class CharacterAtPositionFinder implements Finder<Character> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFound(@Nullable Character s) {
|
||||
public boolean apply(@Nullable Character s) {
|
||||
return s != null && s.equals(targetString.charAt(i));
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ import org.solovyev.android.view.drag.DragDirection;
|
||||
import org.solovyev.android.view.drag.SimpleOnDragListener;
|
||||
import org.solovyev.android.view.drag.DirectionDragButton;
|
||||
import org.solovyev.android.view.drag.DragButton;
|
||||
import org.solovyev.common.utils.Point2d;
|
||||
import org.solovyev.common.math.Point2d;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
@ -11,7 +11,7 @@ import org.solovyev.android.view.drag.DragDirection;
|
||||
import org.solovyev.android.view.drag.SimpleOnDragListener;
|
||||
import org.solovyev.android.view.drag.DirectionDragButton;
|
||||
import org.solovyev.android.view.drag.DragButton;
|
||||
import org.solovyev.common.utils.Point2d;
|
||||
import org.solovyev.common.math.Point2d;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
@ -12,7 +12,7 @@ import org.solovyev.android.view.drag.DragDirection;
|
||||
import org.solovyev.android.view.drag.SimpleOnDragListener;
|
||||
import org.solovyev.android.view.drag.DirectionDragButton;
|
||||
import org.solovyev.android.view.drag.DragButton;
|
||||
import org.solovyev.common.utils.Point2d;
|
||||
import org.solovyev.common.math.Point2d;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
@ -18,7 +18,7 @@ import org.solovyev.android.AndroidUtils;
|
||||
import org.solovyev.android.ResourceCache;
|
||||
import org.solovyev.android.calculator.CalculatorActivity;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
@ -25,7 +25,12 @@ import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.android.calculator.jscl.JsclOperation;
|
||||
import org.solovyev.android.menu.AMenuBuilder;
|
||||
import org.solovyev.android.menu.MenuImpl;
|
||||
import org.solovyev.common.utils.*;
|
||||
import org.solovyev.common.collections.CollectionsUtils;
|
||||
import org.solovyev.common.equals.Equalizer;
|
||||
import org.solovyev.common.filter.Filter;
|
||||
import org.solovyev.common.filter.FilterRule;
|
||||
import org.solovyev.common.filter.FilterRulesChain;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -12,9 +12,9 @@ import android.preference.PreferenceManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.common.utils.history.HistoryAction;
|
||||
import org.solovyev.common.utils.history.HistoryHelper;
|
||||
import org.solovyev.common.utils.history.SimpleHistoryHelper;
|
||||
import org.solovyev.common.history.HistoryAction;
|
||||
import org.solovyev.common.history.HistoryHelper;
|
||||
import org.solovyev.common.history.SimpleHistoryHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -13,7 +13,7 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
@ -20,7 +20,7 @@ import android.widget.Toast;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.android.menu.LabeledMenuItem;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
@ -10,11 +10,11 @@ import jscl.NumeralBase;
|
||||
import jscl.math.function.Constants;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.common.JPredicate;
|
||||
import org.solovyev.common.StartsWithFinder;
|
||||
import org.solovyev.android.calculator.model.CalculatorEngine;
|
||||
import org.solovyev.android.calculator.model.CalculatorParseException;
|
||||
import org.solovyev.common.utils.CollectionsUtils;
|
||||
import org.solovyev.common.utils.Finder;
|
||||
import org.solovyev.common.collections.CollectionsUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -425,7 +425,7 @@ public enum MathType {
|
||||
}
|
||||
}
|
||||
|
||||
private static class EndsWithFinder implements Finder<String> {
|
||||
private static class EndsWithFinder implements JPredicate<String> {
|
||||
|
||||
private int i;
|
||||
|
||||
@ -437,7 +437,7 @@ public enum MathType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFound(@Nullable String s) {
|
||||
public boolean apply(@Nullable String s) {
|
||||
return targetString.subSequence(0, i).toString().endsWith(s);
|
||||
}
|
||||
|
||||
|
@ -23,14 +23,13 @@ import org.solovyev.android.calculator.CalculatorModel;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.android.calculator.model.AndroidMathRegistry;
|
||||
import org.solovyev.android.menu.AMenuBuilder;
|
||||
import org.solovyev.android.menu.AMenuItem;
|
||||
import org.solovyev.android.menu.LabeledMenuItem;
|
||||
import org.solovyev.android.menu.MenuImpl;
|
||||
import org.solovyev.common.equals.EqualsTool;
|
||||
import org.solovyev.common.filter.FilterRule;
|
||||
import org.solovyev.common.filter.Filter;
|
||||
import org.solovyev.common.math.MathEntity;
|
||||
import org.solovyev.common.utils.EqualsTool;
|
||||
import org.solovyev.common.utils.Filter;
|
||||
import org.solovyev.common.utils.FilterRule;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
@ -161,7 +160,7 @@ public abstract class AbstractMathEntityListActivity<T extends MathEntity> exten
|
||||
return !isInCategory(t);
|
||||
}
|
||||
}).filter(result.iterator());
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.android.calculator.CalculatorModel;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.android.calculator.model.CalculatorEngine;
|
||||
import org.solovyev.android.menu.AMenuItem;
|
||||
import org.solovyev.android.menu.LabeledMenuItem;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -8,9 +8,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.android.calculator.CalculatorModel;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.android.calculator.model.CalculatorEngine;
|
||||
import org.solovyev.android.menu.AMenuItem;
|
||||
import org.solovyev.android.menu.LabeledMenuItem;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -27,9 +27,9 @@ import org.solovyev.android.calculator.math.MathType;
|
||||
import org.solovyev.android.calculator.model.CalculatorEngine;
|
||||
import org.solovyev.android.calculator.model.Var;
|
||||
import org.solovyev.android.menu.LabeledMenuItem;
|
||||
import org.solovyev.common.utils.CollectionsUtils;
|
||||
import org.solovyev.common.utils.Finder;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.JPredicate;
|
||||
import org.solovyev.common.collections.CollectionsUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -165,9 +165,9 @@ public class CalculatorVarsActivity extends AbstractMathEntityListActivity<ICons
|
||||
protected List<IConstant> getMathEntities() {
|
||||
final List<IConstant> result = new ArrayList<IConstant>(CalculatorEngine.instance.getVarsRegistry().getEntities());
|
||||
|
||||
CollectionsUtils.removeAll(result, new Finder<IConstant>() {
|
||||
CollectionsUtils.removeAll(result, new JPredicate<IConstant>() {
|
||||
@Override
|
||||
public boolean isFound(@Nullable IConstant var) {
|
||||
public boolean apply(@Nullable IConstant var) {
|
||||
return var != null && CollectionsUtils.contains(var.getName(), MathType.INFINITY_JSCL, MathType.NAN);
|
||||
}
|
||||
});
|
||||
|
@ -24,7 +24,7 @@ import org.solovyev.android.calculator.model.AndroidMathRegistry;
|
||||
import org.solovyev.android.calculator.model.CalculatorEngine;
|
||||
import org.solovyev.android.calculator.model.MathEntityBuilder;
|
||||
import org.solovyev.common.math.MathEntity;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|
@ -22,7 +22,7 @@ import org.solovyev.android.calculator.model.AndroidMathRegistry;
|
||||
import org.solovyev.android.calculator.model.CalculatorEngine;
|
||||
import org.solovyev.android.calculator.model.MathEntityBuilder;
|
||||
import org.solovyev.common.math.MathEntity;
|
||||
import org.solovyev.common.utils.StringUtils;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
|