Fix small issues

This commit is contained in:
Victor Shcherb 2015-04-17 01:31:52 +02:00
parent 696e87f8aa
commit 3bd522d523
2 changed files with 13 additions and 4 deletions

View file

@ -14,6 +14,7 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleToast; import net.osmand.access.AccessibleToast;
@ -26,7 +27,9 @@ import net.osmand.plus.download.DownloadFileHelper.DownloadFileShowWarning;
import net.osmand.plus.helpers.DatabaseHelper; import net.osmand.plus.helpers.DatabaseHelper;
import net.osmand.plus.resources.ResourceManager; import net.osmand.plus.resources.ResourceManager;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
@ -125,7 +128,9 @@ public class DownloadIndexesThread {
return indexFiles != null && indexFiles.isDownloadedFromInternet(); return indexFiles != null && indexFiles.isDownloadedFromInternet();
} }
public List<IndexItem> getItemsToUpdate() { return itemsToUpdate;} public List<IndexItem> getItemsToUpdate() {
return itemsToUpdate;
}
public class DownloadIndexesAsyncTask extends BasicProgressAsyncTask<IndexItem, Object, String> implements DownloadFileShowWarning { public class DownloadIndexesAsyncTask extends BasicProgressAsyncTask<IndexItem, Object, String> implements DownloadFileShowWarning {

View file

@ -17,7 +17,6 @@ import android.widget.CheckBox;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import net.osmand.access.AccessibleToast; import net.osmand.access.AccessibleToast;
import net.osmand.map.OsmandRegions; import net.osmand.map.OsmandRegions;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
@ -105,7 +104,11 @@ public class UpdatesIndexFragment extends ListFragment {
updateHeader(); updateHeader();
if (indexItems.size() == 0) { if (indexItems.size() == 0) {
indexItems.clear(); indexItems.clear();
indexItems.add(new IndexItem(getString(R.string.everything_up_to_date), "", 0, "", 0, 0, null)); if (DownloadActivity.downloadListIndexThread.isDownloadedFromInternet()) {
indexItems.add(new IndexItem(getString(R.string.everything_up_to_date), "", 0, "", 0, 0, null));
} else {
indexItems.add(new IndexItem(getString(R.string.no_index_file_to_download), "", 0, "", 0, 0, null));
}
} }
listAdapter = new UpdateIndexAdapter(getDownloadActivity(), R.layout.download_index_list_item, indexItems); listAdapter = new UpdateIndexAdapter(getDownloadActivity(), R.layout.download_index_list_item, indexItems);
listAdapter.sort(new Comparator<IndexItem>() { listAdapter.sort(new Comparator<IndexItem>() {
@ -267,7 +270,8 @@ public class UpdatesIndexFragment extends ListFragment {
TextView updateDescr = (TextView) v.findViewById(R.id.update_descr); TextView updateDescr = (TextView) v.findViewById(R.id.update_descr);
final CheckBox ch = (CheckBox) v.findViewById(R.id.check_download_item); final CheckBox ch = (CheckBox) v.findViewById(R.id.check_download_item);
IndexItem e = items.get(position); IndexItem e = items.get(position);
if (e.getFileName().equals(getString(R.string.everything_up_to_date))) { if (e.getFileName().equals(getString(R.string.everything_up_to_date)) ||
e.getFileName().equals(getString(R.string.no_index_file_to_download))) {
name.setText(e.getFileName()); name.setText(e.getFileName());
description.setText(""); description.setText("");
ch.setVisibility(View.INVISIBLE); ch.setVisibility(View.INVISIBLE);