隐身榜单的更改

This commit is contained in:
18401019693 2022-09-19 16:22:57 +08:00
parent 0de802bf3c
commit f531fd4d0e
8 changed files with 81 additions and 33 deletions

View File

@ -1,7 +1,9 @@
package com.yunbao.common.http.live;
import android.content.Context;
import android.text.TextUtils;
import com.yunbao.common.R;
import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.LiveInfoModel;
@ -199,8 +201,13 @@ public class LiveNetManager {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null)
callback.onSuccess(listResponseModel.getData().getInfo());
if (callback != null) {
if (TextUtils.equals(String.valueOf(listResponseModel.getData().getCode()), "0")) {
callback.onSuccess(listResponseModel.getData().getInfo());
} else {
callback.onError(mContext.getString(R.string.try_again_later));
}
}
}, throwable -> {
if (callback != null)
callback.onError(throwable.getMessage());

View File

@ -906,5 +906,6 @@
<string name="tell_the_world">昭告天下!</string>
<string name="better_emperor_hint">昭告天下! %s 向所有人推薦了主播 %s , 一眼萬年情之所鐘!</string>
<string name="emperor_hint">昭告天下! %s 向所有人推薦了主播 %s , 灼灼風華一瞥驚鴻!</string>
<string name="try_again_later">數據加載失敗,請稍後再試</string>
</resources>

View File

@ -10,9 +10,9 @@ ext {
manifestPlaceholders = [
//
serverHost : "https://napi.yaoulive.com",
// serverHost : "https://napi.yaoulive.com",
//
// serverHost : "https://ceshi.yaoulive.com",
serverHost : "https://ceshi.yaoulive.com",
//
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -17,16 +17,19 @@ import androidx.fragment.app.DialogFragment;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.NobleRankHideUserListModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.event.CoinChangeEvent;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.KeyBoardHeightChangeListener;
import com.yunbao.common.utils.KeyBoardHeightUtil2;
import com.yunbao.common.utils.L;
@ -87,6 +90,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@ -137,7 +141,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
private LiveChatRoomDialogFragment mLiveChatRoomDialogFragment;//私信聊天窗口
protected LiveGuardInfo mLiveGuardInfo;
private HashSet<DialogFragment> mDialogFragmentSet;
// public static boolean isRy = true;
// public static boolean isRy = true;
private List<String> outRankHide = new ArrayList<>();
private boolean outRankHideFirst = true;
@Override
protected void main() {
@ -1230,16 +1236,48 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
* 打开观看列表弹窗
*/
public void openUserMoreListWindow(int i, boolean isOnly) {
LiveUserMoreDialogFragment fragment = new LiveUserMoreDialogFragment();
fragment.setLiveGuardInfo(mLiveGuardInfo);
Bundle bundle = new Bundle();
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.STREAM, mStream);
bundle.putString("By", i + "");
bundle.putBoolean("only", isOnly);
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");
LiveUserMoreDialogFragment.activity = this;
if (outRankHideFirst) {
//获取隐身的用户的ID
LiveNetManager.get(mContext)
.getNobleRankHideUserList(new com.yunbao.common.http.base.HttpCallback<NobleRankHideUserListModel>() {
@Override
public void onSuccess(NobleRankHideUserListModel data) {
outRankHide = data.getOutRankHide();
LiveUserMoreDialogFragment fragment = new LiveUserMoreDialogFragment();
fragment.setLiveGuardInfo(mLiveGuardInfo);
Bundle bundle = new Bundle();
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.STREAM, mStream);
bundle.putString("By", i + "");
bundle.putBoolean("only", isOnly);
bundle.putString("outRankHide", GsonUtils.toJson(outRankHide));
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");
LiveUserMoreDialogFragment.activity = (LiveActivity) mContext;
outRankHideFirst = false;
}
@Override
public void onError(String error) {
Log.e("LiveUserMoreDialog", error);
}
});
} else {
LiveUserMoreDialogFragment fragment = new LiveUserMoreDialogFragment();
fragment.setLiveGuardInfo(mLiveGuardInfo);
Bundle bundle = new Bundle();
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.STREAM, mStream);
bundle.putString("By", i + "");
bundle.putBoolean("only", isOnly);
bundle.putString("outRankHide", GsonUtils.toJson(outRankHide));
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");
LiveUserMoreDialogFragment.activity = this;
}
}
/**

View File

@ -246,9 +246,11 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
if (bean.isHide() && (type.equals("5") || type.equals("4"))) {
mName.setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, mAvatar);
itemView.findViewById(R.id.state).setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
mName.setText(bean.getUserNiceName());
itemView.findViewById(R.id.state).setVisibility(View.VISIBLE);
}
if (bean.getDress() != null && bean.getDress().getAvatar_frame() != null) {
gift_svga.setVisibility(View.VISIBLE);

View File

@ -20,17 +20,17 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
import com.google.gson.reflect.TypeToken;
import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.LiveUserRankBean;
import com.yunbao.common.bean.NobleRankHideUserListModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.UserRankModel;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.API;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
@ -111,6 +111,12 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
mLiveUid = bundle.getString(Constants.LIVE_UID);
stream = bundle.getString(Constants.STREAM);
isOnly = bundle.getBoolean("only", false);
String outRankHideString = bundle.getString("outRankHide");
outRankHide = GsonUtils.fromJson(outRankHideString, new TypeToken<List<String>>(){}.getType());
if (userMoreInfoAdapter != null) {
userMoreInfoAdapter.setHide(outRankHide);
}
title = mRootView.findViewById(R.id.title);
tabs = mRootView.findViewById(R.id.tabs);
audience_btn = mRootView.findViewById(R.id.audience_btn);
@ -312,23 +318,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
tabs.setVisibility(View.GONE);
title.setVisibility(View.GONE);
}
//获取隐身的用户的ID
LiveNetManager.get(mContext)
.getNobleRankHideUserList(new com.yunbao.common.http.base.HttpCallback<NobleRankHideUserListModel>() {
@Override
public void onSuccess(NobleRankHideUserListModel data) {
outRankHide = data.getOutRankHide();
if (userMoreInfoAdapter != null) {
userMoreInfoAdapter.setHide(outRankHide);
}
}
@Override
public void onError(String error) {
Log.e("LiveUserMoreDialog", error);
}
});
}
@Override

View File

@ -84,6 +84,7 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="20dp"
android:orientation="vertical">
@ -111,6 +112,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"

View File

@ -308,9 +308,11 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
if (bean.isHide()) {
mName1.setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, mAvatar1);
mSex1.setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatarThumb(), mAvatar1);
mName1.setText(bean.getUserNiceName());
mSex1.setVisibility(View.VISIBLE);
}
mVotes1.setText(bean.getTotalCoinFormat());
@ -381,9 +383,11 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
if (bean.isHide()) {
mName2.setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, mAvatar2);
mSex2.setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatarThumb(), mAvatar2);
mName2.setText(bean.getUserNiceName());
mSex2.setVisibility(View.VISIBLE);
}
mVotes2.setText(bean.getTotalCoinFormat() + " ");
mSex2.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
@ -454,9 +458,11 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
if (bean.isHide()) {
mName3.setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, mAvatar3);
mSex3.setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatarThumb(), mAvatar3);
mName3.setText(bean.getUserNiceName());
mSex3.setVisibility(View.VISIBLE);
}
mVotes3.setText(bean.getTotalCoinFormat() + " ");
mSex3.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
@ -552,9 +558,11 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
if (bean.isHide()) {
mName.setText(R.string.mystery_man);
ImgLoader.display(mContext, R.mipmap.hide, mAvatar);
mSex.setVisibility(View.GONE);
} else {
ImgLoader.display(mContext, bean.getAvatarThumb(), mAvatar);
mName.setText(bean.getUserNiceName());
mSex.setVisibility(View.VISIBLE);
}