From ecc2ee461c555d615f98842be2aca026530682e8 Mon Sep 17 00:00:00 2001 From: Ahmad Vazirna Date: Fri, 1 Sep 2023 13:09:24 +0200 Subject: [PATCH 1/3] Hide search footer by default --- app/res/layout/entity_select_layout.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/res/layout/entity_select_layout.xml b/app/res/layout/entity_select_layout.xml index f59231a47f..8cf6ae3cbb 100644 --- a/app/res/layout/entity_select_layout.xml +++ b/app/res/layout/entity_select_layout.xml @@ -111,7 +111,8 @@ android:id="@+id/searchfooter" android:orientation="horizontal" android:background="@drawable/border_top_black" - android:paddingTop="1dp"> + android:paddingTop="1dp" + android:visibility="gone"> Date: Mon, 4 Sep 2023 14:25:29 +0200 Subject: [PATCH 2/3] Remove search footer view --- app/res/layout/entity_select_layout.xml | 45 +------------------------ 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/app/res/layout/entity_select_layout.xml b/app/res/layout/entity_select_layout.xml index 8cf6ae3cbb..18a80e2b30 100644 --- a/app/res/layout/entity_select_layout.xml +++ b/app/res/layout/entity_select_layout.xml @@ -68,7 +68,7 @@ - - - - - - - - - - - - - Date: Mon, 4 Sep 2023 14:26:52 +0200 Subject: [PATCH 3/3] Update activities --- .../commcare/activities/CommCareActivity.java | 5 ----- .../activities/FormRecordListActivity.java | 18 ------------------ 2 files changed, 23 deletions(-) diff --git a/app/src/org/commcare/activities/CommCareActivity.java b/app/src/org/commcare/activities/CommCareActivity.java index f6de4e1c34..ce7968295e 100755 --- a/app/src/org/commcare/activities/CommCareActivity.java +++ b/app/src/org/commcare/activities/CommCareActivity.java @@ -731,11 +731,6 @@ protected void tryToAddSearchActionToAppBar(AppCompatActivity activity, Menu men instantiator.onActionBarFound(searchMenuItem, searchView, barcodeItem); } } - - View bottomSearchWidget = activity.findViewById(org.commcare.dalvik.R.id.searchfooter); - if (bottomSearchWidget != null) { - bottomSearchWidget.setVisibility(View.GONE); - } } /** diff --git a/app/src/org/commcare/activities/FormRecordListActivity.java b/app/src/org/commcare/activities/FormRecordListActivity.java index 38cba1e2ed..ce868d3961 100644 --- a/app/src/org/commcare/activities/FormRecordListActivity.java +++ b/app/src/org/commcare/activities/FormRecordListActivity.java @@ -2,7 +2,6 @@ import android.content.ActivityNotFoundException; import android.content.Intent; -import android.os.Build; import android.os.Bundle; import android.os.PowerManager; import android.text.Editable; @@ -18,12 +17,9 @@ import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.ArrayAdapter; -import android.widget.EditText; -import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.Spinner; -import android.widget.TextView; import android.widget.Toast; import org.commcare.CommCareApplication; @@ -85,7 +81,6 @@ public class FormRecordListActivity extends SessionAwareCommCareActivity callBarcodeScanIntent(FormRecordListActivity.this); - TextView searchLabel = findViewById(R.id.screen_entity_select_search_label); - searchLabel.setText(this.localize("select.search.label")); - - searchbox.addTextChangedListener(this); FormRecordLoaderTask task = new FormRecordLoaderTask(this, CommCareApplication.instance().getUserStorage(SessionStateDescriptor.class), platform); task.addListener(this); @@ -336,8 +324,6 @@ private void attachToPurgeTask() { private void setSearchEnabled(boolean enabled) { if (isUsingActionBar()) { searchView.setEnabled(enabled); - } else { - searchbox.setEnabled(enabled); } } @@ -496,7 +482,6 @@ private void setSearchText(CharSequence text) { MenuItemCompat.expandActionView(searchItem); searchView.setQuery(text, false); } - searchbox.setText(text); } @Override @@ -627,9 +612,6 @@ public int getWakeLockLevel() { @Override public void afterTextChanged(Editable s) { String filtertext = s.toString(); - if (searchbox.getText() == s) { - adapter.applyTextFilter(filtertext); - } if (!isUsingActionBar()) { lastQueryString = filtertext; }