Log.e(LOG, "TTS not available in this language: ttsResult=" + ttsResult);
}
} catch (Exception e) {
- Toast.makeText(this, getString(R.string.TTSbroken), Toast.LENGTH_LONG).show();
+ if (!isFinishing())
+ Toast.makeText(this, getString(R.string.TTSbroken), Toast.LENGTH_LONG).show();
}
}
}
});
- application.onCreateGlobalOptionsMenu(this, menu);
-
{
final MenuItem dictionaryManager = menu.add(getString(R.string.dictionaryManager));
MenuItemCompat.setShowAsAction(dictionaryManager, MenuItem.SHOW_AS_ACTION_NEVER);
});
}
+ application.onCreateGlobalOptionsMenu(this, menu);
+
return true;
}
final int rowCount = entry.pairs.size();
if (result == null) {
result = new TableLayout(context);
+ result.setStretchAllColumns(true);
// Because we have a Button inside a ListView row:
// http://groups.google.com/group/android-developers/browse_thread/thread/3d96af1530a7d62a?pli=1
result.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
result.removeViews(rowCount, result.getChildCount() - rowCount);
}
- final TableRow.LayoutParams layoutParams = new TableRow.LayoutParams();
- layoutParams.weight = 0.5f;
- layoutParams.leftMargin = mPaddingLarge;
-
for (int r = result.getChildCount(); r < rowCount; ++r) {
+ final TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT);
+ layoutParams.leftMargin = mPaddingLarge;
+
final TableRow tableRow = new TableRow(result.getContext());
final TextView col1 = new TextView(tableRow.getContext());
textView.setOnLongClickListener(indexIndex > 0 ? textViewLongClickListenerIndex1 : textViewLongClickListenerIndex0);
textView.setLongClickable(true);
- // Doesn't work:
- // textView.setTextColor(android.R.color.secondary_text_light);
textView.setTypeface(typeface);
if (isTokenRow) {
textView.setTextAppearance(context, theme.tokenRowFg);
} else {
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSizeSp);
}
+ textView.setTextColor(textColorFg);
if (!htmlEntries.isEmpty()) {
textView.setClickable(true);
textView.setMovementMethod(LinkMovementMethod.getInstance());