Giter Site home page Giter Site logo

Comments (4)

noties avatar noties commented on May 29, 2024

Hi, I used ViewPager as a header in one of my projects, and it worked just fine. Maybe you could provide me with more details?

from scrollable.

jboeyin avatar jboeyin commented on May 29, 2024

I using the LinearLayout replace the textview in the header, then I add a viewpager into the LinearLayout, and the whole layout is within a fragment, however it is not working. can you show me your codes?

<ru.noties.scrollable.ScrollableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollable_layout"
app:scrollable_maxScroll="@dimen/header_height"
app:scrollable_considerIdleMillis="125"
app:scrollable_friction="0.075"
app:scrollable_closeUpAnimationMillis="250"
app:scrollable_defaultCloseUp="true"
app:scrollable_scrollerFlywheel="false"
app:scrollable_closeUpAnimatorInterpolator="@android:anim/accelerate_decelerate_interpolator">

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/header_height"
        android:background="@color/header_background"
        android:id="@+id/header"
        android:gravity="center">

       <android.support.v4.view.ViewPager
            android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:id="@+id/banner_pager" />

    </LinearLayout>

    <ru.noties.scrollable.sample.TabsLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/tabs_height"
        android:background="@color/tabs_background"
        android:id="@+id/tabs" />

</LinearLayout>

<android.support.v4.view.ViewPager
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="@dimen/tabs_height"
    android:id="@+id/view_pager" />

</ru.noties.scrollable.ScrollableLayout>

from scrollable.

noties avatar noties commented on May 29, 2024

The code looks just fine (although I would eliminate ViewPager's LinearLayout in header). Maybe you could be more specific about the listview move to the header I don't quite get it.

from scrollable.

noties avatar noties commented on May 29, 2024

I've added a ScrollableFragment to the sample application to show how ScrollableLayout could be used inside a Fragment with a ViewPager as a header

from scrollable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.