Icons for plotter

This commit is contained in:
serso 2016-02-26 23:49:48 +01:00
parent 6d1357e15d
commit b1b2a76be8
22 changed files with 17 additions and 26 deletions

View File

@ -12,7 +12,6 @@ import android.support.v7.app.AlertDialog;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -20,19 +19,13 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import butterknife.Bind;
import org.solovyev.android.calculator.App; import butterknife.ButterKnife;
import org.solovyev.android.calculator.AppComponent; import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.BaseDialogFragment;
import org.solovyev.android.calculator.BaseFragment;
import org.solovyev.android.calculator.R;
import org.solovyev.android.plotter.Check; import org.solovyev.android.plotter.Check;
import org.solovyev.android.plotter.Plot; import org.solovyev.android.plotter.Plot;
import org.solovyev.android.plotter.Plotter; import org.solovyev.android.plotter.Plotter;
import butterknife.Bind;
import butterknife.ButterKnife;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.inject.Inject; import javax.inject.Inject;
@ -152,7 +145,7 @@ public class PlotDimensionsFragment extends BaseDialogFragment
@Override @Override
protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) {
builder.setTitle("Dimensions"); builder.setTitle("Dimensions");
builder.setPositiveButton(android.R.string.ok, null); builder.setPositiveButton(R.string.cpp_done, null);
} }
@NonNull @NonNull
@ -243,12 +236,12 @@ public class PlotDimensionsFragment extends BaseDialogFragment
final boolean nanRight = Float.isNaN(r); final boolean nanRight = Float.isNaN(r);
if (nanLeft || nanRight) { if (nanLeft || nanRight) {
if (nanLeft) { if (nanLeft) {
setError(lInput, " "); setError(lInput, R.string.cpp_nan);
} else { } else {
clearError(lInput); clearError(lInput);
} }
if (nanRight) { if (nanRight) {
setError(rInput, " "); setError(rInput, R.string.cpp_nan);
} else { } else {
clearError(rInput); clearError(rInput);
} }
@ -259,8 +252,7 @@ public class PlotDimensionsFragment extends BaseDialogFragment
@NonNull @NonNull
private RectF collectData() { private RectF collectData() {
return new RectF(getDimension(xMin), getDimension(yMin), getDimension(xMax), return new RectF(getDimension(xMin), getDimension(yMin), getDimension(xMax), getDimension(yMax));
getDimension(yMax));
} }
private void applyData() { private void applyData() {
@ -272,7 +264,6 @@ public class PlotDimensionsFragment extends BaseDialogFragment
try { try {
return Float.parseFloat(view.getText().toString().replace(",", ".").replace("", "-")); return Float.parseFloat(view.getText().toString().replace(",", ".").replace("", "-"));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
Log.w(Plot.getTag("MainActivity"), e.getMessage(), e);
return Float.NaN; return Float.NaN;
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

View File

@ -16,11 +16,11 @@
a:layout_gravity="top|start" a:layout_gravity="top|start"
a:src="@drawable/ic_straighten_white_24dp" /> a:src="@drawable/ic_straighten_white_24dp" />
<org.solovyev.android.material.MaterialButton <org.solovyev.android.material.MaterialImageButton
a:id="@id/plot_3d_button" a:id="@id/plot_3d_button"
style="@style/CppPlotButton" style="@style/CppPlotButton"
a:layout_gravity="top|end" a:layout_gravity="top|end"
a:text="@string/cpp_plot_3d" /> a:src="@drawable/ic_3d_rotation_white_24dp" />
<LinearLayout <LinearLayout
a:layout_width="wrap_content" a:layout_width="wrap_content"
@ -28,10 +28,10 @@
a:layout_gravity="bottom|start" a:layout_gravity="bottom|start"
a:orientation="vertical"> a:orientation="vertical">
<org.solovyev.android.material.MaterialButton <org.solovyev.android.material.MaterialImageButton
a:id="@+id/plot_add_function" a:id="@+id/plot_add_function"
style="@style/CppPlotButton" style="@style/CppPlotButton"
a:text="@string/cpp_plot_add_function" /> a:src="@drawable/ic_add_white_24dp" />
<org.solovyev.android.material.MaterialImageButton <org.solovyev.android.material.MaterialImageButton
a:id="@+id/plot_functions" a:id="@+id/plot_functions"
@ -45,20 +45,20 @@
a:layout_gravity="bottom|end" a:layout_gravity="bottom|end"
a:orientation="vertical"> a:orientation="vertical">
<org.solovyev.android.material.MaterialButton <org.solovyev.android.material.MaterialImageButton
a:id="@id/plot_zoom_in_button" a:id="@id/plot_zoom_in_button"
style="@style/CppPlotButton" style="@style/CppPlotButton"
a:text="@string/cpp_plot_zoom_in" /> a:src="@drawable/ic_zoom_in_white_24dp" />
<org.solovyev.android.material.MaterialButton <org.solovyev.android.material.MaterialImageButton
a:id="@id/plot_zoom_reset_button" a:id="@id/plot_zoom_reset_button"
style="@style/CppPlotButton" style="@style/CppPlotButton"
a:text="@string/cpp_plot_zoom_reset" /> a:src="@drawable/ic_my_location_white_24dp" />
<org.solovyev.android.material.MaterialButton <org.solovyev.android.material.MaterialImageButton
a:id="@id/plot_zoom_out_button" a:id="@id/plot_zoom_out_button"
style="@style/CppPlotButton" style="@style/CppPlotButton"
a:text="@string/cpp_plot_zoom_out" /> a:src="@drawable/ic_zoom_out_white_24dp" />
</LinearLayout> </LinearLayout>
</org.solovyev.android.plotter.PlotViewFrame> </org.solovyev.android.plotter.PlotViewFrame>