Sure…
function onRowRender( event )
local row = event.row
local params = event.row.params
local storeId = event.row.params.storeId
local rowHeight = row.contentHeight;
local rowWidth = row.contentWidth;
local id = row.index
objectId = event.row.params.objectId
starSelected = event.row.params.starSelected
starUnselected = event.row.params.starUnselected
long = event.row.params.long
lat = event.row.params.lat
if ( event.row.params ) then
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
------------------------------------------ ADDING NEW STAR BUTTON FOR FAVORITES ------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
starUnchecked = widget.newButton(
{
width = 58/2,
height = 58/2,
– onEvent = drinkChooseEvent,
defaultFile = “images/starUnchecked.png”,
overFile = “images/starUnchecked.png”,
– onEvent = handleButtonEvent
}
)
– Center the button
starUnchecked.x = 25
starUnchecked.y = -130
sceneGroup:insert( starUnchecked)
row:insert( starUnchecked)
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
------------------------------------------ END ADDING STAR BUTTON ------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
function networkListener( event )
if ( event.isError ) then
print( "Network error - download failed: ", event.response )
else
params.progress = true
function locationHandler( event )
currentLocation = myMap:getUserLocation()
if ( currentLocation.errorCode or ( currentLocation.latitude == 0 and currentLocation.longitude == 0 ) ) then
– locationText.text = currentLocation.errorMessage
attempts = attempts + 1
if ( attempts > 10 ) then
native.showAlert( “No GPS Signal”, “Can’t sync with GPS.”, { “Okay” } )
else
timer.performWithDelay( 1000, locationHandler )
end
else
– locationText.text = "Current location: " … currentLocation.latitude … “,” … currentLocation.longitude
myMap:setCenter( currentLocation.latitude, currentLocation.longitude, 0.01, 0.01 )
myMap:addMarker( currentLocation.latitude, currentLocation.longitude,0.01, 0.01 )
end
end
function mapGo(event)
print( "type: ", event.type ) – event type
print( "markerId: ", event.markerId ) – ID of the marker that was touched
print( "lat: ", event.latitude ) – latitude of the marker
print( "long: ", event.longitude ) – longitude of the marker
end
local options =
{
title = params.name,
subtitle = params.address,
listener = mapGo,
imageFile = “images/mapIcon.png”,
}
myMap:addMarker( params.lat, params.long, options )
end
end
network.download( “http://ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com/files/”…params.image…".png", “GET”, networkListener, params.image…".png", system.TemporaryDirectory)
display.loadRemoteImage( “http://ec2-54-206-9-43.ap-southeast-2.compute.amazonaws.com/files/”…params.image…".png", “GET”,
function(myImage)
--Check if row is in bounds by looking for existence of _proxy
if(event.row._proxy ) then
if(myImage.isError) then
print("----error loading photo")
else
myImage.target.alpha = 0
transition.to( myImage.target, { alpha = 1.0 } )
myImage.target.width = myImage.target.width/2
myImage.target.height = myImage.target.height/2
myImage.target.x = math.floor(myImage.target.width/2)
myImage.target.y = math.floor(myImage.target.height/2)
sceneGroup:insert( myImage.target)
row:insert(myImage.target)
row.nameText = display.newText( params.name, 12, 0, “WorkSans-Bold”, 15 )
row.nameText.anchorX = 0
row.nameText.anchorY = 0.5
row.nameText:setFillColor( 1,1,1 )
row.nameText.y = 110
row.nameText.x = 10
sceneGroup:insert( row.nameText )
row:insert( row.nameText )
row.addressText = display.newText( params.address, 12, 0, “WorkSans-Bold”, 11 )
row.addressText.anchorX = 0
row.addressText.anchorY = 0.5
row.addressText:setFillColor( 1,1,1 )
row.addressText.y = 130
row.addressText.x = 10
sceneGroup:insert( row.addressText )
row:insert( row.addressText )
end
else
--Do not add image to row, it is out of bounds
display.remove(myImage.target)
end
end,
params.image…".png", system.TemporaryDirectory
)
end
end