删除无用文件,游戏-插件集成下载模块、更多模块,屏蔽gif代码
This commit is contained in:
@ -59,7 +59,7 @@ import com.gh.gamecenter.eventbus.EBShowDialog;
|
||||
import com.gh.gamecenter.eventbus.EBSkipNewPlugin;
|
||||
import com.gh.gamecenter.eventbus.EBTopState;
|
||||
import com.gh.gamecenter.eventbus.EBUISwitch;
|
||||
import com.gh.gamecenter.home.HomeFragment;
|
||||
import com.gh.gamecenter.game.GameFragment;
|
||||
import com.gh.gamecenter.manager.ConcernManager;
|
||||
import com.gh.gamecenter.manager.DataCollectionManager;
|
||||
import com.gh.gamecenter.manager.FilterManager;
|
||||
@ -68,7 +68,6 @@ import com.gh.gamecenter.manager.PackageManager;
|
||||
import com.gh.gamecenter.manager.SuspectedGameManager;
|
||||
import com.gh.gamecenter.news.NewsFragment;
|
||||
import com.gh.gamecenter.personal.PersonalFragment;
|
||||
import com.gh.gamecenter.plugin.PluginFragment;
|
||||
import com.gh.gamecenter.volley.extended.JsonArrayExtendedRequest;
|
||||
import com.gh.gamecenter.volley.extended.JsonObjectExtendedRequest;
|
||||
import com.google.gson.Gson;
|
||||
@ -110,8 +109,7 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
|
||||
private NewsFragment newsFragment;
|
||||
|
||||
// private HomeFragment home1Fragment;
|
||||
private PluginFragment pluginFragmentActivity;
|
||||
private GameFragment pluginFragmentActivity;
|
||||
private PersonalFragment home3Fragment;
|
||||
private View home1Layout, home2Layout, home3Layout;
|
||||
private ImageView home1Image, home2Image, home3Image;
|
||||
@ -974,55 +972,6 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
hideFragments(transaction);
|
||||
switch (index) {
|
||||
case 1:
|
||||
home2Layout.setClickable(false);
|
||||
home2Image.setImageResource(R.drawable.home2_selected);
|
||||
home2Title.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
// if (home1Fragment == null) {
|
||||
// List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
// if (list != null) {
|
||||
// for (Fragment fragment : list) {
|
||||
// if (fragment.getClass().equals(HomeFragment.class)) {
|
||||
// home1Fragment = (HomeFragment) fragment;
|
||||
// transaction.show(home1Fragment);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (home1Fragment == null) {
|
||||
// home1Fragment = new HomeFragment();
|
||||
// transaction.add(R.id.main_content, home1Fragment);
|
||||
// }
|
||||
// } else {
|
||||
// transaction.show(home1Fragment);
|
||||
// }
|
||||
// if (newsFragment == null) {
|
||||
// List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
// if (list != null) {
|
||||
// for (Fragment fragment : list) {
|
||||
// if (fragment.getClass().equals(HomeFragment.class)) {
|
||||
// newsFragment = (NewsFragment) fragment;
|
||||
// transaction.show(newsFragment);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (newsFragment == null) {
|
||||
// newsFragment = new NewsFragment();
|
||||
// transaction.add(R.id.main_content, newsFragment);
|
||||
// }
|
||||
// } else {
|
||||
// transaction.show(newsFragment);
|
||||
// }
|
||||
if (newsFragment == null){
|
||||
newsFragment = new NewsFragment();
|
||||
transaction.add(R.id.main_content, newsFragment);
|
||||
}else {
|
||||
transaction.show(newsFragment);
|
||||
}
|
||||
currentTab = 1;
|
||||
break;
|
||||
case 0:
|
||||
home1Layout.setClickable(false);
|
||||
home1Image.setImageResource(R.drawable.home1_selected);
|
||||
@ -1032,15 +981,15 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
if (list != null) {
|
||||
for (Fragment fragment : list) {
|
||||
if (fragment.getClass().equals(PluginFragment.class)) {
|
||||
pluginFragmentActivity = (PluginFragment) fragment;
|
||||
if (fragment.getClass().equals(GameFragment.class)) {
|
||||
pluginFragmentActivity = (GameFragment) fragment;
|
||||
transaction.show(pluginFragmentActivity);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pluginFragmentActivity == null) {
|
||||
pluginFragmentActivity = new PluginFragment();
|
||||
pluginFragmentActivity = new GameFragment();
|
||||
transaction.add(R.id.main_content, pluginFragmentActivity);
|
||||
}
|
||||
} else {
|
||||
@ -1048,6 +997,31 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
}
|
||||
currentTab = 0;
|
||||
break;
|
||||
case 1:
|
||||
home2Layout.setClickable(false);
|
||||
home2Image.setImageResource(R.drawable.home2_selected);
|
||||
home2Title.setTextColor(getResources().getColor(
|
||||
R.color.theme_colors));
|
||||
if (newsFragment == null) {
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
if (list != null) {
|
||||
for (Fragment fragment : list) {
|
||||
if (fragment.getClass().equals(NewsFragment.class)) {
|
||||
newsFragment = (NewsFragment) fragment;
|
||||
transaction.show(newsFragment);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newsFragment == null) {
|
||||
newsFragment = new NewsFragment();
|
||||
transaction.add(R.id.main_content, newsFragment);
|
||||
}
|
||||
} else {
|
||||
transaction.show(newsFragment);
|
||||
}
|
||||
currentTab = 1;
|
||||
break;
|
||||
case 2:
|
||||
home3Layout.setClickable(false);
|
||||
home3Image.setImageResource(R.drawable.home3_selected);
|
||||
@ -1104,10 +1078,6 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
if (pluginFragmentActivity != null) {
|
||||
transaction.hide(pluginFragmentActivity);
|
||||
}
|
||||
// if (home1Fragment != null) {
|
||||
// transaction.hide(home1Fragment);
|
||||
// }
|
||||
//
|
||||
if (newsFragment != null) {
|
||||
transaction.hide(newsFragment);
|
||||
}
|
||||
@ -1148,7 +1118,7 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
public void onEventMainThread(EBSkipNewPlugin busFive) {
|
||||
if (busFive.getType() == 0) {
|
||||
if (isFirst) {
|
||||
PluginFragment.isFirst = true;
|
||||
GameFragment.isFirst = true;
|
||||
}
|
||||
onClick(home2Layout);
|
||||
EventBus.getDefault().post(new EBSkipNewPlugin(1));
|
||||
@ -1270,10 +1240,9 @@ public class MainActivity extends BaseFragmentActivity implements
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
isDestroy = true;
|
||||
AppController.canclePendingRequests(HomeFragment.class);
|
||||
AppController.canclePendingRequests(PluginFragment.class);
|
||||
AppController.canclePendingRequests(GameFragment.class);
|
||||
AppController.canclePendingRequests(NewsFragment.class);
|
||||
DownloadManager.getInstance(this).removeObserver(dataWatcher);
|
||||
// home1Fragment = null;
|
||||
pluginFragmentActivity = null;
|
||||
home3Fragment = null;
|
||||
home1Layout = null;
|
||||
|
||||
Reference in New Issue
Block a user