]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
go
authorThad Hughes <thadh@dhcp-172-18-100-204.mtv.corp.google.com>
Fri, 9 Apr 2010 22:25:44 +0000 (15:25 -0700)
committerThad Hughes <thadh@dhcp-172-18-100-204.mtv.corp.google.com>
Fri, 9 Apr 2010 22:25:44 +0000 (15:25 -0700)
AndroidManifest.xml
default.properties
res/layout/main.xml
res/values-de/strings.xml
res/values/strings.xml
src/com/hughes/android/dictionary/DictionaryActivity.java
src/com/hughes/android/dictionary/Language.java
src/com/hughes/android/dictionary/NoDictionaryActivity.java

index 3107cf0fb1b273c43ad0eeb50a463da896b1a5a8..f0bfc11843abfac2d86444d1db4d8f3c991ecf93 100755 (executable)
@@ -1,16 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-       package="com.hughes.android.dictionary" android:versionName="1.6" android:versionCode="6">
+       package="com.hughes.android.dictionary" android:versionName="1.8" android:versionCode="8">
 
-       <uses-sdk android:minSdkVersion="2" />
+       <uses-sdk android:minSdkVersion="4" />
        <uses-permission android:name="android.permission.INTERNET"/>
+  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
 
        <application android:icon="@drawable/icon" android:label="@string/app_name">
-               <activity android:name=".DictionaryActivity" android:label="@string/app_name">
+               <activity android:name=".DictionaryActivity" 
+                   android:label="@string/app_name"
+                   android:windowSoftInputMode="stateVisible|adjustResize">
                        <intent-filter>
                                <action android:name="android.intent.action.MAIN" />
                                <category android:name="android.intent.category.LAUNCHER" />
                        </intent-filter>
+                       
                </activity>
 
                <activity android:name="AboutActivity"/>
@@ -26,5 +31,5 @@
            android:targetPackage="com.hughes.android.dictionary"
            android:label="DictionaryActivityTest" />
            
-           
-</manifest> 
\ No newline at end of file
+</manifest>
\ No newline at end of file
index 0a007ab5e2f26540fa26b796c68f63b5249f688b..ae7b77e572b49cb78669b2626c190c458ce6c00d 100755 (executable)
@@ -7,16 +7,8 @@
 # "build.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-3
-# apk configurations. This property allows creation of APK files with limited
-# resources. For example, if your application contains many locales and
-# you wish to release multiple smaller apks instead of a large one, you can
-# define configuration to create apks with limited language sets.
-# Format is a comma separated list of configuration names. For each
-# configuration, a property will declare the resource configurations to
-# include. Example:
-#     apk-configurations=european,northamerica
-#     apk-config-european=en,fr,it,de,es
-#     apk-config-northamerica=en,es
+target=android-6
 apk-configurations=
index c12bb0f4b2210ae173b752de5dd4b8c113596e14..16a9728c818c17290870c4f121543c19bfb1dea9 100755 (executable)
@@ -15,7 +15,8 @@
                                android:hint="@string/searchText"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content" 
-                               android:inputType="text" 
+                               android:inputType="text|textNoSuggestions" 
+                               android:imeOptions="actionSearch|flagNoEnterAction|flagNoExtractUi"
                                android:layout_weight="1.0"/>
                                
       <Button 
index c461463472145d3f5997e689b046396561246714..a8d07b5cfc97e814d86e37d87ab04ac3c8ce1994 100755 (executable)
@@ -14,7 +14,6 @@
   <string name="failedAddingToWordList">Fehler bei Wortliste hinzufugen: %s</string>
 
        <!-- About. -->
-       <string name="titleWithVersion">QuickDic 1.6</string>
        <string name="thadHughes">Thad Hughes</string>
        <string name="contactMe">Wenn QuickDic dir gefällt, würde ich gern von dir hören.  Bitte schicke Bemerkungen, Aufforderungen, oder Programmfehler an:</string>
        <string name="myEmail">thad.hughes+quickdic@gmail.com</string>
@@ -52,7 +51,7 @@ Einträgezahl: %d\n
   <string name="saveOnlyFirstSubentrySummary">For entries with multiple sub-entries, only write the first to the word list.</string>
 
   <string name="showClearSearchTextButtonKey">showClearSearchTextButton</string>
-  <string name="showClearSearchTextButtonTitle">Show 'clear search text' button</string>
+  <string name="showClearSearchTextButtonTitle">Show \'clear search text\' button</string>
   <string name="showClearSearchTextButtonSummary">Show the button to clear the search text. You can also just move focus away from search text and start typing.</string>
   
        <string name="dictFileKey">dictFile</string>
index 6ffc831480d10d907ed3860de2479f801890f0ca..ada99cbd26ed7d25406c4d686ceaa7162495fda6 100755 (executable)
@@ -14,9 +14,9 @@
   <string name="failedAddingToWordList">Failure adding to word list: %s</string>
 
        <!-- About. -->
-       <string name="titleWithVersion">QuickDic 1.6</string>
+       <string name="titleWithVersion">QuickDic 1.8</string>
        <string name="thadHughes">Thad Hughes</string>
-       <string name="contactMe">If you're using QuickDic, I'd love to hear from you.  Please send comments, suggestions, bug reports, or just a quick hello to:</string>
+       <string name="contactMe">If you\'re using QuickDic, I\'d love to hear from you.  Please send comments, suggestions, bug reports, or just a quick hello to:</string>
        <string name="myEmail">thad.hughes+quickdic@gmail.com</string>
        <string name="currentDictInfo">Current dictionary info:</string>
        <string name="noDictLoaded">No dictionary loaded.</string>
@@ -52,7 +52,7 @@ Entry count: %d\n
   <string name="saveOnlyFirstSubentrySummary">For entries with multiple sub-entries, only write the first to the word list.</string>
 
   <string name="showClearSearchTextButtonKey">showClearSearchTextButton</string>
-  <string name="showClearSearchTextButtonTitle">Show 'clear search text' button</string>
+  <string name="showClearSearchTextButtonTitle">Show \'clear search text\' button</string>
   <string name="showClearSearchTextButtonSummary">Show the button to clear the search text. You can also just move focus away from search text and start typing.</string>
   
        <string name="dictFileKey">dictFile</string>
index 61061d57f1363b4432a450b33c0adbad591b77fb..05f292a9a2e4729aec74dc375eff39bcf1612563 100755 (executable)
@@ -36,6 +36,7 @@ import android.view.ViewGroup;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.view.MenuItem.OnMenuItemClickListener;
 import android.view.View.OnClickListener;
+import android.view.inputmethod.InputMethodManager;
 import android.widget.AdapterView;
 import android.widget.BaseAdapter;
 import android.widget.Button;
@@ -53,7 +54,7 @@ import com.ibm.icu.text.Collator;
 
 public class DictionaryActivity extends ListActivity {
   
-  // TODO:
+  // TO DO:
   // * Download latest dicts.
   //   * http://ftp.tu-chemnitz.de/pub/Local/urz/ding/de-en-devel/
   //   * http://www1.dict.cc/translation_file_request.php?l=e
@@ -144,9 +145,7 @@ public class DictionaryActivity extends ListActivity {
     final Button clearSearchTextButton = (Button) findViewById(R.id.ClearSearchTextButton);
     clearSearchTextButton.setOnClickListener(new OnClickListener() {
       public void onClick(View v) {
-        clearSearchTextButton.requestFocus();
-        searchText.setText("");
-        searchText.requestFocus();
+        onClearSearchTextButton(clearSearchTextButton);
       }
     });
     clearSearchTextButton.setVisibility(PreferenceManager.getDefaultSharedPreferences(this).getBoolean(
@@ -448,12 +447,19 @@ public class DictionaryActivity extends ListActivity {
   void onSearchTextChange(final String searchText) {
     Log.d(LOG, "onSearchTextChange: " + searchText);
     synchronized (this) {
-      searchOperation = new SearchOperation(languageList, searchText, searchOperation);
+      searchOperation = new SearchOperation(languageList, searchText.trim(), searchOperation);
       searchExecutor.execute(searchOperation);
     }
   }
 
-  
+  private void onClearSearchTextButton(final Button clearSearchTextButton) {
+    clearSearchTextButton.requestFocus();
+    searchText.setText("");
+    searchText.requestFocus();
+    Log.d(LOG, "Trying to show soft keyboard.");
+    final InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+    manager.showSoftInput(searchText, InputMethodManager.SHOW_IMPLICIT);
+  }
 
   // ----------------------------------------------------------------
   // ContextMenu
index d8fa3606e71eec80c52418353e78de6338c23d58..0c4b2c5f0f325fc84af0c75b5b8dd9e70fddfdf8 100755 (executable)
@@ -12,7 +12,7 @@ public class Language {
   final String symbol;\r
   final Locale locale;\r
 \r
-  private Collator sortCollator;\r
+  Collator sortCollator;\r
   final Comparator<String> sortComparator;\r
 \r
   private Collator findCollator;\r
index f7fb10f73757c372e010ec261dc88e5f5810a2a2..2e3cfbedbe8c6fb52ed76cc1afa7032a360f307e 100755 (executable)
@@ -51,7 +51,7 @@ public class NoDictionaryActivity extends Activity {
     if (!canReadDict) {\r
       statusText.setText(getString(R.string.unableToReadDictionaryFile, dictFile));\r
     } else {\r
-      statusText.setText(getString(R.string.dictionaryFileExists));\r
+      statusText.setText(getString(R.string.dictionaryFileExists, dictFile));\r
     }\r
 \r
     final Button launchButton = (Button) findViewById(R.id.launchDict);\r