new plotter
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import android.app.Activity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/19/13
|
||||
* Time: 5:04 PM
|
||||
*/
|
||||
public final class Threads {
|
||||
|
||||
private Threads() {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
public static void tryRunOnUiThread(@Nullable final Activity activity, @NotNull final Runnable runnable) {
|
||||
if (activity != null && !activity.isFinishing()) {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// some time may pass and activity might be closing
|
||||
if (!activity.isFinishing()) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,7 +6,7 @@ import android.preference.PreferenceManager;
|
||||
import jscl.math.Generic;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.CalculatorPreferences;
|
||||
import org.solovyev.android.calculator.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -158,6 +158,11 @@ public class AndroidCalculatorPlotter implements CalculatorPlotter, SharedPrefer
|
||||
plotter.setPlotImag(plotImag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlotBoundaries(@NotNull PlotBoundaries plotBoundaries) {
|
||||
plotter.setPlotBoundaries(plotBoundaries);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
|
||||
if (CalculatorPreferences.Graph.plotImag.getKey().equals(key)) {
|
||||
|
Reference in New Issue
Block a user