使用方法 ###Add it in your root build.gradle at the end of repositories: allprojects { repositories { ... maven { url "https://jitpack.io" } } }
原文地址:http://www.apkbus.com/blog-927916-77031.html
Add the dependency dependencies { compile 'com.github.chengzipi:Searchbox:v1.0.0' }
举例说明 ##XML #### 属性方法 app:search_hint hint内容 app:search_baground 搜索框背景
Code //历史搜索数据 String shareData = "澳洲美食,长沙美食,韩国料理,日本料理,舌尖上的中国,意大利餐,山西菜"; List skills = Arrays.asList(shareData.split(","));
//热门搜索数据String shareHotData = "粤菜,浙菜,苏菜";List skillHots = Arrays.asList(shareHotData.split(","));-
this.msearchLy.initData(skills, skillHots, new setSearchCallBackListener() {public void Search(String str) {//进行或联网搜索 str搜索关键词}-
public void Back() {//取消搜索demo.this.finish();}-
public void ClearOldData() {//清除历史搜索记录 执行更新本地 原始历史搜索数据}-
public void SaveOldData(ArrayList<String> AlloldDataList) {//保存所有历史搜索数据 请保保存以便下次使用}}