A few fixes.

- use fill_parent since we are still supporting api level 7.
- on the TrackListActivity, hide the empty view content
  until the check unit dialog has been showned.
- fix the ChartView height. ChartView is no longer displayed
  on the full canvas. The new design has a tab bar and a
  zoom control.
- In TrackDetailActivity, only call methods of a tab fragment
  if it is the current tab.
This commit is contained in:
Jimmy Shih
2012-04-23 17:49:23 -07:00
parent 2ea4b09dcc
commit 33118568bc
7 changed files with 71 additions and 29 deletions
@@ -237,14 +237,20 @@ public class TrackDetailActivity extends AbstractMyTracksActivity {
ChartFragment.CHART_FRAGMENT_TAG.equals(currentTabTag));
menu.findItem(R.id.track_detail_my_location)
.setVisible(MapFragment.MAP_FRAGMENT_TAG.equals(currentTabTag));
// Set map or satellite mode
MapFragment mapFragment = (MapFragment) getSupportFragmentManager()
.findFragmentByTag(MapFragment.MAP_FRAGMENT_TAG);
boolean isSatelliteMode = mapFragment != null ? mapFragment.isSatelliteView() : false;
menu.findItem(R.id.track_detail_satellite_mode)
.setVisible(MapFragment.MAP_FRAGMENT_TAG.equals(currentTabTag))
.setTitle(isSatelliteMode ? R.string.menu_map_mode : R.string.menu_satellite_mode);
MenuItem satelliteMode = menu.findItem(R.id.track_detail_satellite_mode)
.setVisible(MapFragment.MAP_FRAGMENT_TAG.equals(currentTabTag));
if (satelliteMode.isVisible()) {
MapFragment mapFragment = (MapFragment) getSupportFragmentManager()
.findFragmentByTag(MapFragment.MAP_FRAGMENT_TAG);
/*
* The current tag is mapFragment, thus safe to call its methods like
* isSatelliteView.
*/
boolean isSatelliteMode = mapFragment != null ? mapFragment.isSatelliteView() : false;
menu.findItem(R.id.track_detail_satellite_mode).setTitle(
isSatelliteMode ? R.string.menu_map_mode : R.string.menu_satellite_mode);
}
return super.onPrepareOptionsMenu(menu);
}