From 90f2a1acc5b5386f8af6636d9fea0706e2dbf36f Mon Sep 17 00:00:00 2001 From: Thad Hughes Date: Tue, 27 Mar 2012 21:11:35 -0700 Subject: [PATCH] Ready to release... And fixed cursor placement bug and preserving search text when changing dicts. --- AndroidManifest.xml | 4 +-- res/raw-de/whats_new.html | 14 ++------- res/raw/whats_new.html | 12 ++------ res/values-de/strings.xml | 3 +- res/values/strings.xml | 2 +- .../dictionary/DictionaryActivity.java | 30 ++++++++++++++----- 6 files changed, 34 insertions(+), 31 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 52796a0..6b49408 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -4,8 +4,8 @@ package="com.hughes.android.dictionary" - android:versionCode="18" - android:versionName="3.2" + android:versionCode="19" + android:versionName="3.2.1" android:installLocation="auto"> diff --git a/res/raw-de/whats_new.html b/res/raw-de/whats_new.html index 447c4c6..9554acb 100644 --- a/res/raw-de/whats_new.html +++ b/res/raw-de/whats_new.html @@ -9,19 +9,11 @@ -Vielen Dank für die Aktualisierung auf QuickDic 3.2. +Vielen Dank für die Aktualisierung auf QuickDic 3.2.1.

Neue Funktionen:

diff --git a/res/raw/whats_new.html b/res/raw/whats_new.html index dccbe6f..41bda33 100644 --- a/res/raw/whats_new.html +++ b/res/raw/whats_new.html @@ -9,17 +9,11 @@ -Thanks for updating to QuickDic 3.2 +Thanks for updating to QuickDic 3.2.1.

New features:

diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 14746ac..2a3200d 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -3,7 +3,7 @@ QuickDic - QuickDic 3.2 + QuickDic 3.2.1 Über QuickDic… @@ -54,6 +54,7 @@ Wenn Sie QuickDic benutzen, würde ich gerne von Ihnen hören. Leider kann ich keine Verantwortung für die Wörterbücher (außer Formatierung) nehmen, weil sie aus anderen Quellen erzeugt werden. + Danke an Michael Vogel für Hilfe mit dem Icon und den deutschen Übersetzungen. Bitte senden Sie Kommentare, Anregungen, Bug-Reports, oder einfach nur ein kurzes Hallo an: thad.hughes@gmail.com diff --git a/res/values/strings.xml b/res/values/strings.xml index 4e08ead..c5da911 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3,7 +3,7 @@ QuickDic - QuickDic 3.2 + QuickDic 3.2.1 About QuickDic… diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index 5d937f8..78c8a47 100644 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -278,12 +278,14 @@ public class DictionaryActivity extends ListActivity { searchText.requestFocus(); searchText.addTextChangedListener(searchTextWatcher); - String text = ""; + + // Set the search text from the intent, then the saved state. + String text = getIntent().getStringExtra(C.SEARCH_TOKEN); if (savedInstanceState != null) { text = savedInstanceState.getString(C.SEARCH_TOKEN); - if (text == null) { - text = ""; - } + } + if (text == null) { + text = ""; } setSearchText(text, true); Log.d(LOG, "Trying to restore searchText=" + text); @@ -791,12 +793,26 @@ public class DictionaryActivity extends ListActivity { } searchText.setText(text); searchText.requestFocus(); + moveCursorToRight(); + if (triggerSearch) { + onSearchTextChange(text); + } + } + + private long cursorDelayMillis = 100; + private void moveCursorToRight() { if (searchText.getLayout() != null) { + cursorDelayMillis = 100; // Surprising, but this can crash when you rotate... Selection.moveToRightEdge(searchText.getText(), searchText.getLayout()); - } - if (triggerSearch) { - onSearchTextChange(text); + } else { + uiHandler.postDelayed(new Runnable() { + @Override + public void run() { + moveCursorToRight(); + } + }, cursorDelayMillis); + cursorDelayMillis = Math.min(10 * 1000, 2 * cursorDelayMillis); } } -- 2.43.0