diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 4ef7857661..f3d18725fd 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -2016,7 +2016,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
Are you sure you want to download map of roads, even though you have full map?
%1$.1f from %2$.1f MB
%.1f MB
- Update all(%1$s Mb)
+ Update all (%1$s MB)
Free downloads used
You can set how many free downloads you have used
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java
index c41fad496d..811f7a067d 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/UpdatesIndexFragment.java
@@ -50,6 +50,7 @@ public class UpdatesIndexFragment extends OsmAndListFragment implements Download
@Override
public void downloadHasFinished() {
invalidateListView();
+ updateUpdateAllButton();
}
@Override
@@ -60,6 +61,7 @@ public class UpdatesIndexFragment extends OsmAndListFragment implements Download
@Override
public void newDownloadIndexes() {
invalidateListView();
+ updateUpdateAllButton();
}
public void invalidateListView() {
@@ -82,15 +84,17 @@ public class UpdatesIndexFragment extends OsmAndListFragment implements Download
.compareTo(indexItem2.getVisibleName(getMyApplication(), osmandRegions));
}
});
- updateUpdateAllButton(indexes.getItemsToUpdate());
setListAdapter(listAdapter);
}
- private void updateUpdateAllButton(final List indexItems) {
+ private void updateUpdateAllButton() {
+
View view = getView();
- if (getView() == null) {
+ if (view == null) {
return;
}
+ DownloadResources indexes = getMyActivity().getDownloadThread().getIndexes();
+ final List indexItems = indexes.getItemsToUpdate();
final TextView updateAllButton = (TextView) view.findViewById(R.id.updateAllButton);
if (indexItems.size() == 0 || indexItems.get(0).getType() == null) {
updateAllButton.setVisibility(View.GONE);
@@ -114,6 +118,7 @@ public class UpdatesIndexFragment extends OsmAndListFragment implements Download
@Override
public void onResume() {
super.onResume();
+ updateUpdateAllButton();
}
@Override