From: Thad Hughes Date: Sun, 25 Dec 2011 23:57:32 +0000 (-0800) Subject: Font size, rename dictionaries. X-Git-Url: http://gitweb.fperrin.net/?a=commitdiff_plain;h=ce9fbbd23434b2731701b62c10d9272783cfa9e2;p=Dictionary.git Font size, rename dictionaries. --- diff --git a/default.properties b/default.properties deleted file mode 100644 index c1fd41a..0000000 --- a/default.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Indicates whether an apk should be generated for each density. -split.density=false -# Project target. -target=android-8 diff --git a/default.properties b/default.properties new file mode 120000 index 0000000..82d8917 --- /dev/null +++ b/default.properties @@ -0,0 +1 @@ +project.properties \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 9aed937..7fd1139 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -88,7 +88,7 @@ fontSize Font size - The size of the font for dictionary rows. + The size of the font for dictionary rows (restart required). saveOnlyFirstSubentry Save only first sub-entry diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index d52c300..ecd445e 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -45,7 +45,7 @@ android:title="@string/themeTitle" android:summary="@string/themeSummary" android:persistent="true" - android:defaultValue="" + android:defaultValue="themeLight" android:entries="@array/themes" android:entryValues="@array/themeKeys" /> diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index 00d4576..4c56e48 100644 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -221,7 +221,6 @@ public class DictionaryActivity extends ListActivity { searchText.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSizeSp); langButton = (Button) findViewById(R.id.LangButton); - langButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSizeSp); searchText.requestFocus(); searchText.addTextChangedListener(searchTextWatcher); @@ -734,7 +733,7 @@ public class DictionaryActivity extends ListActivity { private View getView(TokenRow row, ViewGroup parent) { final TextView textView = new TextView(parent.getContext()); textView.setText(row.getToken()); - textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 6 * fontSizeSp / 5); + textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 5 * fontSizeSp / 4); return textView; } diff --git a/src/com/hughes/android/dictionary/DictionaryListActivity.java b/src/com/hughes/android/dictionary/DictionaryListActivity.java index 004ce2b..923a918 100644 --- a/src/com/hughes/android/dictionary/DictionaryListActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryListActivity.java @@ -113,6 +113,13 @@ public class DictionaryListActivity extends ListActivity { } if (quickDicConfig.currentVersion < QuickDicConfig.LATEST_VERSION) { Log.d(LOG, "Dictionary list is old, updating it."); + + // Replace <-> with - + if (quickDicConfig.currentVersion == 3) { + for (final DictionaryConfig config : quickDicConfig.dictionaryConfigs) { + config.name = config.name.replace("<->", "-"); + } + } quickDicConfig.addDefaultDictionaries(); quickDicConfig.currentVersion = QuickDicConfig.LATEST_VERSION; } diff --git a/src/com/hughes/android/dictionary/QuickDicConfig.java b/src/com/hughes/android/dictionary/QuickDicConfig.java index b042d40..c465c79 100644 --- a/src/com/hughes/android/dictionary/QuickDicConfig.java +++ b/src/com/hughes/android/dictionary/QuickDicConfig.java @@ -25,7 +25,7 @@ public final class QuickDicConfig implements Serializable { private static final long serialVersionUID = 6711617368780900979L; // Just increment this to have them all update... - static final int LATEST_VERSION = 3; + static final int LATEST_VERSION = 4; final List dictionaryConfigs = new ArrayList(); int currentVersion = LATEST_VERSION; @@ -39,7 +39,7 @@ public final class QuickDicConfig implements Serializable { public void addDefaultDictionaries() { { final DictionaryConfig config = new DictionaryConfig(); - config.name = "German<->English"; + config.name = "German-English"; config.downloadUrl = BASE_URL + "DE-EN_chemnitz_enwiktionary.quickdic.zip"; config.localFile = "/sdcard/quickDic/DE-EN_chemnitz_enwiktionary.quickdic"; addOrReplace(config); @@ -50,7 +50,7 @@ public final class QuickDicConfig implements Serializable { continue; } final DictionaryConfig config = new DictionaryConfig(); - config.name = String.format("English<->%s", Language.isoCodeToWikiName.get(iso)); + config.name = String.format("English-%s", Language.isoCodeToWikiName.get(iso)); config.downloadUrl = String.format("%sEN-%s_enwiktionary.quickdic.zip", BASE_URL, iso); config.localFile = String.format("/sdcard/quickDic/EN-%s_enwiktionary.quickdic", iso); addOrReplace(config);