搜索框带俩页签
效果图
代码
- Activity内有个FrameLayout布局,FrameLayout布局动态替换历史记录和搜索结果
- 历史记录存储于本地,点击某一搜索历史可以调用搜索
- 调用搜索直接切换到搜索结果
- 搜索结果页面布局 tabLayout+NoScrollViewPager,点击切换or滑动切换子Fragment
contract
1 | /** |
入口
1 | package xxx.xxx.view.found.search; |
1 | //activity_platform_search.xml |
历史记录和结果
历史记录Fragment
1 | //GoodsStoreSearchRecordFragment.java |
1 | //fragment_goods_stores_search_record.xml |
搜索结果Frament
1 | //GoodsStoreSearchResultFragment.java |
布局文件
1 | //fragment_community_space_search_result |
数据请求
1 | public class GoodsStoreSearchResultPresenter extends MvpBasePresenter<GoodsStoreSearchContract.SearchResultView> { |
子Fragment
GoodsStoreSearchResultGoodsFragment.java
GoodsStoreSearchResultStoresFragment.java
bean
1 | /** |
1 | /** |
1 | import android.support.annotation.Keep; |
1 | /** |