Monday, 1 October 2018

Android edittext click navigation wrong

In the pictures below you can see 2 edittexts nicely standing next to eachother. When I click on one edittext, it navigates me to the view (no problem). But when I click on the edittext next to it, the navigation send me a little upwards instead of staying on the same height. Anther problem is when I click in the previous edittext, bugging out the height and hiding the edittext from the view.

Normal

enter image description here

Click first (ok)

enter image description here

Click on the next one (problem)

enter image description here

Click back on the previous one (biggest problem), I end up a little below the view

enter image description here

Code:

<activity
            android:name=".activity.ReportsEditActivity"
            android:configChanges="orientation|screenSize"
            android:label="@string/title_activity_reports_edit"
            android:parentActivityName=".activity.MainActivity"
            android:windowSoftInputMode="adjustResize|stateVisible">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activity.MainActivity" />
        </activity>

Edittext:

<EditText
        android:id="@+id/report_template_grid_single_line_edit_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/grid_padding"
        android:layout_marginStart="@dimen/grid_padding"
        android:inputType="text"
        android:maxHeight="@dimen/grid_element_max_height"
        android:maxLines="1"
        android:minHeight="@dimen/grid_element_min_height"
        android:paddingBottom="@dimen/grid_element_top_and_bottom_padding"
        android:gravity="top|start"
        android:paddingEnd="@dimen/grid_element_top_and_bottom_padding"
        android:paddingStart="@dimen/grid_element_top_and_bottom_padding"
        android:paddingTop="@dimen/grid_element_top_and_bottom_padding"
        android:textColor="@color/darkGray"
        android:textSize="@dimen/grid_text_size_small" />



from Android edittext click navigation wrong

No comments:

Post a Comment