Remove duplicate streets

This commit is contained in:
vshcherb 2013-09-26 00:31:16 +02:00
parent 885c364446
commit 6b6e1881ba
2 changed files with 29 additions and 23 deletions

View file

@ -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) {

View file

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<resources><string name="default_buttons_no">Non</string>
<string name="default_buttons_yes"></string>
<string name="osmand_app_not_found">OsmAnd nun ta instaláu</string>
<string name="app_name">OsmAnd Parking</string>
<string name="parking_plugin_installed">El complementu OsmAnd ta instaláu y habilitáu nos axustes d'OsmAnd.</string>
</resources>