X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2FDictionaryActivity.java;h=eb3b2a2fff0b6522722a95ba38e0e783f9903afe;hb=1c929d8c3970a292ab26af3869dd0f11370a9533;hp=78b3b49fd1dca9917016dd9cf07a0f43e4ce5d97;hpb=3a77aa611736e3614873e48578cb48778cf9c7d4;p=Dictionary.git diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index 78b3b49..eb3b2a2 100644 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -974,8 +974,6 @@ public class DictionaryActivity extends ActionBarActivity { } }); - application.onCreateGlobalOptionsMenu(this, menu); - { final MenuItem dictionaryManager = menu.add(getString(R.string.dictionaryManager)); MenuItemCompat.setShowAsAction(dictionaryManager, MenuItem.SHOW_AS_ACTION_NEVER); @@ -1046,6 +1044,8 @@ public class DictionaryActivity extends ActionBarActivity { }); } + application.onCreateGlobalOptionsMenu(this, menu); + return true; } @@ -1598,6 +1598,7 @@ public class DictionaryActivity extends ActionBarActivity { 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); @@ -1611,11 +1612,10 @@ public class DictionaryActivity extends ActionBarActivity { 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()); @@ -1712,8 +1712,6 @@ public class DictionaryActivity extends ActionBarActivity { 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); @@ -1721,6 +1719,7 @@ public class DictionaryActivity extends ActionBarActivity { } else { textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSizeSp); } + textView.setTextColor(textColorFg); if (!htmlEntries.isEmpty()) { textView.setClickable(true); textView.setMovementMethod(LinkMovementMethod.getInstance());