Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

In G2, scrollView is not that smooth?
Started by joe528 Dec 07 2013 12:21 AM

59 replies to this topic
[TOPIC CONTROLS]
Page 2 of 3 1 2 3
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

I will see if I can make a video.

 

But just try to move fast enough between ups & downs 

 

and when you swipes, lift your finger up right away

 

You should be able to see it. It's quite obvious.



[TOPIC: post.html]
#27

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

This are two separate issues.

What joe528 is experiencing is when you scroll fast and it hit's limit then before it bounces back scroll in the other dirrection again. This will cause it to jump to the begining at the time that bounce back was supposed to complete.

This could be fixed by canceling bounce back if there was another touch.

 

The other issue is that you can see when momentum scrolling slows down that it's not smooth. This is not just a scrollview issues. It's any transition, enterFrame update (which is what momentum scrolling is) and alike. If you are doing things in enterFrame or timers that take various amount of time in each frame than you will see this.

 

Primoz



[TOPIC: post.html]
#28

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

@primoz.cerar

 

In your earlier post, you said you could fix the first issue? How?



[TOPIC: post.html]
#29

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

By taking the GitHub source for scrollview and fixing the bounce back to cancel on another press. But you would have to use that version in your project. You can use only one file that is the culprit which is 'widget_momentumScrolling.lua'. And the rest would be used from the builtin version which has some bug fixes already compared to the version on GitHub. I will look into it in the event and post the fix.



[TOPIC: post.html]
#30

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

Do you mean the fix is already in or you are going to look into it?



[TOPIC: post.html]
#31

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

I will look into it and post the fix in the evening. (Typo in last post)



[TOPIC: post.html]
#32

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

Here is what I came up with. It needs some testing to make sure everything is ok.

 

Just unzip with the folder in the zip in to you project dir.

Now if you want to use the scroll view or the table view with the fixes do this:

 

local widgetFix = require ("widgets.widget")

local scroll = widgetFix.newScrollView(options)

 

same for table view.

If you need any other widgets include the default corona ones like you always do:

local widget = require ("widget")

 

Included fixes:

- scroll view will not jump back to starting position if scrolling in opposite direction before bounce back has completed (vertical and horizontal)

- eliminated occasional error when removing objects from scroll view

- exposed scrollView:updateScrollAreaSize() for making sure the scroll works correctly when moving objects inside the scroll view

- fixed some issues when using multiple scroll views at the same time

- scroll view and table view now respect the vertical scrolling threshold

- fixed table view bug when deleting multiple rows

- fixed table view insertRow bug that says table view is scrolling when it's not and doesn't allow insert

- fixed scroll view scrolls to top when inserting objects issue (pass keepPositionOnInsert = true in newScrollView)

- fixed tableView:scrollToY doesn't stop scrolling

 

Hope this helps. Let me know if there are any issues.

Attached Files



[TOPIC: post.html]
#33

eja

[GLOBAL: userInfoPane.html]
eja
  • Contributor

  • 124 posts
  • Enterprise

Here is what I came up with. It needs some testing to make sure everything is ok.

 

Just unzip with the folder in the zip in to you project dir.

Now if you want to use the scroll view or the table view with the fixes do this:

 

local widgetFix = require ("widgets.widget")

local scroll = widgetFix.newScrollView(options)

 

same for table view.

If you need any other widgets include the default corona ones like you always do:

local widget = require ("widget")

 

Included fixes:

- scroll view will not jump back to starting position if scrolling in opposite direction before bounce back has completed (vertical and horizontal)

- eliminated occasional error when removing objects from scroll view

- exposed scrollView:updateScrollAreaSize() for making sure the scroll works correctly when moving objects inside the scroll view

- fixed some issues when using multiple scroll views at the same time

- scroll view and table view now respect the vertical scrolling threshold

- fixed table view bug when deleting multiple rows

- fixed table view insertRow bug that says table view is scrolling when it's not and doesn't allow insert

 

Hope this helps. Let me know if there are any issues.

 

Awesome, this is great work! Now, if you could sneak in preventing scrollView to shift back to top after inserting objects (http://forums.coronalabs.com/topic/41639-20132087-widgetnewscrollview-scrolls-to-top-when-inserting-new-items/#entry233284) you sir, would forever be held in my heart. lol



[TOPIC: post.html]
#34

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

@eja done.

Updated file above.

 

use keepPositionOnInsert = true in newScrollView call

 

Cheers



[TOPIC: post.html]
#35

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

Great news, everybody!

 

After I tried primoz.cerar's fix, the not-that-smooth problem (jerkiness/choppiness) I had been whining about has GONE!

 

What a work, primoz.cerar!

 

I am speechless. 



[TOPIC: post.html]
#36

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

@primoz's command of the widgets is nothing but amazing! I have the privilege of testing something new he is creating and it continually amazes me. Thank you Primoz.



[TOPIC: post.html]
#37

eja

[GLOBAL: userInfoPane.html]
eja
  • Contributor

  • 124 posts
  • Enterprise

@eja done.

Updated file above.

 

use keepPositionOnInsert = true in newScrollView call

 

Cheers

 

Ahhhhhhhhhhhhhh! You are unbelievable, Great job!!! @Primoz.cerar if you have more updates, please let me know!! YOU'RE THE BEST!!!



[TOPIC: post.html]
#38

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

@eja Will I be forever held in your heart? :D



[TOPIC: post.html]
#39

eja

[GLOBAL: userInfoPane.html]
eja
  • Contributor

  • 124 posts
  • Enterprise

@eja Will I be forever held in your heart? :D

 

Hahaha yeah buddy! thanks a lot



[TOPIC: post.html]
#40

trent7

[GLOBAL: userInfoPane.html]
trent7
  • Observer

  • 7 posts
  • Corona SDK

I was really hopeful that this would be the fix.. Below is the issue I am having:

1. As I am scrolling, the scroll bar stays at the top of the screen, until I get to the end of the content, then It jumps to the bottom.

2. As the content is scrolling, it appears choppy, almost as if it's hanging (at random times) as the content scrolls by

3. As I get to the end of the content, the scroll bar jumps to the bottom, and as I scroll back up it looks like it starts to scroll, then starts over again (very fast).

[TOPIC: post.html]
#41

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

@trent7

 

All the 3 issues are related to the scroll bar?



[TOPIC: post.html]
#42

trent7

[GLOBAL: userInfoPane.html]
trent7
  • Observer

  • 7 posts
  • Corona SDK

The scroll bar doesn't really bother me, just wonder if it's a symptom related to what's causing the issue

[TOPIC: post.html]
#43

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

@eja updated the fix per your request regarding tableView:scrollToY.

 

@trent7 In 2 and 3 are you talking about the content or the scroll bar?



[TOPIC: post.html]
#44

trent7

[GLOBAL: userInfoPane.html]
trent7
  • Observer

  • 7 posts
  • Corona SDK

Here is a link to a video i just did.. When I first start the scroll, notice the stutter. I try this a few times, then as I start to scroll down the page, if you look to the right you'll see the scroll bar is still in the same location. In the video, its hard to tell but scroll is choppy as it pans down the screen. Finally, once I get down to the bottom and start to scroll back up, you'll notice where it looks like it starts to scroll up, then starts over again (very fast). It doesn't do it every time. Just during faster swipes. 

 

https://www.dropbox.com/s/7j1ortmyel39ijt/scroll5.mov

I am happy to send anyone a testflight if you want to test it that way..



[TOPIC: post.html]
#45

eja

[GLOBAL: userInfoPane.html]
eja
  • Contributor

  • 124 posts
  • Enterprise

Here is a link to a video i just did.. When I first start the scroll, notice the stutter. I try this a few times, then as I start to scroll down the page, if you look to the right you'll see the scroll bar is still in the same location. In the video, its hard to tell but scroll is choppy as it pans down the screen. Finally, once I get down to the bottom and start to scroll back up, you'll notice where it looks like it starts to scroll up, then starts over again (very fast). It doesn't do it every time. Just during faster swipes. 

 

https://www.dropbox.com/s/7j1ortmyel39ijt/scroll5.mov

I am happy to send anyone a testflight if you want to test it that way..

 

I experience this as well, (although it doesn't bug me too much.. pun :) ) it would be epic if that can be fixed... but as a dev and just from seeing it, I wouldn't even know where to begin to debug this.



[TOPIC: post.html]
#46

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

The issues at the top and bottom when it jumps is I think what joe528 was having a problem with. This is fixed in my fix above. Just to confirm it is the same problem try this exactly:

 

scroll down a bit

scroll quickly so it reaches top

before it bounces back scroll down and let go. (this has to be done quickly because bounce back is quick)

now if you do this the problem is that the bounce back has not completed while you already started to scroll down again in it will jump

back to top then scroll down again from momentum.

 

If this is it then it's fixed in what I posted above. Read the post on how to use it. It needs a different require set to a new variable to use it. The files have to be in a separate folder as they are in the zip.

To make sure you are using my version you can put a print on line 523 in widget_scrollview.lua. Thats just after this line:

function M.new( options )

  print("Fixed") --put this in

 

Look for it in the terminal.

 

Now about the scroll bar. I have not seen this issue. I read about it in the forums but never encountered it. Are you by any chance dynamically inserting and removing items while scrolling? In this case the scroll bar will act strangely. Another thing I can think of is if you insert all the objects in the same position (top) and only after move them down. In this case some strangeness might also occur. After you have set all the items in the scroll view or when you reposition them inside the scroll view, if you are using my version you can call scrollView:updateScrollAreaSize(). This might help as I used it on occasion when I moved things inside the scroll view and the scroll area did not update. If you can come up with a simple project that demonstrates it I can take a look at it.



[TOPIC: post.html]
#47

eja

[GLOBAL: userInfoPane.html]
eja
  • Contributor

  • 124 posts
  • Enterprise

@primoz.cerar - hey buddy, i have not tried the recent version you posted, however the new tableView (scroll to top fix) broke my app... is there something that was left out?



[TOPIC: post.html]
#48

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

As mentioned in PM please check the phones log for errors.

Did you use the table view from my fix before and only now it broke when I added the scrollToY fix or did you not use it before?

I know it works in iPhone as I have another app with these fixes that work on iPhone without a problem.

I don't have one with me to test now.



[TOPIC: post.html]
#49

primoz.cerar

[GLOBAL: userInfoPane.html]
primoz.cerar
  • Contributor

  • 455 posts
  • Corona SDK

Got it. Sorry about that. Made a mistake in file names.

Take the updated zip or just rename widget_tableview.lua to all lower case letters. It had an upper case V which caused the error.

Rookie mistake :)



[TOPIC: post.html]
#50

eja

[GLOBAL: userInfoPane.html]
eja
  • Contributor

  • 124 posts
  • Enterprise

Got it. Sorry about that. Made a mistake in file names.

Take the updated zip or just rename widget_tableview.lua to all lower case letters. It had an upper case V which caused the error.

Rookie mistake :)

 

lol yup that was it =P




[topic_controls]
Page 2 of 3 1 2 3
 
[/topic_controls]