Giter VIP home page Giter VIP logo

Comments (7)

rubensousa avatar rubensousa commented on July 30, 2024

The top position won't be called in onSnap if it can't be snapped. This usually happens when you don't have padding or decoration for the top or bottom items.

from gravitysnaphelper.

leeprohacker avatar leeprohacker commented on July 30, 2024

@rubensousa rube
I looked into your example, in the row Center with decoration, it's same issue i mentioned above. In fact my project I have added decoration to make item center horizontal. So do you have any advices for me? Thanks

from gravitysnaphelper.

rubensousa avatar rubensousa commented on July 30, 2024

@leeprohacker I can confirm there's a problem. Sometimes the position 0 isn't dispatched on onSnap. I'll fix this in the next release

from gravitysnaphelper.

rubensousa avatar rubensousa commented on July 30, 2024

@leeprohacker it should be fixed in the develop branch now. Can you check if now it behaves like you would expect?

from gravitysnaphelper.

rubensousa avatar rubensousa commented on July 30, 2024

You can check this in your app by installing the version 2.2.1-beta01

from gravitysnaphelper.

rubensousa avatar rubensousa commented on July 30, 2024

Released on 2.2.1

from gravitysnaphelper.

Hoalq-0026 avatar Hoalq-0026 commented on July 30, 2024

@rubensousa
Hi!
I have a problem. I can not scroll to the top position when the call method smoothScrollToPosition(0)
in source code:

ryclerviewTopic.apply {
                layoutManager = LinearLayoutManager(context)
               enableSnapping(false)
                adapter = topicAdapter
            }

ryclerviewTopic.smoothScrollToPosition(0)

 <com.github.rubensousa.gravitysnaphelper.GravitySnapRecyclerView
                        android:id="@+id/ryclerviewTopic"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_behavior="@string/appbar_scrolling_view_behavior"
                        app:snapEnabled="false"
                        app:snapGravity="top"
                        app:snapMaxFlingSizeFraction="2"
                        app:snapScrollMsPerInch="50"
                        android:paddingTop="@dimen/_30dp"
                        tools:listitem="@layout/item_home_topic" />

from gravitysnaphelper.

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.