Update actions

This commit is contained in:
Victor Shcherb 2015-03-19 01:41:42 +01:00
parent 2500269cec
commit 4f4ce9eb48
5 changed files with 2 additions and 67 deletions

View file

@ -11,7 +11,6 @@ import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.base.BasicProgressAsyncTask;
import net.osmand.plus.dashboard.DashDownloadMapsFragment;
import net.osmand.plus.dashboard.DashErrorFragment;
import net.osmand.plus.dashboard.DashUpdatesFragment;
import net.osmand.plus.dashboard.NotifyingScrollView;
@ -30,7 +29,6 @@ import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@ -249,9 +247,6 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
((DashUpdatesFragment) f).updatedDownloadsList(list);
}
if (f instanceof DashDownloadMapsFragment && !f.isDetached()) {
((DashDownloadMapsFragment) f).refreshData();
}
}
}

View file

@ -649,37 +649,6 @@ public class MapActivityActions implements DialogProvider {
ContextMenuAdapter optionsMenuHelper = new ContextMenuAdapter(app);
currentDrawer = DrawerType.MAIN_MENU;
boolean USE_OLD_DRAWER_TODELETE = false;
if (USE_OLD_DRAWER_TODELETE) {
optionsMenuHelper.item(R.string.home_button)
.icons(R.drawable.ic_dashboard_dark, R.drawable.ic_dashboard_light)
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos,
boolean isChecked) {
// getMyApplication().getSettings().USE_DASHBOARD_INSTEAD_OF_DRAWER.set(true);
mapActivity.getDashboard().setDashboardVisibility(true);
return true;
}
}).reg();
// 1. Where am I
optionsMenuHelper.item(R.string.where_am_i)
.icons(R.drawable.ic_action_gloc_dark, R.drawable.ic_action_gloc_light)
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos,
boolean isChecked) {
if (getMyApplication().accessibilityEnabled()) {
whereAmIDialog();
} else {
mapActivity.getMapViewTrackingUtilities().backToLocationImpl();
}
return true;
}
}).reg();
}
// 2-4. Navigation related (directions, mute, cancel navigation)
boolean muteVisible = routingHelper.getFinalLocation() != null && routingHelper.isFollowingMode();
if (muteVisible) {
@ -851,23 +820,6 @@ public class MapActivityActions implements DialogProvider {
}).reg();
//////////// Others
final OsmAndLocationProvider loc = app.getLocationProvider();
// this is development functionality so it should stay preferrably here
if (OsmandPlugin.getEnabledPlugin(OsmandDevelopmentPlugin.class) != null && USE_OLD_DRAWER_TODELETE) {
optionsMenuHelper
.item(loc.getLocationSimulation().isRouteAnimating() ? R.string.animate_route_off : R.string.animate_route)
.icons(R.drawable.ic_action_play_dark, R.drawable.ic_action_play_light)
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
// animate moving on route
loc.getLocationSimulation().startStopRouteAnimation(mapActivity);
return true;
}
}).reg();
}
OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper);
optionsMenuHelper.item(R.string.shared_string_exit).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light )
.listen(new OnContextMenuClick() {

View file

@ -5,7 +5,6 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.activities.PluginActivity;
@ -37,7 +36,6 @@ public class DashPluginsFragment extends DashBaseFragment {
return new View.OnClickListener() {
@Override
public void onClick(View view) {
View pluginView = AndroidUtils.findParentViewById(view, R.id.dash_plugin_item);
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(plugin.getInstallURL())));
}
};

View file

@ -112,7 +112,8 @@ public class DashboardOnMap {
params.gravity = landscape ? Gravity.BOTTOM | Gravity.RIGHT : Gravity.TOP | Gravity.RIGHT;
actionButton.setLayoutParams(params);
actionButton.setImageDrawable(mapActivity.getResources().getDrawable(R.drawable.ic_action_get_my_location));
actionButton.setButtonColor(mapActivity.getResources().getColor(R.color.color_myloc_distance));
actionButton.setButtonColor(mapActivity.getResources().getColor(R.color.map_widget_blue));
actionButton.setButtonColorPressed(mapActivity.getResources().getColor(R.color.map_widget_blue_pressed));
actionButton.hide();
actionButton.setOnClickListener(new View.OnClickListener() {
@Override

View file

@ -422,17 +422,6 @@ public class ParkingPositionPlugin extends OsmandPlugin {
@Override
public void registerOptionsMenuItems(final MapActivity mapActivity, ContextMenuAdapter helper) {
if (parkingLayer != null && parkingPosition != null) {
helper.item(R.string.osmand_parking_delete)
.icons(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_light).listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
showDeleteDialog(mapActivity);
return true;
}
}).reg();
}
}
/**