From 6b6e1881bae7af1031f8c2b4a42fca36842b57d7 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Thu, 26 Sep 2013 00:31:16 +0200 Subject: [PATCH] Remove duplicate streets --- .../plus/activities/MainMenuActivity.java | 45 ++++++++++++------- .../res/values-ast/strings.xml | 7 --- 2 files changed, 29 insertions(+), 23 deletions(-) delete mode 100644 plugins/Osmand-ParkingPlugin/res/values-ast/strings.xml diff --git a/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java b/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java index d44679fed4..4f8101ab9c 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java @@ -134,25 +134,25 @@ public class MainMenuActivity extends Activity { rightview = (View) window.findViewById(R.id.SearchButton); rightview.startAnimation(getAnimation(1, 0)); - String textVersion = Version.getAppVersion(((OsmandApplication) activity.getApplication())); + final String textVersion = Version.getAppVersion(((OsmandApplication) activity.getApplication())); final TextView textVersionView = (TextView) window.findViewById(R.id.TextVersion); textVersionView.setText(textVersion); - SharedPreferences prefs = activity.getApplicationContext().getSharedPreferences("net.osmand.settings", MODE_WORLD_READABLE); - + final SharedPreferences prefs = activity.getApplicationContext().getSharedPreferences("net.osmand.settings", MODE_WORLD_READABLE); + textVersionView.setOnClickListener(new OnClickListener(){ + + int i = 0; + @Override + public void onClick(View v) { + if(i++ > 8) { + prefs.edit().putBoolean(CONTRIBUTION_VERSION_FLAG, true).commit(); + enableLink(activity, textVersion, textVersionView); + } + } + }); // only one commit should be with contribution version flag // prefs.edit().putBoolean(CONTRIBUTION_VERSION_FLAG, true).commit(); if (prefs.contains(CONTRIBUTION_VERSION_FLAG)) { - SpannableString content = new SpannableString(textVersion); - content.setSpan(new ClickableSpan() { - - @Override - public void onClick(View widget) { - final Intent mapIntent = new Intent(activity, ContributionVersionActivity.class); - activity.startActivityForResult(mapIntent, 0); - } - }, 0, content.length(), 0); - textVersionView.setText(content); - textVersionView.setMovementMethod(LinkMovementMethod.getInstance()); + enableLink(activity, textVersion, textVersionView); } View helpButton = window.findViewById(R.id.HelpButton); helpButton.setOnClickListener(new OnClickListener() { @@ -164,8 +164,21 @@ public class MainMenuActivity extends Activity { } }); } - - + + private static void enableLink(final Activity activity, String textVersion, TextView textVersionView) { + SpannableString content = new SpannableString(textVersion); + content.setSpan(new ClickableSpan() { + + @Override + public void onClick(View widget) { + final Intent mapIntent = new Intent(activity, ContributionVersionActivity.class); + activity.startActivityForResult(mapIntent, 0); + } + }, 0, content.length(), 0); + textVersionView.setText(content); + textVersionView.setMovementMethod(LinkMovementMethod.getInstance()); + } + @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/plugins/Osmand-ParkingPlugin/res/values-ast/strings.xml b/plugins/Osmand-ParkingPlugin/res/values-ast/strings.xml deleted file mode 100644 index a4d7cd3439..0000000000 --- a/plugins/Osmand-ParkingPlugin/res/values-ast/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - -Non - - OsmAnd nun ta instaláu - OsmAnd Parking - El complementu OsmAnd ta instaláu y habilitáu nos axustes d'OsmAnd. -