filter tweak to deal with large font/small screen

This commit is contained in:
Eric House 2020-08-11 17:00:59 -07:00
parent 7a43e95aa8
commit ba0d551750
3 changed files with 21 additions and 26 deletions

View file

@ -23,13 +23,14 @@ import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TableRow;
import org.eehouse.android.xw4.jni.XwJNI.PatDesc;
public class PatTableRow extends TableRow {
private static final String TAG = PatTableRow.class.getSimpleName();
private EditWClear mEdit;
private EditText mEdit;
private CheckBox mCheck;
public PatTableRow( Context context, AttributeSet as )
@ -67,22 +68,14 @@ public class PatTableRow extends TableRow {
boolean handled = mEdit.hasFocus();
if ( handled ) {
mEdit.insertBlank( blank );
mEdit.getText().insert(mEdit.getSelectionStart(), blank );
}
return handled;
}
private void getFields()
{
for ( int ii = 0;
(null == mEdit || null == mCheck) && ii < getChildCount();
++ii ) {
View view = getChildAt( ii );
if ( view instanceof EditWClear ) {
mEdit = (EditWClear)view;
} else if ( view instanceof CheckBox ) {
mCheck = (CheckBox)view;
}
}
mEdit = (EditText)Utils.getChildInstanceOf( this, EditText.class );
mCheck = (CheckBox)Utils.getChildInstanceOf( this, CheckBox.class );
}
}

View file

@ -53,10 +53,12 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<View android:layout_width="5dp"
android:layout_height="5dp"
android:layout_span="2"
/>
<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:text="@string/pat_col_anyorder"
@ -69,9 +71,8 @@
<TextView style="@style/pat_table_label"
android:text="@string/pat_starts_with"
/>
<org.eehouse.android.xw4.EditWClear
style="@style/pat_table_edit"
/>
<EditText style="@style/pat_table_edit"
/>
<CheckBox style="@style/pat_table_check"
/>
</org.eehouse.android.xw4.PatTableRow>
@ -82,9 +83,8 @@
<TextView style="@style/pat_table_label"
android:text="@string/pat_contains"
/>
<org.eehouse.android.xw4.EditWClear
style="@style/pat_table_edit"
/>
<EditText style="@style/pat_table_edit"
/>
<CheckBox style="@style/pat_table_check"
/>
</org.eehouse.android.xw4.PatTableRow>
@ -95,9 +95,8 @@
<TextView style="@style/pat_table_label"
android:text="@string/pat_ends_with"
/>
<org.eehouse.android.xw4.EditWClear
style="@style/pat_table_edit"
/>
<EditText style="@style/pat_table_edit"
/>
<CheckBox style="@style/pat_table_check"
/>
</org.eehouse.android.xw4.PatTableRow>

View file

@ -120,10 +120,12 @@
</style>
<style name="pat_table_edit" parent="edit_w_clear">
<item name="android:layout_width">200dp</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:maxLines">1</item>
<item name="android:maxLength">15</item>
<item name="android:inputType">text</item>
<item name="android:layout_weight">1</item>
</style>
<style name="pat_table_check">
@ -152,6 +154,7 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:layout_weight">1</item>
<item name="android:maxLines">1</item>
</style>
<style name="config_spinner_spinner">