Align form inputs

This commit is contained in:
serso 2016-02-26 15:23:15 +01:00
parent b03a0df74e
commit 4e1c62a374
5 changed files with 30 additions and 15 deletions

View File

@ -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

View File

@ -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);

View File

@ -59,7 +59,8 @@
<android.support.design.widget.TextInputLayout
a:layout_width="match_parent"
a:layout_height="wrap_content">
a:layout_height="wrap_content"
a:id="@+id/function_description_label">
<EditText
a:id="@+id/function_description"

View File

@ -23,9 +23,10 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
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"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
@ -44,12 +45,12 @@
<org.solovyev.android.plotter.PlotIconView
android:id="@+id/fn_iconview"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_width="@dimen/cpp_plot_icon_size"
android:layout_height="@dimen/cpp_plot_icon_size"
android:layout_marginLeft="@dimen/cpp_plot_icon_margin"
android:layout_marginRight="@dimen/cpp_plot_icon_margin"
android:background="#212121"
android:padding="5dp" />
android:padding="@dimen/cpp_image_button_padding"/>
<LinearLayout
android:layout_width="match_parent"
@ -61,7 +62,10 @@
style="@style/TextAppearance.AppCompat.Caption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fn_line_width" />
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:text="@string/fn_line_width"
tools:ignore="RtlSymmetry"/>
<SeekBar
android:id="@+id/fn_linewidth_seekbar"
@ -73,7 +77,10 @@
style="@style/TextAppearance.AppCompat.Caption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fn_line_color" />
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:text="@string/fn_line_color"
tools:ignore="RtlSymmetry"/>
<uz.shift.colorpicker.LineColorPicker
android:id="@+id/fn_color_picker"

View File

@ -40,6 +40,9 @@
<dimen name="cpp_clickable_area_size">50dp</dimen>
<dimen name="cpp_image_button_size">30dp</dimen>
<dimen name="cpp_image_button_padding">5dp</dimen>
<!-- 3 * cpp_image_button_size - 2 * cpp_plot_icon_margin -->
<dimen name="cpp_plot_icon_size">70dp</dimen>
<dimen name="cpp_plot_icon_margin">10dp</dimen>
<dimen name="cpp_dialog_width_max">400dp</dimen>
<dimen name="cpp_card_margin">4dp</dimen>