Git Product home page Git Product logo

simple-scroll-snap's Introduction

Hey there, I'm Daniel! 👋

Daniel's GitHub Stats

simple-scroll-snap's People

Contributors

daniellochner avatar iggyzuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

simple-scroll-snap's Issues

CurrentPanel weird behavior

Hi there,

I might be wrong, but I think I found a strange behavior in the code, or at least one not intuitive.

I'm using a version of the Example 1 you provide, and on my proyect, I need to know on which panel/element I'm standing so I can render some other stuff. In other words, if CurrentPanel = 0, then I render MyComponent[0], and so on.

So what I do is to access CurrentPanel variable value. I would expect this variable to start on 0; if I move right or down, increase it's value by 1; if I move left or up, decrease it's value by 1 (if I'm on 0, and InfiniteScrolling is active, then maxValue).

The issue is the following: After the first movement, the CurrentPanel value stays on 0, independantly of the direction you move. That means everything is shifted.

Another example: Let's say you are snaping on a direction (for instance, right) and CurrentPanel is increasing it's value, whenever you change to the opposite direction (in this case left), on the first movement, CurrentPanel still increases it's value before start decreasing it.

On this movements: Start->Right->Right->Left I would expect 0->1->2->1, and I get 0->0->1->2

I replicated it with your Example1 as well by adding to Previous and Next Buttons a function that prints CurrentValue. I think this happens with TargetPanel too, but I didn't test that much.

I hope you can help me with this. If it's a bug, by fixing it, and if I'm wrong, by clarifying things to me.

Thank you for your time, have a nice day.

Vertical scroll : top -> down available?

Hi,

I want to knwo top -> down scroll view is available.
(top for later one down for former one, top to down scrollview like in Instagram)

I tryed to do it with your app but down to top way is the only thing I can do for now.

Thank you.

Excess snapping animation to Starting Panel with no 'Use Automatic Layout'

In case of using non automatic scroll-snap layout there is a problem with excess animation lerp to the first panel.

These lines in Setup can fix this behaviour:

private void Setup()
{
    ...
    
    // Starting Panel
    ...
    
    Vector2 targetPosition = -Panels[CenteredPanel].anchoredPosition + offset;
    Content.anchoredPosition = targetPosition;
    
    // Buttons
    ...
}

Or may be you can consider another solution.

Positioning of first/last panels

How can I position the first and last panels for a horizontal scroll view so that they are not centered but aligned to the left and right edges of the viewport respectively?

Issue : Stuck

Did anyone has the issue when using scroll snap, the canvas is stuck and comeback to the original version ?

Infinite Scrolling Initialization Issue

I'm using a scroll snap copied from the macOS finder, but when i do play the scene the infinite scroll doesn't initialize correctly. After i first touch the scroll rect, it does work correctly.

BTW:

  • The content is instantied dinamically;
  • When the boxes are instantiated, the canvas they are sitting in is disabled in the hierarchy

ex01
.
ex02

Could you add a licence?

You mention that it's free in the readme but a proper licence is much better as it:

  1. Adds legal certainty
  2. Allows Github search and other tools to find it when people are looking
  3. Communicates exactly what you mean by "free" (it's harder to express this than you might think)

I'm guessing you'd be happy with something like MIT?

Click event for Scrollview Item

How to implement a click event for the scroll view item?
I want to implement a screen change event based on the scroll view item clicked

CurrentPanel not working as expected

Hi there,

I might be wrong, but I think I found a strange behavior in the code, or at least one not intuitive.

I'm using a version of the Example 1 you provide, and on my proyect, I need to know on which panel/element I'm standing so I can render some other stuff. In other words, if CurrentPanel = 0, then I render MyComponent[0], and so on.

So what I do is to access CurrentPanel variable value. I would expect this variable to start on 0; if I move right or down, increase it's value by 1; if I move left or up, decrease it's value by 1 (if I'm on 0, and InfiniteScrolling is active, then maxValue).

The issue is the following: After the first movement, the CurrentPanel value stays on 0, independantly of the direction you move. That means everything is shifted.

Another example: Let's say you are snaping on a direction (for instance, right) and CurrentPanel is increasing it's value, whenever you change to the opposite direction (in this case left), on the first movement, CurrentPanel still increases it's value before start decreasing it.

On this movements: Start->Right->Right->Left I would expect 0->1->2->1, and I get 0->0->1->2

I replicated it with your Example1 as well by adding to Previous and Next Buttons a function that prints CurrentValue. I think this happens with TargetPanel too, but I didn't test that much.

I hope you can help me with this. If it's a bug, by fixing it, and if I'm wrong, by clarifying things to me.

Thank you for your time, have a nice day.

Change pictures and instantiate at runtime.

Hi,

I am using your Unity asset Simple Scroll Snap in a project. Firstly, the asset is great, and thanks for making it free. In the project that I am working on, the pictures get instantiated at runtime and every time it's enabled it should check the latest number of pictures but I keep getting the error from the second time that "The RectTransform is destroyed but you are still trying to access it". I have tried moving the start function script to OnEnable but no luck. Can you please guide me on what I can do to achieve it?

Thanks in advance

ScrollSnapError

Unexpected behaviour when pressing Previous/Next buttons (When only 2 elements on infinite loop)

Previous and next button actions work fine on infinite loop with 3 or more elements, but when there is only 2 elements sometimes the direction of the transition is the oposite of the expected. While the target element ends up being the right one (Because there are only 2 elements and therefore you only swap between them), when you click the "next button" you expect the rotation reveal spin in the direction that will reveal the element on the RIGHT (on horizontal scrolling) and spin in the oposite direction revealing the element on the LEFT when you click "previous button".

Crash on iOS

this plugin cause crash on iOS 16.3 may be other OS versions too . Randomly when scrolling .

onPanelCentered: should it be called right after initialization?

Thank you for creating this tool, it's very helpful and robust.

Just wondering this cos it seems natural to me that when the panels are first set up and one of the panel is centered, the onPanelCentered() callback would be fired. I don't think that is the case right now as both SelectedPanel and CenteredPanel are set to StartingPanel in Setup(), so in SnapToPanel() onPanelCentered() is not fired.

Go to Panel without Scroll Animation

Hi there,

We have Go to Panel which uses scroll animation, but there are cases when we have to show same scroll snap again from first panel immediatly instead of scroll animation , so how can we achieve that?

Thanks

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.