use of com.knight.wanandroid.module_home.module_adapter.SearchRecordAdapter in project wanandroid by KnightAndroid.
the class SearchActivity method initView.
@Override
public void initView(Bundle savedInstanceState) {
mDatabind.setClick(new ProcyClick());
showLoading(mDatabind.homeSearchhotRv);
mHomeHotKeyAdapter = new HomeHotKeyAdapter(new ArrayList<>());
FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager(this);
// 方向 主轴为水平方向,起点在左端
flexboxLayoutManager.setFlexDirection(FlexDirection.ROW);
// 左对齐
flexboxLayoutManager.setJustifyContent(JustifyContent.FLEX_START);
SetInitCustomView.initSwipeRecycleview(mDatabind.homeSearchhotRv, flexboxLayoutManager, mHomeHotKeyAdapter, false);
SystemUtils.showDelaySoftKeyBoard(mDatabind.homeSearchEt);
mSearchRecordAdapter = new SearchRecordAdapter(new ArrayList<>());
SetInitCustomView.initSwipeRecycleview(mDatabind.homeSearchhistroyKeywordRv, new LinearLayoutManager(this), mSearchRecordAdapter, false);
mDatabind.homeSearchEt.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
keyword = mDatabind.homeSearchEt.getText().toString().trim();
if (TextUtils.isEmpty(keyword)) {
ToastUtils.show(R.string.home_input_content_search);
} else {
AppConfig.SEARCH_KEYWORD = keyword;
ARouterUtils.startActivity(RoutePathActivity.Home.searchResult, "keyword", keyword);
}
return true;
}
return false;
}
});
SystemUtils.seteditTextChangeListener(mDatabind.homeSearchEt, mDatabind.homeTvsearchCancel);
initClickListener();
}
Aggregations