UPDATE
I want to implement this goal using XML if possible since I have too many 2 columned layouts. I don't know if the issue is using a LinearLayout (Just a guess) or something else. I plotted them by order (From Street -> Brgy -> City -> ZipCode etc) and that's why I am confused why it is not going in the right direction by what order I created them
just need some help with my XML/UI. I have a 2 column design of EditTexts and my goal is when I pressed next from keyboard in left side element, it will go to right side element then next to bottom left and so on (as per photo attachments at the bottom: From Street -> Brgy -> City -> ZipCode etc).
But I am having a problem when I press next, it goes down all the way. When I am on left side element, it goes bottom left side and same on right side element, it goes bottom right. How can I make a pattern as per my goal? Tried these but still, a problem occurs.
android:nexFocusRight="@+id/.."
and
android:nextFocusForward="@+id/.."
XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/TitleLayout1"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginRight="@dimen/marginSide1"
android:minHeight="25px"
android:layout_marginTop="@dimen/marginTop2"
android:background="@color/white">
<LinearLayout
android:orientation="horizontal"
android:minWidth="25px"
android:minHeight="20px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/TitleBackround1"
android:background="@color/bluegreendark"
android:layout_gravity="center" />
<TextView
android:text="Personal Data"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/PDRN_Title1"
android:background="@color/white"
android:textColor="@color/darkgray"
android:paddingLeft="@dimen/paddingSide1"
android:paddingRight="@dimen/paddingSide1"
android:layout_gravity="center"
android:fontFamily="@string/fontFamily"
android:textSize="@dimen/textSizeHeader" />
</FrameLayout>
<LinearLayout
android:orientation="vertical"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutApplicant">
<TextView
android:text="Applicant"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/lightgray"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginTop="@dimen/marginSide1"
android:fontFamily="@string/fontFamily"
android:textStyle="bold" />
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutStreet"
android:layout_marginLeft="@dimen/marginSide2"
android:layout_marginRight="@dimen/marginSide2"
android:weightSum="100"
android:layout_width="match_parent">
<EditText
android:inputType="textPostalAddress"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/PD_Street"
android:hint="Street"
android:layout_weight="50"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:nextFocusForward="@+id/PD_Baranggay" <!--Just tried it here-->
android:nextFocusRight="@+id/PD_Baranggay" <!--Just tried it here-->
android:maxLength="@string/genericLongLength" />
<EditText
android:inputType="textPostalAddress"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/PD_Baranggay"
android:hint="Brgy"
android:layout_weight="50"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:maxLength="@string/genericLongLength" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutZipCode"
android:layout_marginLeft="@dimen/marginSide2"
android:layout_marginRight="@dimen/marginSide2"
android:weightSum="100">
<EditText
android:inputType="textPostalAddress"
android:layout_width="0dp"
android:layout_height="match_parent"
android:id="@+id/PD_City"
android:layout_weight="50"
android:hint="City"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:maxLength="@string/genericLength" />
<EditText
android:inputType="number"
android:layout_width="0dp"
android:layout_height="match_parent"
android:id="@+id/PD_ZipCode"
android:layout_weight="50"
android:hint="Zip Code"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:maxLength="@string/yearLength" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutMobile"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginRight="@dimen/marginSide1"
android:weightSum="100"
android:layout_width="match_parent">
<EditText
android:inputType="phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/PD_Telephone"
android:hint="Telephone"
android:layout_weight="50"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:maxLength="@string/contactLength" />
<EditText
android:inputType="phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/PD_MobileNumber"
android:hint="Mobile"
android:layout_weight="50"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:maxLength="@string/contactLength" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutOccularInspected"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginRight="@dimen/marginSide1"
android:weightSum="100"
android:layout_width="match_parent">
<EditText
android:inputType="numberDecimal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/PD_LengthOfStay"
android:hint="Yrs of Stay"
android:layout_weight="50"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:maxLength="@string/numberDecimalLength" />
<CheckBox
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/PD_OccularInspected"
android:text="Occular Inspected"
android:layout_weight="50"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily" />
</LinearLayout>
<EditText
android:inputType="textPostalAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/PD_ProvincialAddress"
android:hint="Provincial Address"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginRight="@dimen/marginSide1"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:maxLength="@string/addressLength" />
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutCivilStatus"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginRight="@dimen/marginSide1"
android:weightSum="100"
android:layout_width="match_parent">
<Spinner
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/PD_CivilStatus"
android:layout_weight="50"
android:spinnerMode="dialog"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:layout_marginTop="@dimen/marginNegativeTop2" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/PDRN_EditTextCivilStatusOthers"
android:layout_weight="50"
android:hint="Pls specify"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:visibility="gone"
android:singleLine="true"
android:maxLength="@string/otherLength" />
</LinearLayout>
<EditText
android:inputType="number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginRight="@dimen/marginSide1"
android:id="@+id/PD_NumberOfDependents"
android:hint="No. of Dependents"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:singleLine="true"
android:maxLength="@string/numberLength" />
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutSubjectNationality"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginRight="@dimen/marginSide1"
android:weightSum="100"
android:layout_width="match_parent">
<Spinner
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:id="@+id/PD_SpinnerSubjectNationality"
android:spinnerMode="dialog"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:layout_marginTop="@dimen/marginNegativeTop2" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/PD_EditTextSubjectNationalityACR"
android:hint="ACR No."
android:layout_weight="50"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:visibility="gone"
android:singleLine="true"
android:maxLength="@string/genericLength" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:id="@+id/linearLayoutSpouseNationality"
android:layout_marginLeft="@dimen/marginSide1"
android:layout_marginRight="@dimen/marginSide1"
android:weightSum="100"
android:layout_width="match_parent">
<Spinner
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:id="@+id/PD_SpinnerSpouseNationality"
android:spinnerMode="dialog"
style="@style/Widget.AppCompat.Spinner.Underlined"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:layout_marginTop="@dimen/marginNegativeTop2" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/PD_EditTextSpouseNationalityACR"
android:hint="ACR No."
android:layout_weight="50"
android:textColor="@color/darkgray"
android:textSize="@dimen/textSizeCommon"
android:fontFamily="@string/fontFamily"
android:visibility="gone"
android:singleLine="true"
android:maxLength="@string/genericLength" />
</LinearLayout>
</LinearLayout>
See photo attached