outState.putString(C.SEARCH_TOKEN, searchView.getQuery().toString());
}
- @Override
- protected void onRestoreInstanceState(final Bundle savedInstanceState) {
- super.onRestoreInstanceState(savedInstanceState);
- Log.d(LOG, "onRestoreInstanceState: " + savedInstanceState.getString(C.SEARCH_TOKEN));
- onCreate(savedInstanceState);
- }
-
@Override
public void onCreate(Bundle savedInstanceState) {
// This needs to be before super.onCreate, otherwise ActionbarSherlock
// Don't auto-launch if this fails.
prefs.edit().remove(C.DICT_FILE).commit();
+ setContentView(R.layout.dictionary_activity);
application = (DictionaryApplication) getApplication();
theme = application.getSelectedTheme();
}
}).start();
- String fontName = prefs.getString(getString(R.string.fontKey), "FreeSerif.ttf.jpg");
+ String fontName = prefs.getString(getString(R.string.fontKey), "FreeSerif.otf.jpg");
if ("SYSTEM".equals(fontName)) {
typeface = Typeface.DEFAULT;
+ } else if ("SERIF".equals(fontName)) {
+ typeface = Typeface.SERIF;
+ } else if ("SANS_SERIF".equals(fontName)) {
+ typeface = Typeface.SANS_SERIF;
+ } else if ("MONOSPACE".equals(fontName)) {
+ typeface = Typeface.MONOSPACE;
} else {
try {
typeface = Typeface.createFromAsset(getAssets(), fontName);
fontSizeSp = 14;
}
- setContentView(R.layout.dictionary_activity);
-
// ContextMenu.
registerForContextMenu(getListView());
final int width = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 300,
getResources().getDisplayMetrics());
final LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
- width, ViewGroup.LayoutParams.WRAP_CONTENT);
+ ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
customSearchView.setLayoutParams(layoutParams);
listView.setOnItemClickListener(new OnItemClickListener() {