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,13 +45,17 @@
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:layout_height="wrap_content"
android:background="#FF1F1F1F" android:background="#FF1F1F1F"
android:visibility="gone" android:visibility="gone"
> >
<TableLayout android:id="@+id/table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TableRow <TableRow
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -103,6 +107,7 @@
<CheckBox style="@style/pat_table_check" <CheckBox style="@style/pat_table_check"
/> />
</org.eehouse.android.xw4.PatTableRow> </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>