From 9dccf679cc32110c7576346bef8ba3a0ebeea888 Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 7 Dec 2014 16:35:34 +0100 Subject: [PATCH] Put Edition date to all versions --- .../plus/activities/DashboardActivity.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/DashboardActivity.java b/OsmAnd/src/net/osmand/plus/activities/DashboardActivity.java index 3b21e2d445..41cb427a35 100644 --- a/OsmAnd/src/net/osmand/plus/activities/DashboardActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/DashboardActivity.java @@ -196,19 +196,21 @@ public class DashboardActivity extends BaseDownloadActivity { String vt = activity.getString(R.string.about_version) +"\t"; int st = vt.length(); String edition = ""; + if (!activity.getString(R.string.app_edition).equals("") { + edition = activity.getString(R.string.local_index_installed) + " : \t" + activity.getString(R.string.app_edition); + } SharedPreferences prefs = app.getSharedPreferences("net.osmand.settings", MODE_WORLD_READABLE); if (prefs.contains(CONTRIBUTION_VERSION_FLAG) && Version.isDeveloperVersion(app)) { - try { - //Next 4 lines produced bogus Edition dates in many situtations, let us try to use the BUILD_ID here as delivered from builder + //Next 7 lines produced bogus Edition dates in many situtations, let us try (see above) to use the BUILD_ID as delivered from builder + //try { //PackageManager pm = activity.getPackageManager(); //ApplicationInfo appInfo = pm.getApplicationInfo(OsmandApplication.class.getPackage().getName(), 0); //Date date = new Date(new File(appInfo.sourceDir).lastModified()); //edition = activity.getString(R.string.local_index_installed) + " : \t" + DateFormat.getDateFormat(app).format(date); - edition = activity.getString(R.string.local_index_installed) + " : \t" + activity.getString(R.string.app_edition); - } catch (Exception e) { - } - SpannableString content = new SpannableString(vt + version +"\n" + - edition +"\n\n"+ + //} catch (Exception e) { + //} + SpannableString content = new SpannableString(vt + version + "\n" + + edition + "\n\n" + activity.getString(R.string.about_content)); content.setSpan(new ClickableSpan() { @Override @@ -220,8 +222,9 @@ public class DashboardActivity extends BaseDownloadActivity { }, st, st + version.length(), 0); tv.setText(content); } else { - tv.setText(vt + version +"\n\n" + - activity.getString(R.string.about_content)); + tv.setText(vt + version + "\n" + + edition + "\n\n" + + activity.getString(R.string.about_content)); } tv.setPadding(5, 0, 5, 5);