use of android.support.v7.widget.SearchView in project Bilal by cdjalel.
the class SearchCityActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search_city);
setTitle(getString(R.string.app_name));
mDBHelper = new LocationsDBHelper(this);
mDBHelper.openReadable();
mLanguage = UserSettings.getLanguage(this).toUpperCase(Locale.ENGLISH);
SearchView searchView = findViewById(R.id.search_city_box);
searchView.setOnQueryTextListener(this);
searchView.setIconified(false);
// XML tag has a bug
searchView.setQueryHint(getString(R.string.search_city));
// Get the intent, verify the action and get the query
Intent intent = getIntent();
Timber.i("onCreate: intent.action = " + intent.getAction());
handleIntent(getIntent());
}
use of android.support.v7.widget.SearchView in project Android-NotesApp by HelloPraveen.
the class MainActivity method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
mi = menu.findItem(R.id.menu_imp);
SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView();
search(searchView);
EditText et = searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
et.setHint(MainActivity.this.getString(R.string.search));
return true;
}
use of android.support.v7.widget.SearchView in project SeniorProject by 5731075221-PM.
the class HospitalNearbyFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_hospital_nearby, container, false);
appBarLayout.setExpanded(true, true);
// searchView = (SearchView) view.findViewById(R.id.searchNearbyHospital);
// searchView.setIconifiedByDefault(false);
// searchView.setIconified(false);
// searchView.clearFocus();
// searchView.setQueryHint("ค้นหา");
// searchView.setOnQueryTextListener(this);
title = getActivity().findViewById(R.id.textTool);
title.setText("ค้นหาโรงพยาบาลใกล้เคียง");
recyclerView = (RecyclerView) view.findViewById(R.id.nearbyHospitalRecyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
adapter = new RecyclerViewAdapter(hosList);
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
adapter.setOnLoadMoreListener(new LoadMore() {
@Override
public void onLoadMore() {
if (hosList.size() <= hospitalList.size()) {
isLoading = true;
hosList.add(null);
adapter.notifyItemInserted(hosList.size() - 1);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
hosList.remove(hosList.size() - 1);
adapter.notifyItemRemoved(hosList.size());
// Generating more data
int index = hosList.size();
int end = index + 10;
for (int i = index; i < end; i++) {
hosList.add(hospitalList.get(i));
}
if (isGPS && isNetwork)
sortHospital();
adapter.notifyDataSetChanged();
isLoading = false;
// adapter.setLoaded();
}
}, 5000);
} else {
Toast.makeText(getActivity(), "Loading data completed", Toast.LENGTH_SHORT).show();
}
}
});
return view;
}
use of android.support.v7.widget.SearchView in project SeniorProject by 5731075221-PM.
the class SearchSymptomFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_search_symptom, container, false);
appBarLayout.setExpanded(true, true);
empty = (TextView) view.findViewById(R.id.textEmpty);
if (diseaseName.isEmpty())
empty.setVisibility(View.VISIBLE);
else
empty.setVisibility(View.INVISIBLE);
searchView = (SearchView) view.findViewById(R.id.searchSymptom);
searchView.setIconifiedByDefault(false);
searchView.setIconified(false);
searchView.clearFocus();
searchView.setQueryHint("ค้นหา");
searchView.setOnQueryTextListener(this);
recyclerView = (RecyclerView) view.findViewById(R.id.searchSymptomList);
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
conslayout = (ConstraintLayout) view.findViewById(R.id.searchSymptomLayout);
empty.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0);
return true;
}
});
return view;
}
use of android.support.v7.widget.SearchView in project SeniorProject by 5731075221-PM.
the class ShowHospitalByOrder method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_show_by_order, container, false);
// searchView = (SearchView) view.findViewById(R.id.searchHospitalByOrder);
// searchView.setIconifiedByDefault(false);
// searchView.setIconified(false);
// searchView.clearFocus();
// searchView.setQueryHint("ค้นหา");
// searchView.setOnQueryTextListener(this);
recyclerView = (IndexFastScrollRecyclerView) view.findViewById(R.id.searchHospitalList);
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
recyclerView.setIndexBarColor("#f9f9f9");
recyclerView.setIndexBarTextColor("#4d4d4d");
recyclerView.setIndexBarHighLateTextVisibility(true);
recyclerView.setIndexbarHighLateTextColor("#4cd29f");
return view;
}
Aggregations