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;
}