/**
 * @author Shannon Hicks
 */

// detect screen density once because Ti.Platform.displayCaps calls are expensive
var retina = Ti.Platform.displayCaps.density == 'high';

var BeerRow = function(beer) {
	// create the Row UI
	var row = Titanium.UI.createTableViewRow({
		className:'beerRow',
		height:70,
	});

	var beerImage = Titanium.UI.createImageView({
		top:5,
		left:5,
		width:60,
		height:60,
		image:retina ? beer.image2x : beer.image,
		hires:retina,
	});
	row.add(beerImage);
	
	var beerName = Titanium.UI.createLabel({
		color:'#C36466',
		font:{fontSize:14,fontWeight:'bold', fontFamily:'Arial'},
		left:75,
		right:30,
		height:Ti.UI.SIZE,
		text:beer.name,
	});
	row.add(beerName);
	
	// setters & getters
	row.pushBeer = function(_beer){
		// save the variable
		beer = _beer;
		
		// update views
		beerImage.image = retina ? beer.image2x : beer.image;
		beerName.text = beer.name;
	}
	
	row.pullBeer = function() {
		// return the variable
		return beer;
	}
	
	return row;
}

module.exports = BeerRow;
@@ -197,16 +197,60 @@
 beer) %7B%0A
+%09// create an empy object%0A%09var row = %7B%7D;%0A%09%09%0A
 %09// crea
@@ -264,22 +264,23 @@
 Row UI%0A%09
-var ro
+row.vie
 w = Tita
@@ -503,32 +503,37 @@
 tina,%0A%09%7D);%0A%09row.
+view.
 add(beerImage);%0A
@@ -722,21 +722,26 @@
 e,%0A%09%7D);%0A
-
 %09row.
+view.
 add(beer

Update reusable-components/Resources/BeerRow.js