nirhart / ParallaxScroll

Parallax ScrollView and ListView for Android
MIT License
847 stars 187 forks source link

MapFragment in header? #38

Open kaiwinter opened 9 years ago

kaiwinter commented 9 years ago

I'm trying since hours to place a MapFragment as parallax header for a ListView. No luck. Is it possible with the library? With my XML below the ListView isn't scollable anymore. Can you help me out?

<com.nirhart.parallaxscroll.views.ParallaxScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:parallax_factor="1.9"
tools:context=".MainActivity" >

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

    <fragment
        android:id="@+id/staticmap"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        class="com.google.android.gms.maps.MapFragment" />

    <ListView
        android:id="@+id/listView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="5dp"
        android:paddingRight="5dp"
        android:scrollbarStyle="outsideOverlay" >
    </ListView>
</LinearLayout>

</com.nirhart.parallaxscroll.views.ParallaxScrollView>

nirhart commented 9 years ago

It's a bad idea to put listview inside scrollview, how about using parallax list view and put the map fragment as a parallaxed header?

kaiwinter commented 9 years ago

Yes, I know... I couldn't manage to put the map fragment as the header. As I declare it in the XML I didn't know where to put it else. I also tried to add the map fragment by code but also had difficulties which made this doesn't seem as a good solution to me.