From 4e1c62a3744f337e832677cba69ed445cd0c714b Mon Sep 17 00:00:00 2001 From: serso Date: Fri, 26 Feb 2016 15:23:15 +0100 Subject: [PATCH] Align form inputs --- .../functions/BaseFunctionFragment.java | 4 ++- .../plot/PlotEditFunctionFragment.java | 2 ++ .../fragment_function_edit_base_controls.xml | 3 +- .../layout/fragment_plot_function_edit.xml | 33 +++++++++++-------- app/src/main/res/values/dimens.xml | 3 ++ 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java b/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java index 0eb75f4d..10a542d9 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java @@ -94,8 +94,10 @@ public abstract class BaseFunctionFragment extends BaseDialogFragment implements public TextInputLayout bodyLabel; @Bind(R.id.function_body) public EditTextCompat bodyView; + @Bind(R.id.function_description_label) + public TextInputLayout descriptionLabel; @Bind(R.id.function_description) - EditText descriptionView; + public EditText descriptionView; @Inject Calculator calculator; @Inject diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotEditFunctionFragment.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotEditFunctionFragment.java index b5169efa..724628b7 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotEditFunctionFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotEditFunctionFragment.java @@ -112,6 +112,8 @@ public class PlotEditFunctionFragment extends BaseFunctionFragment final int[] colors = MeshSpec.LightColors.asIntArray(); colorPicker.setColors(colors); paramsView.setMaxParams(2); + // no descriptions for functions in plotter + descriptionLabel.setVisibility(View.GONE); if (savedInstanceState == null) { if (plotFunction != null) { setupViews(plotFunction.meshSpec); diff --git a/app/src/main/res/layout/fragment_function_edit_base_controls.xml b/app/src/main/res/layout/fragment_function_edit_base_controls.xml index 8bf8eb42..3e90baf1 100644 --- a/app/src/main/res/layout/fragment_function_edit_base_controls.xml +++ b/app/src/main/res/layout/fragment_function_edit_base_controls.xml @@ -59,7 +59,8 @@ + a:layout_height="wrap_content" + a:id="@+id/function_description_label"> + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> - + + android:padding="@dimen/cpp_image_button_padding"/> + android:paddingStart="4dp" + android:paddingLeft="4dp" + android:text="@string/fn_line_width" + tools:ignore="RtlSymmetry"/> + android:layout_height="wrap_content"/> + android:paddingStart="4dp" + android:paddingLeft="4dp" + android:text="@string/fn_line_color" + tools:ignore="RtlSymmetry"/> + app:lcp_orientation="horizontal"/> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 73b3b010..7e6fede8 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -40,6 +40,9 @@ 50dp 30dp 5dp + + 70dp + 10dp 400dp 4dp