@@ -0,0 +1,1756 @@
+package net.squanchy.search;%0A%0Aimport android.os.Bundle;%0Aimport android.support.annotation.IdRes;%0Aimport android.support.annotation.LayoutRes;%0Aimport android.support.annotation.MenuRes;%0Aimport android.support.annotation.Nullable;%0Aimport android.support.v4.view.MenuItemCompat;%0Aimport android.support.v7.widget.SearchView;%0Aimport android.view.Menu;%0Aimport android.view.MenuItem;%0A%0Aimport net.squanchy.fonts.TypefaceStyleableActivity;%0A%0Apublic abstract class AbstractSearchActivity extends TypefaceStyleableActivity implements SearchView.OnQueryTextListener,%0A        MenuItemCompat.OnActionExpandListener %7B%0A%0A    protected SearchView searchView;%0A%0A    @Override%0A    protected void onCreate(@Nullable Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        setContentView(layoutRes());%0A    %7D%0A%0A    @Override%0A    public boolean onCreateOptionsMenu(Menu menu) %7B%0A        getMenuInflater().inflate(menuRes(), menu);%0A        MenuItem searchItem = menu.findItem(searchId());%0A        searchItem.expandActionView();%0A        searchView = (SearchView) MenuItemCompat.getActionView(searchItem);%0A        searchView.setOnQueryTextListener(this);%0A        MenuItemCompat.setOnActionExpandListener(searchItem, this);%0A        loadSearchConfig();%0A        return true;%0A    %7D%0A%0A    protected abstract void loadSearchConfig();%0A%0A    @LayoutRes%0A    protected abstract int layoutRes();%0A%0A    @MenuRes%0A    protected abstract int menuRes();%0A%0A    @IdRes%0A    protected abstract int searchId();%0A%0A    @Override%0A    public boolean onMenuItemActionExpand(MenuItem item) %7B%0A        //This activity should always be expanded%0A        return false;%0A    %7D%0A%0A    @Override%0A    public boolean onMenuItemActionCollapse(MenuItem item) %7B%0A        finish();%0A        return false;%0A    %7D%0A%7D%0A

create the abstract class for the SearchActivity