Commit 7a266bce authored by fallenstardust's avatar fallenstardust

首页启动ygopro的同时移除卡组编辑fragment

以便下次打开卡组编辑会重新初始化ygopro使用的最后卡组
parent d20c5ce6
...@@ -33,6 +33,7 @@ import cn.garymb.ygomobile.utils.glide.GlideCompat; ...@@ -33,6 +33,7 @@ import cn.garymb.ygomobile.utils.glide.GlideCompat;
public class YGOStarter { public class YGOStarter {
private static String TAG = "YGOStarter";
private static Bitmap mLogo; private static Bitmap mLogo;
private static void setFullScreen(Activity activity, ActivityShowInfo activityShowInfo) { private static void setFullScreen(Activity activity, ActivityShowInfo activityShowInfo) {
...@@ -166,10 +167,10 @@ public class YGOStarter { ...@@ -166,10 +167,10 @@ public class YGOStarter {
//如果距离上次加入游戏的时间大于1秒才处理 //如果距离上次加入游戏的时间大于1秒才处理
if (System.currentTimeMillis() - lasttime >= 1000) { if (System.currentTimeMillis() - lasttime >= 1000) {
lasttime = System.currentTimeMillis(); lasttime = System.currentTimeMillis();
Log.e("YGOStarter", "设置背景前" + System.currentTimeMillis()); Log.e(TAG, "设置背景前" + System.currentTimeMillis());
//显示加载背景 //显示加载背景
showLoadingBg(activity); showLoadingBg(activity);
Log.e("YGOStarter", "设置背景后" + System.currentTimeMillis()); Log.e(TAG, "设置背景后" + System.currentTimeMillis());
} }
Intent intent = new Intent(activity, YGOMobileActivity.class); Intent intent = new Intent(activity, YGOMobileActivity.class);
if (options != null) { if (options != null) {
...@@ -178,9 +179,9 @@ public class YGOStarter { ...@@ -178,9 +179,9 @@ public class YGOStarter {
} }
IrrlichtBridge.setArgs(intent, args); IrrlichtBridge.setArgs(intent, args);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Log.e("YGOStarter", "跳转前" + System.currentTimeMillis()); Log.e(TAG, "跳转前" + System.currentTimeMillis());
activity.startActivity(intent); activity.startActivity(intent);
Log.e("YGOStarter", "跳转后" + System.currentTimeMillis()); Log.e(TAG, "跳转后" + System.currentTimeMillis());
} }
private static HashMap<Activity, ActivityShowInfo> Infos = new HashMap<>(); private static HashMap<Activity, ActivityShowInfo> Infos = new HashMap<>();
......
...@@ -66,6 +66,7 @@ import cn.garymb.ygomobile.ui.activities.WebActivity; ...@@ -66,6 +66,7 @@ import cn.garymb.ygomobile.ui.activities.WebActivity;
import cn.garymb.ygomobile.ui.adapters.ServerListAdapter; import cn.garymb.ygomobile.ui.adapters.ServerListAdapter;
import cn.garymb.ygomobile.ui.adapters.SimpleListAdapter; import cn.garymb.ygomobile.ui.adapters.SimpleListAdapter;
import cn.garymb.ygomobile.ui.cards.CardDetailRandom; import cn.garymb.ygomobile.ui.cards.CardDetailRandom;
import cn.garymb.ygomobile.ui.cards.DeckManagerFragment;
import cn.garymb.ygomobile.ui.mycard.McNews; import cn.garymb.ygomobile.ui.mycard.McNews;
import cn.garymb.ygomobile.ui.mycard.MyCard; import cn.garymb.ygomobile.ui.mycard.MyCard;
import cn.garymb.ygomobile.ui.mycard.mcchat.util.ImageUtil; import cn.garymb.ygomobile.ui.mycard.mcchat.util.ImageUtil;
...@@ -626,6 +627,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -626,6 +627,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
protected void openGame() { protected void openGame() {
YGOStarter.startGame(getActivity(), null); YGOStarter.startGame(getActivity(), null);
getFragmentManager().beginTransaction().remove(activity.fragment_deck_cards).commit();
} }
private void duelAssistantCheck() { private void duelAssistantCheck() {
...@@ -713,9 +715,11 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -713,9 +715,11 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
break; break;
case R.id.action_replay: case R.id.action_replay:
YGOStarter.startGame(getActivity(), null, "-k", "-r"); YGOStarter.startGame(getActivity(), null, "-k", "-r");
getFragmentManager().beginTransaction().remove(activity.fragment_deck_cards).commit();
break; break;
case R.id.action_bot: case R.id.action_bot:
YGOStarter.startGame(getActivity(), null, "-k", "-s"); YGOStarter.startGame(getActivity(), null, "-k", "-s");
getFragmentManager().beginTransaction().remove(activity.fragment_deck_cards).commit();
break; break;
case R.id.action_download_ex: case R.id.action_download_ex:
// if (!AppsSettings.get().isReadExpansions()) {//如果未开启扩展卡设置,直接跳过 // if (!AppsSettings.get().isReadExpansions()) {//如果未开启扩展卡设置,直接跳过
...@@ -745,14 +749,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -745,14 +749,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
}); });
} }
break;/*
case R.id.action_join_qq_group:
String key = "anEjPCDdhLgxtfLre-nT52G1Coye3LkK";
joinQQGroup(key);
break; break;
case R.id.action_reset_game_res:
updateImages();
break;*/
case R.id.nav_webpage: { case R.id.nav_webpage: {
Intent intent = new Intent(Intent.ACTION_VIEW); Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(Constants.URL_DONATE)); intent.setData(Uri.parse(Constants.URL_DONATE));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment