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

View file

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

View file

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