Add toolbar settings

This commit is contained in:
Victor Shcherb 2012-07-27 01:01:45 +02:00
parent fefdca8b88
commit 2136f7e100
6 changed files with 23 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -9,6 +9,8 @@
1. All your modified/created strings are in the top of the file (to make easier find what's translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="map_widget_top_text">Street name</string>
<string name="map_widget_config">Configuration</string>
<string name="map_widget_map_select">Map selection</string>
<string name="map_widget_back_to_loc">Where am I</string>
<string name="map_widget_lock_screen">Lock screen</string>

View file

@ -1076,6 +1076,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
routingHelper.setAppMode(settings.getApplicationMode());
mapView.setMapPosition(settings.POSITION_ON_MAP.get());
registerUnregisterSensor(getLastKnownLocation(), false);
mapLayers.getMapInfoLayer().recreateControls();
mapLayers.getMapInfoLayer().applyTheme();
mapLayers.updateLayers(mapView);

View file

@ -77,7 +77,7 @@ public class OsmandBackgroundServicePlugin extends OsmandPlugin {
MapInfoLayer layer = activity.getMapLayers().getMapInfoLayer();
ImageViewControl lockView = createBgServiceView( activity.getMapView(), activity);
// TODO icon
layer.getMapInfoControls().registerTopWidget(lockView, R.drawable.monitoring_rec_big, R.string.map_widget_lock_screen, "lock_view", true, EnumSet.allOf(ApplicationMode.class), 10);
layer.getMapInfoControls().registerTopWidget(lockView, R.drawable.monitoring_rec_small, R.string.map_widget_lock_screen, "lock_view", true, EnumSet.allOf(ApplicationMode.class), 10);
}
@Override

View file

@ -207,11 +207,13 @@ public class MapInfoLayer extends OsmandMapLayer {
ImageViewControl compassView = createCompassView(map);
mapInfoControls.registerTopWidget(compassView, R.drawable.compass, R.string.map_widget_compass, "compass", true, all, 5);
backToLocation = createBackToLocation(map);
mapInfoControls.registerTopWidget(backToLocation, R.drawable.default_mode_small, R.string.map_widget_back_to_loc, "back_to_location", false, all, 5);
View config = createConfiguration();
mapInfoControls.registerTopWidget(config, android.R.drawable.ic_menu_preferences, R.string.map_widget_config, "config", true, all, 10).required(ApplicationMode.values());
backToLocation = createBackToLocation(map);
mapInfoControls.registerTopWidget(backToLocation, R.drawable.location_default, R.string.map_widget_back_to_loc, "back_to_location", false, all, 5);
View globusAndProgress = createGlobusAndProgress();
mapInfoControls.registerTopWidget(globusAndProgress, R.drawable.globus, R.string.map_widget_map_select, "progress", false, all, 10).required(ApplicationMode.values());
mapInfoControls.registerTopWidget(globusAndProgress, R.drawable.globus, R.string.map_widget_map_select, "progress", false, all, 10);
topText = new TopTextView(routingHelper, map);
}
@ -447,6 +449,18 @@ public class MapInfoLayer extends OsmandMapLayer {
}
private View createConfiguration(){
final OsmandMapTileView view = map.getMapView();
ImageView configuration = new ImageView(map);
configuration.setBackgroundDrawable(view.getResources().getDrawable(android.R.drawable.ic_menu_preferences));
configuration.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openViewConfigureDialog();
}
});
return configuration;
}
private View createGlobusAndProgress(){
Drawable globusDrawable = view.getResources().getDrawable(R.drawable.globus);
FrameLayout fl = new FrameLayout(view.getContext());
@ -456,9 +470,7 @@ public class MapInfoLayer extends OsmandMapLayer {
globus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO
openViewConfigureDialog();
// map.getMapLayers().selectMapLayer(view);
map.getMapLayers().selectMapLayer(view);
}
});
fl.addView(globus, fparams);
@ -467,8 +479,7 @@ public class MapInfoLayer extends OsmandMapLayer {
progressBar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openViewConfigureDialog();
// map.getMapLayers().selectMapLayer(view);
map.getMapLayers().selectMapLayer(view);
}
});
fl.addView(progressBar, fparams);