]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Add floating button to switch language.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index c79faf32c77e4384867e54a8745839b5e8f28c4b..356e957ebaf8788645e898a1ac3d6b801ba04e7b 100644 (file)
@@ -367,6 +367,7 @@ public class DictionaryActivity extends ActionBarActivity {
         }
         Log.d(LOG, "Loading index " + indexIndex);
         index = dictionary.indices.get(indexIndex);
+        getListView().setEmptyView(findViewById(android.R.id.empty));
         setListAdapter(new IndexAdapter(index));
 
         // Pre-load the collators.
@@ -448,6 +449,21 @@ public class DictionaryActivity extends ActionBarActivity {
 
         onCreateSetupActionBarAndSearchView();
 
+        View floatSwapButton = findViewById(R.id.floatSwapButton);
+        floatSwapButton.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View arg0) {
+                onLanguageButtonClick();
+            }
+        });
+        floatSwapButton.setOnLongClickListener(new OnLongClickListener() {
+            @Override
+            public boolean onLongClick(View v) {
+                onLanguageButtonLongClick(v.getContext());
+                return true;
+            }
+        });
+
         // Set the search text from the intent, then the saved state.
         String text = getIntent().getStringExtra(C.SEARCH_TOKEN);
         if (savedInstanceState != null) {