I am creating an android application in which the user can view the channel list and programme list on the same screen. For ex :-
The image of the channel will be on left and the programmes scheduled will be on the right and the user can horizontally scroll the programme listing and since there will be many channels the user can also scroll the complete layout vertically. All this has been implemented but what i can not get done is the header should be sticky at the top.
The header has 2 parts :- 1. Simple Image View on left side above the channels list of images and should remain sticky at top and not be scrollable 2. Timings list header like 00:00 , 01:00 , 02:00 on the right of the above image view and on the above of the programme list and should not be scrollable vertically but should be scrollable horizontally.
The following is the code that i am using to display the layout all i can not get it done are the above two points. They just dont remain sticky they also scroll up and down with the rest of layout
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:id="@+id/image_layout">
<ImageView android:layout_gravity="center_vertical|center_horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/tv_guide_channels"
android:scaleType="fitCenter" android:id="@+id/channel_img_header"
android:layout_alignParentTop="true"/>
<LinearLayout android:id="@+id/layout_to_add_channel_image" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical"
android:background="@color/White" android:layout_below="@id/channel_img_header"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_toRightOf="@id/image_layout"
android:id="@+id/programme_layout">
<HorizontalScrollView android:layout_width="fill_parent" android:layout_height="wrap_content">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="horizontal" android:id="@+id/table_header"
android:layout_alignParentTop="true">
</LinearLayout>
<ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_below="@id/table_header">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:gravity="center_vertical" android:background="@color/greyblue"
android:orientation="vertical" android:id="@+id/table_programme"
android:layout_alignParentBottom="true">
</LinearLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</HorizontalScrollView>
</RelativeLayout>
</RelativeLayout>
<LinearLayout android:layout_height="2dip" android:layout_width="fill_parent" android:background="@color/Black"></LinearLayout>