Change dashboard animations
This commit is contained in:
parent
1d695c8e5d
commit
67a6ccb0a2
28 changed files with 158 additions and 125 deletions
|
@ -284,6 +284,12 @@ public class AndroidUtils {
|
||||||
decorView.setSystemUiVisibility(uiOptions);
|
decorView.setSystemUiVisibility(uiOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int[] getViewLocation(View view) {
|
||||||
|
int[] coordinates = new int[2];
|
||||||
|
view.getLocationOnScreen(coordinates);
|
||||||
|
return coordinates;
|
||||||
|
}
|
||||||
|
|
||||||
public static void enterToFullScreen(Activity activity) {
|
public static void enterToFullScreen(Activity activity) {
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
activity.getWindow().getDecorView()
|
activity.getWindow().getDecorView()
|
||||||
|
|
|
@ -252,7 +252,7 @@ public class ContextMenuAdapter {
|
||||||
ItemClickListener ca = item.getItemClickListener();
|
ItemClickListener ca = item.getItemClickListener();
|
||||||
item.setSelected(isChecked);
|
item.setSelected(isChecked);
|
||||||
if (ca != null) {
|
if (ca != null) {
|
||||||
ca.onContextMenuClick(la, item.getTitleId(), position, isChecked);
|
ca.onContextMenuClick(la, item.getTitleId(), position, isChecked, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -348,7 +348,8 @@ public class ContextMenuAdapter {
|
||||||
boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
||||||
int itemId,
|
int itemId,
|
||||||
int position,
|
int position,
|
||||||
boolean isChecked);
|
boolean isChecked,
|
||||||
|
int[] viewCoordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ProgressListener {
|
public interface ProgressListener {
|
||||||
|
@ -372,7 +373,7 @@ public class ContextMenuAdapter {
|
||||||
btn.setChecked(!btn.isChecked());
|
btn.setChecked(!btn.isChecked());
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return onContextMenuClick(adapter, itemId, position, false);
|
return onContextMenuClick(adapter, itemId, position, false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class HelpActivity extends OsmandActionBarActivity implements AdapterView
|
||||||
ContextMenuAdapter.ItemClickListener listener =
|
ContextMenuAdapter.ItemClickListener listener =
|
||||||
mAdapter.getItem(position).getItemClickListener();
|
mAdapter.getItem(position).getItemClickListener();
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onContextMenuClick(mAdapter, position, position, false);
|
listener.onContextMenuClick(mAdapter, position, position, false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,8 @@ public class HelpActivity extends OsmandActionBarActivity implements AdapterView
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
||||||
int itemId,
|
int itemId,
|
||||||
int position,
|
int position,
|
||||||
boolean isChecked) {
|
boolean isChecked,
|
||||||
|
int[] viewCoordinates) {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return false;
|
return false;
|
||||||
|
@ -227,7 +228,7 @@ public class HelpActivity extends OsmandActionBarActivity implements AdapterView
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||||
String title = mTitle == null ? adapter.getItem(position).getTitle() : mTitle;
|
String title = mTitle == null ? adapter.getItem(position).getTitle() : mTitle;
|
||||||
HelpArticleDialogFragment.instantiateWithAsset(filename, title)
|
HelpArticleDialogFragment.instantiateWithAsset(filename, title)
|
||||||
.show(ctx.getSupportFragmentManager(), "DIALOG_HELP_ARTICLE");
|
.show(ctx.getSupportFragmentManager(), "DIALOG_HELP_ARTICLE");
|
||||||
|
|
|
@ -18,6 +18,7 @@ import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
|
@ -282,7 +283,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
|
|
||||||
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (resId == R.string.context_menu_item_add_waypoint) {
|
if (resId == R.string.context_menu_item_add_waypoint) {
|
||||||
mapActivity.getContextMenu().addWptPt();
|
mapActivity.getContextMenu().addWptPt();
|
||||||
} else if (resId == R.string.context_menu_item_edit_waypoint) {
|
} else if (resId == R.string.context_menu_item_edit_waypoint) {
|
||||||
|
@ -322,7 +323,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
int standardId = item.getTitleId();
|
int standardId = item.getTitleId();
|
||||||
ItemClickListener click = item.getItemClickListener();
|
ItemClickListener click = item.getItemClickListener();
|
||||||
if (click != null) {
|
if (click != null) {
|
||||||
click.onContextMenuClick(listAdapter, standardId, which, false);
|
click.onContextMenuClick(listAdapter, standardId, which, false, null);
|
||||||
} else if (standardId == R.string.context_menu_item_last_intermediate_point) {
|
} else if (standardId == R.string.context_menu_item_last_intermediate_point) {
|
||||||
mapActivity.getContextMenu().addAsLastIntermediate();
|
mapActivity.getContextMenu().addAsLastIntermediate();
|
||||||
} else if (standardId == R.string.context_menu_item_search) {
|
} else if (standardId == R.string.context_menu_item_search) {
|
||||||
|
@ -612,11 +613,11 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.map_dashboard)
|
.setIcon(R.drawable.map_dashboard)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_dashboard_open");
|
app.logEvent(mapActivity, "drawer_dashboard_open");
|
||||||
MapActivity.clearPrevActivityIntent();
|
MapActivity.clearPrevActivityIntent();
|
||||||
mapActivity.closeDrawer();
|
mapActivity.closeDrawer();
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD, viewCoordinates);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}).createItem());
|
}).createItem());
|
||||||
|
@ -625,7 +626,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_flag_dark)
|
.setIcon(R.drawable.ic_action_flag_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_markers_open");
|
app.logEvent(mapActivity, "drawer_markers_open");
|
||||||
MapActivity.clearPrevActivityIntent();
|
MapActivity.clearPrevActivityIntent();
|
||||||
MapMarkersDialogFragment.showInstance(mapActivity);
|
MapMarkersDialogFragment.showInstance(mapActivity);
|
||||||
|
@ -637,10 +638,10 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_intermediate)
|
.setIcon(R.drawable.ic_action_intermediate)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_waypoints_open");
|
app.logEvent(mapActivity, "drawer_waypoints_open");
|
||||||
MapActivity.clearPrevActivityIntent();
|
MapActivity.clearPrevActivityIntent();
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS, viewCoordinates);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).createItem());
|
}).createItem());
|
||||||
|
@ -650,7 +651,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_fav_dark)
|
.setIcon(R.drawable.ic_action_fav_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_myplaces_open");
|
app.logEvent(mapActivity, "drawer_myplaces_open");
|
||||||
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
|
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
|
||||||
.getFavoritesActivity());
|
.getFavoritesActivity());
|
||||||
|
@ -664,7 +665,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_search_dark)
|
.setIcon(R.drawable.ic_action_search_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_search_open");
|
app.logEvent(mapActivity, "drawer_search_open");
|
||||||
mapActivity.showQuickSearch(MapActivity.ShowQuickSearchMode.NEW_IF_EXPIRED, false);
|
mapActivity.showQuickSearch(MapActivity.ShowQuickSearchMode.NEW_IF_EXPIRED, false);
|
||||||
return true;
|
return true;
|
||||||
|
@ -676,7 +677,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_search_dark)
|
.setIcon(R.drawable.ic_action_search_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_legacy_search_open");
|
app.logEvent(mapActivity, "drawer_legacy_search_open");
|
||||||
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
|
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
|
||||||
.getSearchActivity());
|
.getSearchActivity());
|
||||||
|
@ -697,7 +698,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_gdirections_dark)
|
.setIcon(R.drawable.ic_action_gdirections_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_directions_open");
|
app.logEvent(mapActivity, "drawer_directions_open");
|
||||||
MapControlsLayer mapControlsLayer = mapActivity.getMapLayers().getMapControlsLayer();
|
MapControlsLayer mapControlsLayer = mapActivity.getMapLayers().getMapControlsLayer();
|
||||||
if (mapControlsLayer != null) {
|
if (mapControlsLayer != null) {
|
||||||
|
@ -724,10 +725,10 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_layers_dark)
|
.setIcon(R.drawable.ic_action_layers_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_config_map_open");
|
app.logEvent(mapActivity, "drawer_config_map_open");
|
||||||
MapActivity.clearPrevActivityIntent();
|
MapActivity.clearPrevActivityIntent();
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP, viewCoordinates);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).createItem());
|
}).createItem());
|
||||||
|
@ -743,7 +744,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setTitle(d).setIcon(R.drawable.ic_type_archive)
|
.setTitle(d).setIcon(R.drawable.ic_type_archive)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_download_maps_open");
|
app.logEvent(mapActivity, "drawer_download_maps_open");
|
||||||
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
|
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
|
||||||
.getDownloadActivity());
|
.getDownloadActivity());
|
||||||
|
@ -758,7 +759,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_osm_live)
|
.setIcon(R.drawable.ic_action_osm_live)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_osm_live_open");
|
app.logEvent(mapActivity, "drawer_osm_live_open");
|
||||||
Intent intent = new Intent(mapActivity, OsmLiveActivity.class);
|
Intent intent = new Intent(mapActivity, OsmLiveActivity.class);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||||
|
@ -772,7 +773,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_ruler)
|
.setIcon(R.drawable.ic_action_ruler)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||||
MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager());
|
MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -782,10 +783,10 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_configure_screen_dark)
|
.setIcon(R.drawable.ic_configure_screen_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_config_screen_open");
|
app.logEvent(mapActivity, "drawer_config_screen_open");
|
||||||
MapActivity.clearPrevActivityIntent();
|
MapActivity.clearPrevActivityIntent();
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_SCREEN);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_SCREEN, viewCoordinates);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).createItem());
|
}).createItem());
|
||||||
|
@ -794,7 +795,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_extension_dark)
|
.setIcon(R.drawable.ic_extension_dark)
|
||||||
.setListener(new ItemClickListener() {
|
.setListener(new ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_plugins_open");
|
app.logEvent(mapActivity, "drawer_plugins_open");
|
||||||
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
|
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
|
||||||
.getPluginsActivity());
|
.getPluginsActivity());
|
||||||
|
@ -808,7 +809,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_settings)
|
.setIcon(R.drawable.ic_action_settings)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_settings_open");
|
app.logEvent(mapActivity, "drawer_settings_open");
|
||||||
final Intent settings = new Intent(mapActivity, getMyApplication().getAppCustomization()
|
final Intent settings = new Intent(mapActivity, getMyApplication().getAppCustomization()
|
||||||
.getSettingsActivity());
|
.getSettingsActivity());
|
||||||
|
@ -835,7 +836,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
.setIcon(R.drawable.ic_action_help)
|
.setIcon(R.drawable.ic_action_help)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
app.logEvent(mapActivity, "drawer_help_open");
|
app.logEvent(mapActivity, "drawer_help_open");
|
||||||
Intent intent = new Intent(mapActivity, HelpActivity.class);
|
Intent intent = new Intent(mapActivity, HelpActivity.class);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||||
|
@ -946,7 +947,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
ContextMenuItem item = contextMenuAdapter.getItem(position);
|
ContextMenuItem item = contextMenuAdapter.getItem(position);
|
||||||
ContextMenuAdapter.ItemClickListener click = item.getItemClickListener();
|
ContextMenuAdapter.ItemClickListener click = item.getItemClickListener();
|
||||||
if (click != null && click.onContextMenuClick(simpleListAdapter, item.getTitleId(),
|
if (click != null && click.onContextMenuClick(simpleListAdapter, item.getTitleId(),
|
||||||
position, false)) {
|
position, false, AndroidUtils.getViewLocation(view))) {
|
||||||
mapActivity.closeDrawer();
|
mapActivity.closeDrawer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,7 +293,7 @@ public class MapActivityLayers {
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
ContextMenuItem item = listAdapter.getItem(position);
|
ContextMenuItem item = listAdapter.getItem(position);
|
||||||
item.setSelected(!item.getSelected());
|
item.setSelected(!item.getSelected());
|
||||||
item.getItemClickListener().onContextMenuClick(listAdapter, position, position, item.getSelected());
|
item.getItemClickListener().onContextMenuClick(listAdapter, position, position, item.getSelected(), null);
|
||||||
listAdapter.notifyDataSetChanged();
|
listAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -416,7 +416,7 @@ public class MapActivityLayers {
|
||||||
builder.setListener(new ContextMenuAdapter.ItemClickListener() {
|
builder.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
||||||
int itemId, int position, boolean isChecked) {
|
int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||||
ContextMenuItem item = adapter.getItem(position);
|
ContextMenuItem item = adapter.getItem(position);
|
||||||
item.setSelected(isChecked);
|
item.setSelected(isChecked);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -623,7 +623,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
||||||
public void registerLayerContextMenuActions(final OsmandMapTileView mapView, ContextMenuAdapter adapter, final MapActivity mapActivity) {
|
public void registerLayerContextMenuActions(final OsmandMapTileView mapView, ContextMenuAdapter adapter, final MapActivity mapActivity) {
|
||||||
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == R.string.layer_recordings) {
|
if (itemId == R.string.layer_recordings) {
|
||||||
SHOW_RECORDINGS.set(!SHOW_RECORDINGS.get());
|
SHOW_RECORDINGS.set(!SHOW_RECORDINGS.get());
|
||||||
adapter.getItem(pos).setColorRes(SHOW_RECORDINGS.get() ?
|
adapter.getItem(pos).setColorRes(SHOW_RECORDINGS.get() ?
|
||||||
|
@ -653,7 +653,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
recordAudio(latitude, longitude, mapActivity);
|
recordAudio(latitude, longitude, mapActivity);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -664,7 +664,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
||||||
.setListener(new ItemClickListener() {
|
.setListener(new ItemClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
recordVideo(latitude, longitude, mapActivity, false);
|
recordVideo(latitude, longitude, mapActivity, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -674,7 +674,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
||||||
.setIcon(R.drawable.ic_action_photo_dark)
|
.setIcon(R.drawable.ic_action_photo_dark)
|
||||||
.setListener(new ItemClickListener() {
|
.setListener(new ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
takePhoto(latitude, longitude, mapActivity, false, false);
|
takePhoto(latitude, longitude, mapActivity, false, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.data.PointDescription;
|
import net.osmand.data.PointDescription;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
@ -85,7 +86,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
dashboard.setDashboardVisibility(true, DashboardType.WAYPOINTS);
|
dashboard.setDashboardVisibility(true, DashboardType.WAYPOINTS, AndroidUtils.getViewLocation(v));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
LinearLayout favorites = (LinearLayout) mainView.findViewById(R.id.items);
|
LinearLayout favorites = (LinearLayout) mainView.findViewById(R.id.items);
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
package net.osmand.plus.dashboard;
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.animation.AnimatorSet;
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -19,9 +23,6 @@ import android.view.Gravity;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.animation.Animation;
|
|
||||||
import android.view.animation.Animation.AnimationListener;
|
|
||||||
import android.view.animation.TranslateAnimation;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.AbsListView;
|
import android.widget.AbsListView;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
@ -510,7 +511,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
setDashboardVisibility(true, flatNow ? DashboardType.WAYPOINTS : DashboardType.WAYPOINTS_FLAT,
|
setDashboardVisibility(true, flatNow ? DashboardType.WAYPOINTS : DashboardType.WAYPOINTS_FLAT,
|
||||||
previousVisibleType, false);
|
previousVisibleType, false, AndroidUtils.getViewLocation(v));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -661,7 +662,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
|
||||||
markersSelectionButton.onClickListener = new View.OnClickListener() {
|
markersSelectionButton.onClickListener = new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
setDashboardVisibility(true, DashboardType.MAP_MARKERS_SELECTION);
|
setDashboardVisibility(true, DashboardType.MAP_MARKERS_SELECTION, AndroidUtils.getViewLocation(v));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -759,12 +760,20 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDashboardVisibility(boolean visible, DashboardType type) {
|
public void setDashboardVisibility(boolean visible, DashboardType type) {
|
||||||
|
setDashboardVisibility(visible, type, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDashboardVisibility(boolean visible, DashboardType type, int[] animationCoordinates) {
|
||||||
boolean animate = !getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get();
|
boolean animate = !getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get();
|
||||||
setDashboardVisibility(visible, type, this.visible ? visibleType : null, animate);
|
setDashboardVisibility(visible, type, this.visible ? visibleType : null, animate, animationCoordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDashboardVisibility(boolean visible, DashboardType type, boolean animation) {
|
public void setDashboardVisibility(boolean visible, DashboardType type, boolean animation) {
|
||||||
setDashboardVisibility(visible, type, this.visible ? visibleType : null, animation);
|
setDashboardVisibility(visible, type, animation, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDashboardVisibility(boolean visible, DashboardType type, boolean animation, int[] animationCoordinates) {
|
||||||
|
setDashboardVisibility(visible, type, this.visible ? visibleType : null, animation, animationCoordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshDashboardFragments() {
|
public void refreshDashboardFragments() {
|
||||||
|
@ -776,7 +785,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
|
||||||
return R.color.status_bar_transparent_gradient;
|
return R.color.status_bar_transparent_gradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDashboardVisibility(boolean visible, DashboardType type, DashboardType prevItem, boolean animation) {
|
public void setDashboardVisibility(boolean visible, DashboardType type, DashboardType prevItem, boolean animation, int[] animationCoordinates) {
|
||||||
if (visible == this.visible && type == visibleType) {
|
if (visible == this.visible && type == visibleType) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -868,7 +877,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
|
||||||
|
|
||||||
updateToolbarActions();
|
updateToolbarActions();
|
||||||
//fabButton.showFloatingActionButton();
|
//fabButton.showFloatingActionButton();
|
||||||
open(dashboardView.findViewById(R.id.animateContent), animation);
|
open(dashboardView.findViewById(R.id.animateContent), animation, animationCoordinates);
|
||||||
updateLocation(true, true, false);
|
updateLocation(true, true, false);
|
||||||
// addOrUpdateDashboardFragments();
|
// addOrUpdateDashboardFragments();
|
||||||
mapActivity.getRoutingHelper().addListener(this);
|
mapActivity.getRoutingHelper().addListener(this);
|
||||||
|
@ -1121,7 +1130,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
|
||||||
if (btn != null && btn.getVisibility() == View.VISIBLE) {
|
if (btn != null && btn.getVisibility() == View.VISIBLE) {
|
||||||
btn.setChecked(!btn.isChecked());
|
btn.setChecked(!btn.isChecked());
|
||||||
} else {
|
} else {
|
||||||
if (click.onContextMenuClick(listAdapter, item.getTitleId(), which, false)) {
|
if (click.onContextMenuClick(listAdapter, item.getTitleId(), which, false, null)) {
|
||||||
hideDashboard();
|
hideDashboard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1202,51 +1211,58 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
|
||||||
|
|
||||||
|
|
||||||
// To animate view slide out from right to left
|
// To animate view slide out from right to left
|
||||||
private void open(View view, boolean animation) {
|
private void open(final View view, boolean animation, int[] animationCoordinates) {
|
||||||
if (animation) {
|
if (animation) {
|
||||||
TranslateAnimation animate = new TranslateAnimation(-mapActivity.findViewById(R.id.MapHudButtonsOverlay)
|
AnimatorSet set = new AnimatorSet();
|
||||||
.getWidth(), 0, 0, 0);
|
List<Animator> animators = new ArrayList<>();
|
||||||
animate.setDuration(500);
|
if (animationCoordinates != null) {
|
||||||
animate.setFillAfter(true);
|
int screenHeight = mapActivity.getResources().getDisplayMetrics().heightPixels;
|
||||||
view.startAnimation(animate);
|
int screenWidth = mapActivity.getResources().getDisplayMetrics().widthPixels;
|
||||||
|
animators.add(ObjectAnimator.ofFloat(view, View.TRANSLATION_X, animationCoordinates[0] - screenWidth / 2, 0));
|
||||||
|
animators.add(ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, animationCoordinates[1] - screenHeight / 2, 0));
|
||||||
|
}
|
||||||
|
animators.add(ObjectAnimator.ofFloat(view, View.ALPHA, 0f, 1f));
|
||||||
|
animators.add(ObjectAnimator.ofFloat(view, View.SCALE_X, 0.2f, 1f));
|
||||||
|
animators.add(ObjectAnimator.ofFloat(view, View.SCALE_Y, 0.2f, 1f));
|
||||||
|
set.setDuration(300).playTogether(animators);
|
||||||
|
set.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animator animation) {
|
||||||
|
super.onAnimationStart(animation);
|
||||||
view.setVisibility(View.VISIBLE);
|
view.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set.start();
|
||||||
} else {
|
} else {
|
||||||
view.setVisibility(View.VISIBLE);
|
view.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hide(View view, boolean animation) {
|
private void hide(final View view, boolean animation) {
|
||||||
if (compassButton != null) {
|
if (compassButton != null) {
|
||||||
mapActivity.getMapLayers().getMapControlsLayer().restoreCompassButton(nightMode);
|
mapActivity.getMapLayers().getMapControlsLayer().restoreCompassButton(nightMode);
|
||||||
compassButton = null;
|
compassButton = null;
|
||||||
}
|
}
|
||||||
if (!animation) {
|
if (!animation) {
|
||||||
dashboardView.setVisibility(View.GONE);
|
dashboardView.setVisibility(View.GONE);
|
||||||
|
view.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
TranslateAnimation animate = new TranslateAnimation(0, -mapActivity.findViewById(R.id.MapHudButtonsOverlay)
|
AnimatorSet set = new AnimatorSet();
|
||||||
.getWidth(), 0, 0);
|
set.setDuration(300).playTogether(
|
||||||
animate.setDuration(500);
|
ObjectAnimator.ofFloat(view, View.ALPHA, 1f, 0f),
|
||||||
animate.setFillAfter(true);
|
ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, 0, view.getHeight())
|
||||||
animate.setAnimationListener(new AnimationListener() {
|
);
|
||||||
|
set.addListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationRepeat(Animation animation) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animation animation) {
|
|
||||||
dashboardView.setVisibility(View.GONE);
|
dashboardView.setVisibility(View.GONE);
|
||||||
|
view.setVisibility(View.GONE);
|
||||||
|
view.setTranslationY(0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
view.startAnimation(animate);
|
set.start();
|
||||||
}
|
}
|
||||||
view.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
|
||||||
.setIcon(R.drawable.ic_action_gabout_dark)
|
.setIcon(R.drawable.ic_action_gabout_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
final Intent mapIntent = new Intent(mapActivity, ContributionVersionActivity.class);
|
final Intent mapIntent = new Intent(mapActivity, ContributionVersionActivity.class);
|
||||||
mapActivity.startActivityForResult(mapIntent, 0);
|
mapActivity.startActivityForResult(mapIntent, 0);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -157,13 +157,13 @@ public class ConfigureMapMenu {
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return onContextMenuClick(adapter, itemId, pos, false);
|
return onContextMenuClick(adapter, itemId, pos, false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int pos, boolean isChecked) {
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
final OsmandSettings settings = ma.getMyApplication().getSettings();
|
final OsmandSettings settings = ma.getMyApplication().getSettings();
|
||||||
final PoiFiltersHelper poiFiltersHelper = ma.getMyApplication().getPoiFilters();
|
final PoiFiltersHelper poiFiltersHelper = ma.getMyApplication().getPoiFilters();
|
||||||
final ContextMenuItem item = cm.getItem(pos);
|
final ContextMenuItem item = cm.getItem(pos);
|
||||||
|
@ -331,14 +331,14 @@ public class ConfigureMapMenu {
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return onContextMenuClick(adapter, itemId, position, false);
|
return onContextMenuClick(adapter, itemId, position, false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
||||||
final int pos, boolean isChecked) {
|
final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (transportSelectedInner) {
|
if (transportSelectedInner) {
|
||||||
for (int i = 0; i < transportPrefs.size(); i++) {
|
for (int i = 0; i < transportPrefs.size(); i++) {
|
||||||
transportPrefs.get(i).set(false);
|
transportPrefs.get(i).set(false);
|
||||||
|
@ -499,7 +499,7 @@ public class ConfigureMapMenu {
|
||||||
.setIcon(R.drawable.ic_map).setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setIcon(R.drawable.ic_map).setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
||||||
final int pos, boolean isChecked) {
|
final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
|
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
|
||||||
bld.setTitle(R.string.renderers);
|
bld.setTitle(R.string.renderers);
|
||||||
final OsmandApplication app = activity.getMyApplication();
|
final OsmandApplication app = activity.getMyApplication();
|
||||||
|
@ -552,7 +552,7 @@ public class ConfigureMapMenu {
|
||||||
.setIcon(getDayNightIcon(activity)).setListener(new ItemClickListener() {
|
.setIcon(getDayNightIcon(activity)).setListener(new ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
||||||
final int pos, boolean isChecked) {
|
final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
final OsmandMapTileView view = activity.getMapView();
|
final OsmandMapTileView view = activity.getMapView();
|
||||||
AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
|
AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
|
||||||
bld.setTitle(R.string.daynight);
|
bld.setTitle(R.string.daynight);
|
||||||
|
@ -588,7 +588,7 @@ public class ConfigureMapMenu {
|
||||||
.setIcon(R.drawable.ic_action_map_magnifier).setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setIcon(R.drawable.ic_action_map_magnifier).setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
||||||
final int pos, boolean isChecked) {
|
final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
final OsmandMapTileView view = activity.getMapView();
|
final OsmandMapTileView view = activity.getMapView();
|
||||||
final OsmandSettings.OsmandPreference<Float> mapDensity = view.getSettings().MAP_DENSITY;
|
final OsmandSettings.OsmandPreference<Float> mapDensity = view.getSettings().MAP_DENSITY;
|
||||||
final AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
|
final AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
|
||||||
|
@ -651,7 +651,7 @@ public class ConfigureMapMenu {
|
||||||
.setIcon(R.drawable.ic_action_map_text_size).setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setIcon(R.drawable.ic_action_map_text_size).setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
||||||
final int pos, boolean isChecked) {
|
final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
final OsmandMapTileView view = activity.getMapView();
|
final OsmandMapTileView view = activity.getMapView();
|
||||||
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
|
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
|
||||||
// test old descr as title
|
// test old descr as title
|
||||||
|
@ -690,7 +690,7 @@ public class ConfigureMapMenu {
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad, int itemId,
|
||||||
final int pos, boolean isChecked) {
|
final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
final OsmandMapTileView view = activity.getMapView();
|
final OsmandMapTileView view = activity.getMapView();
|
||||||
final AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
|
final AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
|
||||||
|
|
||||||
|
@ -889,7 +889,7 @@ public class ConfigureMapMenu {
|
||||||
final ItemClickListener clickListener = new ContextMenuAdapter.ItemClickListener() {
|
final ItemClickListener clickListener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> a, int itemId, int pos,
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> a, int itemId, int pos,
|
||||||
boolean isChecked) {
|
boolean isChecked, int[] viewCoordinates) {
|
||||||
if (!isChecked && !useDescription) {
|
if (!isChecked && !useDescription) {
|
||||||
if (defaultSettings != null) {
|
if (defaultSettings != null) {
|
||||||
defaultSettings.set("");
|
defaultSettings.set("");
|
||||||
|
@ -939,8 +939,8 @@ public class ConfigureMapMenu {
|
||||||
} else {
|
} else {
|
||||||
builder.setListener(new OnRowItemClick() {
|
builder.setListener(new OnRowItemClick() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> a, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> a, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
return clickListener.onContextMenuClick(a, itemId, pos, isChecked);
|
return clickListener.onContextMenuClick(a, itemId, pos, isChecked, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1210,7 +1210,7 @@ public class ConfigureMapMenu {
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
pref.set(!pref.get());
|
pref.set(!pref.get());
|
||||||
refreshMapComplete(activity);
|
refreshMapComplete(activity);
|
||||||
return false;
|
return false;
|
||||||
|
@ -1233,7 +1233,7 @@ public class ConfigureMapMenu {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> ad,
|
||||||
final int itemId, final int pos, boolean isChecked) {
|
final int itemId, final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
|
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
|
||||||
// test old descr as title
|
// test old descr as title
|
||||||
b.setTitle(propertyDescr);
|
b.setTitle(propertyDescr);
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class RasterMapMenu {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter,
|
||||||
final int itemId, final int pos, final boolean isChecked) {
|
final int itemId, final int pos, final boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == toggleActionStringId) {
|
if (itemId == toggleActionStringId) {
|
||||||
app.runInUIThread(new Runnable() {
|
app.runInUIThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -658,7 +658,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
|
||||||
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == R.string.delete_point) {
|
if (itemId == R.string.delete_point) {
|
||||||
for (int i = 0; i < measurementPoints.size(); i++) {
|
for (int i = 0; i < measurementPoints.size(); i++) {
|
||||||
Iterator<WptPt> it = measurementPoints.get(i).iterator();
|
Iterator<WptPt> it = measurementPoints.get(i).iterator();
|
||||||
|
|
|
@ -166,7 +166,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
||||||
ContextMenuItem item = adapter.getItem(which);
|
ContextMenuItem item = adapter.getItem(which);
|
||||||
if (item.getItemClickListener() != null) {
|
if (item.getItemClickListener() != null) {
|
||||||
item.getItemClickListener().onContextMenuClick(null,
|
item.getItemClickListener().onContextMenuClick(null,
|
||||||
item.getTitleId(), which, false);
|
item.getTitleId(), which, false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
||||||
private void basicFileOperation(final LocalIndexInfo info, ContextMenuAdapter adapter) {
|
private void basicFileOperation(final LocalIndexInfo info, ContextMenuAdapter adapter) {
|
||||||
ItemClickListener listener = new ItemClickListener() {
|
ItemClickListener listener = new ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
return performBasicOperation(resId, info);
|
return performBasicOperation(resId, info);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -619,7 +619,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
||||||
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
||||||
int itemId, int pos, boolean isChecked) {
|
int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
localOptionsMenu(itemId);
|
localOptionsMenu(itemId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -681,7 +681,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
||||||
for (int i = 0; i < optionsMenuAdapter.length(); i++) {
|
for (int i = 0; i < optionsMenuAdapter.length(); i++) {
|
||||||
ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(i);
|
ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(i);
|
||||||
if (itemId == contextMenuItem.getTitleId()) {
|
if (itemId == contextMenuItem.getTitleId()) {
|
||||||
contextMenuItem.getItemClickListener().onContextMenuClick(null, itemId, i, false);
|
contextMenuItem.getItemClickListener().onContextMenuClick(null, itemId, i, false, null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import android.view.ViewGroup;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
|
|
||||||
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.map.ITileSource;
|
import net.osmand.map.ITileSource;
|
||||||
import net.osmand.map.TileSourceManager;
|
import net.osmand.map.TileSourceManager;
|
||||||
import net.osmand.plus.ApplicationMode;
|
import net.osmand.plus.ApplicationMode;
|
||||||
|
@ -150,14 +151,14 @@ public class MapillaryPlugin extends OsmandPlugin {
|
||||||
@Override
|
@Override
|
||||||
public boolean onRowItemClick(ArrayAdapter<ContextMenuItem> adapter, View view, int itemId, int position) {
|
public boolean onRowItemClick(ArrayAdapter<ContextMenuItem> adapter, View view, int itemId, int position) {
|
||||||
if (itemId == R.string.mapillary) {
|
if (itemId == R.string.mapillary) {
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardOnMap.DashboardType.MAPILLARY);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardOnMap.DashboardType.MAPILLARY, AndroidUtils.getViewLocation(view));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int pos, boolean isChecked) {
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
final OsmandSettings settings = mapActivity.getMyApplication().getSettings();
|
final OsmandSettings settings = mapActivity.getMyApplication().getSettings();
|
||||||
if (itemId == R.string.mapillary) {
|
if (itemId == R.string.mapillary) {
|
||||||
OsmandMapTileView mapView = mapActivity.getMapView();
|
OsmandMapTileView mapView = mapActivity.getMapView();
|
||||||
|
|
|
@ -450,7 +450,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
||||||
optionsMenuAdapter = new ContextMenuAdapter();
|
optionsMenuAdapter = new ContextMenuAdapter();
|
||||||
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, final int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, final int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == R.string.local_index_mi_reload) {
|
if (itemId == R.string.local_index_mi_reload) {
|
||||||
reloadTracks();
|
reloadTracks();
|
||||||
} else if (itemId == R.string.shared_string_show_on_map) {
|
} else if (itemId == R.string.shared_string_show_on_map) {
|
||||||
|
@ -521,7 +521,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
||||||
for (int i = 0; i < optionsMenuAdapter.length(); i++) {
|
for (int i = 0; i < optionsMenuAdapter.length(); i++) {
|
||||||
ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(i);
|
ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(i);
|
||||||
if (itemId == contextMenuItem.getTitleId()) {
|
if (itemId == contextMenuItem.getTitleId()) {
|
||||||
contextMenuItem.getItemClickListener().onContextMenuClick(null, itemId, i, false);
|
contextMenuItem.getItemClickListener().onContextMenuClick(null, itemId, i, false, null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
final Object selectedObj) {
|
final Object selectedObj) {
|
||||||
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (resId == R.string.context_menu_item_create_poi) {
|
if (resId == R.string.context_menu_item_create_poi) {
|
||||||
//getPoiActions(mapActivity).showCreateDialog(latitude, longitude);
|
//getPoiActions(mapActivity).showCreateDialog(latitude, longitude);
|
||||||
EditPoiDialogFragment editPoiDialogFragment =
|
EditPoiDialogFragment editPoiDialogFragment =
|
||||||
|
@ -273,7 +273,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == R.string.layer_osm_bugs) {
|
if (itemId == R.string.layer_osm_bugs) {
|
||||||
OsmandSettings.OsmandPreference<Boolean> showOsmBugs = settings.SHOW_OSM_BUGS;
|
OsmandSettings.OsmandPreference<Boolean> showOsmBugs = settings.SHOW_OSM_BUGS;
|
||||||
showOsmBugs.set(isChecked);
|
showOsmBugs.set(isChecked);
|
||||||
|
@ -303,7 +303,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
sendGPXFiles(la, (AvailableGPXFragment) fragment, (GpxInfo) info);
|
sendGPXFiles(la, (AvailableGPXFragment) fragment, (GpxInfo) info);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
.setListener(new ItemClickListener() {
|
.setListener(new ItemClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
f.openSelectionMode(R.string.local_index_mi_upload_gpx, R.drawable.ic_action_export,
|
f.openSelectionMode(R.string.local_index_mi_upload_gpx, R.drawable.ic_action_export,
|
||||||
R.drawable.ic_action_export, new OnClickListener() {
|
R.drawable.ic_action_export, new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -282,7 +282,7 @@ public class OsMoPlugin extends OsmandPlugin implements OsMoReactor {
|
||||||
.setIcon(R.drawable.ic_osmo_dark)
|
.setIcon(R.drawable.ic_osmo_dark)
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
Intent intent = new Intent(mapActivity, OsMoGroupsActivity.class);
|
Intent intent = new Intent(mapActivity, OsMoGroupsActivity.class);
|
||||||
mapActivity.startActivity(intent);
|
mapActivity.startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
||||||
ItemClickListener addListener = new ItemClickListener() {
|
ItemClickListener addListener = new ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId,
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId,
|
||||||
int pos, boolean isChecked) {
|
int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (resId == R.string.context_menu_item_add_parking_point) {
|
if (resId == R.string.context_menu_item_add_parking_point) {
|
||||||
showAddParkingDialog(mapActivity, latitude, longitude);
|
showAddParkingDialog(mapActivity, latitude, longitude);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import android.widget.EditText;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.ResultMatcher;
|
import net.osmand.ResultMatcher;
|
||||||
import net.osmand.StateChangedListener;
|
import net.osmand.StateChangedListener;
|
||||||
|
@ -241,18 +242,19 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
||||||
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.OnRowItemClick() {
|
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.OnRowItemClick() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onRowItemClick(ArrayAdapter<ContextMenuItem> adapter, View view, int itemId, int position) {
|
public boolean onRowItemClick(ArrayAdapter<ContextMenuItem> adapter, View view, int itemId, int position) {
|
||||||
|
int[] viewCoordinates = AndroidUtils.getViewLocation(view);
|
||||||
if (itemId == R.string.layer_overlay) {
|
if (itemId == R.string.layer_overlay) {
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.OVERLAY_MAP);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.OVERLAY_MAP, viewCoordinates);
|
||||||
return false;
|
return false;
|
||||||
} else if (itemId == R.string.layer_underlay) {
|
} else if (itemId == R.string.layer_underlay) {
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.UNDERLAY_MAP);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.UNDERLAY_MAP, viewCoordinates);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int pos, boolean isChecked) {
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
final OsmandSettings settings = mapActivity.getMyApplication().getSettings();
|
final OsmandSettings settings = mapActivity.getMyApplication().getSettings();
|
||||||
switch (itemId) {
|
switch (itemId) {
|
||||||
case R.string.layer_overlay:
|
case R.string.layer_overlay:
|
||||||
|
@ -346,7 +348,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
||||||
if (mapView.getMainLayer() instanceof MapTileLayer) {
|
if (mapView.getMainLayer() instanceof MapTileLayer) {
|
||||||
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (resId == R.string.context_menu_item_update_map) {
|
if (resId == R.string.context_menu_item_update_map) {
|
||||||
mapActivity.getMapActions().reloadTile(mapView.getZoom(), latitude, longitude);
|
mapActivity.getMapActions().reloadTile(mapView.getZoom(), latitude, longitude);
|
||||||
} else if (resId == R.string.shared_string_download_map) {
|
} else if (resId == R.string.shared_string_download_map) {
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye
|
||||||
final GPXUtilities.WptPt point = (GPXUtilities.WptPt) o;
|
final GPXUtilities.WptPt point = (GPXUtilities.WptPt) o;
|
||||||
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == R.string.mark_as_not_visited){
|
if (itemId == R.string.mark_as_not_visited){
|
||||||
plugin.getCurrentRoute().markPoint(point,false);
|
plugin.getCurrentRoute().markPoint(point,false);
|
||||||
plugin.saveCurrentRoute();
|
plugin.saveCurrentRoute();
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class ContourLinesMenu {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter,
|
||||||
final int itemId, final int pos, final boolean isChecked) {
|
final int itemId, final int pos, final boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == toggleActionStringId) {
|
if (itemId == toggleActionStringId) {
|
||||||
app.runInUIThread(new Runnable() {
|
app.runInUIThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -268,7 +268,7 @@ public class ContourLinesMenu {
|
||||||
.setIcon(DownloadActivityType.SRTM_COUNTRY_FILE.getIconResource())
|
.setIcon(DownloadActivityType.SRTM_COUNTRY_FILE.getIconResource())
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||||
ContextMenuItem item = adapter.getItem(position);
|
ContextMenuItem item = adapter.getItem(position);
|
||||||
if (downloadThread.isDownloading(indexItem)) {
|
if (downloadThread.isDownloading(indexItem)) {
|
||||||
downloadThread.cancelDownload(indexItem);
|
downloadThread.cancelDownload(indexItem);
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class HillshadeMenu {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter,
|
||||||
final int itemId, final int pos, final boolean isChecked) {
|
final int itemId, final int pos, final boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == toggleActionStringId) {
|
if (itemId == toggleActionStringId) {
|
||||||
app.runInUIThread(new Runnable() {
|
app.runInUIThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -146,7 +146,7 @@ public class HillshadeMenu {
|
||||||
.setIcon(DownloadActivityType.HILLSHADE_FILE.getIconResource())
|
.setIcon(DownloadActivityType.HILLSHADE_FILE.getIconResource())
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||||
ContextMenuItem item = adapter.getItem(position);
|
ContextMenuItem item = adapter.getItem(position);
|
||||||
if (downloadThread.isDownloading(indexItem)) {
|
if (downloadThread.isDownloading(indexItem)) {
|
||||||
downloadThread.cancelDownload(indexItem);
|
downloadThread.cancelDownload(indexItem);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.plus.ApplicationMode;
|
import net.osmand.plus.ApplicationMode;
|
||||||
import net.osmand.plus.ContextMenuAdapter;
|
import net.osmand.plus.ContextMenuAdapter;
|
||||||
import net.osmand.plus.ContextMenuItem;
|
import net.osmand.plus.ContextMenuItem;
|
||||||
|
@ -129,11 +130,12 @@ public class SRTMPlugin extends OsmandPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onRowItemClick(ArrayAdapter<ContextMenuItem> adapter, View view, int itemId, int position) {
|
public boolean onRowItemClick(ArrayAdapter<ContextMenuItem> adapter, View view, int itemId, int position) {
|
||||||
|
int[] viewCoordinates = AndroidUtils.getViewLocation(view);
|
||||||
if (itemId == R.string.srtm_plugin_name) {
|
if (itemId == R.string.srtm_plugin_name) {
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardOnMap.DashboardType.CONTOUR_LINES);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardOnMap.DashboardType.CONTOUR_LINES, viewCoordinates);
|
||||||
return false;
|
return false;
|
||||||
} else if (itemId == R.string.layer_hillshade) {
|
} else if (itemId == R.string.layer_hillshade) {
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardOnMap.DashboardType.HILLSHADE);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardOnMap.DashboardType.HILLSHADE, viewCoordinates);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -143,7 +145,8 @@ public class SRTMPlugin extends OsmandPlugin {
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter,
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter,
|
||||||
final int itemId,
|
final int itemId,
|
||||||
final int position,
|
final int position,
|
||||||
final boolean isChecked) {
|
final boolean isChecked,
|
||||||
|
final int[] viewCoordinates) {
|
||||||
if (itemId == R.string.srtm_plugin_name) {
|
if (itemId == R.string.srtm_plugin_name) {
|
||||||
toggleContourLines(mapActivity, isChecked, new Runnable() {
|
toggleContourLines(mapActivity, isChecked, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -242,7 +242,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
|
||||||
if (menu.hasHiddenBottomInfo()) {
|
if (menu.hasHiddenBottomInfo()) {
|
||||||
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
menu.openMenuFullScreen();
|
menu.openMenuFullScreen();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
|
||||||
if (isObjectMoveable(o)) {
|
if (isObjectMoveable(o)) {
|
||||||
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
RotatedTileBox tileBox = activity.getMapView().getCurrentRotatedTileBox();
|
RotatedTileBox tileBox = activity.getMapView().getCurrentRotatedTileBox();
|
||||||
enterMovingMode(tileBox);
|
enterMovingMode(tileBox);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -218,7 +218,7 @@ public class ImpassableRoadsLayer extends OsmandMapLayer implements
|
||||||
|
|
||||||
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
if (itemId == R.string.avoid_road) {
|
if (itemId == R.string.avoid_road) {
|
||||||
activity.getMyApplication().getAvoidSpecificRoads().addImpassableRoad(
|
activity.getMyApplication().getAvoidSpecificRoads().addImpassableRoad(
|
||||||
activity, latLon, false, null, false);
|
activity, latLon, false, null, false);
|
||||||
|
|
|
@ -249,7 +249,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
MapActivity.clearPrevActivityIntent();
|
MapActivity.clearPrevActivityIntent();
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP, AndroidUtils.getViewLocation(v));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
MapActivity.clearPrevActivityIntent();
|
MapActivity.clearPrevActivityIntent();
|
||||||
if (dash) {
|
if (dash) {
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD, AndroidUtils.getViewLocation(v));
|
||||||
} else {
|
} else {
|
||||||
mapActivity.openDrawer();
|
mapActivity.openDrawer();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
import net.osmand.binary.RouteDataObject;
|
import net.osmand.binary.RouteDataObject;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
|
@ -881,7 +882,7 @@ public class MapInfoWidgetsFactory {
|
||||||
all.setOnClickListener(new OnClickListener() {
|
all.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
map.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
|
map.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS, AndroidUtils.getViewLocation(view));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
remove.setOnClickListener(new OnClickListener() {
|
remove.setOnClickListener(new OnClickListener() {
|
||||||
|
|
|
@ -326,7 +326,7 @@ public class MapWidgetRegistry {
|
||||||
.setDescription(settings.MAP_MARKERS_MODE.get().toHumanString(map))
|
.setDescription(settings.MAP_MARKERS_MODE.get().toHumanString(map))
|
||||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int position, boolean isChecked) {
|
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int position, boolean isChecked, int[] viewCoordinates) {
|
||||||
DirectionIndicationDialogFragment fragment = new DirectionIndicationDialogFragment();
|
DirectionIndicationDialogFragment fragment = new DirectionIndicationDialogFragment();
|
||||||
fragment.setListener(new DirectionIndicationDialogFragment.DirectionIndicationFragmentListener() {
|
fragment.setListener(new DirectionIndicationDialogFragment.DirectionIndicationFragmentListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -418,7 +418,7 @@ public class MapWidgetRegistry {
|
||||||
.setSecondaryIcon( R.drawable.ic_action_additional_option)
|
.setSecondaryIcon( R.drawable.ic_action_additional_option)
|
||||||
.setListener(new ContextMenuAdapter.OnRowItemClick() {
|
.setListener(new ContextMenuAdapter.OnRowItemClick() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||||
setVisibility(adapter, position, isChecked);
|
setVisibility(adapter, position, isChecked);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -557,7 +557,7 @@ public class MapWidgetRegistry {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> a,
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> a,
|
||||||
int itemId, int pos, boolean isChecked) {
|
int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
setVisibility(a, pos, isChecked, false);
|
setVisibility(a, pos, isChecked, false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -780,7 +780,7 @@ public class MapWidgetRegistry {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> a,
|
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> a,
|
||||||
int itemId, int pos, boolean isChecked) {
|
int itemId, int pos, boolean isChecked, int[] viewCoordinates) {
|
||||||
pref.set(!pref.get());
|
pref.set(!pref.get());
|
||||||
map.updateApplicationModeSettings();
|
map.updateApplicationModeSettings();
|
||||||
a.notifyDataSetChanged();
|
a.notifyDataSetChanged();
|
||||||
|
|
Loading…
Reference in a new issue