Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

UMOBILE-257 Fixed issue in MapProxy on Android, and made map ui autom…

…atically responsive to orientation changes.
  • Loading branch information...
commit d83664e78a1175e415bcd38d55130f6b7207a9d7 1 parent b0027ad
Jeff Cross jeffbcross authored
3  Resources/js/models/MapProxy.js
@@ -347,7 +347,8 @@ exports.retrieveLocationsByCategory = function (_catName, _numResults, _pageNum)
347 347 _resultSet.next();
348 348 }
349 349
350   - _result.totalResults = parseInt(_db.execute("SELECT COUNT(*) FROM map_locations WHERE categories LIKE ?", _catNameQuery).field(0), 10);
  350 + // Not used yet, but was causing errors. totalResults would be useful for paging UI, which hasn't yet been implemented.
  351 + // _result.totalResults = parseInt(_db.execute("SELECT COUNT(*) FROM map_locations WHERE categories LIKE ?", _catNameQuery).field(0), 10) || 0;
351 352
352 353 _resultSet.close();
353 354 _db.close();
7 Resources/js/style.js
@@ -502,7 +502,8 @@ exports.updateStyles = function () {
502 502 // MAP STYLES
503 503 exports.mapView= {
504 504 top: defaults.TITLEBAR_HEIGHT * 2 + 'dp',
505   - height: deviceProxy.retrieveHeight(true) - (defaults.TITLEBAR_HEIGHT * 2 + defaults.STATUSBAR_HEIGHT + 50) + 'dp',
  505 + // height: deviceProxy.retrieveHeight(true) - (defaults.TITLEBAR_HEIGHT * 2 + defaults.STATUSBAR_HEIGHT + 50) + 'dp',
  506 + bottom: '50dp',
506 507 mapType: Titanium.Map.STANDARD_TYPE,
507 508 regionFit: true,
508 509 animate: true,
@@ -513,7 +514,7 @@ exports.updateStyles = function () {
513 514 };
514 515 exports.mapTableView = {
515 516 top: defaults.TITLEBAR_HEIGHT * 2 + 'dp',
516   - height: deviceProxy.retrieveHeight(true) - (defaults.TITLEBAR_HEIGHT + defaults.TITLEBAR_HEIGHT + defaults.STATUSBAR_HEIGHT + 50) + 'dp'
  517 + bottom: '50dp'
517 518 };
518 519 exports.mapCategoryRow= {
519 520 font: {
@@ -535,7 +536,7 @@ exports.updateStyles = function () {
535 536 textAlign: 'center'
536 537 };
537 538 exports.mapNavView= {
538   - top: deviceProxy.retrieveHeight(true) - 50 - defaults.STATUSBAR_HEIGHT + 'dp',
  539 + bottom: 0,
539 540 height : '50dp',
540 541 backgroundGradient : defaults.SECONDARY_BAR_BACKGROUND_GRADIENT
541 542 };
16 Resources/js/views/MapWindowView.js
@@ -73,11 +73,6 @@ exports.saveActivityIndicatorMessage = function (message) {
73 73 };
74 74
75 75 exports.rotate = function (orientation) {
76   - styles = styles.updateStyles();
77   - if (mapView) mapView.height = styles.mapView.height;
78   - if (bottomNavView) bottomNavView.top = styles.mapNavView.top;
79   -
80   - if (categoryBrowsingView) categoryBrowsingView.height = styles.mapTableView.height;
81 76 };
82 77
83 78 exports.resetMapLocation = function () {
@@ -91,7 +86,7 @@ exports.searchBlur = function (e) {
91 86 exports.openCategoryBrowsingView = function (categories) {
92 87 _hideAllViews();
93 88
94   - if (categories.length === 1) return exports.openCategoryLocationsListView(require('/js/models/MapProxy').retrieveLocationsByCategory(categories[0].name));
  89 + if (categories.length === 1) return exports.openCategoryLocationsListView(mapProxy.retrieveLocationsByCategory(categories[0].name));
95 90 // If there isn't a categoryNavBar yet, go ahead and create one.
96 91 if (!categoryNavBar) _createAndAddCategoryNav();
97 92
@@ -144,11 +139,8 @@ exports.openCategoryBrowsingView = function (categories) {
144 139 })(categories);
145 140
146 141 // Create the view to hold tableviews listing categories and locations.
147   - categoryBrowsingView = Ti.UI.createTableView({
148   - data: _categoryBrowsingData,
149   - height: styles.mapTableView.height,
150   - top: styles.mapTableView.top
151   - });
  142 + categoryBrowsingView = Ti.UI.createTableView(styles.mapTableView);
  143 + categoryBrowsingView.setData(_categoryBrowsingData);
152 144 view.add(categoryBrowsingView);
153 145 };
154 146
@@ -167,7 +159,7 @@ exports.openCategoryLocationsListView = function (viewModel) {
167 159 if (!categoryNavBar) _createAndAddCategoryNav();
168 160 categoryNavBar.view.show();
169 161
170   - categoryNavBar.leftButton[require('/js/models/MapProxy').retrieveTotalCategories() > 1 ? 'show' : 'hide']();
  162 + categoryNavBar.leftButton[mapProxy.retrieveTotalCategories() > 1 ? 'show' : 'hide']();
171 163 categoryNavBar.titleLabel.text = viewModel.categoryName;
172 164 categoryNavBar.rightButton.title = localDictionary.map;
173 165 categoryNavBar.rightButton.show();

0 comments on commit d83664e

Please sign in to comment.
Something went wrong with that request. Please try again.