From c7860e7202c7c4b69437220a8851c98e686ab703 Mon Sep 17 00:00:00 2001 From: Thad Hughes Date: Tue, 24 Jan 2012 11:19:51 -0800 Subject: [PATCH] Went to LinearLayout, kinda works. --- .../android/dictionary/DictionaryActivity.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/com/hughes/android/dictionary/DictionaryActivity.java b/src/com/hughes/android/dictionary/DictionaryActivity.java index 428f3a0..ca47646 100644 --- a/src/com/hughes/android/dictionary/DictionaryActivity.java +++ b/src/com/hughes/android/dictionary/DictionaryActivity.java @@ -58,6 +58,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; +import android.view.ViewGroup.LayoutParams; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; @@ -823,16 +824,18 @@ public class DictionaryActivity extends ListActivity { } private View getView(PairEntry.Row row, ViewGroup parent, final View convertView) { - final TableLayout result = new TableLayout(parent.getContext()); + final LinearLayout result = new LinearLayout(parent.getContext()); final PairEntry entry = row.getEntry(); final int rowCount = entry.pairs.size(); for (int r = 0; r < rowCount; ++r) { - final TableRow tableRow = new TableRow(result.getContext()); + final LinearLayout tableRow = new LinearLayout(result.getContext()); + final LinearLayout.LayoutParams rowLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + tableRow.setLayoutParams(rowLayoutParams); final TextView col1 = new TextView(tableRow.getContext()); final TextView col2 = new TextView(tableRow.getContext()); - final TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(); - layoutParams.weight = 0.5f; + final LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); + layoutParams.weight = 1.0f; // Set the columns in the table. if (r > 0) { @@ -850,8 +853,8 @@ public class DictionaryActivity extends ListActivity { tableRow.addView(bullet); } tableRow.addView(col2, layoutParams); - col1.setWidth(1); - col2.setWidth(1); + col1.setWidth(0); + col2.setWidth(0); // Set what's in the columns. -- 2.43.0