Android : How to show two fragment views in one activity in Android?

on Thursday, August 7, 2014


Hi i'm new to android development i need to show to fragment views in one activity. i need to show this activity immediately after launching app. Please find the attached screen. For your reference, i have added my both XML layouts below :


enter image description here


XML - 1



<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:fillViewport="true"
android:scrollbars="none" >

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<TextView
android:id="@+id/tvSubtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_dark"
android:gravity="center"
android:padding="15dp"
android:text="Day One"
android:textColor="@color/white"
android:textSize="16sp"
android:typeface="monospace" />

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/grey_line_border" />

<RelativeLayout
android:id="@+id/rlQuestion1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_selector"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingTop="5dp" >

<TextView
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:text="09:00 - 09:15"
android:textColor="@drawable/list_text_top_color"
android:textSize="12sp"
android:textStyle="bold"
android:typeface="monospace" />

<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/time"
android:gravity="center"
android:maxLines="2"
android:padding="2dp"
android:text="Introduction &amp; Briefing"
android:textAllCaps="true"
android:textColor="@drawable/list_text_color"
android:textSize="16sp"
android:typeface="monospace" />
</RelativeLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/grey" />
</LinearLayout>
</RelativeLayout>

</ScrollView>


XML - 2



<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:fillViewport="true"
android:scrollbars="none" >

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<TextView
android:id="@+id/tvSubtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_dark"
android:text="Thank you for attending this event.Kindly take a few minutes to share your feedback with us.Please fill in your contact details clearly or attach your business card.Kindly submit this form at the end of the event."
android:textColor="@color/white"
android:textSize="12sp"
android:typeface="monospace" />

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/grey_line_border" />

<com.andreabaccega.widget.FormEditText
android:id="@+id/etUserId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:ems="10"
android:hint="Name(Mr/Ms/Mdm/Dr)"
android:inputType="text"
android:padding="12dp"
android:textColor="@color/blue"
android:textColorHint="@color/grey_dark"
android:textSize="16sp"
android:typeface="monospace" />

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/grey_line_border" />

<com.andreabaccega.widget.FormEditText
android:id="@+id/etPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:ems="10"
android:hint="Company"
android:inputType="text"
android:padding="12dp"
android:textColor="@color/blue"
android:textColorHint="@color/grey_dark"
android:textSize="16sp"
android:typeface="monospace" />

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/grey_line_border" />
</LinearLayout>
</RelativeLayout>

</ScrollView>

0 comments:

Post a Comment