6.5.4礼物冠名

This commit is contained in:
18401019693 2023-08-03 17:54:14 +08:00
parent 3f8d6ed4af
commit fa086dc5cb
16 changed files with 102 additions and 66 deletions

View File

@ -19,7 +19,7 @@ import com.yunbao.common.http.live.LiveNetManager;
* wei点亮礼物墙
*/
public class GiftWithoutWallFragment extends BaseFragment {
private String mStream, mLiveUid;
private String mStream, mLiveUid, toUid;
private RecyclerView withoutList;
private LinearLayout giftWallNoData;
private GiftWithoutWallAdapter withoutWallAdapter;
@ -34,6 +34,7 @@ public class GiftWithoutWallFragment extends BaseFragment {
protected void initVariables(Bundle bundle) {
mStream = bundle.getString("mStream");
mLiveUid = bundle.getString("mLiveUid");
toUid = bundle.getString("toUid");
}
@Override
@ -48,7 +49,7 @@ public class GiftWithoutWallFragment extends BaseFragment {
@Override
protected void loadData() {
LiveNetManager.get(getActivity()).
giftWithoutWall(mLiveUid, new HttpCallback<GiftAlreadyWallModel>() {
giftWithoutWall(mLiveUid, toUid, new HttpCallback<GiftAlreadyWallModel>() {
@Override
public void onSuccess(GiftAlreadyWallModel data) {
if (data.getGiftWall().size() > 0) {
@ -68,11 +69,12 @@ public class GiftWithoutWallFragment extends BaseFragment {
});
}
public static GiftWithoutWallFragment newInstance(String mStream, String mLiveUid) {
public static GiftWithoutWallFragment newInstance(String mStream, String mLiveUid, String toUid) {
GiftWithoutWallFragment liveGiftFragment = new GiftWithoutWallFragment();
Bundle bundle = new Bundle();
bundle.putString("mStream", mStream);
bundle.putString("mLiveUid", mLiveUid);
bundle.putString("toUid", toUid);
liveGiftFragment.setArguments(bundle);
return liveGiftFragment;
}

View File

@ -50,7 +50,6 @@ import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.SlideInBannerModel;
import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.UserAreaBean;
import com.yunbao.common.bean.UserMedalListModel;
import com.yunbao.common.bean.VipModel;
import com.yunbao.common.bean.WishListGiftConfModel;
import com.yunbao.common.bean.WishListModel;
@ -841,7 +840,8 @@ public interface PDLiveApi {
*/
@GET("/api/public/?service=Gift.giftAlreadyWall")
Observable<ResponseModel<GiftAlreadyWallModel>> giftAlreadyWall(
@Query("liveuid") String liveUid
@Query("liveuid") String liveUid,
@Query("to_uid") String toUid
);
/**
@ -849,7 +849,8 @@ public interface PDLiveApi {
*/
@GET("/api/public/?service=Gift.giftWithoutWall")
Observable<ResponseModel<GiftAlreadyWallModel>> giftWithoutWall(
@Query("liveuid") String liveUid
@Query("liveuid") String liveUid,
@Query("to_uid") String toUid
);
/**
@ -876,6 +877,7 @@ public interface PDLiveApi {
*/
@GET("/api/public/?service=Gift.lastMonthGiftNaming")
Observable<ResponseModel<List<GiftWallModel>>> lastMonthGiftNaming();
/**
* 礼物墙上月冠名
*
@ -890,8 +892,10 @@ public interface PDLiveApi {
Observable<ResponseModel<List<GiftGuideModel>>> getGiftGuideHistory(
@Query("liveuid") String liveUid
);
@GET("/api/public/?service=Gift.getUserMedalList")
Observable<ResponseModel<MedalAchievementModel>> getUserMedalList();
Observable<ResponseModel<MedalAchievementModel>> getUserMedalList(@Query("to_uid") String toUid);
@GET("/api/public/?service=Gift.getLiveMedalList")
Observable<ResponseModel<MedalAchievementModel>> getLiveMedalList();

View File

@ -1801,9 +1801,9 @@ public class LiveNetManager {
}).isDisposed();
}
public void giftAlreadyWall(String liveUid, HttpCallback<GiftAlreadyWallModel> callback) {
public void giftAlreadyWall(String liveUid, String toUid, HttpCallback<GiftAlreadyWallModel> callback) {
API.get().pdLiveApi(mContext)
.giftAlreadyWall(liveUid)
.giftAlreadyWall(liveUid, toUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<GiftAlreadyWallModel>>() {
@ -1823,9 +1823,9 @@ public class LiveNetManager {
}).isDisposed();
}
public void giftWithoutWall(String liveUid, HttpCallback<GiftAlreadyWallModel> callback) {
public void giftWithoutWall(String liveUid, String toUid, HttpCallback<GiftAlreadyWallModel> callback) {
API.get().pdLiveApi(mContext)
.giftWithoutWall(liveUid)
.giftWithoutWall(liveUid, toUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<GiftAlreadyWallModel>>() {
@ -1955,9 +1955,9 @@ public class LiveNetManager {
}).isDisposed();
}
public void getUserMedalList(HttpCallback<MedalAchievementModel> callback) {
public void getUserMedalList(String toUid, HttpCallback<MedalAchievementModel> callback) {
API.get().pdLiveApi(mContext)
.getUserMedalList()
.getUserMedalList(toUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<MedalAchievementModel>>() {

View File

@ -550,7 +550,7 @@ public class JavascriptInterfaceUtils {
}
@JavascriptInterface
public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl) {
public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl,String toUid) {
RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0);
}
}

View File

@ -82,6 +82,7 @@
android:background="@drawable/background_skip_button"
android:gravity="center"
android:text="@string/instant_light"
android:visibility="gone"
android:textColor="#F16D00"
android:textSize="14sp" />
</LinearLayout>

View File

@ -20,17 +20,13 @@ import com.yunbao.common.event.LiveGiftDialogEvent;
import com.yunbao.common.fragment.AllServiceChampionFragment;
import com.yunbao.common.fragment.GiftWithoutWallFragment;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.dialog.CodexDialog;
import com.yunbao.live.dialog.GiftWallItemPopup;
import com.yunbao.live.dialog.RegularIntroducePopup;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.dialog.MedalAchievementPopup;
import com.yunbao.live.views.GiftAlreadyWallFragment;
import org.greenrobot.eventbus.Subscribe;
@ -38,11 +34,12 @@ import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
@Route(path = RouteUtil.PATH_GIFT_WALL)
public class GiftWallActivity extends AbsActivity {
private LinearLayout layoutLitIcon, layoutUnlitIcon, layoutAllServiceChampion;
private TextView textLitIcon, textUnlitIcon, textAllServiceChampion, anchorName;
private View viewAllServiceChampion, viewUnlitIcon, viewLitIcon, attention;
private View viewAllServiceChampion, viewUnlitIcon, viewLitIcon;
private RoundedImageView avatar;
private List<TextView> tabText = new ArrayList<>();
private List<View> tabView = new ArrayList<>();
@ -79,7 +76,6 @@ public class GiftWallActivity extends AbsActivity {
viewUnlitIcon = findViewById(R.id.view_unlit_icon);
viewLitIcon = findViewById(R.id.view_lit_icon);
avatar = findViewById(R.id.avatar);
attention = findViewById(R.id.attention);
anchorName = findViewById(R.id.anchor_name);
tabText.add(textLitIcon);
tabText.add(textUnlitIcon);
@ -91,7 +87,7 @@ public class GiftWallActivity extends AbsActivity {
ViewClicksAntiShake.clicksAntiShake(layoutLitIcon, () -> {
selectTab(textLitIcon, viewLitIcon);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid));
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, mLiveUid));
transaction.commit();
});
ViewClicksAntiShake.clicksAntiShake(layoutUnlitIcon, new ViewClicksAntiShake.ViewClicksCallBack() {
@ -99,7 +95,7 @@ public class GiftWallActivity extends AbsActivity {
public void onViewClicks() {
selectTab(textUnlitIcon, viewUnlitIcon);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.context_layout_gift, GiftWithoutWallFragment.newInstance(mStream, mLiveUid));
transaction.replace(R.id.context_layout_gift, GiftWithoutWallFragment.newInstance(mStream, mLiveUid, mLiveUid));
transaction.commit();
}
@ -113,23 +109,7 @@ public class GiftWallActivity extends AbsActivity {
transaction.commit();
}
});
ViewClicksAntiShake.clicksAntiShake(attention, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
CommonHttpUtil.setAttention(mLiveUid, new CommonCallback<Integer>() {
@Override
public void callback(Integer isAttention) {
if (isAttention == 1) {
LiveActivity.sendSystemMessage(IMLoginManager.get(GiftWallActivity.this).getUserInfo().getUserNicename()
+ getString(R.string.live_follow_anchor));
attention.setVisibility(View.GONE);
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.IS_ATTENTION).setLiveType(isAttention));
}
}
});
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.codex_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
@ -140,6 +120,27 @@ public class GiftWallActivity extends AbsActivity {
.show();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.medal_achievement), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new XPopup.Builder(GiftWallActivity.this)
.enableDrag(false)
.asCustom(new MedalAchievementPopup(GiftWallActivity.this, false, mLiveUid))
.show();
}
});
ViewClicksAntiShake.clicksAntiShake(avatar, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
forwardHomePage();
}
});
ViewClicksAntiShake.clicksAntiShake(anchorName, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
forwardHomePage();
}
});
}
private void initDate() {
@ -154,11 +155,10 @@ public class GiftWallActivity extends AbsActivity {
isAttention = intent.getIntExtra("isAttention", 0);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid));
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, mLiveUid));
transaction.commit();
ImgLoader.display(GiftWallActivity.this, mAvatarUrl, avatar);
anchorName.setText(mAnchorName);
attention.setVisibility(isAttention == 0 ? View.VISIBLE : View.GONE);
}
private void selectTab(TextView textView, View tab) {
@ -173,7 +173,10 @@ public class GiftWallActivity extends AbsActivity {
view.setVisibility(view == tab ? View.VISIBLE : View.GONE);
}
}
private void forwardHomePage() {
finish();
RouteUtil.forwardUserHome(mContext, mLiveUid, false, mLiveUid, 0);
}
/**
* 关于点击礼物分类的通知
*/
@ -183,6 +186,7 @@ public class GiftWallActivity extends AbsActivity {
.asCustom(new GiftWallItemPopup(this, event.getGiftWallModel(), event.isUnlit(), mLiveUid, mStream))
.show();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) {
onBackPressed();

View File

@ -1440,7 +1440,7 @@ public class LiveAudienceActivity extends LiveActivity {
break;
case GIFT_WALL:
if (manager != null) {
manager.showGiftWall();
manager.showGiftWall(event.getUid());
}
break;

View File

@ -296,7 +296,7 @@ public class ZhuangBanActivity extends AbsActivity {
Intent intent = new Intent(context, ZhuangBanActivity.class);
Log.i("tag", url);
intent.putExtra(Constants.URL, url);
if (url.contains("Noble/index.html")) {
if (url.contains("Noble/index.html")||url.contains("RongYuQiang")) {
intent.putExtra("title", "");
}
context.startActivity(intent);

View File

@ -47,7 +47,7 @@ public class GiftWallDialog extends AbsDialogFragment {
private RoundedImageView avatar;
private List<TextView> tabText = new ArrayList<>();
private List<View> tabView = new ArrayList<>();
private String mStream, mAnchorName, mLiveUid, mAvatarUrl;
private String mStream, mAnchorName, mLiveUid, mAvatarUrl, toUid;
private int isAttention = 0;//是否关注 0=没关注,
private boolean isLive;//是否正在直播
@ -83,7 +83,7 @@ public class GiftWallDialog extends AbsDialogFragment {
ViewClicksAntiShake.clicksAntiShake(layoutLitIcon, () -> {
selectTab(textLitIcon, viewLitIcon);
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid));
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid));
transaction.commit();
});
ViewClicksAntiShake.clicksAntiShake(layoutUnlitIcon, new ViewClicksAntiShake.ViewClicksCallBack() {
@ -91,7 +91,7 @@ public class GiftWallDialog extends AbsDialogFragment {
public void onViewClicks() {
selectTab(textUnlitIcon, viewUnlitIcon);
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.replace(R.id.context_layout_gift, GiftWithoutWallFragment.newInstance(mStream, mLiveUid));
transaction.replace(R.id.context_layout_gift, GiftWithoutWallFragment.newInstance(mStream, mLiveUid, toUid));
transaction.commit();
}
@ -145,7 +145,7 @@ public class GiftWallDialog extends AbsDialogFragment {
public void onViewClicks() {
new XPopup.Builder(getContext())
.enableDrag(false)
.asCustom(new MedalAchievementPopup(getContext(), isLive))
.asCustom(new MedalAchievementPopup(getContext(), isLive, toUid))
.show();
}
});
@ -160,10 +160,11 @@ public class GiftWallDialog extends AbsDialogFragment {
mStream = bundle.getString(Constants.STREAM);
mAnchorName = bundle.getString("mAnchorName");
mAvatarUrl = bundle.getString("mAvatarUrl");
toUid = bundle.getString("toUid");
isAttention = bundle.getInt("isAttention");
isLive = bundle.getBoolean("isLive");
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid));
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid));
transaction.commit();
ImgLoader.display(getContext(), mAvatarUrl, avatar);
anchorName.setText(mAnchorName);

View File

@ -272,7 +272,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
@Override
public void onViewClicks() {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL));
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL).setUid(mToUid));
dismiss();
}
});

View File

@ -8,22 +8,29 @@ import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.core.BottomPopupView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.adapter.MedalAchievementAdapter;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.MedalAchievementModel;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.activity.ZhuangBanActivity;
public class MedalAchievementPopup extends BottomPopupView {
private boolean isLive;
private String toUid;
private TextView achievementText;
private RecyclerView achievementList;
private MedalAchievementAdapter medalAchievementAdapter;
public MedalAchievementPopup(@NonNull Context context, boolean isLive) {
public MedalAchievementPopup(@NonNull Context context, boolean isLive, String toUid) {
super(context);
this.isLive = isLive;
this.toUid = toUid;
}
// 返回自定义弹窗的布局
@ -61,7 +68,7 @@ public class MedalAchievementPopup extends BottomPopupView {
});
} else {
LiveNetManager.get(getContext())
.getUserMedalList(new HttpCallback<MedalAchievementModel>() {
.getUserMedalList(toUid, new HttpCallback<MedalAchievementModel>() {
@Override
public void onSuccess(MedalAchievementModel data) {
StringBuffer stringBuffer = new StringBuffer();
@ -90,5 +97,21 @@ public class MedalAchievementPopup extends BottomPopupView {
}
medalAchievementAdapter = new MedalAchievementAdapter();
achievementList.setAdapter(medalAchievementAdapter);
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.wall_honor), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
StringBuffer htmlUrl = new StringBuffer();
IMLoginModel userInfo = IMLoginManager.get(getContext()).getUserInfo();
htmlUrl.append(CommonAppConfig.HOST)
.append("/h5/shequ/index.html#/h5/shequ/RongYuQiang?")
.append("touid=")
.append(toUid)
.append("&token=")
.append(userInfo.getToken())
.append("&uid=")
.append(userInfo.getId());
ZhuangBanActivity.forward(getContext(), htmlUrl.toString(), false);
}
});
}
}

View File

@ -25,7 +25,7 @@ import com.yunbao.common.event.LiveGiftDialogEvent;
* 已点亮礼物墙
*/
public class GiftAlreadyWallFragment extends BaseFragment {
private String mStream, mLiveUid;
private String mStream, mLiveUid,toUid;
private LinearLayout giftWallNoData, giftWallData;
private RecyclerView alreadyList;
private GiftAlreadyWallAdapter alreadyWallAdapter;
@ -41,6 +41,7 @@ public class GiftAlreadyWallFragment extends BaseFragment {
protected void initVariables(Bundle bundle) {
mStream = bundle.getString("mStream");
mLiveUid = bundle.getString("mLiveUid");
toUid = bundle.getString("toUid");
}
@Override
@ -68,7 +69,7 @@ public class GiftAlreadyWallFragment extends BaseFragment {
@Override
protected void loadData() {
LiveNetManager.get(getActivity()).
giftAlreadyWall(mLiveUid, new HttpCallback<GiftAlreadyWallModel>() {
giftAlreadyWall(mLiveUid,toUid, new HttpCallback<GiftAlreadyWallModel>() {
@Override
public void onSuccess(GiftAlreadyWallModel data) {
if (data.getGiftWall().size() > 0) {
@ -90,11 +91,13 @@ public class GiftAlreadyWallFragment extends BaseFragment {
});
}
public static GiftAlreadyWallFragment newInstance(String mStream, String mLiveUid) {
public static GiftAlreadyWallFragment newInstance(String mStream, String mLiveUid,String toUid) {
GiftAlreadyWallFragment liveGiftFragment = new GiftAlreadyWallFragment();
Bundle bundle = new Bundle();
bundle.putString("mStream", mStream);
bundle.putString("mLiveUid", mLiveUid);
bundle.putString("mLiveUid", mLiveUid);
bundle.putString("toUid", toUid);
liveGiftFragment.setArguments(bundle);
return liveGiftFragment;
}

View File

@ -2658,13 +2658,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
}
public void showGiftWall() {
public void showGiftWall(String toUid) {
GiftWallDialog giftWallDialog = new GiftWallDialog();
Bundle bundle = new Bundle();
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.LIVE_STREAM, mStream);
bundle.putString("mAnchorName", mAnchorName);
bundle.putString("mAvatarUrl", mAvatarUrl);
bundle.putString("toUid", toUid);
bundle.putInt("isAttention", isAttention);
bundle.putBoolean("isLive", mContext instanceof LiveRyAnchorActivity);
giftWallDialog.setArguments(bundle);
@ -2865,7 +2866,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override
public void onViewClicks() {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL));
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL).setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId())));
}
});
}

View File

@ -1910,10 +1910,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.setAttention(attention);
}
public void showGiftWall() {
public void showGiftWall(String toUid) {
if (mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.showGiftWall();
mLiveRoomViewHolder.showGiftWall(toUid);
}
}

View File

@ -39,12 +39,7 @@
android:textColor="@color/white"
android:textSize="14sp" />
<ImageView
android:id="@+id/attention"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginStart="4dp"
android:src="@mipmap/icon_following_anchor" />
</LinearLayout>
<LinearLayout
@ -66,6 +61,7 @@
android:textSize="16sp" />
<TextView
android:id="@+id/medal_achievement"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"

View File

@ -47,6 +47,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/wall_honor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"