年度全服
This commit is contained in:
@@ -1179,7 +1179,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
}
|
}
|
||||||
int second2 = baseProtocol.getSecond();
|
int second2 = baseProtocol.getSecond();
|
||||||
AllServiceGiftProtocol.DataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocol.DataBean.class);
|
AllServiceGiftProtocol.DataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocol.DataBean.class);
|
||||||
if (data == null || (data.getGiftUrl()) == null)
|
if (data == null || data.getGiftUrl() == null || data.isCeremonyGift())
|
||||||
return;
|
return;
|
||||||
giftList.add(data);
|
giftList.add(data);
|
||||||
if (second2 == CUSTOM_MSG_ALL_SERVICE_GIFT) {
|
if (second2 == CUSTOM_MSG_ALL_SERVICE_GIFT) {
|
||||||
|
@@ -4,6 +4,7 @@ import static com.mango.core.Constants.DEBUG_MAX_UID;
|
|||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_HEAD_NOBLE;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_HEAD_NOBLE;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_OPENNOBLE;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_OPENNOBLE;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE;
|
||||||
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_GIFT;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ALL_DIAMOND;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ALL_DIAMOND;
|
||||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VIP;
|
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_VIP;
|
||||||
@@ -39,6 +40,7 @@ import androidx.fragment.app.FragmentManager;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.mango.core.noble.AllServiceGiftProtocol;
|
||||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||||
import com.netease.nimlib.sdk.NIMSDK;
|
import com.netease.nimlib.sdk.NIMSDK;
|
||||||
import com.netease.nimlib.sdk.Observer;
|
import com.netease.nimlib.sdk.Observer;
|
||||||
@@ -100,6 +102,7 @@ import com.mango.xchat_android_library.utils.UIUtils;
|
|||||||
import com.mango.xchat_android_library.utils.codec.DESUtils;
|
import com.mango.xchat_android_library.utils.codec.DESUtils;
|
||||||
import com.mango.xchat_android_library.utils.config.BasicConfig;
|
import com.mango.xchat_android_library.utils.config.BasicConfig;
|
||||||
import com.mango.xchat_android_library.utils.log.MLog;
|
import com.mango.xchat_android_library.utils.log.MLog;
|
||||||
|
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftLevelCeremonyDialog;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
@@ -108,6 +111,7 @@ import java.lang.ref.WeakReference;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
@@ -922,6 +926,16 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CUSTOM_MSG_HEADER_TYPE_GIFT:
|
||||||
|
if (!isValid()) return;
|
||||||
|
if (this instanceof AddUserInfoActivity ||
|
||||||
|
UserUtils.getUserInfo() == null)
|
||||||
|
return;
|
||||||
|
AllServiceGiftProtocol.DataBean data = JSON.parseObject(String.valueOf(baseProtocol.getData()), AllServiceGiftProtocol.DataBean.class);
|
||||||
|
if (data == null || data.getGiftUrl() == null || !data.isCeremonyGift())
|
||||||
|
return;
|
||||||
|
new AllServiceGiftLevelCeremonyDialog(context, data).show();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,78 @@
|
|||||||
|
package com.yizhuan.erban.ui.widget.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Point;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mango.core.manager.AvRoomDataManager;
|
||||||
|
import com.mango.core.noble.AllServiceGiftProtocol;
|
||||||
|
import com.mango.moshen.R;
|
||||||
|
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||||
|
import com.mango.moshen.databinding.DialogGiftAllServiceCeremonyBinding;
|
||||||
|
import com.mango.moshen.ui.widget.dialog.AllServiceGiftDialog;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by MadisonRong on 11/05/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AllServiceGiftLevelCeremonyDialog extends AllServiceGiftDialog {
|
||||||
|
|
||||||
|
private DialogGiftAllServiceCeremonyBinding binding;
|
||||||
|
|
||||||
|
public AllServiceGiftLevelCeremonyDialog(Context context, AllServiceGiftProtocol.DataBean dataBean) {
|
||||||
|
super(context, R.style.FullScreenDialog, dataBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.dialog_gift_all_service_ceremony, null);
|
||||||
|
setContentView(inflate.getRootView());
|
||||||
|
setCancelable(true);
|
||||||
|
setCanceledOnTouchOutside(true);
|
||||||
|
binding = DataBindingUtil.bind(inflate);
|
||||||
|
|
||||||
|
Window window = getWindow();
|
||||||
|
Point point = new Point();
|
||||||
|
if (window != null) {
|
||||||
|
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
WindowManager.LayoutParams windowParams = window.getAttributes();
|
||||||
|
windowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
|
windowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||||
|
windowParams.dimAmount = 0.0f;
|
||||||
|
windowParams.gravity = Gravity.TOP;
|
||||||
|
windowParams.x = 0;
|
||||||
|
windowParams.y = 0;
|
||||||
|
window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
|
||||||
|
window.setAttributes(windowParams);
|
||||||
|
window.setWindowAnimations(R.style.anim_fade);
|
||||||
|
window.getWindowManager().getDefaultDisplay().getSize(point);
|
||||||
|
}
|
||||||
|
if (dataBean != null) {
|
||||||
|
// 设置定时器
|
||||||
|
Observable.timer((long) dataBean.getNotifyStaySecond(), TimeUnit.SECONDS)
|
||||||
|
.subscribe(aLong -> {
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
binding.setGiftBean(dataBean);
|
||||||
|
binding.tvGoRoom.setVisibility(dataBean.getRoomUid() == 0
|
||||||
|
|| (AvRoomDataManager.get().mCurrentRoomInfo != null && dataBean.getRoomUid() == AvRoomDataManager.get().mCurrentRoomInfo.getUid())
|
||||||
|
? View.GONE : View.VISIBLE);
|
||||||
|
binding.tvGoRoom.setOnClickListener(view -> AVRoomActivity.start(getContext(), dataBean.getRoomUid()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 229 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
130
app/src/main/res/layout/dialog_gift_all_service_ceremony.xml
Normal file
130
app/src/main/res/layout/dialog_gift_all_service_ceremony.xml
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout 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">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="giftBean"
|
||||||
|
type="com.mango.core.noble.AllServiceGiftProtocol.DataBean" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="30dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/all_service_gift_ceremony_background"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/benefactor_nick"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="35dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxEms="5"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@{giftBean.sendUserNick}"
|
||||||
|
android:textColor="#FBC200"
|
||||||
|
android:textSize="12dp"
|
||||||
|
tools:ignore="SpUsage"
|
||||||
|
tools:text="宫泽艾里斯-宫泽艾里斯-宫泽艾里斯" />
|
||||||
|
|
||||||
|
<com.mango.moshen.common.widget.CircleImageView
|
||||||
|
android:id="@+id/benefactor_avatar"
|
||||||
|
avatarUrl="@{giftBean.sendUserAvatar}"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
app:cborder_color="#FFEB71"
|
||||||
|
app:cborder_width="1dp"
|
||||||
|
tools:src="@drawable/default_avatar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/give_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:text="送给"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="12dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/receiver_nick"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxEms="5"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@{giftBean.recvUserNick}"
|
||||||
|
android:textColor="#FBC200"
|
||||||
|
android:textSize="12dp"
|
||||||
|
tools:text="梅利奥达斯-梅利奥达斯-梅利奥达斯" />
|
||||||
|
|
||||||
|
<com.mango.moshen.common.widget.CircleImageView
|
||||||
|
android:id="@+id/receiver_avatar"
|
||||||
|
avatarUrl="@{giftBean.recvUserAvatar}"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
app:cborder_color="#FFEB71"
|
||||||
|
app:cborder_width="1dp"
|
||||||
|
tools:src="@drawable/default_avatar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/gift_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{giftBean.giftName}"
|
||||||
|
android:textColor="#80F9FF"
|
||||||
|
android:textSize="12dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:ignore="SpUsage"
|
||||||
|
tools:text="神邸荣光" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/gift_img"
|
||||||
|
nomalUrl="@{giftBean.giftUrl}"
|
||||||
|
android:layout_width="25dp"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="2dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/gift_number"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@{@string/x + giftBean.giftNum}"
|
||||||
|
android:textColor="#80F9FF"
|
||||||
|
android:textSize="12dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:ignore="SpUsage"
|
||||||
|
tools:text="x1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/tv_go_room"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_5"
|
||||||
|
android:src="@drawable/all_service_gift_ceremony_go_to" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
</layout>
|
@@ -43,6 +43,7 @@ public class AllServiceGiftProtocol extends BaseProtocol<AllServiceGiftProtocol.
|
|||||||
private long roomUid;
|
private long roomUid;
|
||||||
private String roomTitle;
|
private String roomTitle;
|
||||||
private String levelNum;
|
private String levelNum;
|
||||||
|
private boolean ceremonyGift;
|
||||||
|
|
||||||
public String getSendUserNick() {
|
public String getSendUserNick() {
|
||||||
return sendUserNick;
|
return sendUserNick;
|
||||||
@@ -196,6 +197,14 @@ public class AllServiceGiftProtocol extends BaseProtocol<AllServiceGiftProtocol.
|
|||||||
this.levelNum = levelNum;
|
this.levelNum = levelNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCeremonyGift() {
|
||||||
|
return ceremonyGift;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCeremonyGift(boolean ceremonyGift) {
|
||||||
|
this.ceremonyGift = ceremonyGift;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "DataBean{" +
|
return "DataBean{" +
|
||||||
|
Reference in New Issue
Block a user