copyright + code reformat

This commit is contained in:
Sergey Solovyev
2013-06-26 12:22:07 +04:00
parent 23d5441b99
commit 99e7471ebd
579 changed files with 14908 additions and 3680 deletions

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
@@ -9,8 +31,10 @@ import android.preference.PreferenceManager;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.history.CalculatorHistoryState;
import org.solovyev.android.calculator.view.AngleUnitsButton;
import org.solovyev.android.calculator.view.NumeralBasesButton;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
@@ -7,8 +29,10 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import jscl.NumeralBase;
import jscl.math.Generic;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.history.CalculatorHistoryState;
import org.solovyev.android.calculator.jscl.JsclOperation;
import org.solovyev.common.history.HistoryAction;

View File

@@ -1,8 +1,31 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Application;
import android.content.Context;
import android.text.ClipboardManager;
import javax.annotation.Nonnull;
/**

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
@@ -6,8 +28,10 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.view.VibratorContainer;
/**

View File

@@ -1,6 +1,29 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.util.Log;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

View File

@@ -1,10 +1,34 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Application;
import android.os.Handler;
import android.widget.Toast;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.Threads;
import org.solovyev.android.msg.AndroidMessage;
import org.solovyev.common.msg.Message;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Application;
@@ -5,7 +27,9 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import jscl.AngleUnit;
import jscl.NumeralBase;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
import org.solovyev.android.msg.AndroidMessage;
import org.solovyev.common.msg.MessageType;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import javax.annotation.Nonnull;

View File

@@ -1,8 +1,32 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
import jscl.NumeralBase;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.units.CalculatorNumeralBase;
import org.solovyev.android.view.drag.DirectionDragButton;
import org.solovyev.android.view.drag.DragDirection;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import javax.annotation.Nonnull;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import javax.annotation.Nonnull;

View File

@@ -1,6 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
@@ -23,8 +40,10 @@ import android.view.ViewConfiguration;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import org.solovyev.android.Activities;
import org.solovyev.android.Android;
import org.solovyev.android.Threads;
@@ -136,7 +155,7 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
if (!CalculatorApplication.isMonkeyRunner(context)) {
boolean dialogShown = false;
if(isWizardStarted(FIRST_TIME_WIZARD) && !isWizardFinished(FIRST_TIME_WIZARD)) {
if (isWizardStarted(FIRST_TIME_WIZARD) && !isWizardFinished(FIRST_TIME_WIZARD)) {
CalculatorWizardActivity.continueWizard(FIRST_TIME_WIZARD, context);
dialogShown = true;
} else {

View File

@@ -1,10 +1,34 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
@@ -14,10 +36,13 @@ import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.Activities;
import org.solovyev.android.Views;
import org.solovyev.android.sherlock.tabs.ActionBarFragmentTabListener;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
@@ -10,8 +32,11 @@ import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import jscl.math.Generic;
import org.solovyev.android.Android;
import org.solovyev.android.App;
import org.solovyev.android.calculator.about.CalculatorAboutActivity;
@@ -29,6 +54,7 @@ import org.solovyev.common.text.Strings;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
/**

View File

@@ -1,8 +1,31 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import javax.annotation.Nullable;
/**

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.content.Context;
@@ -9,10 +31,13 @@ import android.util.Log;
import net.robotmedia.billing.BillingController;
import net.robotmedia.billing.helper.DefaultBillingObserver;
import net.robotmedia.billing.model.BillingDB;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
import javax.annotation.Nonnull;
import org.solovyev.android.Android;
import org.solovyev.android.App;
import org.solovyev.android.ServiceLocator;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.content.Context;
@@ -8,9 +30,12 @@ import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.Android;
import org.solovyev.android.fragments.FragmentUtils;
import org.solovyev.common.msg.MessageType;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.content.SharedPreferences;
@@ -6,7 +28,9 @@ import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockFragment;
import javax.annotation.Nonnull;
/**

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
@@ -7,11 +29,14 @@ import android.preference.PreferenceManager;
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 javax.annotation.Nonnull;
import org.solovyev.android.menu.ActivityMenu;
import org.solovyev.android.menu.ListActivityMenu;
import org.solovyev.android.sherlock.menu.SherlockMenuHelper;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
@@ -5,7 +27,9 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockFragment;
import javax.annotation.Nonnull;
/**

View File

@@ -1,7 +1,31 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
/**

View File

@@ -1,9 +1,32 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.support.v4.app.Fragment;
@@ -5,9 +27,12 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.google.ads.AdView;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.ads.AdsController;
/**

View File

@@ -1,7 +1,31 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.support.v4.app.Fragment;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.about.CalculatorAboutFragment;
import org.solovyev.android.calculator.about.CalculatorReleaseNotesFragment;
import org.solovyev.android.calculator.help.CalculatorHelpFaqFragment;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.content.SharedPreferences;
@@ -6,9 +28,12 @@ import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockFragment;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
/**

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
@@ -5,7 +27,9 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockListFragment;
import javax.annotation.Nonnull;
/**

View File

@@ -1,10 +1,35 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
import android.content.Context;
import android.util.Log;
import com.actionbarsherlock.view.MenuItem;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.view.NumeralBaseConverterDialog;
import org.solovyev.android.menu.LabeledMenuItem;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2012. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.os.Bundle;

View File

@@ -1,13 +1,30 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.common.JPredicate;
/**

View File

@@ -1,12 +1,31 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.view.MotionEvent;
import javax.annotation.Nonnull;
import org.solovyev.android.view.drag.DirectionDragButton;
import org.solovyev.android.view.drag.DragButton;
import org.solovyev.android.view.drag.DragDirection;

View File

@@ -1,13 +1,31 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.view.MotionEvent;
import javax.annotation.Nonnull;
import org.solovyev.android.view.drag.DirectionDragButton;
import org.solovyev.android.view.drag.DragButton;
import org.solovyev.android.view.drag.DragDirection;

View File

@@ -1,9 +1,33 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator;
import android.app.Activity;
import android.content.SharedPreferences;
import jscl.NumeralBase;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
/**

View File

@@ -1,12 +1,31 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.about;
import android.os.Bundle;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorFragmentActivity;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.about;
@@ -10,6 +26,7 @@ import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;
import org.solovyev.android.calculator.CalculatorFragment;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.about;
@@ -12,7 +28,9 @@ import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;
import javax.annotation.Nonnull;
import org.solovyev.android.Android;
import org.solovyev.android.calculator.CalculatorApplication;
import org.solovyev.android.calculator.CalculatorFragment;

View File

@@ -1,6 +1,29 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.about;
import android.content.res.Resources;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.function;
import android.content.Context;
@@ -11,14 +33,18 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import jscl.math.Generic;
import jscl.math.function.Constant;
import jscl.math.function.CustomFunction;
import jscl.math.function.Function;
import jscl.math.function.IFunction;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.math.edit.CalculatorFunctionsActivity;
import org.solovyev.android.calculator.math.edit.CalculatorFunctionsFragment;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.function;
import android.view.View;
@@ -5,8 +27,10 @@ import android.widget.EditText;
import jscl.CustomFunctionCalculationException;
import jscl.math.function.Function;
import jscl.math.function.IFunction;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorFunctionsMathRegistry;
import org.solovyev.android.calculator.CalculatorMathRegistry;
import org.solovyev.android.calculator.Locator;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.function;
import android.content.Context;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.function;
import android.content.Context;
@@ -9,8 +31,10 @@ import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import jscl.text.MutableInt;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.R;
import java.util.ArrayList;

View File

@@ -1,13 +1,31 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.help;
import android.os.Bundle;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorFragmentActivity;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.help;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.help;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.help;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
@@ -19,10 +35,12 @@ import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.actionbarsherlock.app.SherlockListFragment;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.jscl.JsclOperation;
@@ -37,6 +55,7 @@ import org.solovyev.common.text.Strings;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
@@ -10,8 +26,10 @@ import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.Calculator;
import org.solovyev.android.calculator.CalculatorEventData;
import org.solovyev.android.calculator.CalculatorEventType;

View File

@@ -1,15 +1,34 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import static org.solovyev.android.calculator.CalculatorFragmentType.history;

View File

@@ -1,19 +1,37 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.CalculatorPreferences;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.R;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;

View File

@@ -1,12 +1,29 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.R;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
@@ -12,10 +28,12 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import org.solovyev.android.calculator.R;
import org.solovyev.common.text.Strings;
import javax.annotation.Nonnull;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@@ -79,7 +97,7 @@ public class HistoryArrayAdapter extends ArrayAdapter<CalculatorHistoryState> {
@Override
public void onClick(View view) {
final Context context = getContext();
if(context instanceof CalculatorHistoryActivity) {
if (context instanceof CalculatorHistoryActivity) {
final CalculatorHistoryActivity activity = (CalculatorHistoryActivity) context;
activity.getActivityHelper().selectTab(activity, saved_history);
}

View File

@@ -1,12 +1,29 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
import android.widget.ArrayAdapter;
import javax.annotation.Nonnull;
/**

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
@@ -16,7 +32,9 @@ import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.R;
import org.solovyev.android.menu.LabeledMenuItem;

View File

@@ -1,15 +1,33 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.history;
import android.widget.EditText;
import android.widget.TextView;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.Editor;
/**

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
@@ -9,9 +25,12 @@ package org.solovyev.android.calculator.math.edit;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.history.CalculatorHistoryActivity;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
@@ -11,14 +27,18 @@ import android.content.Context;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.ClipboardManager;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import jscl.math.function.Function;
import jscl.math.function.IFunction;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.function.FunctionEditDialogFragment;
import org.solovyev.android.menu.AMenuItem;

View File

@@ -1,15 +1,34 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.history.CalculatorHistoryActivity;

View File

@@ -1,10 +1,34 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
import android.app.Activity;
import android.content.Context;
import android.text.ClipboardManager;
import jscl.math.operator.Operator;
import javax.annotation.Nonnull;
import org.solovyev.android.calculator.CalculatorEventType;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.Locator;

View File

@@ -1,16 +1,35 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
import android.content.Intent;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.history.CalculatorHistoryActivity;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
@@ -9,13 +25,17 @@ package org.solovyev.android.calculator.math.edit;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import jscl.math.function.IConstant;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.math.MathType;
import org.solovyev.android.menu.AMenuItem;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
@@ -13,8 +29,10 @@ import android.view.View;
import android.widget.TextView;
import jscl.math.function.Function;
import jscl.math.function.IConstant;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorEventType;
import org.solovyev.android.calculator.CalculatorMathRegistry;
import org.solovyev.android.calculator.Locator;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
import android.os.Bundle;
@@ -12,8 +34,10 @@ import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Toast;
import jscl.math.function.IConstant;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.model.Var;
import org.solovyev.android.sherlock.AndroidSherlockUtils;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.math.edit;
@@ -12,8 +28,10 @@ import jscl.text.Identifier;
import jscl.text.MutableInt;
import jscl.text.ParseException;
import jscl.text.Parser;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorMathRegistry;
import org.solovyev.android.calculator.CalculatorVarsRegistry;
import org.solovyev.android.calculator.Locator;

View File

@@ -1,6 +1,29 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.matrix;
import android.os.Bundle;
import org.solovyev.android.calculator.CalculatorFragmentActivity;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;

View File

@@ -1,9 +1,33 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.matrix;
import android.os.Bundle;
import android.view.View;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorFragment;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.matrix;
import android.content.Context;
@@ -8,6 +30,7 @@ import android.widget.EditText;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.content.Context;
@@ -11,10 +33,12 @@ import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import org.solovyev.android.Android;
import org.solovyev.android.Threads;
import org.solovyev.android.calculator.*;
@@ -28,6 +52,7 @@ import org.solovyev.common.msg.MessageType;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -341,7 +366,7 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
}
private String getPicturesDirectory() {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
return Environment.DIRECTORY_PICTURES;
} else {
return "Pictures";

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import javax.annotation.Nonnull;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
@@ -8,9 +30,11 @@ import android.view.MotionEvent;
import android.view.View;
import android.widget.Scroller;
import android.widget.ZoomButtonsController;
import org.solovyev.common.math.Point2d;
import javax.annotation.Nonnull;
import java.text.DecimalFormat;
import java.util.Collections;
import java.util.List;
@@ -240,7 +264,7 @@ public class CalculatorGraph2dView extends View implements GraphView {
private void drawGraph(@Nonnull Canvas canvas) {
drawn = true;
if(adjustYAxis) {
if (adjustYAxis) {
adjustYAxis();
adjustYAxis = false;
}

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.content.Context;
@@ -7,10 +29,12 @@ import android.os.Build;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ZoomButtonsController;
import javax.annotation.Nonnull;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -249,7 +273,7 @@ public class CalculatorGraph3dView extends GLView implements GraphView {
}
/*if (fps.incFrame()) {
Calculator.log("f/s " + fps.getValue());
Calculator.log("f/s " + fps.getValue());
}*/
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

View File

@@ -1,7 +1,30 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.content.Intent;
import android.os.Bundle;
import org.solovyev.android.calculator.CalculatorFragmentActivity;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.R;

View File

@@ -1,9 +1,32 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import org.solovyev.android.calculator.R;
import javax.annotation.Nonnull;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.app.Activity;
@@ -10,9 +32,12 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.Spinner;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorFragment;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.Locator;

View File

@@ -1,10 +1,35 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.CalculatorListFragment;
import org.solovyev.android.calculator.Locator;

View File

@@ -1,7 +1,31 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
import org.solovyev.android.calculator.R;
/**

View File

@@ -1,11 +1,36 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.CalculatorFragment;
import org.solovyev.android.calculator.CalculatorFragmentType;
import org.solovyev.android.calculator.Locator;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
class FPS {

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
// This is a OpenGL ES 1.0 dynamic font rendering system. It loads actual font
// files, generates a font map (texture) from them, and allows rendering of
// text strings.
@@ -21,55 +43,55 @@ import javax.microedition.khronos.opengles.GL10;
public class GLText {
//--Constants--//
public final static int CHAR_START = 32; // First Character (ASCII Code)
public final static int CHAR_END = 126; // Last Character (ASCII Code)
public final static int CHAR_START = 32; // First Character (ASCII Code)
public final static int CHAR_END = 126; // Last Character (ASCII Code)
public final static int CHAR_CNT = (((CHAR_END - CHAR_START) + 1) + 1); // Character Count (Including Character to use for Unknown)
public final static int CHAR_NONE = 32; // Character to Use for Unknown (ASCII Code)
public final static int CHAR_NONE = 32; // Character to Use for Unknown (ASCII Code)
public final static int CHAR_UNKNOWN = (CHAR_CNT - 1); // Index of the Unknown Character
public final static int FONT_SIZE_MIN = 6; // Minumum Font Size (Pixels)
public final static int FONT_SIZE_MAX = 180; // Maximum Font Size (Pixels)
public final static int FONT_SIZE_MIN = 6; // Minumum Font Size (Pixels)
public final static int FONT_SIZE_MAX = 180; // Maximum Font Size (Pixels)
public final static int CHAR_BATCH_SIZE = 100; // Number of Characters to Render Per Batch
public final static int CHAR_BATCH_SIZE = 100; // Number of Characters to Render Per Batch
//--Members--//
GL10 gl; // GL10 Instance
AssetManager assets; // Asset Manager
SpriteBatch batch; // Batch Renderer
GL10 gl; // GL10 Instance
AssetManager assets; // Asset Manager
SpriteBatch batch; // Batch Renderer
int fontPadX, fontPadY; // Font Padding (Pixels; On Each Side, ie. Doubled on Both X+Y Axis)
int fontPadX, fontPadY; // Font Padding (Pixels; On Each Side, ie. Doubled on Both X+Y Axis)
float fontHeight; // Font Height (Actual; Pixels)
float fontAscent; // Font Ascent (Above Baseline; Pixels)
float fontDescent; // Font Descent (Below Baseline; Pixels)
float fontHeight; // Font Height (Actual; Pixels)
float fontAscent; // Font Ascent (Above Baseline; Pixels)
float fontDescent; // Font Descent (Below Baseline; Pixels)
int textureId; // Font Texture ID [NOTE: Public for Testing Purposes Only!]
int textureSize; // Texture Size for Font (Square) [NOTE: Public for Testing Purposes Only!]
TextureRegion textureRgn; // Full Texture Region
int textureId; // Font Texture ID [NOTE: Public for Testing Purposes Only!]
int textureSize; // Texture Size for Font (Square) [NOTE: Public for Testing Purposes Only!]
TextureRegion textureRgn; // Full Texture Region
float charWidthMax; // Character Width (Maximum; Pixels)
float charHeight; // Character Height (Maximum; Pixels)
final float[] charWidths; // Width of Each Character (Actual; Pixels)
TextureRegion[] charRgn; // Region of Each Character (Texture Coordinates)
int cellWidth, cellHeight; // Character Cell Width/Height
int rowCnt, colCnt; // Number of Rows/Columns
float charWidthMax; // Character Width (Maximum; Pixels)
float charHeight; // Character Height (Maximum; Pixels)
final float[] charWidths; // Width of Each Character (Actual; Pixels)
TextureRegion[] charRgn; // Region of Each Character (Texture Coordinates)
int cellWidth, cellHeight; // Character Cell Width/Height
int rowCnt, colCnt; // Number of Rows/Columns
float scaleX, scaleY; // Font Scale (X,Y Axis)
float spaceX; // Additional (X,Y Axis) Spacing (Unscaled)
float scaleX, scaleY; // Font Scale (X,Y Axis)
float spaceX; // Additional (X,Y Axis) Spacing (Unscaled)
//--Constructor--//
// D: save GL instance + asset manager, create arrays, and initialize the members
// A: gl - OpenGL ES 10 Instance
public GLText(GL10 gl, AssetManager assets) {
this.gl = gl; // Save the GL10 Instance
this.assets = assets; // Save the Asset Manager Instance
this.gl = gl; // Save the GL10 Instance
this.assets = assets; // Save the Asset Manager Instance
batch = new SpriteBatch(gl, CHAR_BATCH_SIZE); // Create Sprite Batch (with Defined Size)
charWidths = new float[CHAR_CNT]; // Create the Array of Character Widths
charRgn = new TextureRegion[CHAR_CNT]; // Create the Array of Character Regions
charWidths = new float[CHAR_CNT]; // Create the Array of Character Widths
charRgn = new TextureRegion[CHAR_CNT]; // Create the Array of Character Regions
// initialize remaining members
fontPadX = 0;
@@ -90,8 +112,8 @@ public class GLText {
rowCnt = 0;
colCnt = 0;
scaleX = 1.0f; // Default Scale = 1 (Unscaled)
scaleY = 1.0f; // Default Scale = 1 (Unscaled)
scaleX = 1.0f; // Default Scale = 1 (Unscaled)
scaleY = 1.0f; // Default Scale = 1 (Unscaled)
spaceX = 0.0f;
}
@@ -106,16 +128,16 @@ public class GLText {
public boolean load(String file, int size, int padX, int padY) {
// setup requested values
fontPadX = padX; // Set Requested X Axis Padding
fontPadY = padY; // Set Requested Y Axis Padding
fontPadX = padX; // Set Requested X Axis Padding
fontPadY = padY; // Set Requested Y Axis Padding
// load the font and setup paint instance for drawing
Typeface tf = Typeface.createFromAsset(assets, file); // Create the Typeface from Font File
Paint paint = new Paint(); // Create Android Paint Instance
paint.setAntiAlias(true); // Enable Anti Alias
paint.setTextSize(size); // Set Text Size
paint.setColor(0xffffffff); // Set ARGB (White, Opaque)
paint.setTypeface(tf); // Set Typeface
Paint paint = new Paint(); // Create Android Paint Instance
paint.setAntiAlias(true); // Enable Anti Alias
paint.setTextSize(size); // Set Text Size
paint.setColor(0xffffffff); // Set ARGB (White, Opaque)
paint.setTypeface(tf); // Set Typeface
// get font metrics
Paint.FontMetrics fm = paint.getFontMetrics(); // Get Font Metrics
@@ -125,76 +147,76 @@ public class GLText {
// determine the width of each character (including unknown character)
// also determine the maximum character width
char[] s = new char[2]; // Create Character Array
charWidthMax = charHeight = 0; // Reset Character Width/Height Maximums
float[] w = new float[2]; // Working Width Value
int cnt = 0; // Array Counter
char[] s = new char[2]; // Create Character Array
charWidthMax = charHeight = 0; // Reset Character Width/Height Maximums
float[] w = new float[2]; // Working Width Value
int cnt = 0; // Array Counter
for (char c = CHAR_START; c <= CHAR_END; c++) { // FOR Each Character
s[0] = c; // Set Character
paint.getTextWidths(s, 0, 1, w); // Get Character Bounds
charWidths[cnt] = w[0]; // Get Width
if (charWidths[cnt] > charWidthMax) // IF Width Larger Than Max Width
charWidthMax = charWidths[cnt]; // Save New Max Width
cnt++; // Advance Array Counter
s[0] = c; // Set Character
paint.getTextWidths(s, 0, 1, w); // Get Character Bounds
charWidths[cnt] = w[0]; // Get Width
if (charWidths[cnt] > charWidthMax) // IF Width Larger Than Max Width
charWidthMax = charWidths[cnt]; // Save New Max Width
cnt++; // Advance Array Counter
}
s[0] = CHAR_NONE; // Set Unknown Character
paint.getTextWidths(s, 0, 1, w); // Get Character Bounds
charWidths[cnt] = w[0]; // Get Width
if (charWidths[cnt] > charWidthMax) // IF Width Larger Than Max Width
charWidthMax = charWidths[cnt]; // Save New Max Width
cnt++; // Advance Array Counter
s[0] = CHAR_NONE; // Set Unknown Character
paint.getTextWidths(s, 0, 1, w); // Get Character Bounds
charWidths[cnt] = w[0]; // Get Width
if (charWidths[cnt] > charWidthMax) // IF Width Larger Than Max Width
charWidthMax = charWidths[cnt]; // Save New Max Width
cnt++; // Advance Array Counter
// set character height to font height
charHeight = fontHeight; // Set Character Height
charHeight = fontHeight; // Set Character Height
// find the maximum size, validate, and setup cell sizes
cellWidth = (int) charWidthMax + (2 * fontPadX); // Set Cell Width
cellHeight = (int) charHeight + (2 * fontPadY); // Set Cell Height
int maxSize = cellWidth > cellHeight ? cellWidth : cellHeight; // Save Max Size (Width/Height)
if (maxSize < FONT_SIZE_MIN || maxSize > FONT_SIZE_MAX) // IF Maximum Size Outside Valid Bounds
return false; // Return Error
return false; // Return Error
// set texture size based on max font size (width or height)
// NOTE: these values are fixed, based on the defined characters. when
// changing start/end characters (CHAR_START/CHAR_END) this will need adjustment too!
if (maxSize <= 24) // IF Max Size is 18 or Less
textureSize = 256; // Set 256 Texture Size
else if (maxSize <= 40) // ELSE IF Max Size is 40 or Less
textureSize = 512; // Set 512 Texture Size
else if (maxSize <= 80) // ELSE IF Max Size is 80 or Less
textureSize = 1024; // Set 1024 Texture Size
else // ELSE IF Max Size is Larger Than 80 (and Less than FONT_SIZE_MAX)
textureSize = 2048; // Set 2048 Texture Size
if (maxSize <= 24) // IF Max Size is 18 or Less
textureSize = 256; // Set 256 Texture Size
else if (maxSize <= 40) // ELSE IF Max Size is 40 or Less
textureSize = 512; // Set 512 Texture Size
else if (maxSize <= 80) // ELSE IF Max Size is 80 or Less
textureSize = 1024; // Set 1024 Texture Size
else // ELSE IF Max Size is Larger Than 80 (and Less than FONT_SIZE_MAX)
textureSize = 2048; // Set 2048 Texture Size
// create an empty bitmap (alpha only)
Bitmap bitmap = Bitmap.createBitmap(textureSize, textureSize, Bitmap.Config.ALPHA_8); // Create Bitmap
Canvas canvas = new Canvas(bitmap); // Create Canvas for Rendering to Bitmap
bitmap.eraseColor(0x00000000); // Set Transparent Background (ARGB)
Canvas canvas = new Canvas(bitmap); // Create Canvas for Rendering to Bitmap
bitmap.eraseColor(0x00000000); // Set Transparent Background (ARGB)
// calculate rows/columns
// NOTE: while not required for anything, these may be useful to have :)
colCnt = textureSize / cellWidth; // Calculate Number of Columns
colCnt = textureSize / cellWidth; // Calculate Number of Columns
rowCnt = (int) Math.ceil((float) CHAR_CNT / (float) colCnt); // Calculate Number of Rows
// render each of the characters to the canvas (ie. build the font map)
float x = fontPadX; // Set Start Position (X)
float x = fontPadX; // Set Start Position (X)
float y = (cellHeight - 1) - fontDescent - fontPadY; // Set Start Position (Y)
for (char c = CHAR_START; c <= CHAR_END; c++) { // FOR Each Character
s[0] = c; // Set Character to Draw
canvas.drawText(s, 0, 1, x, y, paint); // Draw Character
x += cellWidth; // Move to Next Character
s[0] = c; // Set Character to Draw
canvas.drawText(s, 0, 1, x, y, paint); // Draw Character
x += cellWidth; // Move to Next Character
if ((x + cellWidth - fontPadX) > textureSize) { // IF End of Line Reached
x = fontPadX; // Set X for New Row
y += cellHeight; // Move Down a Row
x = fontPadX; // Set X for New Row
y += cellHeight; // Move Down a Row
}
}
s[0] = CHAR_NONE; // Set Character to Use for NONE
canvas.drawText(s, 0, 1, x, y, paint); // Draw Character
s[0] = CHAR_NONE; // Set Character to Use for NONE
canvas.drawText(s, 0, 1, x, y, paint); // Draw Character
// generate a new texture
int[] textureIds = new int[1]; // Array to Get Texture Id
gl.glGenTextures(1, textureIds, 0); // Generate New Texture
textureId = textureIds[0]; // Save Texture Id
int[] textureIds = new int[1]; // Array to Get Texture Id
gl.glGenTextures(1, textureIds, 0); // Generate New Texture
textureId = textureIds[0]; // Save Texture Id
// setup filters for texture
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId); // Bind Texture
@@ -205,20 +227,20 @@ public class GLText {
// load the generated bitmap onto the texture
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); // Load Bitmap to Texture
gl.glBindTexture(GL10.GL_TEXTURE_2D, 0); // Unbind Texture
gl.glBindTexture(GL10.GL_TEXTURE_2D, 0); // Unbind Texture
// release the bitmap
bitmap.recycle(); // Release the Bitmap
bitmap.recycle(); // Release the Bitmap
// setup the array of character texture regions
x = 0; // Initialize X
y = 0; // Initialize Y
for (int c = 0; c < CHAR_CNT; c++) { // FOR Each Character (On Texture)
x = 0; // Initialize X
y = 0; // Initialize Y
for (int c = 0; c < CHAR_CNT; c++) { // FOR Each Character (On Texture)
charRgn[c] = new TextureRegion(textureSize, textureSize, x, y, cellWidth - 1, cellHeight - 1); // Create Region for Character
x += cellWidth; // Move to Next Char (Cell)
x += cellWidth; // Move to Next Char (Cell)
if (x + cellWidth > textureSize) {
x = 0; // Reset X Position to Start
y += cellHeight; // Move to Next Row (Cell)
x = 0; // Reset X Position to Start
y += cellHeight; // Move to Next Row (Cell)
}
}
@@ -226,7 +248,7 @@ public class GLText {
textureRgn = new TextureRegion(textureSize, textureSize, 0, 0, textureSize, textureSize); // Create Full Texture Region
// return success
return true; // Return Success
return true; // Return Success
}
//--Begin/End Text Drawing--//
@@ -236,22 +258,22 @@ public class GLText {
// alpha - optional alpha value for font (default = 1.0)
// R: [none]
public void begin() {
begin(1.0f, 1.0f, 1.0f, 1.0f); // Begin with White Opaque
begin(1.0f, 1.0f, 1.0f, 1.0f); // Begin with White Opaque
}
public void begin(float alpha) {
begin(1.0f, 1.0f, 1.0f, alpha); // Begin with White (Explicit Alpha)
begin(1.0f, 1.0f, 1.0f, alpha); // Begin with White (Explicit Alpha)
}
public void begin(float red, float green, float blue, float alpha) {
gl.glColor4f(red, green, blue, alpha); // Set Color+Alpha
gl.glColor4f(red, green, blue, alpha); // Set Color+Alpha
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId); // Bind the Texture
batch.beginBatch(); // Begin Batch
batch.beginBatch(); // Begin Batch
}
public void end() {
batch.endBatch(); // End Batch
gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // Restore Default Color/Alpha
batch.endBatch(); // End Batch
gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // Restore Default Color/Alpha
}
//--Draw Text--//
@@ -260,17 +282,17 @@ public class GLText {
// x, y - the x,y position to draw text at (bottom left of text; including descent)
// R: [none]
public void draw(String text, float x, float y) {
float chrHeight = cellHeight * scaleY; // Calculate Scaled Character Height
float chrWidth = cellWidth * scaleX; // Calculate Scaled Character Width
int len = text.length(); // Get String Length
float chrHeight = cellHeight * scaleY; // Calculate Scaled Character Height
float chrWidth = cellWidth * scaleX; // Calculate Scaled Character Width
int len = text.length(); // Get String Length
x += (chrWidth / 2.0f) - (fontPadX * scaleX); // Adjust Start X
y += (chrHeight / 2.0f) - (fontPadY * scaleY); // Adjust Start Y
for (int i = 0; i < len; i++) { // FOR Each Character in String
for (int i = 0; i < len; i++) { // FOR Each Character in String
int c = (int) text.charAt(i) - CHAR_START; // Calculate Character Index (Offset by First Char in Font)
if (c < 0 || c >= CHAR_CNT) // IF Character Not In Font
c = CHAR_UNKNOWN; // Set to Unknown Character Index
if (c < 0 || c >= CHAR_CNT) // IF Character Not In Font
c = CHAR_UNKNOWN; // Set to Unknown Character Index
batch.drawSprite(x, y, chrWidth, chrHeight, charRgn[c]); // Draw the Character
x += (charWidths[c] + spaceX) * scaleX; // Advance X Position by Scaled Character Width
x += (charWidths[c] + spaceX) * scaleX; // Advance X Position by Scaled Character Width
}
}
@@ -280,15 +302,15 @@ public class GLText {
// x, y - the x,y position to draw text at (bottom left of text)
// R: the total width of the text that was drawn
public float drawC(String text, float x, float y) {
float len = getLength(text); // Get Text Length
float len = getLength(text); // Get Text Length
draw(text, x - (len / 2.0f), y - (getCharHeight() / 2.0f)); // Draw Text Centered
return len; // Return Length
return len; // Return Length
}
public float drawCX(String text, float x, float y) {
float len = getLength(text); // Get Text Length
draw(text, x - (len / 2.0f), y); // Draw Text Centered (X-Axis Only)
return len; // Return Length
float len = getLength(text); // Get Text Length
draw(text, x - (len / 2.0f), y); // Draw Text Centered (X-Axis Only)
return len; // Return Length
}
public void drawCY(String text, float x, float y) {
@@ -301,12 +323,12 @@ public class GLText {
// sx, sy - separate x and y axis scaling factors
// R: [none]
public void setScale(float scale) {
scaleX = scaleY = scale; // Set Uniform Scale
scaleX = scaleY = scale; // Set Uniform Scale
}
public void setScale(float sx, float sy) {
scaleX = sx; // Set X Scale
scaleY = sy; // Set Y Scale
scaleX = sx; // Set X Scale
scaleY = sy; // Set Y Scale
}
//--Get Scale--//
@@ -314,11 +336,11 @@ public class GLText {
// A: [none]
// R: the x/y scale currently used for scale
public float getScaleX() {
return scaleX; // Return X Scale
return scaleX; // Return X Scale
}
public float getScaleY() {
return scaleY; // Return Y Scale
return scaleY; // Return Y Scale
}
//--Set Space--//
@@ -326,7 +348,7 @@ public class GLText {
// A: space - space for x axis spacing
// R: [none]
public void setSpace(float space) {
spaceX = space; // Set Space
spaceX = space; // Set Space
}
//--Get Space--//
@@ -334,7 +356,7 @@ public class GLText {
// A: [none]
// R: the x/y space currently used for scale
public float getSpace() {
return spaceX; // Return X Space
return spaceX; // Return X Space
}
//--Get Length of a String--//
@@ -342,14 +364,14 @@ public class GLText {
// A: text - the string to get length for
// R: the length of the specified string (pixels)
public float getLength(String text) {
float len = 0.0f; // Working Length
int strLen = text.length(); // Get String Length (Characters)
for (int i = 0; i < strLen; i++) { // For Each Character in String (Except Last
float len = 0.0f; // Working Length
int strLen = text.length(); // Get String Length (Characters)
for (int i = 0; i < strLen; i++) { // For Each Character in String (Except Last
int c = (int) text.charAt(i) - CHAR_START; // Calculate Character Index (Offset by First Char in Font)
len += (charWidths[c] * scaleX); // Add Scaled Character Width to Total Length
len += (charWidths[c] * scaleX); // Add Scaled Character Width to Total Length
}
len += (strLen > 1 ? ((strLen - 1) * spaceX) * scaleX : 0); // Add Space Length
return len; // Return Total Length
return len; // Return Total Length
}
//--Get Width/Height of Character--//
@@ -359,16 +381,16 @@ public class GLText {
// A: chr - the character to get width for
// R: the requested character size (scaled)
public float getCharWidth(char chr) {
int c = chr - CHAR_START; // Calculate Character Index (Offset by First Char in Font)
return (charWidths[c] * scaleX); // Return Scaled Character Width
int c = chr - CHAR_START; // Calculate Character Index (Offset by First Char in Font)
return (charWidths[c] * scaleX); // Return Scaled Character Width
}
public float getCharWidthMax() {
return (charWidthMax * scaleX); // Return Scaled Max Character Width
return (charWidthMax * scaleX); // Return Scaled Max Character Width
}
public float getCharHeight() {
return (charHeight * scaleY); // Return Scaled Character Height
return (charHeight * scaleY); // Return Scaled Character Height
}
//--Get Font Metrics--//
@@ -376,15 +398,15 @@ public class GLText {
// A: [none]
// R: the requested font metric (scaled)
public float getAscent() {
return (fontAscent * scaleY); // Return Font Ascent
return (fontAscent * scaleY); // Return Font Ascent
}
public float getDescent() {
return (fontDescent * scaleY); // Return Font Descent
return (fontDescent * scaleY); // Return Font Descent
}
public float getHeight() {
return (fontHeight * scaleY); // Return Font Height (Actual)
return (fontHeight * scaleY); // Return Font Height (Actual)
}
//--Draw Font Texture--//
@@ -392,9 +414,9 @@ public class GLText {
// A: width, height - the width and height of the area to draw to. this is used
// to draw the texture to the top-left corner.
public void drawTexture(int width, int height) {
batch.beginBatch(textureId); // Begin Batch (Bind Texture)
batch.beginBatch(textureId); // Begin Batch (Bind Texture)
batch.drawSprite(textureSize / 2, height - (textureSize / 2), textureSize, textureSize, textureRgn); // Draw
batch.endBatch(); // End Batch
batch.endBatch(); // End Batch
}

View File

@@ -1,4 +1,24 @@
// Copyright (C) 2009 Mihai Preda
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
@@ -10,11 +30,13 @@ import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import javax.annotation.Nonnull;
import javax.microedition.khronos.egl.*;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ShortBuffer;

View File

@@ -1,7 +1,31 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.view.View;
import javax.annotation.Nonnull;
import org.solovyev.common.math.Point2d;
/**

View File

@@ -1,12 +1,34 @@
// Copyright (C) 2009-2010 Mihai Preda
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.graphics.Color;
import javax.annotation.Nonnull;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import javax.annotation.Nonnull;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import javax.annotation.Nonnull;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import javax.annotation.Nonnull;

View File

@@ -1,7 +1,30 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.graphics.Bitmap;
import android.widget.ZoomButtonsController;
import javax.annotation.Nonnull;
import java.util.List;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import javax.annotation.Nonnull;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import javax.annotation.Nonnull;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.content.Context;
@@ -6,6 +28,7 @@ import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.TextView;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.R;
import org.solovyev.android.list.ListItem;

View File

@@ -1,6 +1,29 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.graphics.Color;
import javax.annotation.Nonnull;
/**

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import javax.microedition.khronos.opengles.GL10;
@@ -5,42 +27,42 @@ import javax.microedition.khronos.opengles.GL10;
public class SpriteBatch {
//--Constants--//
final static int VERTEX_SIZE = 4; // Vertex Size (in Components) ie. (X,Y,U,V)
final static int VERTICES_PER_SPRITE = 4; // Vertices Per Sprite
final static int INDICES_PER_SPRITE = 6; // Indices Per Sprite
final static int VERTEX_SIZE = 4; // Vertex Size (in Components) ie. (X,Y,U,V)
final static int VERTICES_PER_SPRITE = 4; // Vertices Per Sprite
final static int INDICES_PER_SPRITE = 6; // Indices Per Sprite
//--Members--//
GL10 gl; // GL Instance
Vertices vertices; // Vertices Instance Used for Rendering
float[] vertexBuffer; // Vertex Buffer
int bufferIndex; // Vertex Buffer Start Index
int maxSprites; // Maximum Sprites Allowed in Buffer
int numSprites; // Number of Sprites Currently in Buffer
GL10 gl; // GL Instance
Vertices vertices; // Vertices Instance Used for Rendering
float[] vertexBuffer; // Vertex Buffer
int bufferIndex; // Vertex Buffer Start Index
int maxSprites; // Maximum Sprites Allowed in Buffer
int numSprites; // Number of Sprites Currently in Buffer
//--Constructor--//
// D: prepare the sprite batcher for specified maximum number of sprites
// A: gl - the gl instance to use for rendering
// maxSprites - the maximum allowed sprites per batch
public SpriteBatch(GL10 gl, int maxSprites) {
this.gl = gl; // Save GL Instance
this.gl = gl; // Save GL Instance
this.vertexBuffer = new float[maxSprites * VERTICES_PER_SPRITE * VERTEX_SIZE]; // Create Vertex Buffer
this.vertices = new Vertices(gl, maxSprites * VERTICES_PER_SPRITE, maxSprites * INDICES_PER_SPRITE, false, true, false); // Create Rendering Vertices
this.bufferIndex = 0; // Reset Buffer Index
this.maxSprites = maxSprites; // Save Maximum Sprites
this.numSprites = 0; // Clear Sprite Counter
this.bufferIndex = 0; // Reset Buffer Index
this.maxSprites = maxSprites; // Save Maximum Sprites
this.numSprites = 0; // Clear Sprite Counter
short[] indices = new short[maxSprites * INDICES_PER_SPRITE]; // Create Temp Index Buffer
int len = indices.length; // Get Index Buffer Length
short j = 0; // Counter
int len = indices.length; // Get Index Buffer Length
short j = 0; // Counter
for (int i = 0; i < len; i += INDICES_PER_SPRITE, j += VERTICES_PER_SPRITE) { // FOR Each Index Set (Per Sprite)
indices[i + 0] = (short) (j + 0); // Calculate Index 0
indices[i + 1] = (short) (j + 1); // Calculate Index 1
indices[i + 2] = (short) (j + 2); // Calculate Index 2
indices[i + 3] = (short) (j + 2); // Calculate Index 3
indices[i + 4] = (short) (j + 3); // Calculate Index 4
indices[i + 5] = (short) (j + 0); // Calculate Index 5
indices[i + 0] = (short) (j + 0); // Calculate Index 0
indices[i + 1] = (short) (j + 1); // Calculate Index 1
indices[i + 2] = (short) (j + 2); // Calculate Index 2
indices[i + 3] = (short) (j + 2); // Calculate Index 3
indices[i + 4] = (short) (j + 3); // Calculate Index 4
indices[i + 5] = (short) (j + 0); // Calculate Index 5
}
vertices.setIndices(indices, 0, len); // Set Index Buffer for Rendering
vertices.setIndices(indices, 0, len); // Set Index Buffer for Rendering
}
//--Begin Batch--//
@@ -50,13 +72,13 @@ public class SpriteBatch {
// R: [none]
public void beginBatch(int textureId) {
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId); // Bind the Texture
numSprites = 0; // Empty Sprite Counter
bufferIndex = 0; // Reset Buffer Index (Empty)
numSprites = 0; // Empty Sprite Counter
bufferIndex = 0; // Reset Buffer Index (Empty)
}
public void beginBatch() {
numSprites = 0; // Empty Sprite Counter
bufferIndex = 0; // Reset Buffer Index (Empty)
numSprites = 0; // Empty Sprite Counter
bufferIndex = 0; // Reset Buffer Index (Empty)
}
//--End Batch--//
@@ -64,11 +86,11 @@ public class SpriteBatch {
// A: [none]
// R: [none]
public void endBatch() {
if (numSprites > 0) { // IF Any Sprites to Render
if (numSprites > 0) { // IF Any Sprites to Render
vertices.setVertices(vertexBuffer, 0, bufferIndex); // Set Vertices from Buffer
vertices.bind(); // Bind Vertices
vertices.bind(); // Bind Vertices
vertices.draw(GL10.GL_TRIANGLES, 0, numSprites * INDICES_PER_SPRITE); // Render Batched Sprites
vertices.unbind(); // Unbind Vertices
vertices.unbind(); // Unbind Vertices
}
}
@@ -82,40 +104,40 @@ public class SpriteBatch {
// region - the texture region to use for sprite
// R: [none]
public void drawSprite(float x, float y, float width, float height, TextureRegion region) {
if (numSprites == maxSprites) { // IF Sprite Buffer is Full
endBatch(); // End Batch
if (numSprites == maxSprites) { // IF Sprite Buffer is Full
endBatch(); // End Batch
// NOTE: leave current texture bound!!
numSprites = 0; // Empty Sprite Counter
bufferIndex = 0; // Reset Buffer Index (Empty)
numSprites = 0; // Empty Sprite Counter
bufferIndex = 0; // Reset Buffer Index (Empty)
}
float halfWidth = width / 2.0f; // Calculate Half Width
float halfHeight = height / 2.0f; // Calculate Half Height
float x1 = x - halfWidth; // Calculate Left X
float y1 = y - halfHeight; // Calculate Bottom Y
float x2 = x + halfWidth; // Calculate Right X
float y2 = y + halfHeight; // Calculate Top Y
float halfWidth = width / 2.0f; // Calculate Half Width
float halfHeight = height / 2.0f; // Calculate Half Height
float x1 = x - halfWidth; // Calculate Left X
float y1 = y - halfHeight; // Calculate Bottom Y
float x2 = x + halfWidth; // Calculate Right X
float y2 = y + halfHeight; // Calculate Top Y
vertexBuffer[bufferIndex++] = x1; // Add X for Vertex 0
vertexBuffer[bufferIndex++] = y1; // Add Y for Vertex 0
vertexBuffer[bufferIndex++] = region.u1; // Add U for Vertex 0
vertexBuffer[bufferIndex++] = region.v2; // Add V for Vertex 0
vertexBuffer[bufferIndex++] = x1; // Add X for Vertex 0
vertexBuffer[bufferIndex++] = y1; // Add Y for Vertex 0
vertexBuffer[bufferIndex++] = region.u1; // Add U for Vertex 0
vertexBuffer[bufferIndex++] = region.v2; // Add V for Vertex 0
vertexBuffer[bufferIndex++] = x2; // Add X for Vertex 1
vertexBuffer[bufferIndex++] = y1; // Add Y for Vertex 1
vertexBuffer[bufferIndex++] = region.u2; // Add U for Vertex 1
vertexBuffer[bufferIndex++] = region.v2; // Add V for Vertex 1
vertexBuffer[bufferIndex++] = x2; // Add X for Vertex 1
vertexBuffer[bufferIndex++] = y1; // Add Y for Vertex 1
vertexBuffer[bufferIndex++] = region.u2; // Add U for Vertex 1
vertexBuffer[bufferIndex++] = region.v2; // Add V for Vertex 1
vertexBuffer[bufferIndex++] = x2; // Add X for Vertex 2
vertexBuffer[bufferIndex++] = y2; // Add Y for Vertex 2
vertexBuffer[bufferIndex++] = region.u2; // Add U for Vertex 2
vertexBuffer[bufferIndex++] = region.v1; // Add V for Vertex 2
vertexBuffer[bufferIndex++] = x2; // Add X for Vertex 2
vertexBuffer[bufferIndex++] = y2; // Add Y for Vertex 2
vertexBuffer[bufferIndex++] = region.u2; // Add U for Vertex 2
vertexBuffer[bufferIndex++] = region.v1; // Add V for Vertex 2
vertexBuffer[bufferIndex++] = x1; // Add X for Vertex 3
vertexBuffer[bufferIndex++] = y2; // Add Y for Vertex 3
vertexBuffer[bufferIndex++] = region.u1; // Add U for Vertex 3
vertexBuffer[bufferIndex++] = region.v1; // Add V for Vertex 3
vertexBuffer[bufferIndex++] = x1; // Add X for Vertex 3
vertexBuffer[bufferIndex++] = y2; // Add Y for Vertex 3
vertexBuffer[bufferIndex++] = region.u1; // Add U for Vertex 3
vertexBuffer[bufferIndex++] = region.v1; // Add V for Vertex 3
numSprites++; // Increment Sprite Count
numSprites++; // Increment Sprite Count
}
}

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
// This is based on the OpenGL ES 1.0 sample application from the Android Developer website:
// http://developer.android.com/resources/tutorials/opengl/opengl-es10.html
@@ -11,15 +33,15 @@ import javax.microedition.khronos.opengles.GL10;
public class TexampleRenderer implements GLSurfaceView.Renderer {
private GLText glText; // A GLText Instance
private Context context; // Context (from Activity)
private GLText glText; // A GLText Instance
private Context context; // Context (from Activity)
private int width = 100; // Updated to the Current Width + Height in onSurfaceChanged()
private int width = 100; // Updated to the Current Width + Height in onSurfaceChanged()
private int height = 100;
public TexampleRenderer(Context context) {
super();
this.context = context; // Save Specified Context
this.context = context; // Save Specified Context
}
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
@@ -39,51 +61,51 @@ public class TexampleRenderer implements GLSurfaceView.Renderer {
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
// Set to ModelView mode
gl.glMatrixMode(GL10.GL_MODELVIEW); // Activate Model View Matrix
gl.glLoadIdentity(); // Load Identity Matrix
gl.glMatrixMode(GL10.GL_MODELVIEW); // Activate Model View Matrix
gl.glLoadIdentity(); // Load Identity Matrix
// enable texture + alpha blending
// NOTE: this is required for text rendering! we could incorporate it into
// the GLText class, but then it would be called multiple times (which impacts performance).
gl.glEnable(GL10.GL_TEXTURE_2D); // Enable Texture Mapping
gl.glEnable(GL10.GL_BLEND); // Enable Alpha Blend
gl.glEnable(GL10.GL_TEXTURE_2D); // Enable Texture Mapping
gl.glEnable(GL10.GL_BLEND); // Enable Alpha Blend
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); // Set Alpha Blend Function
// TEST: render the entire font texture
gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // Set Color to Use
glText.drawTexture(width, height); // Draw the Entire Texture
gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // Set Color to Use
glText.drawTexture(width, height); // Draw the Entire Texture
// TEST: render some strings with the font
glText.begin(1.0f, 1.0f, 1.0f, 1.0f); // Begin Text Rendering (Set Color WHITE)
glText.draw("Test String :)", 0, 0); // Draw Test String
glText.draw("Line 1", 50, 50); // Draw Test String
glText.draw("Line 2", 100, 100); // Draw Test String
glText.end(); // End Text Rendering
glText.begin(1.0f, 1.0f, 1.0f, 1.0f); // Begin Text Rendering (Set Color WHITE)
glText.draw("Test String :)", 0, 0); // Draw Test String
glText.draw("Line 1", 50, 50); // Draw Test String
glText.draw("Line 2", 100, 100); // Draw Test String
glText.end(); // End Text Rendering
glText.begin(0.0f, 0.0f, 1.0f, 1.0f); // Begin Text Rendering (Set Color BLUE)
glText.draw("More Lines...", 50, 150); // Draw Test String
glText.begin(0.0f, 0.0f, 1.0f, 1.0f); // Begin Text Rendering (Set Color BLUE)
glText.draw("More Lines...", 50, 150); // Draw Test String
glText.draw("The End.", 50, 150 + glText.getCharHeight()); // Draw Test String
glText.end(); // End Text Rendering
glText.end(); // End Text Rendering
// disable texture + alpha
gl.glDisable(GL10.GL_BLEND); // Disable Alpha Blend
gl.glDisable(GL10.GL_TEXTURE_2D); // Disable Texture Mapping
gl.glDisable(GL10.GL_BLEND); // Disable Alpha Blend
gl.glDisable(GL10.GL_TEXTURE_2D); // Disable Texture Mapping
}
public void onSurfaceChanged(GL10 gl, int width, int height) {
gl.glViewport(0, 0, width, height);
// Setup orthographic projection
gl.glMatrixMode(GL10.GL_PROJECTION); // Activate Projection Matrix
gl.glLoadIdentity(); // Load Identity Matrix
gl.glOrthof( // Set Ortho Projection (Left,Right,Bottom,Top,Front,Back)
gl.glMatrixMode(GL10.GL_PROJECTION); // Activate Projection Matrix
gl.glLoadIdentity(); // Load Identity Matrix
gl.glOrthof( // Set Ortho Projection (Left,Right,Bottom,Top,Front,Back)
0, width,
0, height,
1.0f, -1.0f
);
// Save width and height
this.width = width; // Save Current Width
this.height = height; // Save Current Height
this.width = width; // Save Current Width
this.height = height; // Save Current Height
}
}

View File

@@ -1,10 +1,32 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
class TextureRegion {
//--Members--//
public float u1, v1; // Top/Left U,V Coordinates
public float u2, v2; // Bottom/Right U,V Coordinates
public float u1, v1; // Top/Left U,V Coordinates
public float u2, v2; // Bottom/Right U,V Coordinates
//--Constructor--//
// D: calculate U,V coordinates from specified texture coordinates
@@ -12,9 +34,9 @@ class TextureRegion {
// x, y - the top/left (x,y) of the region on the texture (in pixels)
// width, height - the width and height of the region on the texture (in pixels)
public TextureRegion(float texWidth, float texHeight, float x, float y, float width, float height) {
this.u1 = x / texWidth; // Calculate U1
this.v1 = y / texHeight; // Calculate V1
this.u2 = this.u1 + (width / texWidth); // Calculate U2
this.v2 = this.v1 + (height / texHeight); // Calculate V2
this.u1 = x / texWidth; // Calculate U1
this.v1 = y / texHeight; // Calculate V1
this.u2 = this.u1 + (width / texWidth); // Calculate U2
this.v2 = this.v1 + (height / texHeight); // Calculate V2
}
}

View File

@@ -1,10 +1,32 @@
// Copyright (C) 2009-2010 Mihai Preda
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import javax.annotation.Nonnull;
import org.solovyev.android.Views;
class TouchHandler {

View File

@@ -1,6 +1,29 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
import javax.microedition.khronos.opengles.GL10;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
@@ -9,28 +32,28 @@ import java.nio.ShortBuffer;
public class Vertices {
//--Constants--//
final static int POSITION_CNT_2D = 2; // Number of Components in Vertex Position for 2D
final static int POSITION_CNT_3D = 3; // Number of Components in Vertex Position for 3D
final static int COLOR_CNT = 4; // Number of Components in Vertex Color
final static int TEXCOORD_CNT = 2; // Number of Components in Vertex Texture Coords
final static int NORMAL_CNT = 3; // Number of Components in Vertex Normal
final static int POSITION_CNT_2D = 2; // Number of Components in Vertex Position for 2D
final static int POSITION_CNT_3D = 3; // Number of Components in Vertex Position for 3D
final static int COLOR_CNT = 4; // Number of Components in Vertex Color
final static int TEXCOORD_CNT = 2; // Number of Components in Vertex Texture Coords
final static int NORMAL_CNT = 3; // Number of Components in Vertex Normal
final static int INDEX_SIZE = Short.SIZE / 8; // Index Byte Size (Short.SIZE = bits)
final static int INDEX_SIZE = Short.SIZE / 8; // Index Byte Size (Short.SIZE = bits)
//--Members--//
// NOTE: all members are constant, and initialized in constructor!
final GL10 gl; // GL Instance
final boolean hasColor; // Use Color in Vertices
final boolean hasTexCoords; // Use Texture Coords in Vertices
final boolean hasNormals; // Use Normals in Vertices
public final int positionCnt; // Number of Position Components (2=2D, 3=3D)
public final int vertexStride; // Vertex Stride (Element Size of a Single Vertex)
public final int vertexSize; // Bytesize of a Single Vertex
final IntBuffer vertices; // Vertex Buffer
final ShortBuffer indices; // Index Buffer
public int numVertices; // Number of Vertices in Buffer
public int numIndices; // Number of Indices in Buffer
final int[] tmpBuffer; // Temp Buffer for Vertex Conversion
final GL10 gl; // GL Instance
final boolean hasColor; // Use Color in Vertices
final boolean hasTexCoords; // Use Texture Coords in Vertices
final boolean hasNormals; // Use Normals in Vertices
public final int positionCnt; // Number of Position Components (2=2D, 3=3D)
public final int vertexStride; // Vertex Stride (Element Size of a Single Vertex)
public final int vertexSize; // Bytesize of a Single Vertex
final IntBuffer vertices; // Vertex Buffer
final ShortBuffer indices; // Index Buffer
public int numVertices; // Number of Vertices in Buffer
public int numIndices; // Number of Indices in Buffer
final int[] tmpBuffer; // Temp Buffer for Vertex Conversion
//--Constructor--//
// D: create the vertices/indices as specified (for 2d/3d)
@@ -47,27 +70,27 @@ public class Vertices {
}
public Vertices(GL10 gl, int maxVertices, int maxIndices, boolean hasColor, boolean hasTexCoords, boolean hasNormals, boolean use3D) {
this.gl = gl; // Save GL Instance
this.hasColor = hasColor; // Save Color Flag
this.hasTexCoords = hasTexCoords; // Save Texture Coords Flag
this.hasNormals = hasNormals; // Save Normals Flag
this.gl = gl; // Save GL Instance
this.hasColor = hasColor; // Save Color Flag
this.hasTexCoords = hasTexCoords; // Save Texture Coords Flag
this.hasNormals = hasNormals; // Save Normals Flag
this.positionCnt = use3D ? POSITION_CNT_3D : POSITION_CNT_2D; // Set Position Component Count
this.vertexStride = this.positionCnt + (hasColor ? COLOR_CNT : 0) + (hasTexCoords ? TEXCOORD_CNT : 0) + (hasNormals ? NORMAL_CNT : 0); // Calculate Vertex Stride
this.vertexSize = this.vertexStride * 4; // Calculate Vertex Byte Size
this.vertexSize = this.vertexStride * 4; // Calculate Vertex Byte Size
ByteBuffer buffer = ByteBuffer.allocateDirect(maxVertices * vertexSize); // Allocate Buffer for Vertices (Max)
buffer.order(ByteOrder.nativeOrder()); // Set Native Byte Order
this.vertices = buffer.asIntBuffer(); // Save Vertex Buffer
buffer.order(ByteOrder.nativeOrder()); // Set Native Byte Order
this.vertices = buffer.asIntBuffer(); // Save Vertex Buffer
if (maxIndices > 0) { // IF Indices Required
if (maxIndices > 0) { // IF Indices Required
buffer = ByteBuffer.allocateDirect(maxIndices * INDEX_SIZE); // Allocate Buffer for Indices (MAX)
buffer.order(ByteOrder.nativeOrder()); // Set Native Byte Order
this.indices = buffer.asShortBuffer(); // Save Index Buffer
} else // ELSE Indices Not Required
indices = null; // No Index Buffer
buffer.order(ByteOrder.nativeOrder()); // Set Native Byte Order
this.indices = buffer.asShortBuffer(); // Save Index Buffer
} else // ELSE Indices Not Required
indices = null; // No Index Buffer
numVertices = 0; // Zero Vertices in Buffer
numIndices = 0; // Zero Indices in Buffer
numVertices = 0; // Zero Vertices in Buffer
numIndices = 0; // Zero Indices in Buffer
this.tmpBuffer = new int[maxVertices * vertexSize / 4]; // Create Temp Buffer
}
@@ -81,12 +104,12 @@ public class Vertices {
// for easy setting use: vtx_cnt * (this.vertexSize / 4)
// R: [none]
public void setVertices(float[] vertices, int offset, int length) {
this.vertices.clear(); // Remove Existing Vertices
int last = offset + length; // Calculate Last Element
this.vertices.clear(); // Remove Existing Vertices
int last = offset + length; // Calculate Last Element
for (int i = offset, j = 0; i < last; i++, j++) // FOR Each Specified Vertex
tmpBuffer[j] = Float.floatToRawIntBits(vertices[i]); // Set Vertex as Raw Integer Bits in Buffer
this.vertices.put(tmpBuffer, 0, length); // Set New Vertices
this.vertices.flip(); // Flip Vertex Buffer
this.vertices.put(tmpBuffer, 0, length); // Set New Vertices
this.vertices.flip(); // Flip Vertex Buffer
this.numVertices = length / this.vertexStride; // Save Number of Vertices
//this.numVertices = length / ( this.vertexSize / 4 ); // Save Number of Vertices
}
@@ -98,10 +121,10 @@ public class Vertices {
// length - number of indices in array (from offset)
// R: [none]
public void setIndices(short[] indices, int offset, int length) {
this.indices.clear(); // Clear Existing Indices
this.indices.put(indices, offset, length); // Set New Indices
this.indices.flip(); // Flip Index Buffer
this.numIndices = length; // Save Number of Indices
this.indices.clear(); // Clear Existing Indices
this.indices.put(indices, offset, length); // Set New Indices
this.indices.flip(); // Flip Index Buffer
this.numIndices = length; // Save Number of Indices
}
//--Bind--//
@@ -111,16 +134,16 @@ public class Vertices {
// R: [none]
public void bind() {
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); // Enable Position in Vertices
vertices.position(0); // Set Vertex Buffer to Position
vertices.position(0); // Set Vertex Buffer to Position
gl.glVertexPointer(positionCnt, GL10.GL_FLOAT, vertexSize, vertices); // Set Vertex Pointer
if (hasColor) { // IF Vertices Have Color
if (hasColor) { // IF Vertices Have Color
gl.glEnableClientState(GL10.GL_COLOR_ARRAY); // Enable Color in Vertices
vertices.position(positionCnt); // Set Vertex Buffer to Color
vertices.position(positionCnt); // Set Vertex Buffer to Color
gl.glColorPointer(COLOR_CNT, GL10.GL_FLOAT, vertexSize, vertices); // Set Color Pointer
}
if (hasTexCoords) { // IF Vertices Have Texture Coords
if (hasTexCoords) { // IF Vertices Have Texture Coords
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Enable Texture Coords in Vertices
vertices.position(positionCnt + (hasColor ? COLOR_CNT : 0)); // Set Vertex Buffer to Texture Coords (NOTE: position based on whether color is also specified)
gl.glTexCoordPointer(TEXCOORD_CNT, GL10.GL_FLOAT, vertexSize, vertices); // Set Texture Coords Pointer
@@ -141,10 +164,10 @@ public class Vertices {
// numVertices - the number of vertices (indices) to draw
// R: [none]
public void draw(int primitiveType, int offset, int numVertices) {
if (indices != null) { // IF Indices Exist
indices.position(offset); // Set Index Buffer to Specified Offset
if (indices != null) { // IF Indices Exist
indices.position(offset); // Set Index Buffer to Specified Offset
gl.glDrawElements(primitiveType, numVertices, GL10.GL_UNSIGNED_SHORT, indices); // Draw Indexed
} else { // ELSE No Indices Exist
} else { // ELSE No Indices Exist
gl.glDrawArrays(primitiveType, offset, numVertices); // Draw Direct (Array)
}
}
@@ -155,13 +178,13 @@ public class Vertices {
// A: [none]
// R: [none]
public void unbind() {
if (hasColor) // IF Vertices Have Color
if (hasColor) // IF Vertices Have Color
gl.glDisableClientState(GL10.GL_COLOR_ARRAY); // Clear Color State
if (hasTexCoords) // IF Vertices Have Texture Coords
if (hasTexCoords) // IF Vertices Have Texture Coords
gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Clear Texture Coords State
if (hasNormals) // IF Vertices Have Normals
if (hasNormals) // IF Vertices Have Normals
gl.glDisableClientState(GL10.GL_NORMAL_ARRAY); // Clear Normals State
}
@@ -174,32 +197,32 @@ public class Vertices {
// R: [none]
public void drawFull(int primitiveType, int offset, int numVertices) {
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); // Enable Position in Vertices
vertices.position(0); // Set Vertex Buffer to Position
vertices.position(0); // Set Vertex Buffer to Position
gl.glVertexPointer(positionCnt, GL10.GL_FLOAT, vertexSize, vertices); // Set Vertex Pointer
if (hasColor) { // IF Vertices Have Color
if (hasColor) { // IF Vertices Have Color
gl.glEnableClientState(GL10.GL_COLOR_ARRAY); // Enable Color in Vertices
vertices.position(positionCnt); // Set Vertex Buffer to Color
vertices.position(positionCnt); // Set Vertex Buffer to Color
gl.glColorPointer(COLOR_CNT, GL10.GL_FLOAT, vertexSize, vertices); // Set Color Pointer
}
if (hasTexCoords) { // IF Vertices Have Texture Coords
if (hasTexCoords) { // IF Vertices Have Texture Coords
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Enable Texture Coords in Vertices
vertices.position(positionCnt + (hasColor ? COLOR_CNT : 0)); // Set Vertex Buffer to Texture Coords (NOTE: position based on whether color is also specified)
gl.glTexCoordPointer(TEXCOORD_CNT, GL10.GL_FLOAT, vertexSize, vertices); // Set Texture Coords Pointer
}
if (indices != null) { // IF Indices Exist
indices.position(offset); // Set Index Buffer to Specified Offset
if (indices != null) { // IF Indices Exist
indices.position(offset); // Set Index Buffer to Specified Offset
gl.glDrawElements(primitiveType, numVertices, GL10.GL_UNSIGNED_SHORT, indices); // Draw Indexed
} else { // ELSE No Indices Exist
} else { // ELSE No Indices Exist
gl.glDrawArrays(primitiveType, offset, numVertices); // Draw Direct (Array)
}
if (hasTexCoords) // IF Vertices Have Texture Coords
if (hasTexCoords) // IF Vertices Have Texture Coords
gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Clear Texture Coords State
if (hasColor) // IF Vertices Have Color
if (hasColor) // IF Vertices Have Color
gl.glDisableClientState(GL10.GL_COLOR_ARRAY); // Clear Color State
}
@@ -213,13 +236,13 @@ public class Vertices {
// nx, ny, nz - the x,y,z normal to set in buffer
// R: [none]
void setVtxPosition(int vtxIdx, float x, float y) {
int index = vtxIdx * vertexStride; // Calculate Actual Index
int index = vtxIdx * vertexStride; // Calculate Actual Index
vertices.put(index + 0, Float.floatToRawIntBits(x)); // Set X
vertices.put(index + 1, Float.floatToRawIntBits(y)); // Set Y
}
void setVtxPosition(int vtxIdx, float x, float y, float z) {
int index = vtxIdx * vertexStride; // Calculate Actual Index
int index = vtxIdx * vertexStride; // Calculate Actual Index
vertices.put(index + 0, Float.floatToRawIntBits(x)); // Set X
vertices.put(index + 1, Float.floatToRawIntBits(y)); // Set Y
vertices.put(index + 2, Float.floatToRawIntBits(z)); // Set Z

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.plot;
class ZoomTracker {

View File

@@ -1,6 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.preferences;
@@ -14,13 +31,17 @@ import android.preference.Preference;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockPreferenceActivity;
import net.robotmedia.billing.BillingController;
import net.robotmedia.billing.IBillingObserver;
import net.robotmedia.billing.ResponseCode;
import net.robotmedia.billing.helper.AbstractBillingObserver;
import net.robotmedia.billing.model.Transaction;
import javax.annotation.Nonnull;
import org.solovyev.android.Activities;
import org.solovyev.android.App;
import org.solovyev.android.ads.AdsController;

View File

@@ -1,3 +1,25 @@
/*
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.preferences;
import android.app.Activity;
@@ -8,10 +30,14 @@ import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import net.robotmedia.billing.BillingController;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.ads.AdsController;
import org.solovyev.android.calculator.CalculatorApplication;
import org.solovyev.android.calculator.CalculatorFragment;

View File

@@ -1,7 +1,23 @@
/*
* Copyright (c) 2009-2011. Created by serso aka se.solovyev.
* For more information, please, contact se.solovyev@gmail.com
* or visit http://se.solovyev.org
* Copyright 2013 serso aka se.solovyev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Contact details
*
* Email: se.solovyev@gmail.com
* Site: http://se.solovyev.org
*/
package org.solovyev.android.calculator.view;
@@ -10,8 +26,10 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.util.AttributeSet;
import android.widget.TextView;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.solovyev.android.calculator.Locator;
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;

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