继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

android搜索框,推荐搜索,历史搜索

吃鸡游戏
关注TA
已关注
手记 297
粉丝 55
获赞 339

image.png

 使用方法 ###Add it in your root build.gradle at the end of repositories: allprojects { repositories { ... maven { url "https://jitpack.io" } } }

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) {            //保存所有历史搜索数据  请保保存以便下次使用
        }
    }

原文链接:http://www.apkbus.com/blog-927916-77031.html

打开App,阅读手记
1人推荐
发表评论
随时随地看视频慕课网APP