+ searchView.setMinimumWidth((int)
+ TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 300, getResources().getDisplayMetrics()));
+ searchView.setOnQueryTextListener(new OnQueryTextListener() {
+ @Override
+ public boolean onQueryTextSubmit(String query) {
+ Log.d(LOG, "OnQueryTextListener: onQueryTextSubmit: " + searchView.getQuery());
+ return true;
+ }
+
+ @Override
+ public boolean onQueryTextChange(String newText) {
+// if (searchView.hasFocus()) {
+ Log.d(LOG, "OnQueryTextListener: onQueryTextChange: " + searchView.getQuery());
+ // If they were typing to cause the change, update the UI.
+ onSearchTextChange(searchView.getQuery().toString());
+// }
+ return true;
+ }
+ });
+
+ // 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 = "";
+ }
+ setSearchText(text, true);
+ Log.d(LOG, "Trying to restore searchText=" + text);
+
+ setDictionaryPrefs(this, dictFile, indexIndex, searchView.getQuery().toString());
+
+ searchHintIcon = (ImageView) searchView.findViewById(R.id.abs__search_mag_icon);
+ searchHintIcon.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) {
+ onLanguageButton();
+ }
+ });
+ searchHintIcon.setOnLongClickListener(new OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View v) {
+ onLanguageButtonLongClick(v.getContext());
+ return true;
+ }
+ });
+
+
+
+// ImageView searchHintIcon = (ImageView) searchView.findViewById(searchView.getContext().getResources().
+// getIdentifier("android:id/search_mag_icon", null, null));
+// searchHintIcon.setImageResource(android.R.color.transparent);