|
|
@@ -113,7 +113,9 @@ public class ActSearch extends BaseContainerActivity {
|
|
|
|
|
|
@OnClick(R.id.clear_btn)
|
|
|
public void onClear() {
|
|
|
-
|
|
|
+ DDProviderHelper.getInstance().deleteAllSearchRecords();
|
|
|
+ historyKeywords.clear();
|
|
|
+ historyListLayout.getAdapter().notifyDataChanged();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -151,9 +153,7 @@ public class ActSearch extends BaseContainerActivity {
|
|
|
|
|
|
private void showKeywords() {
|
|
|
if (hintKeyword != null) {
|
|
|
- TitleBarUtils.getInstance().setSearchText(ActSearch.this, hintKeyword.getKeyword());
|
|
|
- } else {
|
|
|
- TitleBarUtils.getInstance().setSearchText(ActSearch.this, "");
|
|
|
+ TitleBarUtils.getInstance().setSearchHint(ActSearch.this, hintKeyword.getKeyword());
|
|
|
}
|
|
|
addHotView(hotListLayout, hotKeywords);
|
|
|
addHistoryView(historyListLayout, historyKeywords);
|
|
|
@@ -208,12 +208,17 @@ public class ActSearch extends BaseContainerActivity {
|
|
|
if (fgtSearch == null) {
|
|
|
return;
|
|
|
}
|
|
|
-// if (fgtSearch.isLoadingData()) {
|
|
|
-// return;
|
|
|
-// }
|
|
|
+ String inputText = TitleBarUtils.getInstance().getSearchText(this);
|
|
|
+ if(TextUtils.isEmpty(inputText)){
|
|
|
+ if(hintKeyword!=null){
|
|
|
+ inputText = hintKeyword.getKeyword();
|
|
|
+ TitleBarUtils.getInstance().setSearchText(ActSearch.this, inputText);
|
|
|
+ } else{
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
quickSearchLayout.setVisibility(View.INVISIBLE);
|
|
|
frame_container.setVisibility(View.VISIBLE);
|
|
|
- String inputText = TitleBarUtils.getInstance().getSearchText(this);
|
|
|
if (!TextUtils.isEmpty(inputText)) {
|
|
|
//保存搜索到数据库
|
|
|
SearchRecord searchRecord = new SearchRecord();
|