Reputation: 87
When create simple recyclerView containing just two editText widgets, direction of next focus element when typing data is like on pic1 --- how to set direction of next focus element like that on pic2? cheers
my simple code
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/edit_text_left"
tools:hint="editTextLeft"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/edit_text_right"
tools:hint="editTextRight"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
</LinearLayout>
Upvotes: 1
Views: 555
Reputation: 69709
try this use android:imeOptions="actionNext"
to move focus to the next Editext
<EditText
android:id="@+id/edit_text_left"
tools:hint="editTextLeft"
android:layout_width="0dp"
android:layout_weight="1"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_height="wrap_content" />
make your layout like this
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/edit_text_left"
tools:hint="editTextLeft"
android:layout_width="0dp"
android:layout_weight="1"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/edit_text_right"
tools:hint="editTextRight"
android:layout_width="0dp"
android:layout_weight="1"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_height="wrap_content" />
</LinearLayout>
Upvotes: 1