调整客服页面返回键交给h5处理(含系统按键/手势)

统一客服页面为同一个WebView
调整短剧与社区使用原生分开加载
调整送礼-包裹接口为新接口
调整粉丝团礼物送礼为新接口
修复战令-兑换-列表页面在名字过长晴空下高度不统一
This commit is contained in:
2024-01-09 16:37:43 +08:00
parent b175e42ee1
commit 1759757176
17 changed files with 978 additions and 359 deletions

View File

@@ -42,6 +42,7 @@ public class LiveParcelItemAdapter extends RecyclerView.Adapter {
frameGiftViewHolder.giftSelect(giftJson.get(position), position, mStream, mLiveUid, new LiveParcelItemViewHolder.FrameGiftClickListener() {
@Override
public void onCallBack(int position, LiveGiftBean model) {
model.setPageGift(true);
Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(model));
giftSelect(model);
}

View File

@@ -55,7 +55,7 @@ public class LiveFansGroupSendGiftDialog extends AbsDialogCenterPopupWindow {
recyclerView = findViewById(R.id.giftList);
adapter = new LiveFansGroupSendGiftAdapter(mContext);
adapter.setOnItemClickListener((bean, position) -> {
LiveHttpUtil.sendGift("0",
LiveHttpUtil.sendGiftForFansGroup("0",
liveUid,
mStream,
bean.getId(),

View File

@@ -129,7 +129,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
private MarqueeTextView giftDescription, namingName;
private boolean isPk;
private FragmentTransaction transaction=null;
private FragmentTransaction transaction = null;
private FragmentManager fragmentManager;
private Fragment contentFragment;
@@ -137,8 +137,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if(transaction==null){
transaction=getChildFragmentManager().beginTransaction();
if (transaction == null) {
transaction = getChildFragmentManager().beginTransaction();
}
Bus.getOn(this);
initView();
@@ -243,8 +243,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
giftTitleAdapter.uncheck();
liveWrap.setAlpha(1.0f);
liveWrap.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
transaction=getTransaction();
contentFragment=LiveParcelFragment.newInstance(mStream, mLiveUid);
transaction = getTransaction();
contentFragment = LiveParcelFragment.newInstance(mStream, mLiveUid);
transaction.replace(R.id.context_layout_gift, contentFragment);
transaction.commitAllowingStateLoss();
isWrap = true;
@@ -328,13 +328,13 @@ public class LiveGiftPopup extends AbsDialogFragment {
.append(userInfo.getToken())
.append("&no_back=1")
.append("&type=")
.append(blindBoxType-1)
.append(blindBoxType - 1)
.append("&isZh=")
.append(WordUtil.isNewZh() ? "1" : 0);
Bundle bundle = new Bundle();
bundle.putString("url", htmlUrl.toString());
// System.out.println("盲盒页面 = "+htmlUrl.toString());
// System.out.println("盲盒页面 = "+htmlUrl.toString());
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
fragment.setArguments(bundle);
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
@@ -399,7 +399,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken())
.append("&for") .append("&isZh=")
.append("&for").append("&isZh=")
.append(WordUtil.isNewZh() ? "1" : 0);
Bundle bundle = new Bundle();
bundle.putString("url", htmlUrl.toString());
@@ -480,8 +480,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
List<LiveGiftBean> liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class);
for (LiveGiftBean model : liveGiftBeans) {
if (TextUtils.equals(model.getId() + "", mWishGiftId)) {
transaction=getTransaction();
contentFragment=LiveGiftFragment.newInstance(giftJson,
transaction = getTransaction();
contentFragment = LiveGiftFragment.newInstance(giftJson,
liveGiftList.getJSONObject(i).getString("name"),
mStream, mLiveUid, mWishGiftId);
transaction.replace(R.id.context_layout_gift, contentFragment);
@@ -495,11 +495,11 @@ public class LiveGiftPopup extends AbsDialogFragment {
JSONObject obj2 = liveGiftList.getJSONObject(0);
String giftJson = obj2.getString("giftlist");
transaction=getTransaction();
contentFragment= LiveGiftFragment.newInstance(giftJson,
transaction = getTransaction();
contentFragment = LiveGiftFragment.newInstance(giftJson,
liveGiftList.getJSONObject(0).getString("name"),
mStream, mLiveUid, mWishGiftId);
transaction.replace(R.id.context_layout_gift,contentFragment);
transaction.replace(R.id.context_layout_gift, contentFragment);
transaction.commitAllowingStateLoss();
}
@@ -620,7 +620,11 @@ public class LiveGiftPopup extends AbsDialogFragment {
if (isWrap && liveGiftModel.getType() == 7) {
sendBlindBoxTicket();
} else {
sendGift();
if (liveGiftModel.isPageGift()) {
sendGiftForPage();
} else {
sendGift();
}
}
}
@@ -636,7 +640,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
LiveHttpUtil.sendBlindBoxTicket((by != null ? "1" : "0"),
mLiveUid,
mStream,
isWrap ? liveGiftModel.getId() : liveGiftModel.getBlindBoxTicketId(), new HttpCallback() {
isWrap ? liveGiftModel.getGift_id() : liveGiftModel.getBlindBoxTicketId(), new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0) {
@@ -755,6 +759,16 @@ public class LiveGiftPopup extends AbsDialogFragment {
}
}
private void sendGiftForPage() {
if (liveGiftModel == null) return;
SendGiftCallback callback = new SendGiftCallback(liveGiftModel);
if (by != null) {
LiveHttpUtil.sendGiftForPage("1", mLiveUid, mStream, liveGiftModel.getGift_id(), mCount, 0, false, callback);
} else {
LiveHttpUtil.sendGiftForPage("0", mLiveUid, mStream, liveGiftModel.getGift_id(), mCount, 0, false, callback);
}
}
/**
* 跳转到我的钻石
*/
@@ -888,8 +902,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
giftNumberLayout.setVisibility(View.INVISIBLE);
JSONObject obj2 = liveGiftList.getJSONObject(event.getmPosition());
String giftJson = obj2.getString("giftlist");
transaction=getTransaction();
contentFragment=LiveGiftFragment.newInstance(giftJson, event.getGiftTitle(), mStream, mLiveUid, mWishGiftId);
transaction = getTransaction();
contentFragment = LiveGiftFragment.newInstance(giftJson, event.getGiftTitle(), mStream, mLiveUid, mWishGiftId);
transaction.replace(R.id.context_layout_gift, contentFragment);
transaction.commitAllowingStateLoss();
isWrap = false;
@@ -1115,12 +1129,12 @@ public class LiveGiftPopup extends AbsDialogFragment {
}
if (!TextUtils.isEmpty(event.getDressName()) && !TextUtils.isEmpty(event.getDressMsg())) {
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability2), WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en(),WordUtil.isNewZh()? event.getDressName():event.getDress_nameen());
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability2), WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en(), WordUtil.isNewZh() ? event.getDressName() : event.getDress_nameen());
stringBuilder.append(boxBlindMsg);
int dressNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh()? event.getDressName():event.getDress_nameen());
int dressNameSize =(WordUtil.isNewZh()? event.getDressName():event.getDress_nameen()).length();
int giftNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en());
int giftNameSize = (WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en()).length();
int dressNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh() ? event.getDressName() : event.getDress_nameen());
int dressNameSize = (WordUtil.isNewZh() ? event.getDressName() : event.getDress_nameen()).length();
int giftNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en());
int giftNameSize = (WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en()).length();
stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getDressColour())),
dressNameIndex,
dressNameIndex + dressNameSize,
@@ -1132,11 +1146,11 @@ public class LiveGiftPopup extends AbsDialogFragment {
stringBuilders.add(stringBuilder);
} else {
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability3), WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en());
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability3), WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en());
stringBuilder.append(boxBlindMsg);
if (!TextUtils.isEmpty(event.getGiftname_en())){
int giftNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en());
int giftNameSize = (WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en()).length();
if (!TextUtils.isEmpty(event.getGiftname_en())) {
int giftNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en());
int giftNameSize = (WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en()).length();
stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getGiftColour())),
giftNameIndex,
giftNameIndex + giftNameSize,
@@ -1446,15 +1460,16 @@ public class LiveGiftPopup extends AbsDialogFragment {
}
}
}
private FragmentTransaction getTransaction(){
if(contentFragment!=null && transaction!=null){
private FragmentTransaction getTransaction() {
if (contentFragment != null && transaction != null) {
transaction.remove(contentFragment);
contentFragment=null;
contentFragment = null;
}
if(fragmentManager==null){
fragmentManager=getChildFragmentManager();
if (fragmentManager == null) {
fragmentManager = getChildFragmentManager();
}
transaction=fragmentManager.beginTransaction();
transaction = fragmentManager.beginTransaction();
return transaction;
}