Fix duplicate Tile Data, disappear menu items: Edit, Clear all tiles
This commit is contained in:
parent
a3ea96d387
commit
3970859278
2 changed files with 4 additions and 7 deletions
|
@ -74,10 +74,9 @@ public class LocalIndexHelper {
|
|||
} else {
|
||||
return;
|
||||
}
|
||||
String descr = "";
|
||||
descr += app.getString(R.string.local_index_tile_data_name, template.getName());
|
||||
String descr = " ";
|
||||
if (template.getExpirationTimeMinutes() >= 0) {
|
||||
descr += "\n" + app.getString(R.string.local_index_tile_data_expire, template.getExpirationTimeMinutes());
|
||||
descr += app.getString(R.string.local_index_tile_data_expire, String.valueOf(template.getExpirationTimeMinutes()));
|
||||
}
|
||||
info.setAttachedObject(template);
|
||||
info.setDescription(descr);
|
||||
|
|
|
@ -1236,8 +1236,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
|||
return true;
|
||||
}
|
||||
});
|
||||
if (info.getType() == LocalIndexType.TILES_DATA && (info.getAttachedObject() instanceof ITileSource) &&
|
||||
((ITileSource) info.getAttachedObject()).couldBeDownloadedFromInternet()) {
|
||||
if (info.getType() == LocalIndexType.TILES_DATA && (info.getAttachedObject() instanceof ITileSource)) {
|
||||
item = optionsMenu.getMenu().add(R.string.shared_string_edit)
|
||||
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_edit_dark));
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
|
@ -1248,8 +1247,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
|||
}
|
||||
});
|
||||
}
|
||||
if (info.getType() == LocalIndexType.TILES_DATA && (info.getAttachedObject() instanceof ITileSource) &&
|
||||
((ITileSource)info.getAttachedObject()).couldBeDownloadedFromInternet()) {
|
||||
if (info.getType() == LocalIndexType.TILES_DATA && (info.getAttachedObject() instanceof ITileSource)) {
|
||||
item = optionsMenu.getMenu().add(R.string.clear_tile_data)
|
||||
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_remove_dark));
|
||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
|
|
Loading…
Reference in a new issue