|
|
@@ -1,15 +1,10 @@
|
|
|
package com.sheep.gamegroup.view.activity;
|
|
|
|
|
|
-import android.os.Bundle;
|
|
|
import android.support.v4.app.Fragment;
|
|
|
import android.support.v4.app.FragmentTransaction;
|
|
|
-import android.support.v7.widget.AppCompatAutoCompleteTextView;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
-import android.text.Editable;
|
|
|
import android.text.TextUtils;
|
|
|
-import android.text.TextWatcher;
|
|
|
-import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
import android.widget.ImageView;
|
|
|
@@ -18,9 +13,7 @@ import android.widget.TextView;
|
|
|
import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
|
|
|
import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
-import com.sheep.gamegroup.absBase.BaseContainerActivity;
|
|
|
import com.sheep.gamegroup.absBase.IHomePageSearch;
|
|
|
-import com.sheep.gamegroup.absBase.ISearch;
|
|
|
import com.sheep.gamegroup.absBase.ISearchRecord;
|
|
|
import com.sheep.gamegroup.greendao.DDProviderHelper;
|
|
|
import com.sheep.gamegroup.greendao.download.SearchRecord;
|
|
|
@@ -33,12 +26,10 @@ import com.sheep.gamegroup.util.DataUtil;
|
|
|
import com.sheep.gamegroup.util.ListUtil;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.gamegroup.view.adapter.AdpTitleInfoList;
|
|
|
-import com.sheep.gamegroup.view.fragment.FgtSearchApp;
|
|
|
import com.sheep.gamegroup.view.fragment.FgtSearchAppOrTask;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
-import com.umeng.socialize.utils.Log;
|
|
|
|
|
|
import org.afinal.simplecache.ApiKey;
|
|
|
|
|
|
@@ -47,7 +38,6 @@ import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
import butterknife.BindView;
|
|
|
-import butterknife.OnClick;
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
import io.reactivex.schedulers.Schedulers;
|
|
|
|
|
|
@@ -180,7 +170,7 @@ public class ActSearchAppOrTask extends BaseActivity {
|
|
|
//排序
|
|
|
Collections.sort(titleInfoListList);
|
|
|
//刷新
|
|
|
- recyclerView.getAdapter().notifyDataSetChanged();
|
|
|
+ ViewUtil.notifyDataSetChanged(recyclerView);
|
|
|
if (isTitleInfoListEmpty()) {
|
|
|
frame_container.setVisibility(View.VISIBLE);
|
|
|
recyclerView.setVisibility(View.INVISIBLE);
|
|
|
@@ -205,7 +195,7 @@ public class ActSearchAppOrTask extends BaseActivity {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
list.remove(item);
|
|
|
- recyclerView.getAdapter().notifyDataSetChanged();
|
|
|
+ ViewUtil.notifyDataSetChanged(recyclerView);
|
|
|
DDProviderHelper.getInstance().deleteSearchRecord((SearchRecord) item);
|
|
|
if (isTitleInfoListEmpty()) {
|
|
|
frame_container.setVisibility(View.VISIBLE);
|
|
|
@@ -238,6 +228,12 @@ public class ActSearchAppOrTask extends BaseActivity {
|
|
|
|
|
|
//尝试搜索游戏
|
|
|
private void toSearchApp() {
|
|
|
+ if(fgtSearchAppOrTask == null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(fgtSearchAppOrTask.isLoadingData()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
recyclerView.setVisibility(View.INVISIBLE);
|
|
|
frame_container.setVisibility(View.VISIBLE);
|
|
|
String inputText = TitleBarUtils.getInstance().getSearchText(this);
|
|
|
@@ -249,7 +245,7 @@ public class ActSearchAppOrTask extends BaseActivity {
|
|
|
searchRecord.setCount(1);
|
|
|
searchRecordList.add(searchRecord);
|
|
|
DDProviderHelper.getInstance().addOrUpdateSearchRecord(searchRecord, null);
|
|
|
- recyclerView.getAdapter().notifyDataSetChanged();
|
|
|
+ ViewUtil.notifyDataSetChanged(recyclerView);
|
|
|
}
|
|
|
fgtSearchAppOrTask.toSearch(inputText);
|
|
|
}
|