I am trying to design confirmation dialog which has two lists (scrollable). One part shows numbers of foot and another shows inches values. This should be in a single dialog as shown in the image below. Any suggestions to do this is appreciated.
I achieved this UI by using the following code
mycustomwidget.xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:text="@string/txtHeight"
android:id="@+id/tvHeight" />
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:id="@+id/editText_Height"
android:hint="select Height"
android:paddingBottom="8dp"
android:background="@drawable/border_bottom" />
</LinearLayout>
in my Activity is used this code to get the dialog
editText_Height.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Dialog dialog = new Dialog(ProfileInfo.this);
dialog.setContentView(R.layout.height_picker);
dialog.show();
}
});
heightpicker.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="250dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/txtHeight"
android:layout_marginTop="24dp"
android:textAlignment="center"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/border_bottom">
<com.myapp.HelperClasses.MyNumberPicker
android:id="@+id/footValue"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_gravity="center"
android:orientation="vertical"
max="7"
min="4" />
<com.myapp.HelperClasses.MyNumberPicker
android:id="@+id/inchValue"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_gravity="center"
android:orientation="vertical"
max="11"
min="0" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView_cancel"
android:layout_width="0dp"
android:layout_weight="0.5"
android:layout_height="36dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="24dp"
android:text="@string/txtCancel"
android:textAlignment="center"
android:textColor="@color/blue"/>
<TextView
android:id="@+id/textView_Okay"
android:layout_width="0dp"
android:layout_weight="0.5"
android:layout_height="32dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:text="@string/txtOkay"
android:textAlignment="center"
android:textColor="@color/blue"/>
</LinearLayout>
</LinearLayout>