use of org.wikipedia.analytics.FindInPageFunnel in project apps-android-wikipedia by wikimedia.
the class PageFragment method showFindInPage.
public void showFindInPage() {
if (model.getPage() == null) {
return;
}
final FindInPageFunnel funnel = new FindInPageFunnel(app, model.getTitle().getWikiSite(), model.getPage().getPageProperties().getPageId());
final FindInWebPageActionProvider findInPageActionProvider = new FindInWebPageActionProvider(this, funnel);
startSupportActionMode(new ActionMode.Callback() {
private final String actionModeTag = "actionModeFindInPage";
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
findInPageActionMode = mode;
MenuItem menuItem = menu.add(R.string.menu_page_find_in_page);
menuItem.setActionProvider(findInPageActionProvider);
menuItem.expandActionView();
setToolbarElevationEnabled(false);
return true;
}
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
mode.setTag(actionModeTag);
return false;
}
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
return false;
}
@Override
public void onDestroyActionMode(ActionMode mode) {
if (webView == null || !isAdded()) {
return;
}
findInPageActionMode = null;
funnel.setPageHeight(webView.getContentHeight());
funnel.logDone();
webView.clearMatches();
showToolbar();
hideSoftKeyboard();
setToolbarElevationEnabled(true);
}
});
}
Aggregations