Add next focus to the other textView

This commit is contained in:
adrienmalin
2018-12-08 14:38:41 +01:00
parent 6c1ff4f20f
commit fb2f81226f
2 changed files with 26 additions and 16 deletions

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout <android.support.design.widget.CoordinatorLayout
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/myCoordinatorLayout" xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/myCoordinatorLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".StarterNameActivity"> tools:context=".StarterNameActivity">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
@ -42,7 +42,9 @@
android:id="@+id/player1Name" android:id="@+id/player1Name"
tools:layout_editor_absoluteX="143dp" android:hint="@string/player_1_default_name" tools:layout_editor_absoluteX="143dp" android:hint="@string/player_1_default_name"
android:layout_weight="1" android:layout_weight="1"
android:completionThreshold="1"/> android:completionThreshold="1"
android:singleLine="true"
android:imeOptions="actionNext"/>
<ImageButton <ImageButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" app:srcCompat="@drawable/ic_swap_horiz" android:layout_height="wrap_content" app:srcCompat="@drawable/ic_swap_horiz"
@ -57,8 +59,11 @@
android:text="@string/player_2_default_name" android:text="@string/player_2_default_name"
android:layout_width="match_parent" android:layout_width="match_parent"
tools:layout_editor_absoluteX="136dp" android:id="@+id/player2Name" tools:layout_editor_absoluteX="136dp" android:id="@+id/player2Name"
android:hint="@string/player_2_default_name" android:layout_height="wrap_content" android:layout_weight="1" android:hint="@string/player_2_default_name" android:layout_height="wrap_content"
android:completionThreshold="1"/> android:layout_weight="1"
android:completionThreshold="1"
android:singleLine="true"
android:imeOptions="actionNext"/>
</RadioGroup> </RadioGroup>
<Switch <Switch
android:text="@string/TTS" android:text="@string/TTS"
@ -66,7 +71,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/enableTtsSwitch" android:id="@+id/enableTtsSwitch"
android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/starterRadioGroup" android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/starterRadioGroup"
android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp" android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp" app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp" app:layout_constraintStart_toStartOf="parent"
android:layout_marginLeft="8dp"/> android:layout_marginLeft="8dp"/>
<Switch <Switch
@ -82,7 +88,7 @@
android:text="@string/start" android:text="@string/start"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/button2" android:id="@+id/startMatchButton"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent" android:layout_marginEnd="8dp" app:layout_constraintBottom_toBottomOf="parent" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp"

View File

@ -63,7 +63,9 @@
android:id="@+id/player1Name" android:id="@+id/player1Name"
tools:layout_editor_absoluteX="143dp" android:hint="@string/player_1_default_name" tools:layout_editor_absoluteX="143dp" android:hint="@string/player_1_default_name"
android:selectAllOnFocus="true" android:selectAllOnFocus="true"
android:completionThreshold="1"/> android:completionThreshold="1"
android:singleLine="true"
android:imeOptions="actionNext"/>
<ImageButton <ImageButton
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" app:srcCompat="@drawable/ic_swap_vert" android:layout_height="wrap_content" app:srcCompat="@drawable/ic_swap_vert"
@ -74,7 +76,9 @@
tools:layout_editor_absoluteX="136dp" android:id="@+id/player2Name" tools:layout_editor_absoluteX="136dp" android:id="@+id/player2Name"
android:hint="@string/player_2_default_name" android:layout_height="wrap_content" android:hint="@string/player_2_default_name" android:layout_height="wrap_content"
android:layout_width="match_parent" android:selectAllOnFocus="true" android:layout_width="match_parent" android:selectAllOnFocus="true"
android:completionThreshold="1"/> android:completionThreshold="1"
android:singleLine="true"
android:imeOptions="actionNext"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<Switch <Switch
@ -99,7 +103,7 @@
android:text="@string/start" android:text="@string/start"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/button" android:id="@+id/startMatchButton"
style="@android:style/Widget.DeviceDefault.Button" style="@android:style/Widget.DeviceDefault.Button"
android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp" android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp"
android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent"