update 餘額不足時彈框

This commit is contained in:
zlzw 2023-09-22 13:38:34 +08:00
parent 00db8a00c7
commit 18970c22cf
3 changed files with 59 additions and 8 deletions

View File

@ -4,6 +4,7 @@ import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN; import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.view.View; import android.view.View;
@ -643,4 +644,19 @@ public class JavascriptInterfaceUtils {
Bus.get().post(new JavascriptInterfaceEvent() Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidCancelAnchorAttention")); .setMethod("androidCancelAnchorAttention"));
} }
@JavascriptInterface
public void androidLnsufficientBalanceClick(String msg){
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
});
}
} }

View File

@ -1,5 +1,7 @@
package com.yunbao.live.activity; package com.yunbao.live.activity;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Dialog; import android.app.Dialog;
import android.content.ClipData; import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
@ -15,6 +17,7 @@ import android.widget.TextView;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
@ -36,6 +39,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.KeyBoardHeightChangeListener; import com.yunbao.common.interfaces.KeyBoardHeightChangeListener;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.KeyBoardHeightUtil2; import com.yunbao.common.utils.KeyBoardHeightUtil2;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ProcessImageUtil; import com.yunbao.common.utils.ProcessImageUtil;
@ -946,6 +950,19 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
} }
String[] data = new String[]{obj.getString("barragetoken")}; String[] data = new String[]{obj.getString("barragetoken")};
SocketRyChatUtil.sendDanmuMessage(mLiveUid, contents, obj.getIntValue("level_fans")); SocketRyChatUtil.sendDanmuMessage(mLiveUid, contents, obj.getIntValue("level_fans"));
} else if (code==1001) {
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
});
} else { } else {
ToastUtil.show(msg); ToastUtil.show(msg);
} }

View File

@ -1,5 +1,7 @@
package com.yunbao.live.dialog; package com.yunbao.live.dialog;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.app.Dialog; import android.app.Dialog;
import android.os.Bundle; import android.os.Bundle;
import android.text.Html; import android.text.Html;
@ -19,6 +21,7 @@ import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.makeramen.roundedimageview.RoundedImageView; import com.makeramen.roundedimageview.RoundedImageView;
@ -34,6 +37,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity;
@ -462,7 +466,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
private void buy() { private void buy() {
DialogUitl.showSimpleDialog(mContext, DialogUitl.showSimpleDialog(mContext,
String.format(mContext.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin(), mCoinName, mTargetBuyBean.getShopName(getContext())), String.format(mContext.getString(R.string.guard_buy_tip_3), mTargetBuyBean.getCoin()+"", mCoinName, mTargetBuyBean.getShopName(getContext())),
new DialogUitl.SimpleCallback() { new DialogUitl.SimpleCallback() {
@Override @Override
@ -499,6 +503,20 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
} }
((LiveActivity) mContext).sendBuyGuardMessage2(votes, guardNum, guardType, ancherName, liveuid); ((LiveActivity) mContext).sendBuyGuardMessage2(votes, guardNum, guardType, ancherName, liveuid);
dismiss(); dismiss();
}else if(code==1002){
DialogUitl.showSimpleDialog(mContext, msg, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
}
});
return;
} }
ToastUtil.show(msg); ToastUtil.show(msg);
} }