diff --git a/common/src/main/java/com/yunbao/common/dialog/YoursystemisolderDialog.java b/common/src/main/java/com/yunbao/common/dialog/YoursystemisolderDialog.java new file mode 100644 index 000000000..ecac3b7d9 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/YoursystemisolderDialog.java @@ -0,0 +1,74 @@ +package com.yunbao.common.dialog; + +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.FragmentManager; + +import com.yunbao.common.R; +import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class YoursystemisolderDialog extends AbsDialogFragment { + @Override + protected int getLayoutId() { + return R.layout.view_yoursystemisolder; + } + + @Override + protected int getDialogStyle() { + return R.style.dialog; + } + + @Override + protected boolean canCancel() { + return false; + } + + @Override + protected void setWindowAttributes(Window window) { + window.setWindowAnimations(R.style.bottomToTopAnim); + WindowManager.LayoutParams params = window.getAttributes(); + params.width = DpUtil.dp2px(277); + params.height = DpUtil.dp2px(134); + params.gravity = Gravity.CENTER; + window.setAttributes(params); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + TextView hint = (TextView) findViewById(R.id.hint); + TextView toSetUp = (TextView) findViewById(R.id.to_set_up); + TextView knowThe = (TextView) findViewById(R.id.know_the); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.to_set_up), () -> dismiss()); + } + + @Override + public void show(@NonNull FragmentManager manager, @Nullable String tag) { + try { + super.show(manager, tag); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private YoursystemisolderDialog.HintListener listener; + + public YoursystemisolderDialog setListener(YoursystemisolderDialog.HintListener listener) { + this.listener = listener; + return this; + } + + public interface HintListener { + void requestPermission(); + } +} diff --git a/common/src/main/res/layout/view_yoursystemisolder.xml b/common/src/main/res/layout/view_yoursystemisolder.xml new file mode 100644 index 000000000..ef06d5cba --- /dev/null +++ b/common/src/main/res/layout/view_yoursystemisolder.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 5b2cf5822..7db64177f 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -21,6 +21,7 @@ import androidx.annotation.NonNull; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; import androidx.core.view.WindowInsetsControllerCompat; +import androidx.fragment.app.FragmentActivity; import androidx.viewpager.widget.ViewPager; import com.alibaba.android.arouter.facade.annotation.Route; @@ -51,8 +52,10 @@ import com.yunbao.common.bean.SlideInfoModel; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.EffectsSettingsDialog; import com.yunbao.common.dialog.FloatSettingsDialog; +import com.yunbao.common.dialog.HintDialog; import com.yunbao.common.dialog.LiveChargeDialogFragment; import com.yunbao.common.dialog.SlideSettingsDialog; +import com.yunbao.common.dialog.YoursystemisolderDialog; import com.yunbao.common.event.CustomDrawerPopupEvent; import com.yunbao.common.event.FollowEvent; import com.yunbao.common.glide.ImgLoader; @@ -184,8 +187,9 @@ public class LiveAudienceActivity extends LiveActivity { mStream = mLiveBean.getStream(); initData(); MicStatusManager.getInstance().addOnMicListener(onMicStatusListener); - if (!IMLoginManager.get(mContext).IsXiaJBG() && (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)) { - ToastUtil.show(R.string.yoursystemisolder); + if (!IMLoginManager.get(mContext).IsXiaJBG() && (Build.VERSION.SDK_INT < Build.VERSION_CODES.P)) { + YoursystemisolderDialog fragment = new YoursystemisolderDialog(); + fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "YoursystemisolderDialog"); IMLoginManager.get(mContext).setXiaJBG(true); } }