]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Show dictionary list on normal click.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sat, 29 Oct 2016 12:43:02 +0000 (14:43 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sat, 29 Oct 2016 12:50:22 +0000 (14:50 +0200)
With the swap action button there is no need
to hide this in the long-press action.
I remember it took me fairly long to find my way
out of the dictionary again the first time...

src/com/hughes/android/dictionary/DictionaryActivity.java

index 8575fa6eda81b4262d268d5652f412860db79290..4b147141dd6c8507cb2618893919cc0a62d1500c 100644 (file)
@@ -301,6 +301,12 @@ public class DictionaryActivity extends ActionBarActivity {
             if (query != null)
                 getIntent().putExtra(C.SEARCH_TOKEN, query);
         }
+        if (intentAction != null && intentAction.equals(Intent.ACTION_SEND))
+        {
+            String query = intent.getStringExtra(Intent.EXTRA_TEXT);
+            if (query != null)
+                getIntent().putExtra(C.SEARCH_TOKEN, query);
+        }
         /*
          * This processes text on M+ devices where QuickDic shows up in the context menu.
          */
@@ -532,15 +538,8 @@ public class DictionaryActivity extends ActionBarActivity {
         languageButton.setScaleType(ScaleType.FIT_CENTER);
         languageButton.setOnClickListener(new OnClickListener() {
             @Override
-            public void onClick(View arg0) {
-                onLanguageButtonClick();
-            }
-        });
-        languageButton.setOnLongClickListener(new OnLongClickListener() {
-            @Override
-            public boolean onLongClick(View v) {
+            public void onClick(View v) {
                 onLanguageButtonLongClick(v.getContext());
-                return true;
             }
         });
         languageButton.setAdjustViewBounds(true);