small refactor

This commit is contained in:
veliymolfar 2020-07-03 16:31:34 +03:00
parent 23fde2b150
commit 6ba13eb92c

View file

@ -424,14 +424,14 @@ public class TerrainFragment extends BaseOsmAndFragment implements View.OnClickL
TerrainMode mode = srtmPlugin.getTerrainMode();
IndexItem currentDownloadingItem = downloadThread.getCurrentDownloadingItem();
int currentDownloadingProgress = downloadThread.getCurrentDownloadingItemProgress();
List<IndexItem> indexItemsAt = DownloadResources.findIndexItemsAt(
app, ((MapActivity) mapActivity).getMapLocation(),
List<IndexItem> terrainItems = DownloadResources.findIndexItemsAt(
app, mapActivity.getMapLocation(),
mode == HILLSHADE ? HILLSHADE_FILE : SLOPE_FILE, false, -1, true);
if (indexItemsAt.size() > 0) {
if (terrainItems.size() > 0) {
downloadContainer.setVisibility(View.VISIBLE);
downloadTopDivider.setVisibility(View.VISIBLE);
downloadBottomDivider.setVisibility(View.VISIBLE);
for (final IndexItem indexItem : indexItemsAt) {
for (final IndexItem indexItem : terrainItems) {
ContextMenuItem.ItemBuilder itemBuilder = new ContextMenuItem.ItemBuilder()
.setLayout(R.layout.list_item_icon_and_download)
.setTitle(indexItem.getVisibleName(app, app.getRegions(), false))