- final View clearSearchTextButton = findViewById(R.id.ClearSearchTextButton);
- clearSearchTextButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- onClearSearchTextButton();
+ setDictionaryPrefs(this, dictFile, index.shortName, searchView.getQuery().toString());
+
+ updateLangButton();
+ searchView.requestFocus();
+
+ // http://stackoverflow.com/questions/2833057/background-listview-becomes-black-when-scrolling
+// getListView().setCacheColorHint(0);
+ }
+
+ private void onCreateSetupActionBarAndSearchView() {
+ ActionBar actionBar = getSupportActionBar();
+ actionBar.setDisplayShowTitleEnabled(false);
+ actionBar.setDisplayShowHomeEnabled(false);
+ actionBar.setDisplayHomeAsUpEnabled(false);
+
+ final LinearLayout customSearchView = new LinearLayout(getSupportActionBar().getThemedContext());
+
+ final int width = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 300,
+ getResources().getDisplayMetrics());
+ final LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+ customSearchView.setLayoutParams(layoutParams);
+
+ listView.setOnItemClickListener(new OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view, int row, long id) {
+ onListItemClick(getListView(), view, row, id);