Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix barcode screen glitch #2702

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 1 addition & 43 deletions app/res/layout/entity_select_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/searchfooter"
android:layout_above="@+id/universal_frame_tile"
android:layout_below="@+id/entity_select_filter_dropdown">

<ListView
Expand Down Expand Up @@ -104,48 +104,6 @@
android:layout_alignParentBottom="true">
</FrameLayout>

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_above="@id/ad_container"
android:id="@+id/searchfooter"
android:orientation="horizontal"
android:background="@drawable/border_top_black"
android:paddingTop="1dp">

<TextView
android:id="@+id/screen_entity_select_search_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Search:">
</TextView>

<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_height="wrap_content"
android:layout_width="fill_parent">

<EditText
android:id="@+id/searchbox"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_toLeftOf="@+id/barcodeButton"
android:maxLines="3"
android:inputType="textImeMultiLine"
android:imeOptions="actionDone"
android:layout_toStartOf="@+id/barcodeButton" />

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
app:srcCompat="@drawable/barcode"
android:id="@+id/barcodeButton"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</LinearLayout>

<FrameLayout
android:id="@+id/universal_frame_tile"
android:layout_width="match_parent"
Expand Down
5 changes: 0 additions & 5 deletions app/src/org/commcare/activities/CommCareActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,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);
}
}

/**
Expand Down
18 changes: 0 additions & 18 deletions app/src/org/commcare/activities/FormRecordListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -85,7 +81,6 @@ public class FormRecordListActivity extends SessionAwareCommCareActivity<FormRec

private int initialSelection = -1;

private EditText searchbox;
private ListView listView;
private SearchView searchView;
private MenuItem searchItem;
Expand Down Expand Up @@ -157,24 +152,17 @@ public void onCreateSessionSafe(Bundle savedInstanceState) {
setContentView(R.layout.entity_select_layout);
findViewById(R.id.entity_select_loading).setVisibility(View.GONE);

searchbox = findViewById(R.id.searchbox);
LinearLayout header = findViewById(R.id.entity_select_header);
ImageButton barcodeButton = findViewById(R.id.barcodeButton);

Spinner filterSelect = findViewById(R.id.entity_select_filter_dropdown);

listView = findViewById(R.id.screen_entity_select_list);
listView.setOnItemClickListener(this);

header.setVisibility(View.GONE);
barcodeButton.setVisibility(View.GONE);

barcodeScanOnClickListener = v -> 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);

Expand Down Expand Up @@ -336,8 +324,6 @@ private void attachToPurgeTask() {
private void setSearchEnabled(boolean enabled) {
if (isUsingActionBar()) {
searchView.setEnabled(enabled);
} else {
searchbox.setEnabled(enabled);
}
}

Expand Down Expand Up @@ -496,7 +482,6 @@ private void setSearchText(CharSequence text) {
MenuItemCompat.expandActionView(searchItem);
searchView.setQuery(text, false);
}
searchbox.setText(text);
}

@Override
Expand Down Expand Up @@ -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;
}
Expand Down
Loading