Skip to content

Commit

Permalink
Allow deleting offline data from map context (rel. to cgeo#16357)
Browse files Browse the repository at this point in the history
  • Loading branch information
moving-bits committed Nov 18, 2024
1 parent a7d0dc6 commit 7384218
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public static boolean onOptionsItemSelected(final Activity activity, final int i
if (id == R.id.menu_download_offlinemap) {
activity.startActivity(new Intent(activity, DownloadSelectorActivity.class));
return true;
} else if (id == R.id.menu_delete_offline_data) {
deleteOfflineData(activity);
return true;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public static void addMapviewMenuItems(final Activity activity, final Menu menu)
parentMenu.setGroupCheckable(R.id.menu_group_map_sources_offline, true, true);
parentMenu.add(R.id.menu_group_offlinemaps, R.id.menu_hillshading, mapSources.size(), activity.getString(R.string.settings_hillshading_enable)).setCheckable(true).setChecked(Settings.getMapShadingShowLayer()).setVisible(Settings.getMapShadingEnabled() && Settings.getMapSource().supportsHillshading());
parentMenu.add(R.id.menu_group_offlinemaps, R.id.menu_download_offlinemap, mapSources.size(), '<' + activity.getString(R.string.downloadmap_title) + '>');
parentMenu.add(R.id.menu_group_offlinemaps, R.id.menu_delete_offline_data, mapSources.size() + 1, '<' + activity.getString(R.string.menu_delete_offline_data) + '>');
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public static void addMapviewMenuItems(final Activity activity, final PopupMenu
parentMenu.setGroupCheckable(R.id.menu_group_map_sources_online, true, true);
parentMenu.add(R.id.menu_group_offlinemaps, R.id.menu_hillshading, tileProviders.size(), activity.getString(R.string.settings_hillshading_enable)).setCheckable(true).setChecked(Settings.getMapShadingShowLayer()).setVisible(Settings.getMapShadingEnabled() && Settings.getTileProvider().supportsHillshading());
parentMenu.add(R.id.menu_group_offlinemaps, R.id.menu_download_offlinemap, tileProviders.size(), '<' + activity.getString(R.string.downloadmap_title) + '>');
parentMenu.add(R.id.menu_group_offlinemaps, R.id.menu_delete_offline_data, tileProviders.size() + 1, '<' + activity.getString(R.string.menu_delete_offline_data) + '>');
}

public static HashMap<String, AbstractTileProvider> getTileProviders() {
Expand Down

0 comments on commit 7384218

Please sign in to comment.