Update menu icons.

Update tab icons.
Place tab tag in the appropriate fragment.
This commit is contained in:
Jimmy Shih
2012-04-23 10:07:08 -07:00
parent 7701d31bdc
commit 7fd3f0e8d9
68 changed files with 50 additions and 47 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+3 -3
View File
@@ -18,16 +18,16 @@ limitations under the License.
<item
android:icon="@drawable/menu_show_on_map"
android:id="@+id/list_context_menu_show_on_map"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_show_on_map"/>
<item
android:icon="@drawable/menu_edit"
android:id="@+id/list_context_menu_edit"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_edit"/>
<item
android:icon="@drawable/menu_delete"
android:id="@+id/list_context_menu_delete"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_delete"/>
</menu>
+2 -2
View File
@@ -18,12 +18,12 @@ limitations under the License.
<item
android:icon="@drawable/menu_show_on_map"
android:id="@+id/marker_detail_show_on_map"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_show_on_map"/>
<item
android:icon="@drawable/menu_edit"
android:id="@+id/marker_detail_edit"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_edit"/>
<item
android:icon="@drawable/menu_delete"
+1 -1
View File
@@ -18,7 +18,7 @@ limitations under the License.
<item
android:icon="@drawable/menu_insert_marker"
android:id="@+id/marker_list_insert_marker"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_insert_marker"/>
<item
android:actionViewClass="android.widget.SearchView"
+12 -9
View File
@@ -18,22 +18,22 @@ limitations under the License.
<item
android:icon="@drawable/menu_stop_recording"
android:id="@+id/track_detail_stop_recording"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_stop_recording"/>
<item
android:icon="@drawable/menu_insert_marker"
android:id="@+id/track_detail_insert_marker"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_insert_marker"/>
<item
android:icon="@drawable/menu_play"
android:id="@+id/track_detail_play"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_play"/>
<item
android:icon="@drawable/menu_share"
android:id="@+id/track_detail_share"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_share">
<menu>
<item
@@ -49,13 +49,16 @@ limitations under the License.
</menu>
</item>
<item
android:icon="@drawable/ic_menu_waypoints"
android:icon="@drawable/menu_markers"
android:id="@+id/track_detail_markers"
android:showAsAction="ifRoom"
android:title="@string/menu_markers"/>
<item
android:icon="@drawable/menu_send_google"
android:id="@+id/track_detail_send_google"
android:title="@string/menu_send_google"/>
<item
android:icon="@drawable/menu_save"
android:id="@+id/track_detail_save"
android:title="@string/menu_save">
<menu>
@@ -74,19 +77,19 @@ limitations under the License.
android:id="@+id/track_detail_delete"
android:title="@string/menu_delete"/>
<item
android:icon="@android:drawable/ic_menu_mylocation"
android:icon="@drawable/menu_my_location"
android:id="@+id/track_detail_my_location"
android:title="@string/menu_my_location"/>
<item
android:icon="@android:drawable/ic_menu_mapmode"
android:icon="@drawable/menu_satellite_mode"
android:id="@+id/track_detail_satellite_mode"
android:title="@string/menu_satellite_mode"/>
<item
android:icon="@drawable/ic_menu_chartsettings"
android:icon="@drawable/menu_chart_settings"
android:id="@+id/track_detail_chart_settings"
android:title="@string/menu_chart_settings"/>
<item
android:icon="@drawable/ic_menu_sensorstatus"
android:icon="@drawable/menu_sensor_state"
android:id="@+id/track_detail_sensor_state"
android:title="@string/menu_sensor_state"/>
<item
+6 -2
View File
@@ -18,12 +18,12 @@ limitations under the License.
<item
android:icon="@drawable/menu_record_track"
android:id="@+id/track_list_record_track"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_record_track"/>
<item
android:icon="@drawable/menu_stop_recording"
android:id="@+id/track_list_stop_recording"
android:showAsAction="always"
android:showAsAction="ifRoom"
android:title="@string/menu_stop_recording"/>
<item
android:actionViewClass="android.widget.SearchView"
@@ -32,9 +32,11 @@ limitations under the License.
android:showAsAction="always|collapseActionView"
android:title="@string/menu_search"/>
<item
android:icon="@drawable/menu_import_all"
android:id="@+id/track_list_import_all"
android:title="@string/menu_import_all"/>
<item
android:icon="@drawable/menu_export_all"
android:id="@+id/track_list_export_all"
android:title="@string/menu_export_all">
<menu>
@@ -45,9 +47,11 @@ limitations under the License.
</menu>
</item>
<item
android:icon="@drawable/menu_delete_all"
android:id="@+id/track_list_delete_all"
android:title="@string/menu_delete_all"/>
<item
android:icon="@drawable/menu_aggregated_statistics"
android:id="@+id/track_list_aggregated_statistics"
android:title="@string/menu_aggregated_statistics"/>
<item
@@ -33,14 +33,6 @@ public abstract class Constants {
*/
public static final String SDCARD_TOP_DIR = "MyTracks";
/*
* Main screen tab tags:
*/
public static final String MAP_TAB_TAG = "map";
public static final String STATS_TAB_TAG = "stats";
public static final String CHART_TAB_TAG = "chart";
/**
* The number of distance readings to smooth to get a stable signal.
*/
@@ -16,10 +16,6 @@
package com.google.android.apps.mytracks;
import static com.google.android.apps.mytracks.Constants.CHART_TAB_TAG;
import static com.google.android.apps.mytracks.Constants.MAP_TAB_TAG;
import static com.google.android.apps.mytracks.Constants.STATS_TAB_TAG;
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
import com.google.android.apps.mytracks.content.TrackDataHub;
import com.google.android.apps.mytracks.content.Waypoint;
@@ -148,17 +144,16 @@ public class TrackDetailActivity extends FragmentActivity {
tabHost = (TabHost) findViewById(android.R.id.tabhost);
tabHost.setup();
tabManager = new TabManager(this, tabHost, R.id.realtabcontent);
TabSpec mapTabSpec = tabHost.newTabSpec(MAP_TAB_TAG).setIndicator(
getString(R.string.track_detail_map_tab),
getResources().getDrawable(android.R.drawable.ic_menu_mapmode));
TabSpec mapTabSpec = tabHost.newTabSpec(MapFragment.MAP_FRAGMENT_TAG).setIndicator(
getString(R.string.track_detail_map_tab), getResources().getDrawable(R.drawable.tab_map));
tabManager.addTab(mapTabSpec, MapFragment.class, null);
TabSpec chartTabSpec = tabHost.newTabSpec(CHART_TAB_TAG).setIndicator(
TabSpec chartTabSpec = tabHost.newTabSpec(ChartFragment.CHART_FRAGMENT_TAG).setIndicator(
getString(R.string.track_detail_chart_tab),
getResources().getDrawable(R.drawable.menu_elevation));
getResources().getDrawable(R.drawable.tab_chart));
tabManager.addTab(chartTabSpec, ChartFragment.class, null);
TabSpec statsTabSpec = tabHost.newTabSpec(STATS_TAB_TAG).setIndicator(
TabSpec statsTabSpec = tabHost.newTabSpec(StatsFragment.STATS_FRAGMENT_TAG).setIndicator(
getString(R.string.track_detail_stats_tab),
getResources().getDrawable(R.drawable.ic_menu_statistics));
getResources().getDrawable(R.drawable.tab_stats));
tabManager.addTab(statsTabSpec, StatsFragment.class, null);
if (savedInstanceState != null) {
tabHost.setCurrentTabByTag(savedInstanceState.getString(CURRENT_TAG_KEY));
@@ -242,14 +237,17 @@ public class TrackDetailActivity extends FragmentActivity {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
String currentTabTag = tabHost.getCurrentTabTag();
menu.findItem(R.id.track_detail_chart_settings).setVisible(CHART_TAB_TAG.equals(currentTabTag));
menu.findItem(R.id.track_detail_my_location).setVisible(MAP_TAB_TAG.equals(currentTabTag));
menu.findItem(R.id.track_detail_chart_settings).setVisible(
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(MAP_TAB_TAG);
.findFragmentByTag(MapFragment.MAP_FRAGMENT_TAG);
boolean isSatelliteMode = mapFragment != null ? mapFragment.isSatelliteView() : false;
menu.findItem(R.id.track_detail_satellite_mode).setVisible(MAP_TAB_TAG.equals(currentTabTag))
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);
return super.onPrepareOptionsMenu(menu);
@@ -339,13 +337,15 @@ public class TrackDetailActivity extends FragmentActivity {
getSupportFragmentManager(), DeleteOneTrackDialogFragment.DELETE_ONE_TRACK_DIALOG_TAG);
return true;
case R.id.track_detail_my_location:
mapFragment = (MapFragment) getSupportFragmentManager().findFragmentByTag(MAP_TAB_TAG);
mapFragment = (MapFragment) getSupportFragmentManager()
.findFragmentByTag(MapFragment.MAP_FRAGMENT_TAG);
if (mapFragment != null) {
mapFragment.showMyLocation();
}
return true;
case R.id.track_detail_satellite_mode:
mapFragment = (MapFragment) getSupportFragmentManager().findFragmentByTag(MAP_TAB_TAG);
mapFragment = (MapFragment) getSupportFragmentManager()
.findFragmentByTag(MapFragment.MAP_FRAGMENT_TAG);
if (mapFragment != null) {
mapFragment.setSatelliteView(!mapFragment.isSatelliteView());
}
@@ -433,9 +433,9 @@ public class TrackDetailActivity extends FragmentActivity {
if (markerId != -1L) {
MapFragment mapFragmet = (MapFragment) getSupportFragmentManager()
.findFragmentByTag(MAP_TAB_TAG);
.findFragmentByTag(MapFragment.MAP_FRAGMENT_TAG);
if (mapFragmet != null) {
tabHost.setCurrentTabByTag(MAP_TAB_TAG);
tabHost.setCurrentTabByTag(MapFragment.MAP_FRAGMENT_TAG);
mapFragmet.showMarker(trackId, markerId);
} else {
Log.e(TAG, "MapFragment is null");
@@ -55,6 +55,8 @@ import java.util.EnumSet;
*/
public class ChartFragment extends Fragment implements TrackDataListener {
public static final String CHART_FRAGMENT_TAG = "chartFragment";
// Android reports 128 when the speed is invalid
private static final int INVALID_SPEED = 128;
private final DoubleBuffer elevationBuffer = new DoubleBuffer(
@@ -16,8 +16,6 @@
package com.google.android.apps.mytracks.fragments;
import static com.google.android.apps.mytracks.Constants.CHART_TAB_TAG;
import com.google.android.apps.mytracks.ChartView;
import com.google.android.maps.mytracks.R;
@@ -42,7 +40,7 @@ public class ChartSettingsDialogFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final ChartFragment chartFragment = (ChartFragment) getActivity()
.getSupportFragmentManager().findFragmentByTag(CHART_TAB_TAG);
.getSupportFragmentManager().findFragmentByTag(ChartFragment.CHART_FRAGMENT_TAG);
View view = getActivity().getLayoutInflater().inflate(R.layout.chart_settings, null);
final RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.chart_settings_x);
radioGroup.check(chartFragment.getMode() == ChartView.Mode.BY_DISTANCE
@@ -57,6 +57,8 @@ import java.util.EnumSet;
public class MapFragment extends Fragment
implements View.OnTouchListener, View.OnClickListener, TrackDataListener {
public static final String MAP_FRAGMENT_TAG = "mapFragment";
private static final String KEY_CURRENT_LOCATION = "currentLocation";
private static final String KEY_KEEP_MY_LOCATION_VISIBLE = "keepMyLocationVisible";
@@ -48,6 +48,8 @@ import java.util.EnumSet;
*/
public class StatsFragment extends Fragment implements TrackDataListener {
public static final String STATS_FRAGMENT_TAG = "statsFragment";
private static final String TAG = StatsFragment.class.getSimpleName();
private TrackDataHub trackDataHub;