功能基本调试完成
This commit is contained in:
parent
cdf9e75ebd
commit
ea558cb22f
@ -13,7 +13,7 @@
|
|||||||
android:id="@+id/giftBg"
|
android:id="@+id/giftBg"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="-14dp"
|
android:layout_marginTop="-16dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@ -146,19 +146,51 @@
|
|||||||
tools:text="28000000" />
|
tools:text="28000000" />
|
||||||
|
|
||||||
<!--礼物列表 -->
|
<!--礼物列表 -->
|
||||||
|
|
||||||
<!--礼物栏的Title -->
|
|
||||||
<!--顶部Warp -->
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/giftRecyclerView"
|
android:id="@+id/giftRecyclerView"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="234dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/giftSendBgV"
|
app:layout_constraintBottom_toTopOf="@+id/giftSendBgV"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="1.0"
|
app:layout_constraintDimensionRatio="1.56"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/emptyImg"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/giftRecyclerView"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/giftRecyclerView"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/giftRecyclerView"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/giftRecyclerView"
|
||||||
|
android:layout_width="112dp"
|
||||||
|
android:layout_height="90dp"
|
||||||
|
android:src="@mipmap/icon_empty_parcel" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/emptyTv"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/giftRecyclerView"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/giftRecyclerView"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/emptyImg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:text="@string/nothing_in_the_package_yet"
|
||||||
|
android:textColor="#717375"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Group
|
||||||
|
android:id="@+id/emptyGroup"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:constraint_referenced_ids="emptyImg,emptyTv"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<!--礼物列表无数据时候 -->
|
||||||
|
|
||||||
|
<!--顶部Warp -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/giftWrapTv"
|
android:id="@+id/giftWrapTv"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
@ -205,13 +237,23 @@
|
|||||||
tools:layout_height="0dp" />
|
tools:layout_height="0dp" />
|
||||||
|
|
||||||
<!--升级进度条 -->
|
<!--升级进度条 -->
|
||||||
|
<View
|
||||||
|
android:id="@+id/giftLevelClickV"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/week_progressbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/week_progressbar"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/lvTitleTv"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/lvTipsTv"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/lvTitleTv"
|
android:id="@+id/lvTitleTv"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="18dp"
|
android:layout_marginStart="18dp"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="11dp"
|
||||||
android:background="@drawable/bg_live_gift_lv"
|
android:background="@drawable/bg_live_gift_lv"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
@ -265,15 +307,7 @@
|
|||||||
app:layout_constraintWidth_percent="0.54"
|
app:layout_constraintWidth_percent="0.54"
|
||||||
tools:progress="10" />
|
tools:progress="10" />
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/giftLevelClickV"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/week_progressbar"
|
|
||||||
app:layout_constraintEnd_toEndOf="@+id/week_progressbar"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/lvTitleTv"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/lvTipsTv"
|
|
||||||
tools:visibility="gone" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Group
|
<androidx.constraintlayout.widget.Group
|
||||||
android:id="@+id/giftLevelGroup"
|
android:id="@+id/giftLevelGroup"
|
||||||
|
@ -39,6 +39,7 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
|||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.dialog.SendRendPacketPopup;
|
import com.yunbao.live.dialog.SendRendPacketPopup;
|
||||||
import com.yunbao.live.event.LiveGiftItemEvent;
|
import com.yunbao.live.event.LiveGiftItemEvent;
|
||||||
|
import com.yunbao.live.event.LiveParcelItemRefreshEvent;
|
||||||
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -271,4 +272,32 @@ public class FrameGiftNewAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void refreshWrapListAfterSend(LiveParcelItemRefreshEvent refreshEvent) {
|
||||||
|
LiveGiftBean liveGiftBean = refreshEvent.getLiveGiftModel();
|
||||||
|
int sendCount = refreshEvent.getSendCount();//赠送礼物数量
|
||||||
|
for (int i = 0; i < giftJson.size(); i++) {
|
||||||
|
if (giftJson.get(i).getId() == liveGiftBean.getId()) {
|
||||||
|
|
||||||
|
|
||||||
|
String giftNum = giftJson.get(i).getGiftNum();
|
||||||
|
int number = 0;
|
||||||
|
try {
|
||||||
|
number = Integer.parseInt(giftNum);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
number = 0;
|
||||||
|
}
|
||||||
|
if (number == 1) {
|
||||||
|
//如果礼物只剩一个,直接移除礼物
|
||||||
|
giftJson.remove(i);
|
||||||
|
} else {
|
||||||
|
//设置送礼后的礼物数量
|
||||||
|
giftJson.get(i).setGiftNum(String.valueOf(number - sendCount));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,17 @@ import android.text.TextUtils;
|
|||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.RadioButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
@ -67,6 +70,7 @@ import com.yunbao.common.utils.Bus;
|
|||||||
import com.yunbao.common.utils.DebugUtils;
|
import com.yunbao.common.utils.DebugUtils;
|
||||||
import com.yunbao.common.utils.DeviceUtils;
|
import com.yunbao.common.utils.DeviceUtils;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
|
import com.yunbao.common.utils.GiftCacheUtil;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.utils.NobleUtil;
|
import com.yunbao.common.utils.NobleUtil;
|
||||||
@ -81,6 +85,7 @@ import com.yunbao.live.activity.LiveActivity;
|
|||||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||||
import com.yunbao.live.adapter.FrameGiftNewAdapter;
|
import com.yunbao.live.adapter.FrameGiftNewAdapter;
|
||||||
import com.yunbao.live.adapter.GiftTitleAdapter;
|
import com.yunbao.live.adapter.GiftTitleAdapter;
|
||||||
|
import com.yunbao.live.adapter.LiveGiftFragmentPagerAdapter;
|
||||||
import com.yunbao.live.bean.CoinModel;
|
import com.yunbao.live.bean.CoinModel;
|
||||||
import com.yunbao.live.bean.GiftTopBean;
|
import com.yunbao.live.bean.GiftTopBean;
|
||||||
import com.yunbao.live.bean.LiveGuardInfo;
|
import com.yunbao.live.bean.LiveGuardInfo;
|
||||||
@ -90,6 +95,7 @@ import com.yunbao.live.event.LiveGiftItemEvent;
|
|||||||
import com.yunbao.live.event.LiveParcelItemRefreshEvent;
|
import com.yunbao.live.event.LiveParcelItemRefreshEvent;
|
||||||
import com.yunbao.live.views.LiveGiftFragment;
|
import com.yunbao.live.views.LiveGiftFragment;
|
||||||
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
@ -126,8 +132,8 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
private MarqueeTextView giftDescription;
|
private MarqueeTextView giftDescription;
|
||||||
private ImageView continuousClicksBg;
|
private ImageView continuousClicksBg;
|
||||||
private TextView lianText, liveGiftSendTv;
|
private TextView lianText, liveGiftSendTv;
|
||||||
private androidx.constraintlayout.widget.Group continuousClickGroup;
|
private androidx.constraintlayout.widget.Group continuousClickGroup,emptyGroup;
|
||||||
private ImageView operateImage,openVipArrowImg;
|
private ImageView operateImage, openVipArrowImg;
|
||||||
private View blindBox;
|
private View blindBox;
|
||||||
private ImageView giftSponsorBgImg;
|
private ImageView giftSponsorBgImg;
|
||||||
private ImageView giftItle;
|
private ImageView giftItle;
|
||||||
@ -147,10 +153,14 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
private SVGAImageView blindSvg;
|
private SVGAImageView blindSvg;
|
||||||
private ImageView iconMasking;
|
private ImageView iconMasking;
|
||||||
private SVGAImageView blindBoxOpen;
|
private SVGAImageView blindBoxOpen;
|
||||||
|
//包裹的礼物数据
|
||||||
|
private List<LiveGiftBean> mWrapGiftList;
|
||||||
//连送逻辑
|
//连送逻辑
|
||||||
private int mLianCountDownCount;//连送倒计时的数字
|
private int mLianCountDownCount;//连送倒计时的数字
|
||||||
private int blindBoxType;
|
private int blindBoxType;
|
||||||
private FrameGiftNewAdapter mFrameGiftNewAdapter;
|
private FrameGiftNewAdapter mFrameGiftNewAdapter;
|
||||||
|
|
||||||
|
|
||||||
// 返回自定义弹窗的布局
|
// 返回自定义弹窗的布局
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
@ -185,6 +195,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
private boolean isPk;
|
private boolean isPk;
|
||||||
private Handler sendGiftHandler = new Handler();
|
private Handler sendGiftHandler = new Handler();
|
||||||
|
|
||||||
private JSONArray liveGiftList;
|
private JSONArray liveGiftList;
|
||||||
private Runnable sendGiftRunnble = new Runnable() {
|
private Runnable sendGiftRunnble = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -277,6 +288,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
blindBoxOpen = findViewById(R.id.blind_box_open);
|
blindBoxOpen = findViewById(R.id.blind_box_open);
|
||||||
giftSendGroup = findViewById(R.id.giftSendGroup);
|
giftSendGroup = findViewById(R.id.giftSendGroup);
|
||||||
openVipArrowImg = findViewById(R.id.openVipArrowImg);
|
openVipArrowImg = findViewById(R.id.openVipArrowImg);
|
||||||
|
emptyGroup = findViewById(R.id.emptyGroup);
|
||||||
//赞助信息
|
//赞助信息
|
||||||
giftSponsorGroup.setVisibility(View.GONE);
|
giftSponsorGroup.setVisibility(View.GONE);
|
||||||
//设置礼物弹窗背景 这里不设置
|
//设置礼物弹窗背景 这里不设置
|
||||||
@ -285,7 +297,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
// ImgLoader.display(getContext(), R.mipmap.ic_gift_right_arrow, liveGiftImg);
|
// ImgLoader.display(getContext(), R.mipmap.ic_gift_right_arrow, liveGiftImg);
|
||||||
|
|
||||||
//设置礼物的信息
|
//设置礼物的信息
|
||||||
RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
|
RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
|
||||||
giftRecyclerView.setLayoutManager(layoutManager);
|
giftRecyclerView.setLayoutManager(layoutManager);
|
||||||
|
|
||||||
//礼物分类tab
|
//礼物分类tab
|
||||||
@ -302,10 +314,10 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
giftLevelGroup.setVisibility(View.VISIBLE);
|
giftLevelGroup.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
|
||||||
mRootView.setOnClickListener(new View.OnClickListener(){
|
mRootView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
giftBg.setOnClickListener(new View.OnClickListener() {
|
giftBg.setOnClickListener(new View.OnClickListener() {
|
||||||
@ -347,14 +359,23 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
giftWrapTv.setAlpha(1.0f);
|
giftWrapTv.setAlpha(1.0f);
|
||||||
giftWrapTv.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
|
giftWrapTv.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
|
||||||
giftWrapTv.setTextColor(ContextCompat.getColor(mContext, com.yunbao.live.R.color.feea36));
|
giftWrapTv.setTextColor(ContextCompat.getColor(mContext, com.yunbao.live.R.color.feea36));
|
||||||
|
isWrap = true;
|
||||||
|
giftSendGroup.setVisibility(View.INVISIBLE);
|
||||||
//TODO 切换到包裹取消更爱
|
//TODO 切换到包裹取消更爱
|
||||||
// transaction = getTransaction();
|
GiftCacheUtil.getInstance().addDownloadList(mWrapGiftList);
|
||||||
// contentFragment = LiveParcelFragment.newInstance(mStream, mLiveUid);
|
if (mWrapGiftList!=null && !mWrapGiftList.isEmpty()){
|
||||||
// transaction.replace(R.id.context_layout_gift, contentFragment);
|
mWrapGiftList.get(0).setChecked(true);
|
||||||
// transaction.commitAllowingStateLoss();
|
mFrameGiftNewAdapter = new FrameGiftNewAdapter(mWrapGiftList, mStream, mLiveUid, mWrapGiftList.get(0).getGift_id()+"");
|
||||||
// isWrap = true;
|
emptyGroup.setVisibility(View.GONE);
|
||||||
// findViewById(R.id.giftWrapRedPoint).setVisibility(View.GONE);
|
// mWrapGiftList.get(0).setChecked(true);
|
||||||
// hideLianBtn();
|
// liveGiftSendTv.setText(1+"");
|
||||||
|
// liveGiftModel= mWrapGiftList.get(0);
|
||||||
|
hideLianBtn();
|
||||||
|
}else {
|
||||||
|
emptyGroup.setVisibility(View.INVISIBLE);
|
||||||
|
Log.i("LiveGiftPopup2", "包裹为空");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -494,7 +515,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
.enableDrag(false)
|
.enableDrag(false)
|
||||||
.asCustom(new GiftNumberPopup(getContext()))
|
.asCustom(new GiftNumberPopup(getContext()))
|
||||||
.show();
|
.show();
|
||||||
ImgLoader.display(getContext(), R.mipmap.icon_arrow_down, liveGiftImg);
|
liveGiftImg.setImageResource( R.mipmap.ic_gift_top_arrow);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -583,6 +604,27 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
});
|
});
|
||||||
getBlindBoxInfo();
|
getBlindBoxInfo();
|
||||||
loadUserVip();
|
loadUserVip();
|
||||||
|
|
||||||
|
//获取包裹礼物列表
|
||||||
|
LiveHttpUtil.getWrapList(new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info.length > 0) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
String giftJson = obj.getString("giftlist");
|
||||||
|
mWrapGiftList = JSON.parseArray(giftJson, LiveGiftBean.class);
|
||||||
|
GiftCacheUtil.getInstance().addDownloadList(mWrapGiftList);
|
||||||
|
if (!GiftCacheUtil.getInstance().isDownloading()) {
|
||||||
|
GiftCacheUtil.getInstance().downloadAllGift();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1013,8 +1055,6 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//设置礼物类别数据
|
//设置礼物类别数据
|
||||||
private void setTitleData() {
|
private void setTitleData() {
|
||||||
List<GiftTopBean> name = new ArrayList<>();
|
List<GiftTopBean> name = new ArrayList<>();
|
||||||
@ -1037,7 +1077,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
giftTitleAdapter.addAllData(name);
|
giftTitleAdapter.addAllData(name);
|
||||||
if (!TextUtils.isEmpty(mWishGiftId) && liveGiftList.size() > 0) {
|
if (!TextUtils.isEmpty(mWishGiftId) && liveGiftList.size() > 0) {
|
||||||
Log.i("LiveGiftPopup2", "有礼物设置");
|
Log.i("LiveGiftPopup2", "有礼物设置");
|
||||||
int postion =-1;
|
int postion = -1;
|
||||||
for (int i = 0; i < liveGiftList.size(); i++) {
|
for (int i = 0; i < liveGiftList.size(); i++) {
|
||||||
JSONObject data = liveGiftList.getJSONObject(i);
|
JSONObject data = liveGiftList.getJSONObject(i);
|
||||||
String giftJson = data.getString("giftlist");
|
String giftJson = data.getString("giftlist");
|
||||||
@ -1046,7 +1086,8 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
LiveGiftBean model = liveGiftBeans.get(j);
|
LiveGiftBean model = liveGiftBeans.get(j);
|
||||||
if (TextUtils.equals(model.getId() + "", mWishGiftId)) {
|
if (TextUtils.equals(model.getId() + "", mWishGiftId)) {
|
||||||
model.setChecked(true);
|
model.setChecked(true);
|
||||||
postion= j;
|
postion = j;
|
||||||
|
emptyGroup.setVisibility(View.GONE);
|
||||||
mFrameGiftNewAdapter = new FrameGiftNewAdapter(liveGiftBeans, mStream, mLiveUid, mWishGiftId);
|
mFrameGiftNewAdapter = new FrameGiftNewAdapter(liveGiftBeans, mStream, mLiveUid, mWishGiftId);
|
||||||
giftRecyclerView.setAdapter(mFrameGiftNewAdapter);
|
giftRecyclerView.setAdapter(mFrameGiftNewAdapter);
|
||||||
giftTitleAdapter.setTitleIndex(i);
|
giftTitleAdapter.setTitleIndex(i);
|
||||||
@ -1054,22 +1095,16 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (postion>-1){
|
if (postion > -1) {
|
||||||
|
//滚动到选中的位置
|
||||||
final int p = postion;
|
final int p = postion;
|
||||||
giftRecyclerView.scrollToPosition(postion);
|
giftRecyclerView.scrollToPosition(postion);
|
||||||
// Log.i("LiveGiftPopup2", "进行位置滚动"+p);
|
|
||||||
// giftRecyclerView.postDelayed(new Runnable() {
|
|
||||||
// @Override
|
|
||||||
// public void run() {
|
|
||||||
// Log.i("LiveGiftPopup2", "进行位置滚动"+p);
|
|
||||||
// giftRecyclerView.scrollToPosition(p);
|
|
||||||
// }
|
|
||||||
// },200);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
JSONObject obj2 = liveGiftList.getJSONObject(0);
|
JSONObject obj2 = liveGiftList.getJSONObject(0);
|
||||||
String giftJson = obj2.getString("giftlist");
|
String giftJson = obj2.getString("giftlist");
|
||||||
List<LiveGiftBean> liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class);
|
List<LiveGiftBean> liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class);
|
||||||
|
emptyGroup.setVisibility(View.GONE);
|
||||||
mFrameGiftNewAdapter = new FrameGiftNewAdapter(liveGiftBeans, mStream, mLiveUid, mWishGiftId);
|
mFrameGiftNewAdapter = new FrameGiftNewAdapter(liveGiftBeans, mStream, mLiveUid, mWishGiftId);
|
||||||
giftRecyclerView.setAdapter(mFrameGiftNewAdapter);
|
giftRecyclerView.setAdapter(mFrameGiftNewAdapter);
|
||||||
}
|
}
|
||||||
@ -1077,6 +1112,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
|
|
||||||
|
|
||||||
public List<BlindBoxInfoModel> blindBoxInfoModels = new ArrayList<>();
|
public List<BlindBoxInfoModel> blindBoxInfoModels = new ArrayList<>();
|
||||||
|
|
||||||
private void getBlindBoxInfo() {
|
private void getBlindBoxInfo() {
|
||||||
LiveNetManager.get(mContext)
|
LiveNetManager.get(mContext)
|
||||||
.getBlindBoxInfo(new com.yunbao.common.http.base.HttpCallback<List<BlindBoxInfoModel>>() {
|
.getBlindBoxInfo(new com.yunbao.common.http.base.HttpCallback<List<BlindBoxInfoModel>>() {
|
||||||
@ -1131,18 +1167,23 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
giftWrapTv.setTextColor(ContextCompat.getColor(mContext, com.yunbao.live.R.color.white));
|
giftWrapTv.setTextColor(ContextCompat.getColor(mContext, com.yunbao.live.R.color.white));
|
||||||
|
|
||||||
liveGiftSend.setEnabled(false);
|
liveGiftSend.setEnabled(false);
|
||||||
giftSendGroup.setVisibility(View.INVISIBLE);
|
|
||||||
JSONObject obj2 = liveGiftList.getJSONObject(event.getmPosition());
|
JSONObject obj2 = liveGiftList.getJSONObject(event.getmPosition());
|
||||||
String giftJson = obj2.getString("giftlist");
|
String giftJson = obj2.getString("giftlist");
|
||||||
|
|
||||||
|
|
||||||
List<LiveGiftBean> liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class);
|
List<LiveGiftBean> liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class);
|
||||||
|
emptyGroup.setVisibility(View.GONE);
|
||||||
mFrameGiftNewAdapter = new FrameGiftNewAdapter(liveGiftBeans, mStream, mLiveUid, mWishGiftId);
|
mFrameGiftNewAdapter = new FrameGiftNewAdapter(liveGiftBeans, mStream, mLiveUid, mWishGiftId);
|
||||||
giftRecyclerView.setAdapter(mFrameGiftNewAdapter);
|
giftRecyclerView.setAdapter(mFrameGiftNewAdapter);
|
||||||
|
|
||||||
isWrap = false;
|
isWrap = false;
|
||||||
if (giftSendGroup.getVisibility() == View.INVISIBLE) {
|
|
||||||
|
if (continuousClickGroup.getVisibility() == View.INVISIBLE) {
|
||||||
hideLianBtn();
|
hideLianBtn();
|
||||||
}
|
}
|
||||||
|
giftSendGroup.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
mCount = DEFAULT_COUNT;
|
mCount = DEFAULT_COUNT;
|
||||||
liveGiftSendTv.setText(mCount);
|
liveGiftSendTv.setText(mCount);
|
||||||
giftDescription.setVisibility(View.GONE);
|
giftDescription.setVisibility(View.GONE);
|
||||||
@ -1152,15 +1193,22 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onGiftNumberEvent(GiftNumberEvent event) {
|
public void onGiftNumberEvent(GiftNumberEvent event) {
|
||||||
if (TextUtils.equals(event.getmCount(), "-1")) {
|
if (TextUtils.equals(event.getmCount(), "-1")) {
|
||||||
ImgLoader.display(getContext(), R.mipmap.ic_gift_right_arrow, liveGiftImg);
|
liveGiftImg.setImageResource( R.mipmap.ic_gift_right_arrow);
|
||||||
} else {
|
} else {
|
||||||
ImgLoader.display(getContext(), R.mipmap.ic_gift_right_arrow, liveGiftImg);
|
liveGiftImg.setImageResource( R.mipmap.ic_gift_right_arrow);
|
||||||
mCount = event.getmCount();
|
mCount = event.getmCount();
|
||||||
liveGiftSendTv.setText(mCount);
|
liveGiftSendTv.setText(mCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onLiveParcelItemRefreshEvent(LiveParcelItemRefreshEvent event) {
|
||||||
|
if (isWrap){
|
||||||
|
mFrameGiftNewAdapter.refreshWrapListAfterSend(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选中的礼物数据
|
* 选中的礼物数据
|
||||||
*
|
*
|
||||||
@ -1186,13 +1234,13 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
namingNameText.append("Get title: ")
|
namingNameText.append("Get title: ")
|
||||||
.append(liveGiftModel.getNamingUserCoin());
|
.append(liveGiftModel.getNamingUserCoin());
|
||||||
}
|
}
|
||||||
String hideName=liveGiftModel.getNamingUid().equals(IMLoginManager.get(mContext).getUserInfo().getId()+"")?liveGiftModel.getNamingUserName():WordUtil.getNewString(R.string.mystery_man);
|
String hideName = liveGiftModel.getNamingUid().equals(IMLoginManager.get(mContext).getUserInfo().getId() + "") ? liveGiftModel.getNamingUserName() : WordUtil.getNewString(R.string.mystery_man);
|
||||||
String hideLiveName=liveGiftModel.getNamingLiveuid().equals(IMLoginManager.get(mContext).getUserInfo().getId()+"")?liveGiftModel.getNamingLiveName():WordUtil.getNewString(R.string.mystery_man);
|
String hideLiveName = liveGiftModel.getNamingLiveuid().equals(IMLoginManager.get(mContext).getUserInfo().getId() + "") ? liveGiftModel.getNamingLiveName() : WordUtil.getNewString(R.string.mystery_man);
|
||||||
namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor))
|
namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor))
|
||||||
.append(liveGiftModel.getNamingLiveName())
|
.append(liveGiftModel.getNamingLiveName())
|
||||||
.append(" ")
|
.append(" ")
|
||||||
.append(mContext.getText(com.yunbao.live.R.string.the_title_financier))
|
.append(mContext.getText(com.yunbao.live.R.string.the_title_financier))
|
||||||
.append(liveGiftModel.getNaming_user_gift_hall_rank_hide()==0?liveGiftModel.getNamingUserName():hideName);
|
.append(liveGiftModel.getNaming_user_gift_hall_rank_hide() == 0 ? liveGiftModel.getNamingUserName() : hideName);
|
||||||
namingName.setText(namingNameText.toString());
|
namingName.setText(namingNameText.toString());
|
||||||
} else {
|
} else {
|
||||||
giftSponsorGroup.setVisibility(View.GONE);
|
giftSponsorGroup.setVisibility(View.GONE);
|
||||||
@ -1201,7 +1249,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
|
|
||||||
if (liveGiftModel.getType() == 7) {
|
if (liveGiftModel.getType() == 7) {
|
||||||
MobclickAgent.onEvent(mContext, "gif_list_blind_box", "用户点开礼物列表盲盒");
|
MobclickAgent.onEvent(mContext, "gif_list_blind_box", "用户点开礼物列表盲盒");
|
||||||
liveGiftImg.setVisibility(View.GONE);
|
liveGiftImg.setVisibility(View.INVISIBLE);
|
||||||
showBlindProgress(liveGiftModel.getBlind_box_type());
|
showBlindProgress(liveGiftModel.getBlind_box_type());
|
||||||
description.setTag(liveGiftModel.getBlind_box_type());
|
description.setTag(liveGiftModel.getBlind_box_type());
|
||||||
} else {
|
} else {
|
||||||
@ -1398,6 +1446,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
|
|||||||
* @param blindBoxType
|
* @param blindBoxType
|
||||||
*/
|
*/
|
||||||
private StringBuffer blindGiftNamesBuffer = null;
|
private StringBuffer blindGiftNamesBuffer = null;
|
||||||
|
|
||||||
private void showBlindProgress(int blindBoxType) {
|
private void showBlindProgress(int blindBoxType) {
|
||||||
this.blindBoxType = blindBoxType;
|
this.blindBoxType = blindBoxType;
|
||||||
blindGiftNamesBuffer = new StringBuffer();
|
blindGiftNamesBuffer = new StringBuffer();
|
||||||
|
@ -69,7 +69,7 @@ public class GiftTitleViewHolder extends RecyclerView.ViewHolder {
|
|||||||
} else {
|
} else {
|
||||||
name.setAlpha(0.5f);
|
name.setAlpha(0.5f);
|
||||||
name.setTextColor(ContextCompat.getColor(itemView.getContext(),R.color.white));
|
name.setTextColor(ContextCompat.getColor(itemView.getContext(),R.color.white));
|
||||||
name.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);
|
// name.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user