Make column shrink to fit within table.

This commit is contained in:
Brian Pellin
2009-11-22 20:59:42 -06:00
parent f9771e3cf1
commit 9e9fe6963b
2 changed files with 11 additions and 2 deletions

View File

@@ -51,8 +51,9 @@
android:layout_height="fill_parent"
android:layout_above="@id/entry_divider2"
android:layout_below="@id/entry_divider1">
<TableLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout android:id="@+id/entry_table"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<!-- Username -->
<TableRow>
<TextView android:id="@+id/entry_user_name_label"

View File

@@ -44,6 +44,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -68,6 +69,10 @@ public class EntryActivity extends LockCloseActivity {
public static final int NOTIFY_USERNAME = 1;
public static final int NOTIFY_PASSWORD = 2;
@SuppressWarnings("unused")
private static final int COL_LABEL = 0;
private static final int COL_DATA = 1;
public static void Launch(Activity act, PwEntry pw, int pos) {
Intent i = new Intent(act, EntryActivity.class);
@@ -112,6 +117,9 @@ public class EntryActivity extends LockCloseActivity {
View scroll = findViewById(R.id.entry_scroll);
scroll.setScrollBarStyle(View.SCROLLBARS_INSIDE_INSET);
TableLayout table = (TableLayout) findViewById(R.id.entry_table);
table.setColumnShrinkable(COL_DATA, true);
Button edit = (Button) findViewById(R.id.entry_edit);
edit.setOnClickListener(new View.OnClickListener() {