Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-10-21 17:12:56 +02:00
commit 1caee5cc97

View file

@ -2,6 +2,7 @@ package net.osmand.plus.activities;
import java.io.File; import java.io.File;
import java.text.ParseException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
@ -28,8 +29,6 @@ public class LocalIndexHelper {
private final OsmandApplication app; private final OsmandApplication app;
public LocalIndexHelper(OsmandApplication app){ public LocalIndexHelper(OsmandApplication app){
this.app = app; this.app = app;
} }
@ -40,8 +39,7 @@ public class LocalIndexHelper {
} }
public String getInstalledDateEdition(long t, TimeZone timeZone){ public String getInstalledDateEdition(long t, TimeZone timeZone){
return app.getString(R.string.local_index_installed) + ": " + android.text.format.DateFormat.getMediumDateFormat(app) return android.text.format.DateFormat.getMediumDateFormat(app).format(new Date(t));
.format(new Date(t));
} }
public String getInstalledDate(long t, TimeZone timeZone){ public String getInstalledDate(long t, TimeZone timeZone){
@ -53,7 +51,12 @@ public class LocalIndexHelper {
if(info.getType() == LocalIndexType.MAP_DATA){ if(info.getType() == LocalIndexType.MAP_DATA){
Map<String, String> ifns = app.getResourceManager().getIndexFileNames(); Map<String, String> ifns = app.getResourceManager().getIndexFileNames();
if(ifns.containsKey(info.getFileName())) { if(ifns.containsKey(info.getFileName())) {
info.setDescription(ifns.get(info.getFileName())); try {
Date dt = app.getResourceManager().getDateFormat().parse(ifns.get(info.getFileName()));
info.setDescription(getInstalledDate(dt.getTime(), null));
} catch (ParseException e) {
e.printStackTrace();
}
} else { } else {
info.setDescription(getInstalledDate(f)); info.setDescription(getInstalledDate(f));
} }
@ -203,11 +206,6 @@ public class LocalIndexHelper {
} }
} }
public enum LocalIndexType { public enum LocalIndexType {
MAP_DATA(R.string.local_indexes_cat_map), MAP_DATA(R.string.local_indexes_cat_map),
TILES_DATA(R.string.local_indexes_cat_tile), TILES_DATA(R.string.local_indexes_cat_tile),