Fix compilation 1.6
This commit is contained in:
parent
edba19a901
commit
0bcbb6f5f1
2 changed files with 13 additions and 33 deletions
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<resources>
|
||||
<string name="update_poi_does_not_change_indexes">POI changes inside application do not affect downloaded map files, changes are saved to local file instead.</string>
|
||||
<string name="local_openstreetmap_uploading_poi">Uploading POI</string>
|
||||
<string name="local_openstreetmap_poi_were_uploaded">{0} POI were uploaded</string>
|
||||
<string name="local_openstreetmap_uploadall">Upload All POI</string>
|
||||
|
@ -166,7 +167,6 @@
|
|||
<string name="poi_filter_by_name">Search by name</string>
|
||||
<string name="old_poi_file_should_be_deleted">The POI data file \'%1$s\' is redundant and can be deleted.</string>
|
||||
<string name="update_poi_file_not_found">Local file to maintain POI changes not found and could not be created.</string>
|
||||
<string name="update_poi_does_not_change_indexes">POI changes inside application do not affect downloaded map files, changes are saved to local file instead.</string>
|
||||
|
||||
<string name="button_upgrade_osmandplus">Upgrade Osmand+</string>
|
||||
<string name="map_version_changed_info">Server contains map files not compatible with your current version of the application. To download and use them, please upgrade the application to newer version.</string>
|
||||
|
|
|
@ -42,27 +42,21 @@ public class LocalOpenstreetmapActivity extends ExpandableListActivity {
|
|||
/** dialogs **/
|
||||
protected static final int DIALOG_PROGRESS_UPLOAD = 0;
|
||||
|
||||
/** bundles **/
|
||||
protected static final String ALL_OPENSTREETMAP_POINTS = "all_openstreetmap_points";
|
||||
protected static final String OPENSTREETMAP_POINT = "openstreetmap_point";
|
||||
|
||||
private LocalOpenstreetmapAdapter listAdapter;
|
||||
|
||||
private OsmandSettings settings;
|
||||
|
||||
private OpenstreetmapsDbHelper db;
|
||||
|
||||
private OpenstreetmapRemoteUtil remote;
|
||||
|
||||
private ProgressDialog progressPointDlg = null;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected OpenstreetmapPoint[] toUpload;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.local_openstreetmap);
|
||||
settings = OsmandSettings.getOsmandSettings(this);
|
||||
listAdapter = new LocalOpenstreetmapAdapter();
|
||||
|
||||
getExpandableListView().setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
|
||||
|
@ -92,11 +86,11 @@ public class LocalOpenstreetmapActivity extends ExpandableListActivity {
|
|||
|
||||
findViewById(R.id.UploadAllButton).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(ALL_OPENSTREETMAP_POINTS, true);
|
||||
showDialog(DIALOG_PROGRESS_UPLOAD, bundle);
|
||||
toUpload = listAdapter.values().toArray(new OpenstreetmapPoint[0]);
|
||||
showDialog(DIALOG_PROGRESS_UPLOAD);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -110,7 +104,6 @@ public class LocalOpenstreetmapActivity extends ExpandableListActivity {
|
|||
getString(R.string.uploading),
|
||||
getString(R.string.local_openstreetmap_uploading_poi),
|
||||
ProgressDialog.STYLE_HORIZONTAL).getDialog();
|
||||
|
||||
return progressPointDlg;
|
||||
}
|
||||
return null;
|
||||
|
@ -119,21 +112,11 @@ public class LocalOpenstreetmapActivity extends ExpandableListActivity {
|
|||
@Override
|
||||
protected void onPrepareDialog(int id, Dialog dialog, Bundle args) {
|
||||
switch (id) {
|
||||
case DIALOG_PROGRESS_UPLOAD:
|
||||
UploadOpenstreetmapPointAsyncTask uploadTask;
|
||||
|
||||
if (args.getBoolean(ALL_OPENSTREETMAP_POINTS)) {
|
||||
List<OpenstreetmapPoint> l = listAdapter.values();
|
||||
uploadTask = new UploadOpenstreetmapPointAsyncTask(progressPointDlg,
|
||||
remote, db, l.size());
|
||||
uploadTask.execute(l.toArray(new OpenstreetmapPoint[0]));
|
||||
} else {
|
||||
OpenstreetmapPoint info = (OpenstreetmapPoint) args.getSerializable(OPENSTREETMAP_POINT);
|
||||
uploadTask = new UploadOpenstreetmapPointAsyncTask(progressPointDlg,
|
||||
remote, db, 1);
|
||||
uploadTask.execute(info);
|
||||
}
|
||||
break;
|
||||
case DIALOG_PROGRESS_UPLOAD:
|
||||
UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask(progressPointDlg, remote, db,
|
||||
toUpload.length);
|
||||
uploadTask.execute(toUpload);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,10 +222,8 @@ public class LocalOpenstreetmapActivity extends ExpandableListActivity {
|
|||
} else if (resId == R.string.local_openstreetmap_delete) {
|
||||
listAdapter.delete(info);
|
||||
} else if (resId == R.string.local_openstreetmap_upload) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(ALL_OPENSTREETMAP_POINTS, false);
|
||||
bundle.putSerializable(OPENSTREETMAP_POINT, info);
|
||||
showDialog(DIALOG_PROGRESS_UPLOAD, bundle);
|
||||
toUpload = new OpenstreetmapPoint[]{info};
|
||||
showDialog(DIALOG_PROGRESS_UPLOAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -379,7 +360,6 @@ public class LocalOpenstreetmapActivity extends ExpandableListActivity {
|
|||
if(getString(R.string.local_openstreetmap_items).length() > 0){
|
||||
t.append(" ").append(getString(R.string.local_openstreetmap_items));
|
||||
}
|
||||
List<OpenstreetmapPoint> list = data.get(group);
|
||||
t.append("]");
|
||||
nameView.setText(t.toString());
|
||||
|
||||
|
|
Loading…
Reference in a new issue