问题详情与邀请回答优化(完成)
This commit is contained in:
@ -47,7 +47,7 @@ public class ToolBoxActivity extends BaseActivity implements SwipeRefreshLayout.
|
||||
|
||||
|
||||
private boolean mIsSearch; // 记录页面状态 搜索页面/普通页面
|
||||
private String mSearckKey; // 记录搜索关键字
|
||||
private String mSearchKey; // 记录搜索关键字
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
@ -80,7 +80,7 @@ public class ToolBoxActivity extends BaseActivity implements SwipeRefreshLayout.
|
||||
|
||||
mLayoutManager = new LinearLayoutManager(this);
|
||||
mToolboxRv.setLayoutManager(mLayoutManager);
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, ToolBoxActivity.this, mIsSearch, mSearckKey);
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, ToolBoxActivity.this, mIsSearch, mSearchKey);
|
||||
mToolboxRv.addItemDecoration(new VerticalItemDecoration(this, 8, false));
|
||||
mToolboxRv.setAdapter(mRvAdapter);
|
||||
|
||||
@ -164,13 +164,13 @@ public class ToolBoxActivity extends BaseActivity implements SwipeRefreshLayout.
|
||||
mLoading.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mIsSearch = isSearch;
|
||||
mSearckKey = searchKey;
|
||||
mSearchKey = searchKey;
|
||||
changeAdapter(false);
|
||||
}
|
||||
|
||||
private void changeAdapter(boolean isRefresh) {
|
||||
if (mIsSearch) {
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, this, mIsSearch, mSearckKey);
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, this, mIsSearch, mSearchKey);
|
||||
} else {
|
||||
if (mNormalRvAdapter != null && !isRefresh) {
|
||||
mRvAdapter = mNormalRvAdapter;
|
||||
|
||||
Reference in New Issue
Block a user