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 3 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]
#51

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

I am going to publish my app with this fix soon.

 

While primoz.cerar fix is fantastic, my questions are:

 

(1) How am I going to maintain the "branches" of widgets, now my source code has this widget fix and also another widget fix for segmentedControl (a bug that segmentedControl is not working correctly while it's put on a scrollView)

 

Is my source code going to have more and more widget patches?

 

(2) If I have a bug for widget, whom should I report to? 



[TOPIC: post.html]
#52

primoz.cerar

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

  • 455 posts
  • Corona SDK

This made me laugh a bit :D

Well you should report to CL with the bug report tool, but you never know when the engineers will get to it.

Regarding maintaining the different versions what I do is for the widgets I need fixes for I use the github version with my fixes, for others I use the built in ones. When I see the issues have been fixed by CL I would revert back to built in version (in reality I never do this as I don't have access to daily builds), but since there are usualy multiple bugs and only some get fixed I stick with my version and nag the CL staff to update the github repository. When it's updated I merge the CL fixes with my own and use that.

 

Edit: If you have a bug that you see with my version and not the built in one then you should PM me and not file a bug report obviously. I offer no guarantees, I'm just trying to get you past the issues you are having as I have already had to deal with most of them and I felt like sharing.



[TOPIC: post.html]
#53

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

The scrollView fix Rob mentioned earlier seems to be included in the latest Corona build 2189 (https://developer.coronalabs.com/release/2014/2189/):

 

  • Widget: Fixing the scrollview jumping to 0,0 after inserting content, casenum #30775. Improving the limit calculation on scrollviews. Fixing the scrollToY method of the tableView to stop velocity before transitioning.

 

The second phrase "Improving the limit calculation on scrollviews" sounds like a fix for this problem...

 

So I tested with 2189 about this scrollView jerkiness problem...

 

Guess what?

 

It's NOT fixed.

 

Only primoz.cerar's fix is the one that really fixes this problem. 

 

Corona, please keep going for this problem. It's NOT fixed yet.



[TOPIC: post.html]
#54

yosu

[GLOBAL: userInfoPane.html]
yosu
  • Contributor

  • 518 posts
  • Corona SDK

i am having a problem with the scrollview, where a bug in the 'setScrollHeight' feature.

 

After creating a scroll view and setting the height (using 'setScrollHeight'), the scroll-down effect is messed up.

 

Bug case : #31096

 

 

 

Sample code (based on Corona's samples) :

 

-- 
-- Abstract: Scroll View sample app
--  
-- Version: 2.0
-- 
-- Sample code is MIT licensed, see http://www.coronalabs.com/links/code/license
-- Copyright © 2010 Corona Labs Inc. All Rights Reserved.
--
-- Demonstrates how to make text and graphics move up and down on touch,
-- or scroll, using the widget libraries scrollView methods.
--
-- Supports Graphics 2.0
------------------------------------------------------------

display.setStatusBar( display.HiddenStatusBar ) 

local widget = require( "widget" )

-- Our ScrollView listener
local function scrollListener( event )
	local phase = event.phase
	local direction = event.direction
	
	if "began" == phase then
		--print( "Began" )
	elseif "moved" == phase then
		--print( "Moved" )
	elseif "ended" == phase then
		--print( "Ended" )
	end
	
	-- If the scrollView has reached it's scroll limit
	if event.limitReached then
		if "up" == direction then
			print( "Reached Top Limit" )
		elseif "down" == direction then
			print( "Reached Bottom Limit" )
		elseif "left" == direction then
			print( "Reached Left Limit" )
		elseif "right" == direction then
			print( "Reached Right Limit" )
		end
	end
			
	return true
end

-- Create a ScrollView
local scrollView = widget.newScrollView
{
	left = 0,
	top = 0,
	width = display.contentWidth,
	height = display.contentHeight,
	bottomPadding = 50,
	id = "onBottom",
	horizontalScrollDisabled = true,
	verticalScrollDisabled = false,
	listener = scrollListener,
}

--Create a text object for the scrollViews title
local titleText = display.newText("Move Up to Scroll", display.contentCenterX, 48, native.systemFontBold, 16)
titleText:setFillColor( 0 )

-- insert the text object into the created display group
scrollView:insert( titleText )

--Create a large text string
local lotsOfText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet consectetur euismod. Phasellus non ipsum vel eros vestibulum consequat. Integer convallis quam id urna tristique eu viverra risus eleifend.\n\nAenean suscipit placerat venenatis. Pellentesque faucibus venenatis eleifend. Nam lorem felis, rhoncus vel rutrum quis, tincidunt in sapien. Proin eu elit tortor. Nam ut mauris pellentesque justo vulputate convallis eu vitae metus. Praesent mauris eros, hendrerit ac convallis vel, cursus quis sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque fermentum, dui in vehicula dapibus, lorem nisi placerat turpis, quis gravida elit lectus eget nibh. Mauris molestie auctor facilisis.\n\nCurabitur lorem mi, molestie eget tincidunt quis, blandit a libero. Cras a lorem sed purus gravida rhoncus. Cras vel risus dolor, at accumsan nisi. Morbi sit amet sem purus, ut tempor mauris.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet consectetur euismod. Phasellus non ipsum vel eros vestibulum consequat. Integer convallis quam id urna tristique eu viverra risus eleifend.\n\nAenean suscipit placerat venenatis. Pellentesque faucibus venenatis eleifend. Nam lorem felis, rhoncus vel rutrum quis, tincidunt in sapien. Proin eu elit tortor. Nam ut mauris pellentesque justo vulputate convallis eu vitae metus. Praesent mauris eros, hendrerit ac convallis vel, cursus quis sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque fermentum, dui in vehicula dapibus, lorem nisi placerat turpis, quis gravida elit lectus eget nibh. Mauris molestie auctor facilisis.\n\nCurabitur lorem mi, molestie eget tincidunt quis, blandit a libero. Cras a lorem sed purus gravida rhoncus. Cras vel risus dolor, at accumsan nisi. Morbi sit amet sem purus, ut tempor mauris. "

--Create a text object containing the large text string and insert it into the scrollView
local lotsOfTextObject = display.newText( lotsOfText, display.contentCenterX, 0, 300, 0, "Helvetica", 14)
lotsOfTextObject:setFillColor( 0 ) 
lotsOfTextObject.anchorY = 0.0		-- Top
--------------------------------lotsOfTextObject:setReferencePoint( display.TopCenterReferencePoint )
lotsOfTextObject.y = titleText.y + titleText.contentHeight + 10

scrollView:insert( lotsOfTextObject )




-- Adjust scroll height
scrollView:setScrollHeight( 250 )

 



[TOPIC: post.html]
#55

primoz.cerar

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

  • 455 posts
  • Corona SDK

That is because you've set scroll height that is less than the height of the scroll view widget itself. You should not have to do that. At least i don't see a use for it, I may be wrong.

Though there should be a check for that in the scroll view itself so this doesn't happen.



[TOPIC: post.html]
#56

joe528

[GLOBAL: userInfoPane.html]
joe528
  • Contributor

  • 800 posts
  • Corona SDK

@yosu

 

primoz.cerar is right. If you don't set the height less than scrollView's, there shouldn't be a problem. I happened running into this issue couple days ago. So I had to check the scrollHeight before I set (in my case, my content height is dynamic). Of course, if you think scrollview should do the checking, probably it's doable. But you have to either ask widget master primoz.cerar or Corona, I am not really sure.

 

By the way, please create another thread for your issue if you still feel like to discuss because the original problem in this post has not been fixed by Corona yet, so please don't divert them to something else. We finally brought up their attention to this issue after 3 pages of discussion. 



[TOPIC: post.html]
#57

VincentV

[GLOBAL: userInfoPane.html]
VincentV
  • Enthusiast

  • 58 posts
  • Enterprise

Hi there,

 

I'm facing the problem of a choppy scroll view and would like to ask if it's fixed or if theres any solution to this yet? Tried the widgetFix mod by primoz but it didnt fix the choppy issue yet. 

 

Regards,

Vincent



[TOPIC: post.html]
#58

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,527 posts
  • Enterprise

There should be some scrollView fixes coming soon in a daily build.  Lets see if any of those fixes address this.

 

Rob



[TOPIC: post.html]
#59

VincentV

[GLOBAL: userInfoPane.html]
VincentV
  • Enthusiast

  • 58 posts
  • Enterprise

Okay thanks Rob!



[TOPIC: post.html]
#60

Dave Haynes

[GLOBAL: userInfoPane.html]
Dave Haynes
  • Contributor

  • 233 posts
  • Corona SDK

I don't know if this is related to the issue you guys are talking about, but I've got a problem with the scrollview where the momentum scrolling sometimes just doesn't react as well as it should.

 

It's hard to describe, but sometimes "flinging" the scrollview doesn't work, and the scrollview just moves up to where my finger left the screen instead of scrolling quickly as I intended.

 

Thanks,

Dave




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