Skip to content

Commit

Permalink
- measurement fixes
Browse files Browse the repository at this point in the history
- sample1 rename
  • Loading branch information
pykaso committed Feb 7, 2013
1 parent a28ca1f commit c2e888a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 31 deletions.
26 changes: 0 additions & 26 deletions samples/sample1/ListView.gproj

This file was deleted.

2 changes: 1 addition & 1 deletion samples/sample2/Sample2.gproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<project>
<properties autorotation="0" fps="60" scaleMode="0" mouseToTouch="1" iosDevice="0" packageName="com.yourdomain.yourapp" logicalHeight="480" logicalWidth="320" mouseTouchOrder="0" retinaDisplay="0" touchToMouse="1" assetsOnly="0" orientation="0" architecture="0">
<properties autorotation="0" fps="60" scaleMode="0" mouseToTouch="1" iosDevice="0" packageName="net.pykaso.gideros.listview.sample1" logicalHeight="480" logicalWidth="320" mouseTouchOrder="0" retinaDisplay="0" touchToMouse="1" assetsOnly="0" orientation="0" architecture="1">
<imageScales/>
</properties>
<folder name="libs">
Expand Down
1 change: 1 addition & 0 deletions samples/sample2/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data[4] = box(300, 480, 25, 0xffffff)
myList = ListView.new({
width=480,
height=700,
friction = 0.97,
bgTexture = Texture.new("resources/images/texture.png"),
data=data
})
Expand Down
8 changes: 4 additions & 4 deletions ui/ListView.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ function ListView:listItemTouch(e, act)
elseif( self.isFocus ) then
if(act == "move") then
local lastItem = li:getChildAt(li:getNumChildren())
delta = (e.touch.y - prevPos)
delta = e.touch.y - prevPos
prevPos = e.touch.y

if (li:getChildAt(1).id == 1 and li:getY() > 0) or
(lastItem.id == #self.itemData and (self.listHeight - lastItem:getY()-lastItem:getHeight()) <= 0) then
li:setY(li:getY() + delta/3)
li:setY(math.floor(li:getY() + delta/3))
else
li:setY(li:getY() + delta)
li:setY(math.floor(li:getY() + delta))
end
self:updateRender()
end
Expand All @@ -170,7 +170,7 @@ end

function ListView:scrollList(event)

if math.abs(velocity) < 0.1 then
if math.abs(velocity) < 0.3 then
velocity = 0
self:removeEventListener("enterFrame", self.scrollList, self)

Expand Down

0 comments on commit c2e888a

Please sign in to comment.