Merge branch '2.3' of https://git.oschina.net/dreamhua/GH-ASSISTv1.45 into 2.3
Conflicts: app/src/main/java/com/gh/gamecenter/MainActivity.java app/src/main/java/com/gh/gamecenter/adapter/SubjectAdapter.java
This commit is contained in:
@ -53,6 +53,7 @@ import com.gh.gamecenter.eventbus.EBShowDialog;
|
||||
import com.gh.gamecenter.eventbus.EBSkip;
|
||||
import com.gh.gamecenter.eventbus.EBUISwitch;
|
||||
import com.gh.gamecenter.game.GameFragment;
|
||||
import com.gh.gamecenter.game.NewGameFragment;
|
||||
import com.gh.gamecenter.manager.ConcernManager;
|
||||
import com.gh.gamecenter.manager.DataCollectionManager;
|
||||
import com.gh.gamecenter.manager.FilterManager;
|
||||
@ -96,6 +97,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
private GameFragment gameFragment;
|
||||
private NewsFragment newsFragment;
|
||||
private PersonalFragment personalFragment;
|
||||
private NewGameFragment newGameFragment;
|
||||
private ImageView ivGame;
|
||||
private ImageView ivNews;
|
||||
private ImageView ivPersonal;
|
||||
@ -857,8 +859,8 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
} else {
|
||||
searchHint = response.get(RandomUtils.nextInt(response.size()));
|
||||
}
|
||||
if (gameFragment != null) {
|
||||
gameFragment.setHint(searchHint);
|
||||
if (newGameFragment != null) {
|
||||
newGameFragment.setHint(searchHint);
|
||||
}
|
||||
if (newsFragment != null) {
|
||||
newsFragment.setHint(searchHint);
|
||||
@ -924,26 +926,26 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
case 0:
|
||||
ivGame.setImageResource(R.drawable.home1_selected);
|
||||
tvGame.setTextColor(getResources().getColor(R.color.theme));
|
||||
if (gameFragment == null) {
|
||||
if (newGameFragment == null) {
|
||||
List<Fragment> list = getSupportFragmentManager().getFragments();
|
||||
if (list != null) {
|
||||
for (Fragment fragment : list) {
|
||||
if (fragment.getClass().equals(GameFragment.class)) {
|
||||
gameFragment = (GameFragment) fragment;
|
||||
transaction.show(gameFragment);
|
||||
if (fragment.getClass().equals(NewGameFragment.class)) {
|
||||
newGameFragment = (NewGameFragment) fragment;
|
||||
transaction.show(newGameFragment);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gameFragment == null) {
|
||||
gameFragment = new GameFragment();
|
||||
if (newGameFragment == null) {
|
||||
newGameFragment = new NewGameFragment();
|
||||
if (!TextUtils.isEmpty(searchHint)) {
|
||||
gameFragment.setHint(searchHint);
|
||||
newGameFragment.setHint(searchHint);
|
||||
}
|
||||
transaction.add(R.id.main_content, gameFragment);
|
||||
transaction.add(R.id.main_content, newGameFragment);
|
||||
}
|
||||
} else {
|
||||
transaction.show(gameFragment);
|
||||
transaction.show(newGameFragment);
|
||||
}
|
||||
currentTab = 0;
|
||||
break;
|
||||
@ -1017,8 +1019,8 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
if (personalFragment != null) {
|
||||
transaction.hide(personalFragment);
|
||||
}
|
||||
if (gameFragment != null) {
|
||||
transaction.hide(gameFragment);
|
||||
if (newGameFragment != null) {
|
||||
transaction.hide(newGameFragment);
|
||||
}
|
||||
if (newsFragment != null) {
|
||||
transaction.hide(newsFragment);
|
||||
@ -1033,7 +1035,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
}
|
||||
|
||||
public void onEventMainThread(EBSkip skip) {
|
||||
if ("GameFragment".equals(skip.getType())) {
|
||||
if ("NewGameFragment".equals(skip.getType())) {
|
||||
EventBus.getDefault().post(new EBUISwitch("MainActivity", 0));
|
||||
setTabSelection(0);
|
||||
EventBus.getDefault().post(new EBSkip("MainActivity", skip.getCurrentItem()));
|
||||
|
||||
Reference in New Issue
Block a user