Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9a4ca0a0e9
6 changed files with 33 additions and 17 deletions
|
@ -9,6 +9,7 @@
|
||||||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||||
-->
|
-->
|
||||||
|
<string name="download_additional_maps">Download missing maps $1%s ($2%d MB)?</string>
|
||||||
<string name="more">More...</string>
|
<string name="more">More...</string>
|
||||||
<string name="rendering_value_browse_map_name">Browse map</string>
|
<string name="rendering_value_browse_map_name">Browse map</string>
|
||||||
<string name="rendering_value_car_name">Car</string>
|
<string name="rendering_value_car_name">Car</string>
|
||||||
|
|
|
@ -115,6 +115,7 @@ public class OsmAndAppCustomization {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void preDownloadActivity(final DownloadIndexActivity da, final List<DownloadActivityType> downloadTypes, ActionBar actionBar ) {
|
public void preDownloadActivity(final DownloadIndexActivity da, final List<DownloadActivityType> downloadTypes, ActionBar actionBar ) {
|
||||||
|
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
|
||||||
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(actionBar.getThemedContext(), R.layout.sherlock_spinner_item,
|
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(actionBar.getThemedContext(), R.layout.sherlock_spinner_item,
|
||||||
toString(downloadTypes)
|
toString(downloadTypes)
|
||||||
);
|
);
|
||||||
|
|
|
@ -40,7 +40,6 @@ import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
@ -51,8 +50,6 @@ import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.actionbarsherlock.app.ActionBar;
|
|
||||||
import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
|
|
||||||
import com.actionbarsherlock.view.Menu;
|
import com.actionbarsherlock.view.Menu;
|
||||||
import com.actionbarsherlock.view.MenuItem;
|
import com.actionbarsherlock.view.MenuItem;
|
||||||
import com.actionbarsherlock.view.SubMenu;
|
import com.actionbarsherlock.view.SubMenu;
|
||||||
|
@ -111,7 +108,6 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
||||||
makeSureUserCancelDownload();
|
makeSureUserCancelDownload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
|
|
||||||
getSupportActionBar().setTitle(R.string.local_index_download);
|
getSupportActionBar().setTitle(R.string.local_index_download);
|
||||||
// recreation upon rotation is pgetaprevented in manifest file
|
// recreation upon rotation is pgetaprevented in manifest file
|
||||||
findViewById(R.id.DownloadButton).setOnClickListener(new View.OnClickListener(){
|
findViewById(R.id.DownloadButton).setOnClickListener(new View.OnClickListener(){
|
||||||
|
@ -256,19 +252,38 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showDialogToDownloadMaps(List<String> maps) {
|
public void showDialogToDownloadMaps(List<String> maps) {
|
||||||
DownloadIndexAdapter a = (DownloadIndexAdapter) getListAdapter();
|
int count = 0;
|
||||||
boolean e = true;
|
int sz = 0;
|
||||||
for (IndexItem i : a.getIndexFiles()) {
|
String s = "";
|
||||||
|
for (IndexItem i : downloadListIndexThread.getCachedIndexFiles()) {
|
||||||
for (String map : maps) {
|
for (String map : maps) {
|
||||||
if (i.getFileName().equals(map + ".obf.zip")) {
|
if (i.getFileName().equals(map + ".obf.zip") && i.getType() == DownloadActivityType.NORMAL_FILE) {
|
||||||
e = false;
|
final List<DownloadEntry> de = i.createDownloadEntry(getMyApplication(), i.getType(), new ArrayList<DownloadEntry>(1));
|
||||||
getEntriesToDownload().put(i, i.createDownloadEntry(getMyApplication(), type, new ArrayList<DownloadEntry>(1)));
|
for(DownloadEntry d : de ) {
|
||||||
|
count++;
|
||||||
|
sz += d.sizeMB;
|
||||||
|
}
|
||||||
|
if(s.length() > 0) {
|
||||||
|
s +=", ";
|
||||||
|
}
|
||||||
|
s += i.getVisibleName(getMyApplication(), getMyApplication().getResourceManager().getOsmandRegions());
|
||||||
|
getEntriesToDownload().put(i, de);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!e){
|
if(count > 0){
|
||||||
|
Builder builder = new AlertDialog.Builder(this);
|
||||||
|
builder.setMessage(MessageFormat.format(getString(R.string.download_additional_maps), s, sz));
|
||||||
|
builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
downloadFilesCheckInternet();
|
downloadFilesCheckInternet();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
builder.setNegativeButton(R.string.default_buttons_no, null);
|
||||||
|
builder.show();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -277,14 +277,13 @@ public class DownloadIndexesThread {
|
||||||
|
|
||||||
private String reindexFiles(List<File> filesToReindex) {
|
private String reindexFiles(List<File> filesToReindex) {
|
||||||
boolean vectorMapsToReindex = false;
|
boolean vectorMapsToReindex = false;
|
||||||
|
// reindex vector maps all at one time
|
||||||
|
ResourceManager manager = app.getResourceManager();
|
||||||
for (File f : filesToReindex) {
|
for (File f : filesToReindex) {
|
||||||
if (f.getName().endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)) {
|
if (f.getName().endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)) {
|
||||||
vectorMapsToReindex = true;
|
vectorMapsToReindex = true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// reindex vector maps all at one time
|
|
||||||
ResourceManager manager = app.getResourceManager();
|
|
||||||
List<String> warnings = new ArrayList<String>();
|
List<String> warnings = new ArrayList<String>();
|
||||||
manager.indexVoiceFiles(this);
|
manager.indexVoiceFiles(this);
|
||||||
if (vectorMapsToReindex) {
|
if (vectorMapsToReindex) {
|
||||||
|
|
|
@ -197,7 +197,7 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
|
||||||
da.showDialogToDownloadMaps(suggestToDownloadMap);
|
da.showDialogToDownloadMaps(suggestToDownloadMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return warns;
|
return warns;
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class TourDownloadType extends DownloadActivityType {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBaseUrl(OsmandApplication ctx, String fileName) {
|
public String getBaseUrl(OsmandApplication ctx, String fileName) {
|
||||||
return "http://" + SherpafyCustomization.TOUR_SERVER + "/download?event=2&"
|
return "http://" + SherpafyCustomization.TOUR_SERVER + "/download_tour.php?event=2&"
|
||||||
+ Version.getVersionAsURLParam(ctx) + "&file=" + fileName;
|
+ Version.getVersionAsURLParam(ctx) + "&file=" + fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue