Devlight / InfiniteCycleViewPager

Infinite cycle ViewPager with two-way orientation and interactive effect.
Apache License 2.0
5.75k stars 827 forks source link

ViewPager takes the whole screen #78

Closed murad-alm closed 4 years ago

murad-alm commented 4 years ago

Hello, I am having the problem that the ViewPager is wrapping the whole content (Buttons, TextViews, etc.) in the recycler. I only want the ImageViews to be in the recycler. I have tried many solutions online but none of them worked.. I hope you can help me! Thanks

murad-alm commented 4 years ago

Activity's XML:

` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".PlayActivity">

<RelativeLayout
    android:id="@+id/buttons"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true">

    <Button
        android:layout_width="200dp"
        android:layout_height="50dp"
        android:text="Test Button" />
</RelativeLayout>

<com.gigamole.infinitecycleviewpager.HorizontalInfiniteCycleViewPager
    android:id="@+id/horizontal_cycle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@id/text"
    android:layout_below="@id/buttons"

    app:icvp_center_page_scale_offset="30dp"
    app:icvp_interpolator="@android:anim/accelerate_decelerate_interpolator"
    app:icvp_max_page_scale="0.8"
    app:icvp_medium_scaled="false"
    app:icvp_min_page_scale="0.55"
    app:icvp_min_page_scale_offset="5dp"
    app:icvp_scroll_duration="250"/>

<ImageView
    android:id="@+id/cardImageView"
    android:layout_width="242dp"
    android:layout_height="410dp"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true" />

<TextView
    android:id="@+id/text"
    android:layout_width="300dp"
    android:layout_height="50dp"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:text="TEXT"
    android:textAlignment="center"
    android:textSize="24dp" />

`

murad-alm commented 4 years ago

Here is a screenshot from the app's screen:

android

murad-alm commented 4 years ago

Just noticed this is not supported anymore....