个播粉丝团开通粉丝团UI修改
This commit is contained in:
@@ -234,8 +234,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_join_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="76dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_marginStart="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/bg_join"
|
||||
app:layout_constraintStart_toStartOf="@id/bg_join"
|
||||
|
@@ -1253,9 +1253,11 @@ public final class IMNetEaseManager {
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_SUB_ROOM_PK_NOTIFY:
|
||||
case CUSTOM_MSG_SUB_SINGLE_ROOM_PK_NOTIFY:
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_PK_NOTIFY);
|
||||
break;
|
||||
case CUSTOM_MSG_SUB_SINGLE_ROOM_PK_NOTIFY:
|
||||
noticeRoomEvent(msg, RoomEvent.SINGLE_ROOM_PK_NOTIFY);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_VIP:
|
||||
|
@@ -226,6 +226,8 @@ public class RoomEvent {
|
||||
public static final int FANS_TEAM_JOIN = 86;
|
||||
public static final int FANS_TEAM_EXIT = 87;
|
||||
|
||||
public static final int SINGLE_ROOM_PK_NOTIFY = 88;
|
||||
|
||||
private int event = NONE;
|
||||
private int micPosition = Integer.MIN_VALUE;
|
||||
private int posState = -1;
|
||||
|
@@ -31,4 +31,6 @@ public interface IPraiseModel extends IModel {
|
||||
|
||||
Single<Boolean> isPraised(long uid, long isLikeUid);
|
||||
|
||||
boolean isPraised(long isLikeUid);
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package com.yizhuan.xchat_android_core.praise;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.util.LongSparseArray;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
@@ -23,6 +25,8 @@ import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleSource;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@@ -38,20 +42,17 @@ import retrofit2.http.Query;
|
||||
*/
|
||||
|
||||
public class PraiseModel extends BaseModel implements IPraiseModel {
|
||||
private final LongSparseArray<Boolean> praiseCache = new LongSparseArray<>();
|
||||
private Api api = RxNet.create(Api.class);
|
||||
|
||||
private static final class Helper {
|
||||
public static final PraiseModel INSTANCE = new PraiseModel();
|
||||
private PraiseModel() {
|
||||
|
||||
}
|
||||
|
||||
public static PraiseModel get() {
|
||||
return Helper.INSTANCE;
|
||||
}
|
||||
|
||||
private PraiseModel() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 1点赞,2取消
|
||||
*/
|
||||
@@ -67,8 +68,8 @@ public class PraiseModel extends BaseModel implements IPraiseModel {
|
||||
@Override
|
||||
public SingleSource<String> apply(ServiceResult<String> stringServiceResult) throws Exception {
|
||||
if (stringServiceResult.isSuccess()) {
|
||||
return Single.just(isPraise ? "点赞成功":"取消点赞成功");
|
||||
}else {
|
||||
return Single.just(isPraise ? "点赞成功" : "取消点赞成功");
|
||||
} else {
|
||||
return Single.error(new Throwable(stringServiceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -82,6 +83,8 @@ public class PraiseModel extends BaseModel implements IPraiseModel {
|
||||
if (roomInfo != null && roomInfo.getUid() == likedUid && isPraise) {
|
||||
PraiseModel.this.sendAttentionRoomTipMsg(likedUid);
|
||||
}
|
||||
|
||||
praiseCache.put(likedUid, isPraise);
|
||||
UserModel.get().updateCurrentUserInfo().subscribe();
|
||||
EventBus.getDefault().post(new PraiseEvent(isPraise, likedUid));
|
||||
}
|
||||
@@ -94,10 +97,11 @@ public class PraiseModel extends BaseModel implements IPraiseModel {
|
||||
|
||||
/**
|
||||
* 收藏房间成功
|
||||
*
|
||||
* @param targetUid
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
public void setFollowRoomSuccessRoomTip(long targetUid){
|
||||
public void setFollowRoomSuccessRoomTip(long targetUid) {
|
||||
UserModel.get().getUserInfo(targetUid).subscribe(new Consumer<UserInfo>() {
|
||||
@Override
|
||||
public void accept(UserInfo userInfo) throws Exception {
|
||||
@@ -148,7 +152,7 @@ public class PraiseModel extends BaseModel implements IPraiseModel {
|
||||
public SingleSource<String> apply(ServiceResult<String> stringServiceResult) throws Exception {
|
||||
if (stringServiceResult.isSuccess()) {
|
||||
return Single.just("成功");
|
||||
}else {
|
||||
} else {
|
||||
return Single.error(new Throwable(stringServiceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -189,11 +193,17 @@ public class PraiseModel extends BaseModel implements IPraiseModel {
|
||||
@Override
|
||||
public void accept(Boolean aBoolean) throws Exception {
|
||||
EventBus.getDefault().post(new IsLikedEvent(aBoolean, isLikeUid));
|
||||
praiseCache.put(isLikeUid, aBoolean);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPraised(long isLikeUid) {
|
||||
return praiseCache.get(isLikeUid,false);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void sendAttentionRoomTipMsg(long targetUid) {
|
||||
//如果关注的人不是房主,不显示公屏提示。
|
||||
@@ -288,4 +298,8 @@ public class PraiseModel extends BaseModel implements IPraiseModel {
|
||||
@Query("isLikeUid") String isLikeUid);
|
||||
|
||||
}
|
||||
|
||||
private static final class Helper {
|
||||
public static final PraiseModel INSTANCE = new PraiseModel();
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package com.yizhuan.xchat_android_core.room.anotherroompk
|
||||
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet
|
||||
import io.reactivex.Single
|
||||
@@ -78,20 +79,6 @@ object SingleRoomPKModel {
|
||||
.compose(RxHelper.handleBeanData())
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨房pk/牌照房搜索
|
||||
*
|
||||
* @param roomUid roomUid
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
fun getRoomPKData(
|
||||
roomUid: Long
|
||||
): Single<RoomPkBean> {
|
||||
return api.getRoomPKData(roomUid)
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束跨房PK
|
||||
@@ -108,6 +95,17 @@ object SingleRoomPKModel {
|
||||
.compose(RxHelper.handleStringData())
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个播PK规则说明
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
fun getSingleRoomPkRule(): Single<String> {
|
||||
return api.getSingleRoomPkRule(AvRoomDataManager.get().roomUid)
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
.compose(RxHelper.handleStringData())
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
/**
|
||||
* 发起挑战
|
||||
@@ -152,17 +150,6 @@ object SingleRoomPKModel {
|
||||
@Query("pageSize") pageSize: Int
|
||||
): Single<ServiceResult<List<SimpleRoomInfo>>>
|
||||
|
||||
/**
|
||||
*
|
||||
* 获取PK数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/crossroompkround/getCrossPkData")
|
||||
fun getRoomPKData(
|
||||
@Field("roomUid") roomUid: Long?
|
||||
): Single<ServiceResult<RoomPkBean>>
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -176,7 +163,17 @@ object SingleRoomPKModel {
|
||||
@Field("roundId") roundId: String?
|
||||
): Single<ServiceResult<String>>
|
||||
|
||||
|
||||
/**
|
||||
*获取个播PK规则说明
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/crossroompkround/getSingleRoomPkRule")
|
||||
fun getSingleRoomPkRule(
|
||||
@Field("roomUid") roomUid: Long?
|
||||
): Single<ServiceResult<String>>
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user