[
  {
    "path": ".gitignore",
    "content": "# Custom\n_site\n \n# Ant\nMANIFEST.MF\n./*.jar\nbuild.num\nbuild\n \n# ADT\n.classpath\n.project\n.settings\nlocal.properties\nbin\ngen\n_layouts\nproguard.cfg\n \n# OSX\n.DS_Store\n \n# Github\ngh-pages\n \n# Gradle\n.gradle\nbuild\n \n# IDEA\n*.iml\n*.ipr\n*.iws\nout\n.idea\n \n# Maven\ntarget\nrelease.properties\npom.xml.*\n \n#Android studio tools\ncaptures/\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "0.3.1\n===\nFix a bug due a new app compat release (thanks to @almozavr)\n\nAnother cool stuff (part of the customization) with new getters\n\n0.3\n===\nChanged <code>FakeSearchView.OnSearchListener</code> interface, so now this interface have two parameters the FakeSearchView and the <code>CharSequence</code> text on the <code>EditText</code>\n\nAnother tweaks on the code\n\n0.2\n===\nInitial release\n"
  },
  {
    "path": "FakeSearchView/.gitignore",
    "content": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n"
  },
  {
    "path": "FakeSearchView/app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "FakeSearchView/app/build.gradle",
    "content": "apply plugin: 'com.android.library'\n\nandroid {\n  compileSdkVersion 25\n  buildToolsVersion '25.0.1'\n\n  defaultConfig {\n    minSdkVersion 15\n    targetSdkVersion 22\n  }\n}\n\ndependencies {\n}\n\napply from: '../maven_push.gradle'\n"
  },
  {
    "path": "FakeSearchView/app/gradle.properties",
    "content": "POM_NAME = FakeSearchView\nPOM_ARTIFACT_ID = fake-search-view\nPOM_PACKAGING = aar"
  },
  {
    "path": "FakeSearchView/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /home/leonardo/Android/Sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "FakeSearchView/app/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.github.leonardoxh.fakesearchview\">\n\n</manifest>\n"
  },
  {
    "path": "FakeSearchView/app/src/main/java/com/github/leonardoxh/fakesearchview/FakeSearchAdapter.java",
    "content": "/*\n * Copyright 2015 Leonardo Rossetto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.github.leonardoxh.fakesearchview;\n\nimport android.text.TextUtils;\nimport android.widget.AdapterView;\nimport android.widget.BaseAdapter;\nimport android.widget.Filter;\nimport android.widget.Filterable;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * An custom adapter to filter models more easy\n * @param <T> Any model that extends {@link SearchItem} this make search easy\n *\n * @author Leonardo Rossetto\n */\npublic abstract class FakeSearchAdapter<T extends SearchItem> extends BaseAdapter\n    implements Filterable {\n\n  protected final List<T> items;\n  private final List<T> shallowCopy;\n  private final Filter filter = new FakeSearchFilter();\n\n  public FakeSearchAdapter(List<T> items) {\n    this.items = items;\n    this.shallowCopy = new ArrayList<>(items);\n  }\n\n  @Override public Filter getFilter() {\n    return filter;\n  }\n\n  @Override public int getCount() {\n    return items.size();\n  }\n\n  @Override public T getItem(int position) {\n    return items.get(position);\n  }\n\n  @Override public long getItemId(int position) {\n    return AdapterView.INVALID_ROW_ID;\n  }\n\n  /**\n   * Custom filter that use {@link SearchItem} to perform a search over the adapter data\n   *\n   * @author Leonardo Rossetto\n   */\n  class FakeSearchFilter extends Filter {\n\n    @Override protected FilterResults performFiltering(CharSequence constraint) {\n      FilterResults filterResults = new FilterResults();\n      if (TextUtils.isEmpty(constraint)) {\n        filterResults.values = shallowCopy;\n        filterResults.count = shallowCopy.size();\n      } else {\n        List<T> values = new ArrayList<>();\n        for (T item : shallowCopy) {\n          if (item.match(constraint)) {\n            values.add(item);\n          }\n        }\n        filterResults.count = values.size();\n        filterResults.values = values;\n      }\n      return filterResults;\n    }\n\n    //TODO impossible to elimate due FilterResults value\n    @SuppressWarnings(\"unchecked\") @Override protected void publishResults(\n        CharSequence constraint, FilterResults filterResults) {\n      items.clear();\n      if (filterResults.count == 0) {\n        notifyDataSetInvalidated();\n      } else {\n        items.addAll((List<T>) filterResults.values);\n        notifyDataSetChanged();\n      }\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "FakeSearchView/app/src/main/java/com/github/leonardoxh/fakesearchview/FakeSearchView.java",
    "content": "/*\n * Copyright 2015 Leonardo Rossetto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.github.leonardoxh.fakesearchview;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.os.Build;\nimport android.text.Editable;\nimport android.text.TextWatcher;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.view.KeyEvent;\nimport android.view.LayoutInflater;\nimport android.widget.EditText;\nimport android.widget.FrameLayout;\nimport android.widget.TextView;\n\n/**\n * The main lib actor this is a custom FrameLayout\n * wrapper with an EditText with a simple interface to perform the search\n * it collects the user input and pass to an Activity or a Fragment or where you need\n *\n * @author Leonardo Rossetto\n */\npublic class FakeSearchView extends FrameLayout implements TextWatcher,\n    TextView.OnEditorActionListener {\n\n  private EditText wrappedEditText;\n  private OnSearchListener searchListener;\n\n  public FakeSearchView(Context context, AttributeSet attrs) {\n    super(context, attrs);\n    init(context);\n  }\n\n  public FakeSearchView(Context context, AttributeSet attrs, int defStyleAttr) {\n    super(context, attrs, defStyleAttr);\n    init(context);\n  }\n\n  @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n  public FakeSearchView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {\n    super(context, attrs, defStyleAttr, defStyleRes);\n    init(context);\n  }\n\n  public FakeSearchView(Context context) {\n    super(context);\n    init(context);\n  }\n\n  /**\n   * Set the search listener to be used on this search\n   * @param searchListener the search listener to be used on this search\n   * @see OnSearchListener\n   */\n  public void setOnSearchListener(OnSearchListener searchListener) {\n    this.searchListener = searchListener;\n  }\n\n  /**\n   * Sets the search text\n   * @param searchText the text to set on the search\n   * @see #setSearchText(int)\n   */\n  public void setSearchText(CharSequence searchText) {\n    wrappedEditText.setText(searchText);\n  }\n\n  /**\n   * Sets the search text using a resource\n   * @param searchTextRes the resource to set the text\n   * @see #setSearchText(CharSequence)\n   */\n  public void setSearchText(int searchTextRes) {\n    wrappedEditText.setText(searchTextRes);\n  }\n\n  /**\n   * @return the current text on the search\n   */\n  public CharSequence getSearchText() {\n    return wrappedEditText.getText();\n  }\n\n  /**\n   * Set the search placeholder (hint)\n   * @param placeholder the placeholder\n   * @see #setSearchPlaceholder(int)\n   */\n  public void setSearchPlaceholder(CharSequence placeholder) {\n    wrappedEditText.setHint(placeholder);\n  }\n\n  /**\n   * Set the search placeholder (hint)\n   * @param placeholderRes the placeholder\n   * @see #setSearchPlaceholder(CharSequence)\n   */\n  public void setSearchPlaceholder(int placeholderRes) {\n    wrappedEditText.setHint(placeholderRes);\n  }\n\n  /**\n   * Inflate the layout to this FrameLayout wrapper\n   * @param context for inflate views\n   */\n  protected void init(Context context) {\n    LayoutInflater.from(context).inflate(R.layout.fake_search_view, this, true);\n    wrappedEditText = (EditText) findViewById(R.id.wrapped_search);\n    wrappedEditText.addTextChangedListener(this);\n    wrappedEditText.setOnEditorActionListener(this);\n  }\n\n  @Override public void beforeTextChanged(CharSequence constraint, int start, int count, int after) { }\n\n  @Override public void onTextChanged(CharSequence constraint, int start, int count, int after) {\n    if (searchListener != null) {\n      searchListener.onSearch(this, constraint);\n      return;\n    }\n    Log.w(getClass().getName(), \"SearchListener == null\");\n  }\n\n  @Override public void afterTextChanged(Editable editable) { }\n\n  @Override public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {\n    if (searchListener != null) {\n      searchListener.onSearchHint(this, textView.getText());\n      return true;\n    }\n    Log.w(getClass().getName(), \"SearchListener == null\");\n    return false;\n  }\n\n  /**\n   * This interface is an custom method to wrapp the\n   * TextWatcher implementation and provide the search constraint\n   *\n   * @author Leonardo Rossetto\n   */\n  public interface OnSearchListener {\n\n    /**\n     * This method is called every time the EditText change it content\n     * @param fakeSearchView the searchview\n     * @param constraint the current input data\n     */\n    void onSearch(FakeSearchView fakeSearchView, CharSequence constraint);\n\n    /**\n     * This method is called when the user press the search button on the keyboard\n     * @param fakeSearchView the searchview\n     * @param constraint the current input data\n     */\n    void onSearchHint(FakeSearchView fakeSearchView, CharSequence constraint);\n\n  }\n\n}\n"
  },
  {
    "path": "FakeSearchView/app/src/main/java/com/github/leonardoxh/fakesearchview/SearchItem.java",
    "content": "/*\n * Copyright 2015 Leonardo Rossetto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.github.leonardoxh.fakesearchview;\n\n/**\n * Interface to make any model searchable by the {@link FakeSearchAdapter}\n *\n * @author Leonardo Rossetto\n */\npublic interface SearchItem {\n\n  /**\n   * This provide to {@link FakeSearchAdapter} the method to\n   * check if that model match the constraint search\n   * @param constraint used by the adapter to search\n   * @return true if the model match false otherwise\n   */\n  boolean match(CharSequence constraint);\n\n}\n"
  },
  {
    "path": "FakeSearchView/app/src/main/res/layout/fake_search_view.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<EditText xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:id=\"@+id/wrapped_search\"\n  android:layout_width=\"match_parent\"\n  android:layout_height=\"wrap_content\"\n  android:inputType=\"text\"\n  android:imeOptions=\"actionSearch\"\n  android:minWidth=\"240dp\"/>"
  },
  {
    "path": "FakeSearchView/build.gradle",
    "content": "buildscript {\n  repositories {\n    jcenter()\n  }\n  dependencies {\n    classpath 'com.android.tools.build:gradle:2.3.2'\n  }\n}\n\nallprojects {\n  repositories {\n    jcenter()\n  }\n}\n"
  },
  {
    "path": "FakeSearchView/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Thu Jun 08 16:59:34 MSK 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-3.3-all.zip\n"
  },
  {
    "path": "FakeSearchView/gradle.properties",
    "content": "VERSION_NAME = 0.3.1\n\nGROUP = com.github.leonardoxh\nPOM_DESCRIPTION = A custom SearchView for android\nPOM_URL = https://github.com/leonardoxh/FakeSearchView\nPOM_SCM_URL = https://github.com/leonardoxh/FakeSearchView\nPOM_SCM_CONNECTION = scm:git@github.com:leonardoxh/FakeSearchView.git\nPOM_SCM_DEV_CONNECTION = scm:git@github.com:leonardoxh/FakeSearchView.git\nPOM_LICENCE_NAME = The Apache Software License, Version 2.0\nPOM_LICENCE_URL = http://www.apache.org/licenses/LICENSE-2.0.txt\nPOM_LICENCE_DIST = repo\n"
  },
  {
    "path": "FakeSearchView/gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "FakeSearchView/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "FakeSearchView/maven_push.gradle",
    "content": "apply plugin: 'maven'\napply plugin: 'signing'\n\ndef isReleaseBuild() {\n  return VERSION_NAME.contains(\"SNAPSHOT\") == false\n}\n\ndef getRepositoryUrl() {\n  if(isReleaseBuild()) {\n    println 'RELEASE BUILD'\n    return \"https://oss.sonatype.org/service/local/staging/deploy/maven2/\"\n  } else {\n    println 'DEBUG BUILD'\n    return \"https://oss.sonatype.org/content/repositories/snapshots/\"\n  }\n}\n\ndef getRepositoryUsername() {\n  return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : \"\"\n}\n\ndef getRepositoryPassword() {\n  return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : \"\"\n}\n\nafterEvaluate { project ->\n  uploadArchives {\n    repositories {\n      mavenDeployer {\n        beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }\n\n        pom.groupId = GROUP\n        pom.artifactId = POM_ARTIFACT_ID\n        pom.version = VERSION_NAME\n\n        repository(url: getRepositoryUrl()) {\n          authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())\n        }\n\n        pom.project {\n          name POM_NAME\n          packaging POM_PACKAGING\n          description POM_DESCRIPTION\n          url POM_URL\n\n          scm {\n            url POM_SCM_URL\n            connection POM_SCM_CONNECTION\n            developerConnection POM_SCM_DEV_CONNECTION\n          }\n\n          licenses {\n            license {\n              name POM_LICENCE_NAME\n              url POM_LICENCE_URL\n              distribution POM_LICENCE_DIST\n            }\n          }\n\n          developers {\n            developer {\n              id \"leorossetto\"\n              name \"Leonardo Rossetto\"\n            }\n          }\n        }\n      }\n    }\n  }\n\n  signing {\n    required { isReleaseBuild() && gradle.taskGraph.hasTask(\"uploadArchives\") }\n    sign configurations.archives\n  }\n\n  task androidJavadocs(type: Javadoc) {\n    source = android.sourceSets.main.java.srcDirs\n    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))\n  }\n\n  task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {\n    classifier = 'javadoc'\n    from androidJavadocs.destinationDir\n  }\n\n  task androidSourcesJar(type: Jar) {\n    classifier = 'sources'\n    from android.sourceSets.main.java.srcDirs\n  }\n\n  artifacts {\n    archives androidSourcesJar\n    archives androidJavadocsJar\n  }\n\n}"
  },
  {
    "path": "FakeSearchView/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "FakeSearchViewSample/.gitignore",
    "content": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n"
  },
  {
    "path": "FakeSearchViewSample/app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "FakeSearchViewSample/app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n  compileSdkVersion 22\n  buildToolsVersion '22.0.1'\n  defaultConfig {\n    applicationId 'com.github.leonardoxh.fakesearchview.sample'\n    minSdkVersion 15\n    targetSdkVersion 22\n    versionCode 1\n    versionName '1.1'\n  }\n  buildTypes {\n    release {\n      minifyEnabled false\n      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n    }\n  }\n}\n\ndependencies {\n  compile 'com.android.support:appcompat-v7:22.1.0'\n  compile 'com.jakewharton:butterknife:6.1.0'\n  compile 'com.github.leonardoxh:fake-search-view:0.3.1'\n}\n"
  },
  {
    "path": "FakeSearchViewSample/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /home/leonardo/Android/Sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  package=\"com.github.leonardoxh.fakesearchview.sample\">\n\n  <application\n    android:allowBackup=\"true\"\n    android:icon=\"@mipmap/ic_launcher\"\n    android:label=\"@string/app_name\"\n    android:theme=\"@style/AppTheme\">\n\n    <activity\n      android:name=\".MainActivity\"\n      android:label=\"@string/app_name\">\n\n      <intent-filter>\n        <action android:name=\"android.intent.action.MAIN\"/>\n        <category android:name=\"android.intent.category.LAUNCHER\"/>\n      </intent-filter>\n\n    </activity>\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/java/com/github/leonardoxh/fakesearchview/sample/Car.java",
    "content": "/*\n * Copyright 2015 Leonardo Rossetto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.github.leonardoxh.fakesearchview.sample;\n\nimport com.github.leonardoxh.fakesearchview.SearchItem;\n\nimport java.util.Locale;\n\npublic class Car implements SearchItem {\n\n  private String model;\n\n  public Car(String model) {\n    this.model = model;\n  }\n\n  public String getModel() {\n    return model;\n  }\n\n  @Override public boolean match(CharSequence constraint) {\n    return model.toLowerCase(Locale.US)\n        .startsWith(constraint.toString().toLowerCase(Locale.US));\n  }\n\n}\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/java/com/github/leonardoxh/fakesearchview/sample/CarAdapter.java",
    "content": "/*\n * Copyright 2015 Leonardo Rossetto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.github.leonardoxh.fakesearchview.sample;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.TextView;\n\nimport butterknife.ButterKnife;\nimport butterknife.InjectView;\n\nimport com.github.leonardoxh.fakesearchview.FakeSearchAdapter;\n\nimport java.util.List;\n\npublic class CarAdapter extends FakeSearchAdapter<Car> {\n\n  private final Context context;\n\n  public CarAdapter(Context context, List<Car> items) {\n    super(items);\n    this.context = context;\n  }\n\n  @Override public View getView(int position, View convertView, ViewGroup parent) {\n    ViewHolder viewHolder;\n    if (convertView == null) {\n      convertView = LayoutInflater.from(context).inflate(R.layout.item_car, parent, false);\n      viewHolder = new ViewHolder(convertView);\n      convertView.setTag(viewHolder);\n    } else {\n      viewHolder = (ViewHolder) convertView.getTag();\n    }\n    viewHolder.carModel.setText(getItem(position).getModel());\n    return convertView;\n  }\n\n  static class ViewHolder {\n\n    @InjectView(R.id.car_model) TextView carModel;\n\n    ViewHolder(View convertView) {\n      ButterKnife.inject(this, convertView);\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/java/com/github/leonardoxh/fakesearchview/sample/CarFactory.java",
    "content": "/*\n * Copyright 2015 Leonardo Rossetto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.github.leonardoxh.fakesearchview.sample;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nfinal class CarFactory {\n\n  static List<Car> getCars() {\n    List<Car> cars = new ArrayList<>();\n    cars.add(new Car(\"Ferrari\"));\n    cars.add(new Car(\"Lamborghini\"));\n    cars.add(new Car(\"Bugati\"));\n    cars.add(new Car(\"Wolksvagen\"));\n    cars.add(new Car(\"Fiat\"));\n    cars.add(new Car(\"Renault\"));\n    cars.add(new Car(\"Mercedes\"));\n    return cars;\n  }\n\n}\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/java/com/github/leonardoxh/fakesearchview/sample/MainActivity.java",
    "content": "/*\n * Copyright 2015 Leonardo Rossetto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.github.leonardoxh.fakesearchview.sample;\n\nimport android.support.v4.view.MenuItemCompat;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.widget.ListView;\n\nimport butterknife.ButterKnife;\nimport butterknife.InjectView;\n\nimport com.github.leonardoxh.fakesearchview.FakeSearchView;\n\npublic class MainActivity extends AppCompatActivity implements FakeSearchView.OnSearchListener {\n\n  @InjectView(R.id.car_list) protected ListView cars;\n\n  @Override protected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.activity_main);\n    ButterKnife.inject(this);\n  }\n\n  @Override protected void onPostCreate(Bundle savedInstanceState) {\n    super.onPostCreate(savedInstanceState);\n    cars.setAdapter(new CarAdapter(this, CarFactory.getCars()));\n  }\n\n  @Override public boolean onCreateOptionsMenu(Menu menu) {\n    getMenuInflater().inflate(R.menu.menu_main, menu);\n    initSearchView(menu);\n    return true;\n  }\n\n  private void initSearchView(Menu menu) {\n    MenuItem item = menu.findItem(R.id.search_cars);\n    FakeSearchView fakeSearchView = (FakeSearchView) MenuItemCompat.getActionView(item);\n    fakeSearchView.setOnSearchListener(this);\n  }\n\n  @Override public void onSearch(FakeSearchView fakeSearchView, CharSequence constraint) {\n    ((CarAdapter)cars.getAdapter()).getFilter().filter(constraint);\n  }\n\n  @Override public void onSearchHint(FakeSearchView fakeSearchView, CharSequence constraint) {\n    ((CarAdapter)cars.getAdapter()).getFilter().filter(constraint);\n  }\n\n}\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/res/layout/activity_main.xml",
    "content": "<ListView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:id=\"@+id/car_list\"\n  android:layout_width=\"match_parent\"\n  android:layout_height=\"match_parent\"/>\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/res/layout/item_car.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/car_model\"\n    android:padding=\"16dp\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"/>"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/res/menu/menu_main.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  xmlns:app=\"http://schemas.android.com/apk/res-auto\">\n\n  <item\n    android:id=\"@+id/search_cars\"\n    android:title=\"@string/action_search\"\n    android:icon=\"@mipmap/search\"\n    app:showAsAction=\"ifRoom|collapseActionView\"\n    app:actionViewClass=\"com.github.leonardoxh.fakesearchview.FakeSearchView\"/>\n\n</menu>\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/res/values/strings.xml",
    "content": "<resources>\n\n  <string name=\"app_name\" translatable=\"false\">FakeSearchViewSample</string>\n\n  <string name=\"action_search\">Search</string>\n\n</resources>\n"
  },
  {
    "path": "FakeSearchViewSample/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n  <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n  </style>\n\n</resources>\n"
  },
  {
    "path": "FakeSearchViewSample/build.gradle",
    "content": "buildscript {\n  repositories {\n    jcenter()\n  }\n  dependencies {\n    classpath 'com.android.tools.build:gradle:1.1.0'\n  }\n}\n\nallprojects {\n  repositories {\n    jcenter()\n  }\n}\n"
  },
  {
    "path": "FakeSearchViewSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Wed Apr 10 15:27:10 PDT 2013\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.2.1-all.zip\n"
  },
  {
    "path": "FakeSearchViewSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true"
  },
  {
    "path": "FakeSearchViewSample/gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "FakeSearchViewSample/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "FakeSearchViewSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n"
  },
  {
    "path": "README.md",
    "content": "# FakeSearchView\r\nSearch made easy!\r\n\r\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FakeSearchView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1723)\r\n\r\n![](https://github.com/leonardoxh/FakeSearchView/blob/master/demo.gif)\r\n\r\nSo I think the native Android SearchView it's a good option when perform a search, but it's not customizable and it's so burocratic!\r\n\r\nOn my recent projects I use this class many and many times, so it's time to become a library.\r\n\r\nIt's usage is very very simple, you can use it directly or use a custom adapter like the snipet below, or checkout the sample in this project:\r\n\r\nFirst, create the menu options\r\n```xml\r\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n  xmlns:app=\"http://schemas.android.com/apk/res-auto\">\r\n\r\n  <item\r\n    android:id=\"@+id/fake_search\"\r\n    android:title=\"@string/find\"\r\n    android:icon=\"@drawable/ic_action_search\"\r\n    app:showAsAction=\"ifRoom|collapseActionView\"\r\n    app:actionViewClass=\"com.github.leonardoxh.fakesearchview.FakeSearchView\"/>\r\n\r\n</menu>\r\n```\r\n\r\nAfter this you will need use this menu in your activity or fragment and set the search listener like this:\r\n```java\r\npublic class MainActivity extends Fragment implements FakeSearchView.OnSearchListener {\r\n\r\n  private ListView listView;\r\n\r\n  /* Another methods */\r\n\r\n  @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\r\n    inflater.inflate(R.menu.menu_devices, menu);\r\n    MenuItem menuItem = menu.findItem(R.id.fake_search);\r\n    FakeSearchView fakeSearchView = (FakeSearchView) MenuItemCompat.getActionView(menuItem);\r\n    fakeSearchView.setOnSearchListener(this);\r\n  }\r\n\r\n  @Override public void onSearch(@NotNull FakeSearchView fakeSearchView, @NotNull CharSequence constraint) {\r\n    //The constraint variable here change every time user input data\r\n    ((Filterable)listView.getAdapter()).getFilter().filter(constraint);\r\n    /* Any adapter that implements a Filterable interface, or just extends the built in FakeSearchAdapter\r\n       and implements the searchitem on your model to a custom filter logic */\r\n  }\r\n\r\n  @Override public void onSearchHint(@NotNull FakeSearchView fakeSearchView, @NotNull CharSequence constraint) {\r\n    //This is received when the user click in the search button on the keyboard\r\n  }\r\n\r\n}\r\n```\r\n\r\nGradle:\r\n===\r\nThis library is also available at maven central using gradle:\r\n```groovy\r\ndependencies {\r\n  compile 'com.github.leonardoxh:fake-search-view:0.3.1'\r\n}\r\n```\r\n\r\nLicence:\r\n==========\r\n```\r\nCopyright 2015 Leonardo Rossetto\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n```\r\n"
  }
]