diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a31b83d..3ef0d6c 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -41,11 +41,6 @@
-
-
-
-
searchables = searchManager.getSearchablesInGlobalSearch();
-
- // Try to use the "applications" global search provider
- SearchableInfo info = searchManager.getSearchableInfo(getComponentName());
- for (SearchableInfo inf : searchables) {
- if (inf.getSuggestAuthority() != null
- && inf.getSuggestAuthority().startsWith("applications")) {
- info = inf;
- }
- }
- searchView.setSearchableInfo(info);
- }
-
+ private void setupSearchView(Menu menu) {
+ searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
searchView.setOnQueryTextListener(this);
- searchView.setOnCloseListener(new SearchView.OnCloseListener() {
- @Override
- public boolean onClose() {
- return false;
- }
- });
+ searchView.setIconifiedByDefault(true);
}
+
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
@@ -102,13 +80,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
@Override
public boolean onQueryTextSubmit(String query) {
- //Toast.makeText(this, query, Toast.LENGTH_SHORT).show();
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
- //Toast.makeText(this, newText, Toast.LENGTH_SHORT).show();
+ movStockAdapter.search(newText);
+ movStockAdapter.notifyDataSetChanged();
return false;
}
@@ -119,7 +97,11 @@ public class MovStockAdapter extends BaseAdapter implements View.OnClickListener
public MovStockAdapter(Context ctx){
context = ctx;
dbAdapter = new DbAdapter(context);
- cursor = dbAdapter.getRecepciones(MainActivity.codigoEmpresa);
+ search("");
+ }
+
+ public void search(String searchText){
+ cursor = dbAdapter.getRecepcionesSearch(MainActivity.codigoEmpresa, searchText);
cursor.moveToFirst();
}
diff --git a/app/src/main/res/layout/activity_recepciones.xml b/app/src/main/res/layout/activity_recepciones.xml
index 4c37f1b..d8c6d31 100644
--- a/app/src/main/res/layout/activity_recepciones.xml
+++ b/app/src/main/res/layout/activity_recepciones.xml
@@ -18,6 +18,7 @@
android:id="@+id/lv_recepciones"
android:layout_width="match_parent"
android:layout_height="match_parent">
+
diff --git a/app/src/main/res/layout/empty_list_view.xml b/app/src/main/res/layout/empty_list_view.xml
new file mode 100644
index 0000000..cc0a476
--- /dev/null
+++ b/app/src/main/res/layout/empty_list_view.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_recepciones.xml b/app/src/main/res/menu/menu_recepciones.xml
index 56e1c58..4add153 100644
--- a/app/src/main/res/menu/menu_recepciones.xml
+++ b/app/src/main/res/menu/menu_recepciones.xml
@@ -5,7 +5,7 @@
- NO EN SQL
Stock Control
Buscar...
+ No hay datos