final LinearLayout result = new LinearLayout(parent.getContext());
for (int i = 0; i < dictionaryInfo.indexInfos.size(); ++i) {
- if (i > 0) {
- final TextView dash = new TextView(parent.getContext());
- dash.setText("-");
- result.addView(dash);
- }
-
final IndexInfo indexInfo = dictionaryInfo.indexInfos.get(i);
- final Button button = new Button(parent.getContext());
- button.setText(indexInfo.shortName);
+ final View button = application.createButton(parent.getContext(), dictionaryInfo, indexInfo);
final IntentLauncher intentLauncher = new IntentLauncher(parent.getContext(),
getLaunchIntent(
application.getPath(dictionaryInfo.uncompressedFilename),
};
button.setOnClickListener(intentLauncher);
result.addView(button);
-
}
final TextView nameView = new TextView(parent.getContext());
layoutParams.weight = 1.0f;
nameView.setLayoutParams(layoutParams);
result.addView(nameView);
-
return result;
}
}
result.setMinimumWidth(languageButtonPixels);
result.setMinimumHeight(languageButtonPixels * 2 / 3);
- result.setOnClickListener(
- new IntentLauncher(context,
- DictionaryActivity.getLaunchIntent(getPath(dictionaryInfo.uncompressedFilename), indexInfo.shortName, "")));
// result.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
return result;
}
return true;
}
});
+ filterSearchView.setIconifiedByDefault(false);
application.onCreateGlobalOptionsMenu(this, menu);
return true;
final List<IndexInfo> sortedIndexInfos = application.sortedIndexInfos(dictionaryInfo.indexInfos);
for (IndexInfo indexInfo : sortedIndexInfos) {
final View button = application.createButton(buttons.getContext(), dictionaryInfo, indexInfo);
+ button.setOnClickListener(
+ new IntentLauncher(buttons.getContext(),
+ DictionaryActivity.getLaunchIntent(application.getPath(dictionaryInfo.uncompressedFilename), indexInfo.shortName, "")));
buttons.addView(button);
}