From fa086dc5cb114ce3577032c840f4374e387feb3c Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 3 Aug 2023 17:54:14 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/GiftWithoutWallFragment.java | 8 ++- .../com/yunbao/common/http/PDLiveApi.java | 12 ++-- .../common/http/live/LiveNetManager.java | 12 ++-- .../utils/JavascriptInterfaceUtils.java | 2 +- .../res/layout/fragment_gift_already_wall.xml | 1 + .../live/activity/GiftWallActivity.java | 62 ++++++++++--------- .../live/activity/LiveAudienceActivity.java | 2 +- .../live/activity/ZhuangBanActivity.java | 2 +- .../yunbao/live/dialog/GiftWallDialog.java | 11 ++-- .../live/dialog/LiveUserDialogFragment.java | 2 +- .../live/dialog/MedalAchievementPopup.java | 27 +++++++- .../live/views/GiftAlreadyWallFragment.java | 9 ++- .../yunbao/live/views/LiveRoomViewHolder.java | 5 +- .../live/views/PortraitLiveManager.java | 4 +- .../res/layout/activity_live_gift_wall.xml | 8 +-- .../res/layout/dialog_medal_achievement.xml | 1 + 16 files changed, 102 insertions(+), 66 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/fragment/GiftWithoutWallFragment.java b/common/src/main/java/com/yunbao/common/fragment/GiftWithoutWallFragment.java index 25bb35261..f86e1aebf 100644 --- a/common/src/main/java/com/yunbao/common/fragment/GiftWithoutWallFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/GiftWithoutWallFragment.java @@ -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() { + giftWithoutWall(mLiveUid, toUid, new HttpCallback() { @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; } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 12b2a56cf..1155d847c 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -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> 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> 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>> lastMonthGiftNaming(); + /** * 礼物墙上月冠名 * @@ -890,8 +892,10 @@ public interface PDLiveApi { Observable>> getGiftGuideHistory( @Query("liveuid") String liveUid ); + @GET("/api/public/?service=Gift.getUserMedalList") - Observable> getUserMedalList(); + Observable> getUserMedalList(@Query("to_uid") String toUid); + @GET("/api/public/?service=Gift.getLiveMedalList") Observable> getLiveMedalList(); diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index d51ef37be..07c530e3b 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -1801,9 +1801,9 @@ public class LiveNetManager { }).isDisposed(); } - public void giftAlreadyWall(String liveUid, HttpCallback callback) { + public void giftAlreadyWall(String liveUid, String toUid, HttpCallback callback) { API.get().pdLiveApi(mContext) - .giftAlreadyWall(liveUid) + .giftAlreadyWall(liveUid, toUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer>() { @@ -1823,9 +1823,9 @@ public class LiveNetManager { }).isDisposed(); } - public void giftWithoutWall(String liveUid, HttpCallback callback) { + public void giftWithoutWall(String liveUid, String toUid, HttpCallback callback) { API.get().pdLiveApi(mContext) - .giftWithoutWall(liveUid) + .giftWithoutWall(liveUid, toUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer>() { @@ -1955,9 +1955,9 @@ public class LiveNetManager { }).isDisposed(); } - public void getUserMedalList(HttpCallback callback) { + public void getUserMedalList(String toUid, HttpCallback callback) { API.get().pdLiveApi(mContext) - .getUserMedalList() + .getUserMedalList(toUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer>() { diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 41f967ed3..271b7c43a 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -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); } } diff --git a/common/src/main/res/layout/fragment_gift_already_wall.xml b/common/src/main/res/layout/fragment_gift_already_wall.xml index 846998445..40823ee2c 100644 --- a/common/src/main/res/layout/fragment_gift_already_wall.xml +++ b/common/src/main/res/layout/fragment_gift_already_wall.xml @@ -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" /> diff --git a/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java b/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java index 97cc90f08..1844987cd 100644 --- a/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java @@ -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 tabText = new ArrayList<>(); private List 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() { - @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(); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 7b9a56dbc..e1e3637ee 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1440,7 +1440,7 @@ public class LiveAudienceActivity extends LiveActivity { break; case GIFT_WALL: if (manager != null) { - manager.showGiftWall(); + manager.showGiftWall(event.getUid()); } break; diff --git a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java index af28b0cf5..b04de9858 100644 --- a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java @@ -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); diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java index 5703cab6e..5f0db059c 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java @@ -47,7 +47,7 @@ public class GiftWallDialog extends AbsDialogFragment { private RoundedImageView avatar; private List tabText = new ArrayList<>(); private List 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); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java index 09233e892..73849cca0 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java @@ -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(); } }); diff --git a/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java b/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java index e14abf8a3..3f04c10a8 100644 --- a/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java @@ -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() { + .getUserMedalList(toUid, new HttpCallback() { @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); + } + }); } } diff --git a/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java b/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java index 51bce1418..ed577b967 100644 --- a/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java +++ b/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java @@ -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() { + giftAlreadyWall(mLiveUid,toUid, new HttpCallback() { @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; } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 5dfa58d56..2ab379b72 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -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()))); } }); } diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index ef87fca35..abfc9d7fb 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -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); } } diff --git a/live/src/main/res/layout/activity_live_gift_wall.xml b/live/src/main/res/layout/activity_live_gift_wall.xml index f9e5835f4..e1dce4ddf 100644 --- a/live/src/main/res/layout/activity_live_gift_wall.xml +++ b/live/src/main/res/layout/activity_live_gift_wall.xml @@ -39,12 +39,7 @@ android:textColor="@color/white" android:textSize="14sp" /> - +