0

I have added my code which contains Framelayout with mapview dynamic creation and RecyclerView with another layout, I am using this as a Fragment in ViewPager fragmentstate adapter.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <RelativeLayout
        android:id="@+id/list_item"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">  
        <android.support.v7.widget.RecyclerView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:elevation="5dp"
            android:id="@+id/rv"
            android:layout_above="@+id/custom_progress1"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />    
    </RelativeLayout>
    <LinearLayout
        android:id="@+id/mapLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"> 
        <FrameLayout
            android:id="@+id/mapContainer"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:layout_weight="1"/> 
    </LinearLayout> 
</RelativeLayout>
musica
  • 1,373
  • 3
  • 15
  • 34
vino cs
  • 23
  • 6
  • Dear Friend you have added parent layout as relative layout. Use Linear Layout instead of using relative layout. And also use weight in child layouts.So that you can view your screen exactly as you wanted. – Azhar osws Sep 28 '16 at 12:00
  • i have changed but still same responce,Initially swiping is working fine,Once mapview is selected and again back to listview then swipe is dead, then once i have changed page using pagestrip of viewpager then its working fine. – vino cs Sep 28 '16 at 12:10
  • Consider using a more precise title for your question instead of a complete sentence. – M_G Sep 28 '16 at 12:13
  • Have you done any changes in your java code?. If it is as it is. It will work properly. Otherwise you might have done some changes. – Azhar osws Sep 28 '16 at 12:13
  • do i need to remove fragment while return into listview? – vino cs Sep 28 '16 at 12:18
  • I am not getting where you are stuck. But I think you should understand the code and then go with your concept. – Azhar osws Sep 28 '16 at 12:21
  • How you want to show UI i mean mapview should be below list item or ?? – Ram Prakash Bhat Sep 28 '16 at 12:31
  • nope,I have viewpager with pagestrip, on top of pagestrip i have option to show map/list initially i am showing list,its working fine,Once the map is viewed then not able to swipe from list, am trying to change view from recycleview into framelayout then again framelayout from recycleview – vino cs Sep 28 '16 at 13:09

1 Answers1

0

Its better to have single parent layout which helps in faster UI rendering. You can use something like

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:elevation="5dp" />

    <FrameLayout
        android:id="@+id/mapContainer"
        android:layout_width="match_parent"
        android:layout_below="@+id/rv"
        android:layout_height="match_parent" />
</RelativeLayout>
user939997
  • 381
  • 1
  • 8