添加飘屏和访客功能
This commit is contained in:
@@ -10,8 +10,6 @@ android {
|
||||
defaultConfig {
|
||||
minSdk 24
|
||||
targetSdk 35
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.qxcm.moduleutil.adapter.MyFragmentPagerAdapter;
|
||||
import com.qxcm.moduleutil.base.BaseMvpFragment;
|
||||
import com.qxcm.moduleutil.bean.FirstChargeBean;
|
||||
import com.qxcm.moduleutil.dialog.HeavenGiftDialog;
|
||||
import com.qxcm.moduleutil.dialog.YouthModelDialog;
|
||||
import com.qxcm.moduleutil.utils.ARouteConstants;
|
||||
import com.qxcm.moduleutil.utils.SpUtil;
|
||||
|
||||
@@ -67,16 +68,12 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
mBinding.ivRankingList.setOnClickListener(v -> {
|
||||
startActivity(new Intent(getContext(), RankingListActivity.class));
|
||||
});
|
||||
// 检查是否需要显示青少年模式弹窗
|
||||
if (!shouldShowYouthModelDialog()) {
|
||||
showYouthModelDialog();
|
||||
}
|
||||
|
||||
|
||||
// YouthModelDialog youthModelDialog=new YouthModelDialog(getContext(),null);
|
||||
// youthModelDialog.show();
|
||||
// youthModelDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
// @Override
|
||||
// public void onDismiss(DialogInterface dialog) {
|
||||
// //青少年关闭后,弹首充
|
||||
// dialog.dismiss();
|
||||
// }
|
||||
// });
|
||||
// InviteDialog inviteDialog=new InviteDialog(getContext());
|
||||
// inviteDialog.show();
|
||||
// inviteDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@@ -109,6 +106,26 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
|
||||
}
|
||||
|
||||
private boolean shouldShowYouthModelDialog() {
|
||||
// 从 SharedPreferences 中获取是否已经显示过青少年模式弹窗
|
||||
boolean isYouthModelShown = SpUtil.getBooleanValue("youth_model_shown",false);
|
||||
return isYouthModelShown;
|
||||
}
|
||||
private void showYouthModelDialog() {
|
||||
YouthModelDialog youthModelDialog = new YouthModelDialog(getContext(), null);
|
||||
youthModelDialog.show();
|
||||
youthModelDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
// 记录已经显示过青少年模式弹窗
|
||||
SpUtil.setBooleanValue("youth_model_shown", true);
|
||||
dialog.dismiss();
|
||||
|
||||
// 在这里可以继续显示其他弹窗,如首充弹窗
|
||||
// showFirstChargeDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected void initListener () {
|
||||
super.initListener();
|
||||
|
||||
Reference in New Issue
Block a user