diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java index 1cd2550606..5ba6ebedea 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java @@ -4,6 +4,8 @@ package net.osmand.plus.activities; import java.io.File; import java.util.Date; +import android.content.SharedPreferences; +import android.widget.ScrollView; import net.osmand.IndexConstants; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; @@ -35,6 +37,7 @@ public class SettingsActivity extends SettingsBaseActivity { public static final int SCREEN_NAVIGATION_SETTINGS = 2; private static final int PLUGINS_SELECTION_REQUEST = 1; + private static final String CONTRIBUTION_VERSION_FLAG = "CONTRIBUTION_VERSION_FLAG"; private Preference bidforfix; @@ -127,19 +130,24 @@ public class SettingsActivity extends SettingsBaseActivity { private void showAboutDialog() { Builder bld = new AlertDialog.Builder(this); bld.setTitle(R.string.about_settings); - TextView tv = new TextView(this); + ScrollView sv = new ScrollView(this); + TextView tv = new TextView(this); + sv.addView(tv); String version = Version.getFullVersion(getMyApplication()); String vt = getString(R.string.about_version) +"\t"; int st = vt.length(); String edition = ""; - try { - PackageManager pm = getPackageManager(); - ApplicationInfo appInfo = pm.getApplicationInfo(OsmandApplication.class.getPackage().getName(), 0); - Date date = new Date(new File(appInfo.sourceDir).lastModified()); - edition = getString(R.string.local_index_installed) +" :\t" + DateFormat.getDateFormat(getApplicationContext()).format(date); - } catch(Exception e) { - } - SpannableString content = new SpannableString(vt + version +"\n" + + SharedPreferences prefs = getApplicationContext().getSharedPreferences("net.osmand.settings", MODE_WORLD_READABLE); + if (prefs.contains(CONTRIBUTION_VERSION_FLAG)) { + try { + PackageManager pm = getPackageManager(); + ApplicationInfo appInfo = pm.getApplicationInfo(OsmandApplication.class.getPackage().getName(), 0); + Date date = new Date(new File(appInfo.sourceDir).lastModified()); + edition = getString(R.string.local_index_installed) + " :\t" + DateFormat.getDateFormat(getApplicationContext()).format(date); + } catch (Exception e) { + } + } + SpannableString content = new SpannableString(vt + version +"\n" + edition +"\n\n"+ getString(R.string.about_content)); content.setSpan(new ClickableSpan() { @@ -154,7 +162,7 @@ public class SettingsActivity extends SettingsBaseActivity { tv.setPadding(5, 0, 5, 5); tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 19); tv.setMovementMethod(LinkMovementMethod.getInstance()); - bld.setView(tv); + bld.setView(sv); bld.setPositiveButton(R.string.default_buttons_ok, null); bld.show(); diff --git a/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java b/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java index fb0695d883..fa6131e479 100644 --- a/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java +++ b/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java @@ -51,9 +51,10 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer { /** Must be sorted array! */ private final int[] sortedVoiceVersions; private AudioFocusHelper mAudioFocusHelper; + protected String language = ""; protected int streamType; - + T protected AbstractPrologCommandPlayer(ClientContext ctx, String voiceProvider, String configFile, int[] sortedVoiceVersions) throws CommandPlayerException { @@ -72,7 +73,17 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer { } this.streamType = ctx.getSettings().AUDIO_STREAM_GUIDANCE.get(); init(voiceProvider, ctx.getSettings(), configFile); + final Term langVal = solveSimplePredicate("language"); + if (langVal instanceof Struct) { + language = ((Struct) langVal).getName(); + } } + + public String getLanguage() { + return language; + } + + public String[] getLibraries(){ return new String[] { "alice.tuprolog.lib.BasicLibrary", diff --git a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java index 0a160c1481..85c1185b2d 100644 --- a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java +++ b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java @@ -64,16 +64,11 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer { private static final Log log = PlatformUtil.getLog(TTSCommandPlayerImpl.class); private TextToSpeech mTts; private Context mTtsContext; - private String language; private HashMap params = new HashMap(); protected TTSCommandPlayerImpl(Activity ctx, String voiceProvider) throws CommandPlayerException { super((OsmandApplication) ctx.getApplicationContext(), voiceProvider, CONFIG_FILE, TTS_VOICE_VERSION); - final Term langVal = solveSimplePredicate("language"); - if (langVal instanceof Struct) { - language = ((Struct) langVal).getName(); - } if (Algorithms.isEmpty(language)) { throw new CommandPlayerException( ctx.getString(R.string.voice_data_corrupted));