6.5.4礼物冠名
This commit is contained in:
@@ -17,6 +17,7 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.event.GiftWallItemEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.fragment.AllServiceChampionFragment;
|
||||
import com.yunbao.common.fragment.GiftWithoutWallFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -28,7 +29,6 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.live.views.GiftAlreadyWallFragment;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -49,6 +49,7 @@ public class GiftWallDialog extends AbsDialogFragment {
|
||||
private List<View> tabView = new ArrayList<>();
|
||||
private String mStream, mAnchorName, mLiveUid, mAvatarUrl;
|
||||
private int isAttention = 0;//是否关注 0=没关注,
|
||||
private boolean isLive;//是否正在直播
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
@@ -135,7 +136,16 @@ public class GiftWallDialog extends AbsDialogFragment {
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new CodexDialog(getContext(), mStream, mLiveUid,false))
|
||||
.asCustom(new CodexDialog(getContext(), mStream, mLiveUid, false))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.medal_achievement), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new MedalAchievementPopup(getContext(), isLive))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
@@ -151,7 +161,7 @@ public class GiftWallDialog extends AbsDialogFragment {
|
||||
mAnchorName = bundle.getString("mAnchorName");
|
||||
mAvatarUrl = bundle.getString("mAvatarUrl");
|
||||
isAttention = bundle.getInt("isAttention");
|
||||
|
||||
isLive = bundle.getBoolean("isLive");
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid));
|
||||
transaction.commit();
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.adapter.MedalAchievementAdapter;
|
||||
import com.yunbao.common.bean.MedalAchievementModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
public class MedalAchievementPopup extends BottomPopupView {
|
||||
private boolean isLive;
|
||||
private TextView achievementText;
|
||||
private RecyclerView achievementList;
|
||||
private MedalAchievementAdapter medalAchievementAdapter;
|
||||
|
||||
public MedalAchievementPopup(@NonNull Context context, boolean isLive) {
|
||||
super(context);
|
||||
this.isLive = isLive;
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_medal_achievement;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
if (isLive) {
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveMedalList(new HttpCallback<MedalAchievementModel>() {
|
||||
@Override
|
||||
public void onSuccess(MedalAchievementModel data) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(data.getMedalLightNumber())
|
||||
.append("/")
|
||||
.append(data.getMedalTotalNumber());
|
||||
achievementText.setText(stringBuffer.toString());
|
||||
medalAchievementAdapter.addAllData(data.getMedalData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
LiveNetManager.get(getContext())
|
||||
.getUserMedalList(new HttpCallback<MedalAchievementModel>() {
|
||||
@Override
|
||||
public void onSuccess(MedalAchievementModel data) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(data.getMedalLightNumber())
|
||||
.append("/")
|
||||
.append(data.getMedalTotalNumber());
|
||||
achievementText.setText(stringBuffer.toString());
|
||||
medalAchievementAdapter.addAllData(data.getMedalData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
achievementText = findViewById(R.id.achievement_text);
|
||||
achievementList = findViewById(R.id.achievement_list);
|
||||
if (isLive) {
|
||||
achievementList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false));
|
||||
} else {
|
||||
achievementList.setLayoutManager(new GridLayoutManager(getContext(), 4, GridLayoutManager.VERTICAL, false));
|
||||
}
|
||||
medalAchievementAdapter = new MedalAchievementAdapter();
|
||||
achievementList.setAdapter(medalAchievementAdapter);
|
||||
}
|
||||
}
|
||||
@@ -2666,6 +2666,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
bundle.putString("mAnchorName", mAnchorName);
|
||||
bundle.putString("mAvatarUrl", mAvatarUrl);
|
||||
bundle.putInt("isAttention", isAttention);
|
||||
bundle.putBoolean("isLive", mContext instanceof LiveRyAnchorActivity);
|
||||
giftWallDialog.setArguments(bundle);
|
||||
giftWallDialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "GiftWallDialog");
|
||||
// RouteUtil.forwardGiftWallActivity(mStream,mAnchorName,mLiveUid,mAvatarUrl,isAttention);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:centerColor="#FF9615"
|
||||
android:endColor="#EB7314"
|
||||
android:startColor="#FFBD14" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -58,6 +58,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/medal_achievement"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
|
||||
80
live/src/main/res/layout/dialog_medal_achievement.xml
Normal file
80
live/src/main/res/layout/dialog_medal_achievement.xml
Normal file
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="524dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/background_dialog_live_codex"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close_btn"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_margin="13dp"
|
||||
android:src="@mipmap/icon_regular_black" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/background_medal_achievement">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
|
||||
android:id="@+id/achievement_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="9dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/wall_honor"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:src="@mipmap/icon_right" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/achievement_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="14dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp" />
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user