Commit 375d439a authored by fallenstardust's avatar fallenstardust

实现按照ygopro运行与否显示/隐藏返回决斗按钮

parent 332b8546
package cn.garymb.ygomobile.ui.home; package cn.garymb.ygomobile.ui.home;
import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
...@@ -48,6 +49,7 @@ import java.util.List; ...@@ -48,6 +49,7 @@ import java.util.List;
import cn.garymb.ygodata.YGOGameOptions; import cn.garymb.ygodata.YGOGameOptions;
import cn.garymb.ygomobile.AppsSettings; import cn.garymb.ygomobile.AppsSettings;
import cn.garymb.ygomobile.Constants; import cn.garymb.ygomobile.Constants;
import cn.garymb.ygomobile.YGOMobileActivity;
import cn.garymb.ygomobile.YGOStarter; import cn.garymb.ygomobile.YGOStarter;
import cn.garymb.ygomobile.bean.ServerInfo; import cn.garymb.ygomobile.bean.ServerInfo;
import cn.garymb.ygomobile.bean.events.ServerInfoEvent; import cn.garymb.ygomobile.bean.events.ServerInfoEvent;
...@@ -67,6 +69,7 @@ import cn.garymb.ygomobile.ui.preference.SettingsActivity; ...@@ -67,6 +69,7 @@ import cn.garymb.ygomobile.ui.preference.SettingsActivity;
import cn.garymb.ygomobile.ui.widget.Shimmer; import cn.garymb.ygomobile.ui.widget.Shimmer;
import cn.garymb.ygomobile.ui.widget.ShimmerTextView; import cn.garymb.ygomobile.ui.widget.ShimmerTextView;
import cn.garymb.ygomobile.utils.AlipayPayUtils; import cn.garymb.ygomobile.utils.AlipayPayUtils;
import cn.garymb.ygomobile.utils.ComponentUtils;
import cn.garymb.ygomobile.utils.FileLogUtil; import cn.garymb.ygomobile.utils.FileLogUtil;
import cn.garymb.ygomobile.utils.PermissionUtil; import cn.garymb.ygomobile.utils.PermissionUtil;
import cn.garymb.ygomobile.utils.ScreenUtil; import cn.garymb.ygomobile.utils.ScreenUtil;
...@@ -238,6 +241,12 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -238,6 +241,12 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
checkNotch(); checkNotch();
} }
@Override
protected void onResume() {
super.onResume();
BacktoDuel();
}
//检查是否有刘海 //检查是否有刘海
private void checkNotch() { private void checkNotch() {
ScreenUtil.findNotchInformation(HomeActivity.this, new ScreenUtil.FindNotchInformation() { ScreenUtil.findNotchInformation(HomeActivity.this, new ScreenUtil.FindNotchInformation() {
...@@ -581,8 +590,15 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie ...@@ -581,8 +590,15 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
}); });
} }
public void BacktoDuel(){ public void BacktoDuel() {
openGame(); tv.setOnClickListener((v) -> {
openGame();
});
if (ComponentUtils.isActivityRunning(this, new ComponentName(this, YGOMobileActivity.class))) {
tv.setVisibility(View.VISIBLE);
} else {
tv.setVisibility(View.GONE);
}
} }
public boolean joinQQGroup(String key) { public boolean joinQQGroup(String key) {
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
android:text="@string/return_to_duel" android:text="@string/return_to_duel"
android:textColor="@color/item_title" android:textColor="@color/item_title"
android:background="@drawable/blue" android:background="@drawable/blue"
android:visibility="gone"
android:textSize="20sp" /> android:textSize="20sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
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