單人PK卡0分 優化計算中

This commit is contained in:
18142669586 2023-02-28 16:46:52 +08:00
parent 07f0f39978
commit abbc2fc4ee
3 changed files with 136 additions and 2 deletions

View File

@ -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();
}
}

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="277dp"
android:layout_height="133.67dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="16dp"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="true"
tools:ignore="MissingDefaultResource">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16.33dp"
android:layout_marginTop="24.67dp"
android:text="@string/yoursystemisolder"
android:textColor="#161616"
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="33.67dp"
android:layout_marginBottom="23.67dp">
<TextView
android:id="@+id/to_set_up"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/to_set_up"
android:visibility="gone"
android:textColor="#B1B1B1"
android:textSize="16sp" />
<TextView
android:id="@+id/know_the"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23.33dp"
android:text="@string/know_the"
android:textColor="#FFAF08"
android:textSize="16sp" />
</LinearLayout>
</FrameLayout>
</androidx.cardview.widget.CardView>

View File

@ -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);
}
}