去除volley 中TAG的滥用导致无法重复加载同一url,项目整理

This commit is contained in:
huangzhuanghua
2016-11-29 10:49:45 +08:00
parent 47f978a4fa
commit a31d2cd28b
80 changed files with 461 additions and 610 deletions

View File

@ -8,7 +8,6 @@ import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.gh.base.AppController;
import com.gh.base.BaseFragment;
import com.gh.common.util.DownloadItemUtils;
import com.gh.download.DataWatcher;
@ -26,19 +25,16 @@ import de.greenrobot.event.EventBus;
/**
* Created by LGT on 2016/8/12.
* 我的关注-已安装界面
*/
public class InstallFragment extends BaseFragment {
public static final String TAG = InstallFragment.class.getSimpleName();
private RecyclerView fm_install_rv_show;
private InstallFragmentAdapter adapter;
private LinearLayout reuse_nodata_skip;
private TextView reuse_nodata_skip_tv_hint;
private TextView reuse_nodata_skip_tv_btn;
private boolean isEverpause;
private DataWatcher dataWatcher = new DataWatcher() {
@Override
public void onDataChanged(DownloadEntity downloadEntity) {
@ -60,8 +56,6 @@ public class InstallFragment extends BaseFragment {
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
isEverpause = false;
init(R.layout.fm_install);
reuse_nodata_skip.setVisibility(View.GONE);
@ -105,27 +99,20 @@ public class InstallFragment extends BaseFragment {
@Override
public void onResume() {
super.onResume();
if (isEverpause) {
for (GameEntity entity : adapter.getGameList()) {
entity.setEntryMap(DownloadManager.getInstance(getActivity()).getEntryMap(entity.getName()));
}
adapter.notifyDataSetChanged();
}
isEverpause = false;
super.onResume();
DownloadManager.getInstance(getActivity()).addObserver(dataWatcher);
}
@Override
public void onPause() {
super.onPause();
isEverpause = true;
DownloadManager.getInstance(getActivity()).removeObserver(dataWatcher);
}
@Override
public void onDestroy() {
super.onDestroy();
AppController.canclePendingRequests(TAG);
}
}