Library update

This commit is contained in:
Sergey Solovyev 2012-09-16 18:25:50 +04:00
parent 024e211dd3
commit 0ca88fb95d
122 changed files with 325 additions and 235 deletions

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.solovyev.android</groupId> <groupId>org.solovyev.android</groupId>
<artifactId>calculatorpp-parent</artifactId> <artifactId>calculatorpp-parent</artifactId>
<version>1.2.34</version> <version>1.3.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -15,6 +15,7 @@
<artifactId>calculatorpp-service</artifactId> <artifactId>calculatorpp-service</artifactId>
<version>0.1</version> <version>0.1</version>
<packaging>apklib</packaging> <packaging>apklib</packaging>
<name>Calculator++ Service</name>
<dependencies> <dependencies>

View File

@ -6,13 +6,14 @@
<parent> <parent>
<groupId>org.solovyev.android</groupId> <groupId>org.solovyev.android</groupId>
<artifactId>calculatorpp-parent</artifactId> <artifactId>calculatorpp-parent</artifactId>
<version>1.2.34</version> <version>1.3.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.solovyev.android</groupId> <groupId>org.solovyev.android</groupId>
<artifactId>calculatorpp-test</artifactId> <artifactId>calculatorpp-test</artifactId>
<name>Calculator++ Application (Test)</name>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
@ -8,7 +8,7 @@
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8"/> <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"> <activity android:label="@string/c_app_name" android:name=".CalculatorActivity" android:windowSoftInputMode="adjustPan">

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.solovyev.android</groupId> <groupId>org.solovyev.android</groupId>
<artifactId>calculatorpp-parent</artifactId> <artifactId>calculatorpp-parent</artifactId>
<version>1.2.34</version> <version>1.3.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -14,39 +14,54 @@
<groupId>org.solovyev.android</groupId> <groupId>org.solovyev.android</groupId>
<artifactId>calculatorpp</artifactId> <artifactId>calculatorpp</artifactId>
<packaging>apk</packaging> <packaging>apk</packaging>
<name>Calculator++ Application</name>
<repositories>
<repository>
<id>congrace.de</id>
<name>releases</name>
<url>http://nexus.congrace.de/nexus/content/repositories/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies> <dependencies>
<!-- OWN -->
<dependency> <dependency>
<groupId>com.google.android</groupId> <groupId>org.solovyev</groupId>
<artifactId>android</artifactId> <artifactId>common-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.solovyev</groupId> <groupId>org.solovyev</groupId>
<artifactId>common</artifactId> <artifactId>common-text</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.solovyev.android</groupId> <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> <type>apklib</type>
</dependency> </dependency>
@ -69,6 +84,21 @@
</exclusions> </exclusions>
</dependency> </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> <dependency>
<groupId>net.sf.opencsv</groupId> <groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId> <artifactId>opencsv</artifactId>
@ -101,7 +131,7 @@
<dependency> <dependency>
<groupId>admob</groupId> <groupId>admob</groupId>
<artifactId>admob</artifactId> <artifactId>admob</artifactId>
<version>6.0.0</version> <version>6.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
@ -127,13 +157,26 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId> <groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId> <artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<manifest>
<debuggable>true</debuggable>
</manifest>
</configuration>
<executions> <executions>
<execution>
<id>manifestUpdate</id>
<phase>process-resources</phase>
<goals>
<goal>manifest-update</goal>
</goals>
</execution>
<execution> <execution>
<id>alignApk</id> <id>alignApk</id>
<phase>package</phase> <phase>package</phase>
@ -142,26 +185,6 @@
</goals> </goals>
</execution> </execution>
</executions> </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> </plugin>
</plugins> </plugins>
@ -170,27 +193,6 @@
<profiles> <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> <profile>
<id>release</id> <id>release</id>
<!-- via this activation the profile is automatically used when the release is done with the maven release <!-- via this activation the profile is automatically used when the release is done with the maven release
@ -205,6 +207,41 @@
<build> <build>
<plugins> <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> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId> <artifactId>maven-jarsigner-plugin</artifactId>

56
calculatorpp/proguard.cfg Normal file
View 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

View File

@ -9,6 +9,11 @@
# Project target. # Project target.
target=android-15 target=android-15
android.library.reference.1=../calculatorpp-service 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_common_0.1. 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

View File

@ -116,7 +116,7 @@
a:summary="@string/c_swipe_distance_summary" a:summary="@string/c_swipe_distance_summary"
a:text=" pxs" a:text=" pxs"
a:defaultValue="35;350" a:defaultValue="35;350"
range:steps="10" range:step="10"
range:boundaries="10;500"/> range:boundaries="10;500"/>
<!-- <org.solovyev.android.prefs.FloatRangeSeekBarPreference <!-- <org.solovyev.android.prefs.FloatRangeSeekBarPreference

View File

@ -46,11 +46,11 @@ import org.solovyev.android.menu.LayoutActivityMenu;
import org.solovyev.android.prefs.Preference; import org.solovyev.android.prefs.Preference;
import org.solovyev.android.view.ColorButton; import org.solovyev.android.view.ColorButton;
import org.solovyev.android.view.drag.*; import org.solovyev.android.view.drag.*;
import org.solovyev.common.utils.Announcer; import org.solovyev.common.Announcer;
import org.solovyev.common.utils.EqualsTool; import org.solovyev.common.equals.EqualsTool;
import org.solovyev.common.utils.Point2d; import org.solovyev.common.math.Point2d;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
import org.solovyev.common.utils.history.HistoryAction; import org.solovyev.common.history.HistoryAction;
public class CalculatorActivity extends Activity implements FontSizeAdjuster, SharedPreferences.OnSharedPreferenceChangeListener, ServiceConnection { 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); 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; initialized = true;
} }

View File

@ -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.CalculatorVarsTabActivity;
import org.solovyev.android.calculator.math.edit.CalculatorVarsActivity; import org.solovyev.android.calculator.math.edit.CalculatorVarsActivity;
import org.solovyev.android.calculator.plot.CalculatorPlotActivity; import org.solovyev.android.calculator.plot.CalculatorPlotActivity;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
/** /**
* User: serso * User: serso

View File

@ -27,8 +27,8 @@ import org.solovyev.android.calculator.view.UnitConverterViewBuilder;
import org.solovyev.android.menu.AMenuItem; import org.solovyev.android.menu.AMenuItem;
import org.solovyev.android.menu.LabeledMenuItem; import org.solovyev.android.menu.LabeledMenuItem;
import org.solovyev.android.view.AutoResizeTextView; import org.solovyev.android.view.AutoResizeTextView;
import org.solovyev.common.utils.CollectionsUtils; import org.solovyev.common.collections.CollectionsUtils;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;

View File

@ -19,7 +19,7 @@ import org.solovyev.android.calculator.model.CalculatorEngine;
import org.solovyev.android.calculator.model.CalculatorParseException; import org.solovyev.android.calculator.model.CalculatorParseException;
import org.solovyev.android.calculator.model.TextProcessor; import org.solovyev.android.calculator.model.TextProcessor;
import org.solovyev.android.calculator.view.TextHighlighter; import org.solovyev.android.calculator.view.TextHighlighter;
import org.solovyev.common.utils.CollectionsUtils; import org.solovyev.common.collections.CollectionsUtils;
/** /**
* User: serso * User: serso

View File

@ -13,7 +13,7 @@ import org.solovyev.android.menu.IdentifiableMenuItem;
* Date: 4/23/12 * Date: 4/23/12
* Time: 2:25 PM * Time: 2:25 PM
*/ */
enum CalculatorMenu implements IdentifiableMenuItem { enum CalculatorMenu implements IdentifiableMenuItem<MenuItem> {
settings(R.id.main_menu_item_settings){ settings(R.id.main_menu_item_settings){
@Override @Override

View File

@ -31,10 +31,10 @@ import org.solovyev.android.calculator.model.CalculatorParseException;
import org.solovyev.android.history.HistoryControl; import org.solovyev.android.history.HistoryControl;
import org.solovyev.android.menu.AMenuBuilder; import org.solovyev.android.menu.AMenuBuilder;
import org.solovyev.android.menu.MenuImpl; 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.msg.Message;
import org.solovyev.common.utils.MutableObject; import org.solovyev.common.text.StringUtils;
import org.solovyev.common.utils.StringUtils;
import org.solovyev.common.utils.history.HistoryAction;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -329,19 +329,19 @@ public enum CalculatorModel implements CursorControl, HistoryControl<CalculatorH
} }
@Override @Override
public void doHistoryAction(@NotNull HistoryAction historyAction) { public void doHistoryAction(@NotNull HistoryAction historyAction) {
synchronized (CalculatorHistory.instance) { synchronized (CalculatorHistory.instance) {
if (CalculatorHistory.instance.isActionAvailable(historyAction)) { if (CalculatorHistory.instance.isActionAvailable(historyAction)) {
final CalculatorHistoryState newState = CalculatorHistory.instance.doAction(historyAction, getCurrentHistoryState()); final CalculatorHistoryState newState = CalculatorHistory.instance.doAction(historyAction, getCurrentHistoryState());
if (newState != null) { if (newState != null) {
setCurrentHistoryState(newState); setCurrentHistoryState(newState);
} }
} }
} }
} }
@Override @Override
public void setCurrentHistoryState(@NotNull CalculatorHistoryState editorHistoryState) { public void setCurrentHistoryState(@NotNull CalculatorHistoryState editorHistoryState) {
synchronized (CalculatorHistory.instance) { synchronized (CalculatorHistory.instance) {
Log.d(this.getClass().getName(), "Saved history found: " + editorHistoryState); Log.d(this.getClass().getName(), "Saved history found: " + editorHistoryState);

View File

@ -8,14 +8,14 @@ package org.solovyev.android.calculator;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.solovyev.common.utils.Finder; import org.solovyev.common.JPredicate;
/** /**
* User: serso * User: serso
* Date: 10/3/11 * Date: 10/3/11
* Time: 12:54 AM * Time: 12:54 AM
*/ */
public class CharacterAtPositionFinder implements Finder<Character> { public class CharacterAtPositionFinder implements JPredicate<Character> {
private int i; private int i;
@ -28,7 +28,7 @@ public class CharacterAtPositionFinder implements Finder<Character> {
} }
@Override @Override
public boolean isFound(@Nullable Character s) { public boolean apply(@Nullable Character s) {
return s != null && s.equals(targetString.charAt(i)); return s != null && s.equals(targetString.charAt(i));
} }

View File

@ -12,7 +12,7 @@ import org.solovyev.android.view.drag.DragDirection;
import org.solovyev.android.view.drag.SimpleOnDragListener; import org.solovyev.android.view.drag.SimpleOnDragListener;
import org.solovyev.android.view.drag.DirectionDragButton; import org.solovyev.android.view.drag.DirectionDragButton;
import org.solovyev.android.view.drag.DragButton; import org.solovyev.android.view.drag.DragButton;
import org.solovyev.common.utils.Point2d; import org.solovyev.common.math.Point2d;
/** /**
* User: serso * User: serso

View File

@ -11,7 +11,7 @@ import org.solovyev.android.view.drag.DragDirection;
import org.solovyev.android.view.drag.SimpleOnDragListener; import org.solovyev.android.view.drag.SimpleOnDragListener;
import org.solovyev.android.view.drag.DirectionDragButton; import org.solovyev.android.view.drag.DirectionDragButton;
import org.solovyev.android.view.drag.DragButton; import org.solovyev.android.view.drag.DragButton;
import org.solovyev.common.utils.Point2d; import org.solovyev.common.math.Point2d;
/** /**
* User: serso * User: serso

View File

@ -12,7 +12,7 @@ import org.solovyev.android.view.drag.DragDirection;
import org.solovyev.android.view.drag.SimpleOnDragListener; import org.solovyev.android.view.drag.SimpleOnDragListener;
import org.solovyev.android.view.drag.DirectionDragButton; import org.solovyev.android.view.drag.DirectionDragButton;
import org.solovyev.android.view.drag.DragButton; import org.solovyev.android.view.drag.DragButton;
import org.solovyev.common.utils.Point2d; import org.solovyev.common.math.Point2d;
/** /**
* User: serso * User: serso

View File

@ -18,7 +18,7 @@ import org.solovyev.android.AndroidUtils;
import org.solovyev.android.ResourceCache; import org.solovyev.android.ResourceCache;
import org.solovyev.android.calculator.CalculatorActivity; import org.solovyev.android.calculator.CalculatorActivity;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
/** /**
* User: serso * User: serso

View File

@ -25,7 +25,12 @@ import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.jscl.JsclOperation; import org.solovyev.android.calculator.jscl.JsclOperation;
import org.solovyev.android.menu.AMenuBuilder; import org.solovyev.android.menu.AMenuBuilder;
import org.solovyev.android.menu.MenuImpl; 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.ArrayList;
import java.util.Collections; import java.util.Collections;

View File

@ -12,9 +12,9 @@ import android.preference.PreferenceManager;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.common.utils.history.HistoryAction; import org.solovyev.common.history.HistoryAction;
import org.solovyev.common.utils.history.HistoryHelper; import org.solovyev.common.history.HistoryHelper;
import org.solovyev.common.utils.history.SimpleHistoryHelper; import org.solovyev.common.history.SimpleHistoryHelper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;

View File

@ -13,7 +13,7 @@ import android.widget.ArrayAdapter;
import android.widget.TextView; import android.widget.TextView;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;

View File

@ -20,7 +20,7 @@ import android.widget.Toast;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.android.menu.LabeledMenuItem; import org.solovyev.android.menu.LabeledMenuItem;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
/** /**
* User: serso * User: serso

View File

@ -10,11 +10,11 @@ import jscl.NumeralBase;
import jscl.math.function.Constants; import jscl.math.function.Constants;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.solovyev.common.JPredicate;
import org.solovyev.common.StartsWithFinder; import org.solovyev.common.StartsWithFinder;
import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.CalculatorEngine;
import org.solovyev.android.calculator.model.CalculatorParseException; import org.solovyev.android.calculator.model.CalculatorParseException;
import org.solovyev.common.utils.CollectionsUtils; import org.solovyev.common.collections.CollectionsUtils;
import org.solovyev.common.utils.Finder;
import java.util.*; 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; private int i;
@ -437,7 +437,7 @@ public enum MathType {
} }
@Override @Override
public boolean isFound(@Nullable String s) { public boolean apply(@Nullable String s) {
return targetString.subSequence(0, i).toString().endsWith(s); return targetString.subSequence(0, i).toString().endsWith(s);
} }

View File

@ -23,14 +23,13 @@ import org.solovyev.android.calculator.CalculatorModel;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.model.AndroidMathRegistry; import org.solovyev.android.calculator.model.AndroidMathRegistry;
import org.solovyev.android.menu.AMenuBuilder; import org.solovyev.android.menu.AMenuBuilder;
import org.solovyev.android.menu.AMenuItem;
import org.solovyev.android.menu.LabeledMenuItem; import org.solovyev.android.menu.LabeledMenuItem;
import org.solovyev.android.menu.MenuImpl; 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.math.MathEntity;
import org.solovyev.common.utils.EqualsTool; import org.solovyev.common.text.StringUtils;
import org.solovyev.common.utils.Filter;
import org.solovyev.common.utils.FilterRule;
import org.solovyev.common.utils.StringUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
@ -161,7 +160,7 @@ public abstract class AbstractMathEntityListActivity<T extends MathEntity> exten
return !isInCategory(t); return !isInCategory(t);
} }
}).filter(result.iterator()); }).filter(result.iterator());
return result; return result;
} }

View File

@ -15,9 +15,8 @@ import org.jetbrains.annotations.NotNull;
import org.solovyev.android.calculator.CalculatorModel; import org.solovyev.android.calculator.CalculatorModel;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.CalculatorEngine;
import org.solovyev.android.menu.AMenuItem;
import org.solovyev.android.menu.LabeledMenuItem; 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.ArrayList;
import java.util.Arrays; import java.util.Arrays;

View File

@ -8,9 +8,8 @@ import org.jetbrains.annotations.NotNull;
import org.solovyev.android.calculator.CalculatorModel; import org.solovyev.android.calculator.CalculatorModel;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.CalculatorEngine;
import org.solovyev.android.menu.AMenuItem;
import org.solovyev.android.menu.LabeledMenuItem; 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.ArrayList;
import java.util.Arrays; import java.util.Arrays;

View File

@ -27,9 +27,9 @@ import org.solovyev.android.calculator.math.MathType;
import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.CalculatorEngine;
import org.solovyev.android.calculator.model.Var; import org.solovyev.android.calculator.model.Var;
import org.solovyev.android.menu.LabeledMenuItem; import org.solovyev.android.menu.LabeledMenuItem;
import org.solovyev.common.utils.CollectionsUtils; import org.solovyev.common.JPredicate;
import org.solovyev.common.utils.Finder; import org.solovyev.common.collections.CollectionsUtils;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -165,9 +165,9 @@ public class CalculatorVarsActivity extends AbstractMathEntityListActivity<ICons
protected List<IConstant> getMathEntities() { protected List<IConstant> getMathEntities() {
final List<IConstant> result = new ArrayList<IConstant>(CalculatorEngine.instance.getVarsRegistry().getEntities()); final List<IConstant> result = new ArrayList<IConstant>(CalculatorEngine.instance.getVarsRegistry().getEntities());
CollectionsUtils.removeAll(result, new Finder<IConstant>() { CollectionsUtils.removeAll(result, new JPredicate<IConstant>() {
@Override @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); return var != null && CollectionsUtils.contains(var.getName(), MathType.INFINITY_JSCL, MathType.NAN);
} }
}); });

View File

@ -24,7 +24,7 @@ import org.solovyev.android.calculator.model.AndroidMathRegistry;
import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.CalculatorEngine;
import org.solovyev.android.calculator.model.MathEntityBuilder; import org.solovyev.android.calculator.model.MathEntityBuilder;
import org.solovyev.common.math.MathEntity; import org.solovyev.common.math.MathEntity;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
/** /**
* User: serso * User: serso

View File

@ -22,7 +22,7 @@ import org.solovyev.android.calculator.model.AndroidMathRegistry;
import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.CalculatorEngine;
import org.solovyev.android.calculator.model.MathEntityBuilder; import org.solovyev.android.calculator.model.MathEntityBuilder;
import org.solovyev.common.math.MathEntity; import org.solovyev.common.math.MathEntity;
import org.solovyev.common.utils.StringUtils; import org.solovyev.common.text.StringUtils;
/** /**
* User: serso * User: serso

Some files were not shown because too many files have changed in this diff Show More