Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gruehle committed Oct 1, 2011
1 parent 421b976 commit 0611a23
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 176 deletions.
5 changes: 0 additions & 5 deletions src/FlexGroupon.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
resize="resizeHandler(event)"
splashScreenImage="FlouponSplashScreen">
<fx:Style source="assets/styles.css"/>

<!-- TODO:
- Skin for calloutButton on Android
- Add multi-dpi splash screen
-->
<fx:Script>
<![CDATA[
import flash.profiler.showRedrawRegions;
Expand Down
11 changes: 11 additions & 0 deletions src/models/Groupon.as
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,24 @@ public class Groupon extends EventDispatcher
discussionsResult.addEventListener(FaultEvent.FAULT, faultHandler);
}

//////////////////////////////////////////////////////////
//
// Public properties
//
//////////////////////////////////////////////////////////


// nearbyDeals
[Bindable]
public var nearbyDeals:ArrayCollection;

// dealDiscussions - discussions for the selected deal
[Bindable]
public var dealDiscussions:ArrayCollection;

private var _selectedDeal:Deal;

// selectedDeal
[Bindable]
public function get selectedDeal():Deal
{
Expand Down Expand Up @@ -84,12 +93,14 @@ public class Groupon extends EventDispatcher
initialized = true;
}

// Get the discussions for the currently selected deal
public function getSelectedDealDiscussions():void
{
dealDiscussions = null;
discussionsResult.token = grouponService.getDealDiscussions(selectedDeal.id, Constants.CLIENT_ID);
}

// Refresh the nearbyDeals list
public function refresh():void
{
nearbyDeals = null;
Expand Down
2 changes: 1 addition & 1 deletion src/skins/SplitViewNavigatorSkin.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Declarations>
<s:SkinnablePopUpContainer id="viewNavigatorPopUp" height="{height}" skinClass="skins.MasterNavigatorPopUpSkin" />
<s:SkinnablePopUpContainer id="viewNavigatorPopUp" height="{height}" width="401" skinClass="skins.MasterNavigatorPopUpSkin" />
</fx:Declarations>

<s:states>
Expand Down
4 changes: 4 additions & 0 deletions src/utils/DeviceInfo.as
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ public class DeviceInfo {
return FlexGlobals.topLevelApplication.aspectRatio;
}

// Return true if the current device has a tablet-sized screen.
// If the screen has more tha 960 pixels in either width or height,
// consider it a tablet.
public static function get isTablet():Boolean
{
// If either the width or height > 960, we're on a tablet
return (FlexGlobals.topLevelApplication.width > 960 ||
FlexGlobals.topLevelApplication.height > 960);
}

// Return true if we're running on iOS
public static function get isIOS():Boolean
{
return Capabilities.version.indexOf("IOS") >= 0;
Expand Down
Loading

0 comments on commit 0611a23

Please sign in to comment.