|
@@ -22,12 +22,15 @@ package com.owncloud.android.ui.fragment;
|
|
|
|
|
|
import android.accounts.Account;
|
|
|
import android.app.Activity;
|
|
|
+import android.app.SearchManager;
|
|
|
+import android.content.Context;
|
|
|
import android.net.Uri;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.v4.app.Fragment;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
+import android.widget.SearchView;
|
|
|
|
|
|
import com.owncloud.android.R;
|
|
|
import com.owncloud.android.datamodel.OCFile;
|
|
@@ -43,7 +46,7 @@ import com.owncloud.android.datamodel.OCFile;
|
|
|
* create an instance of this fragment.
|
|
|
*/
|
|
|
public class SearchFragment extends Fragment {
|
|
|
- private static final String TAG = ShareFileFragment.class.getSimpleName();
|
|
|
+ private static final String TAG = SearchFragment.class.getSimpleName();
|
|
|
|
|
|
// the fragment initialization parameters
|
|
|
private static final String ARG_FILE = "FILE";
|
|
@@ -92,6 +95,14 @@ public class SearchFragment extends Fragment {
|
|
|
// Inflate the layout for this fragment
|
|
|
View view = inflater.inflate(R.layout.search_users_groups_layout, container, false);
|
|
|
|
|
|
+ // Get the SearchView and set the searchable configuration
|
|
|
+ SearchView searchView = (SearchView) view.findViewById(R.id.searchView);
|
|
|
+ SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
|
|
|
+ searchView.setSearchableInfo(searchManager.getSearchableInfo(
|
|
|
+ getActivity().getComponentName()) // assumes parent activity is the searchable activity
|
|
|
+ );
|
|
|
+ searchView.setIconifiedByDefault(false); // do not iconify the widget; expand it by default
|
|
|
+
|
|
|
return view;
|
|
|
}
|
|
|
|