use of android.support.v7.widget.SearchView in project ToolBarLib by jjhesk.
the class TopBarManagerExample method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.general);
toolbar = (Toolbar) findViewById(R.id.toolbar);
try {
worker = TopBarManager.Builder.with(this).companyLogo(R.drawable.starz_logo).searchBarEvents(new SimpleSearchCallBack() {
@Override
public void onKeySearchStartConfirm(String text) {
Log.d("start", text);
}
@Override
public void onKeySearchLetter(String text) {
Log.d("start", text);
}
@Override
public void onRestoreToNormal(ActionBar toolbar) {
worker.showBack();
}
@Override
public void onPressSearchButton(ActionBar toolbar) {
Log.d("tolk", toolbar.toString());
}
}).burgerIcon(R.drawable.ic_burger).searchMagnetifyIcon(R.drawable.ic_search_action_icn).searchView(LayoutAsset.classic_3).searchCancelColorId(R.color.amber_a100).searchCancalIconColorId(R.mipmap.cross_mi).setLiveIcon(R.layout.dynamic_icon_p, R.mipmap.crossmp).background(R.drawable.actionbar_bg_dark_black).searchArea(R.drawable.search_area).build(toolbar);
toolbar.setTitleTextColor(Color.WHITE);
worker.showCompanyLogo();
dynamic_icon = worker.getDynamicIcon();
} catch (Exception e) {
e.printStackTrace();
}
Button b = (Button) findViewById(R.id.b3);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
worker.triggerfromSearchIcon();
}
});
social = (combar) findViewById(R.id.social_bar_component);
social.connectAlert(getFragmentManager()).setShareContent("Share item now", "This is the best to share the items", "http://www.wonderful.com");
}
use of android.support.v7.widget.SearchView in project ToolBarLib by jjhesk.
the class TestOfCandyBar2Icons method onCreate.
@SuppressLint("ResourceAsColor")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.general);
toolbar = (Toolbar) findViewById(R.id.toolbar);
try {
worker = CandyBar.Builder.with(this).companyLogo(R.drawable.starz_logo).searchView(LayoutAsset.classic_3).searchBarEvents(new commonSearchBarMgr() {
@Override
public void onKeySearchStartConfirm(String text) {
Log.d("start", text);
}
@Override
public void onKeySearchLetter(String text) {
Log.d("start", text);
}
@Override
public void onRestoreToNormal(ActionBar toolbar) {
worker.showBack();
}
@Override
public void onPressSearchButton(ActionBar toolbar) {
Log.d("addNow", toolbar.toString());
}
}).setNotifcationTextColor(R.color.main_background).setNotificationOffset(15).setNotificationDrawableId(R.drawable.notg).overrideIcons(R.mipmap.ic_action_close, R.mipmap.crossmp).background(R.drawable.bottom_line).presetCountNotification(u).build(toolbar);
} catch (Exception e) {
e.printStackTrace();
}
// show title
Button b1 = (Button) findViewById(R.id.b1);
// how main bar
Button b2 = (Button) findViewById(R.id.b2);
// show search bar
Button b3 = (Button) findViewById(R.id.b3);
// other function
Button b4 = (Button) findViewById(R.id.b4);
// other function
Button b5 = (Button) findViewById(R.id.b5);
// other function
Button bx = (Button) findViewById(R.id.bxx);
bx.setText("close this App");
b1.setOnClickListener(this);
b2.setOnClickListener(this);
b3.setOnClickListener(this);
b4.setOnClickListener(this);
b5.setOnClickListener(this);
bx.setOnClickListener(this);
}
use of android.support.v7.widget.SearchView in project Reader by TheKeeperOfPie.
the class FragmentWeb method onDestroyOptionsMenu.
@Override
public void onDestroyOptionsMenu() {
if (itemSearch != null) {
SearchView searchView = (SearchView) itemSearch.getActionView();
searchView.setOnQueryTextListener(null);
MenuItemCompat.setOnActionExpandListener(itemSearch, null);
itemSearch = null;
}
toolbar.setOnMenuItemClickListener(null);
toolbarActions.setOnMenuItemClickListener(null);
super.onDestroyOptionsMenu();
}
use of android.support.v7.widget.SearchView in project Reader by TheKeeperOfPie.
the class FragmentProfile method onDestroyOptionsMenu.
@Override
public void onDestroyOptionsMenu() {
if (itemSearch != null) {
SearchView searchView = (SearchView) itemSearch.getActionView();
searchView.setOnQueryTextListener(null);
itemSearch = null;
}
super.onDestroyOptionsMenu();
}
use of android.support.v7.widget.SearchView in project Reader by TheKeeperOfPie.
the class FragmentHistory method setUpOptionsMenu.
private void setUpOptionsMenu() {
toolbar.inflateMenu(R.menu.menu_history);
toolbar.setOnMenuItemClickListener(this);
menu = toolbar.getMenu();
itemInterface = menu.findItem(R.id.item_interface);
switch(preferences.getString(AppSettings.INTERFACE_MODE, AppSettings.MODE_GRID)) {
case AppSettings.MODE_LIST:
itemInterface.setIcon(R.drawable.ic_view_module_white_24dp);
break;
case AppSettings.MODE_GRID:
itemInterface.setIcon(R.drawable.ic_view_list_white_24dp);
break;
}
itemSearch = menu.findItem(R.id.item_search);
final SearchView searchView = (SearchView) itemSearch.getActionView();
View view = searchView.findViewById(android.support.v7.appcompat.R.id.search_go_btn);
if (view instanceof ImageView) {
((ImageView) view).setColorFilter(themer.getColorFilterPrimary());
}
MenuItemCompat.setOnActionExpandListener(itemSearch, new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem item) {
controllerHistory.setQuery("");
Log.d(TAG, "collapse");
return true;
}
});
searchView.setQueryHint(getString(R.string.hint_title));
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
controllerHistory.setQuery(query);
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
controllerHistory.setQuery(newText);
return true;
}
});
searchView.setSubmitButtonEnabled(true);
for (int index = 0; index < menu.size(); index++) {
menu.getItem(index).getIcon().mutate().setColorFilter(themer.getColorFilterPrimary());
}
}
Aggregations