cleanup: make TableLayout include less

Scroller is allowed only one child and I guess I wanted the TableLayout
to suffice, but having unrelated stuff in it sucked. So wrap it in a
LinearLayout and move the unrelated stuff out.
This commit is contained in:
Eric House 2021-02-24 19:03:52 -08:00
parent ae0a30a088
commit c97b9875bd
2 changed files with 66 additions and 63 deletions

View file

@ -39,6 +39,7 @@ import android.widget.FrameLayout;
import android.widget.ListView; import android.widget.ListView;
import android.widget.SectionIndexer; import android.widget.SectionIndexer;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TableLayout;
import android.widget.TextView; import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
@ -523,7 +524,7 @@ public class DictBrowseDelegate extends DelegateBase
private void findTableRows() private void findTableRows()
{ {
ViewGroup table = (ViewGroup)findViewById( R.id.config ); TableLayout table = (TableLayout)findViewById( R.id.table );
int count = table.getChildCount(); int count = table.getChildCount();
int nFound = 0; int nFound = 0;
for ( int ii = 0; ii < count && nFound < m_rows.length; ++ii ) { for ( int ii = 0; ii < count && nFound < m_rows.length; ++ii ) {

View file

@ -45,64 +45,69 @@
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" android:paddingRight="8dp"
> >
<TableLayout android:id="@+id/config" <LinearLayout android:id="@+id/config"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF1F1F1F"
android:visibility="gone"
>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView style="@style/pat_table_label"
android:visibility="invisible"
/>
<EditText style="@style/pat_table_edit"
android:visibility="invisible"
/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/pat_col_anyorder" android:background="#FF1F1F1F"
/> android:visibility="gone"
</TableRow> >
<org.eehouse.android.xw4.PatTableRow <TableLayout android:id="@+id/table"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
> >
<TextView style="@style/pat_table_label" <TableRow
android:text="@string/pat_starts_with" android:layout_width="fill_parent"
/> android:layout_height="wrap_content"
<EditText style="@style/pat_table_edit" >
/> <TextView style="@style/pat_table_label"
<CheckBox style="@style/pat_table_check" android:visibility="invisible"
/> />
</org.eehouse.android.xw4.PatTableRow> <EditText style="@style/pat_table_edit"
<org.eehouse.android.xw4.PatTableRow android:visibility="invisible"
android:layout_width="fill_parent" />
android:layout_height="wrap_content" <TextView android:layout_width="wrap_content"
> android:layout_height="wrap_content"
<TextView style="@style/pat_table_label" android:text="@string/pat_col_anyorder"
android:text="@string/pat_contains" />
/> </TableRow>
<EditText style="@style/pat_table_edit" <org.eehouse.android.xw4.PatTableRow
/> android:layout_width="fill_parent"
<CheckBox style="@style/pat_table_check" android:layout_height="wrap_content"
/> >
</org.eehouse.android.xw4.PatTableRow> <TextView style="@style/pat_table_label"
<org.eehouse.android.xw4.PatTableRow android:text="@string/pat_starts_with"
android:layout_width="fill_parent" />
android:layout_height="wrap_content" <EditText style="@style/pat_table_edit"
> />
<TextView style="@style/pat_table_label" <CheckBox style="@style/pat_table_check"
android:text="@string/pat_ends_with" />
/> </org.eehouse.android.xw4.PatTableRow>
<EditText style="@style/pat_table_edit" <org.eehouse.android.xw4.PatTableRow
/> android:layout_width="fill_parent"
<CheckBox style="@style/pat_table_check" android:layout_height="wrap_content"
/> >
</org.eehouse.android.xw4.PatTableRow> <TextView style="@style/pat_table_label"
android:text="@string/pat_contains"
/>
<EditText style="@style/pat_table_edit"
/>
<CheckBox style="@style/pat_table_check"
/>
</org.eehouse.android.xw4.PatTableRow>
<org.eehouse.android.xw4.PatTableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView style="@style/pat_table_label"
android:text="@string/pat_ends_with"
/>
<EditText style="@style/pat_table_edit"
/>
<CheckBox style="@style/pat_table_check"
/>
</org.eehouse.android.xw4.PatTableRow>
</TableLayout>
<LinearLayout android:layout_height="wrap_content" <LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
@ -111,10 +116,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:text="@string/button_addBlank" android:text="@string/button_addBlank"
android:layout_span="1"
android:enabled="false" android:enabled="false"
android:minHeight="0dp"
android:minWidth="0dp"
/> />
</LinearLayout> </LinearLayout>
<LinearLayout android:layout_height="wrap_content" <LinearLayout android:layout_height="wrap_content"
@ -154,12 +156,12 @@
</LinearLayout> </LinearLayout>
<Button android:id="@+id/button_useconfig" <Button android:id="@+id/button_useconfig"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:text="@string/button_useconfig" android:text="@string/button_useconfig"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_span="2" android:layout_span="2"
/> />
</TableLayout> </LinearLayout>
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>