Merge branch 'master' into 声网升级

# Conflicts:
#	config.gradle
#	live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java
This commit is contained in:
zlzw 2024-06-11 14:16:00 +08:00
commit 07d6b959d5
6 changed files with 102 additions and 24 deletions

View File

@ -0,0 +1,34 @@
package com.yunbao.common.custom;
import android.view.View;
import com.stx.xhb.androidx.transformers.BasePageTransformer;
public class LiveGuardScalePageTransformer extends BasePageTransformer {
/**
* author: xiaohaibin.
* time: 2018/10/9
* mail:xhb_199409@163.com
* github:https://github.com/xiaohaibin
* describe: 适用于一屏显示多个模式
*/
private static final float MIN_SCALE = 0.8F;
@Override
public void handleInvisiblePage(View view, float position) {
view.setScaleY(MIN_SCALE);
}
@Override
public void handleLeftPage(View view, float position) {
float scale = Math.max(MIN_SCALE, 1 - Math.abs(position));
view.setScaleY(scale);
}
@Override
public void handleRightPage(View view, float position) {
float scale = Math.max(MIN_SCALE, 1 - Math.abs(position));
view.setScaleY(scale);
}
}

View File

@ -30,6 +30,8 @@ import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.enums.PopupPosition;
import com.makeramen.roundedimageview.RoundedImageView;
import com.stx.xhb.androidx.XBanner;
import com.stx.xhb.androidx.transformers.ScalePageTransformer;
import com.yunbao.common.custom.LiveGuardScalePageTransformer;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.adapter.LiveBuyGuardPrivilegeAdapter;
@ -159,6 +161,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
}
buyGuardBanner.setBannerData(R.layout.banner_item_buy_guard, buyGuardBannerModels);
buyGuardBanner.setIsClipChildrenMode(true);
buyGuardBanner.setCustomPageTransformer(new LiveGuardScalePageTransformer());
guardPrivilegeStrings = data.getGuardData().get(0).getGuardPrivilege();
buyGuardBanner.postDelayed(new Runnable() {
@Override

View File

@ -337,7 +337,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
loading.setVisibility(View.GONE);
enterRoomLeaveHandler.post(enterRoomLeaveRunnable);
OpenAdManager.getInstance().show(OpenAdManager.TYPE_LIVE, LiveGuardInfo.isGuard(mLiveGuardInfo));
}
};
final Runnable loadTimeoutRunnableGone = new Runnable() {
@ -350,6 +349,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
};
@Override
public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk, boolean isSw) {
Log.e("直播间接口调用排查", "onAdd onAdd onAdd onAdd");

View File

@ -50,6 +50,7 @@ import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSDKConfig;
import com.tencent.imsdk.v2.V2TIMSDKListener;
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
import com.yunbao.common.dialog.DebugDialog;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
@ -520,8 +521,25 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> {
if (index == 0) {
isfloatBannernet = true;
initAnchorRecommendBanner();
// isfloatBannernet = true;
// initAnchorRecommendBanner();
if (floatEventShow) {
if (floatWarOrder.getTag() != null) {
floatWarOrder.setVisibility(View.VISIBLE);
} else {
floatWarOrder.setVisibility(View.GONE);
if (floatBanner.getTag() != null) {
floatBanner.setVisibility(View.VISIBLE);
} else {
floatBanner.setVisibility(View.GONE);
if (floatRedPacket.getTag() == null) {
floatRedPacket.setVisibility(View.GONE);
} else {
floatRedPacket.setVisibility(View.VISIBLE);
}
}
}
}
} else if (index == 2) {
floatBanner.setVisibility(View.GONE);
floatRedPacket.setVisibility(View.GONE);
@ -640,30 +658,26 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (isFinishing()) return;
if (data.getListShow() == 1 && data.getList().size() > 2) {
floatBanner.setVisibility(View.VISIBLE);
floatBanner.setTag(data);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
floatBanner.showBanner(data.getList());
} else {
floatBanner.setVisibility(View.GONE);
floatBanner.setTag(null);
findViewById(R.id.banner_click).setVisibility(View.GONE);
}
if (data.getShowRedPacket() == 0) {
floatRedPacket.setVisibility(View.GONE);
} else {
floatRedPacket.setVisibility(View.VISIBLE);
((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setMax(data.getRedPacketTotal());
((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setProgress(data.getRedPacketNum());
((TextView) floatRedPacket.findViewById(R.id.progressText)).setText(data.getRedPacketNum() + "/" + data.getRedPacketTotal());
}
if (data.getShowWarOrder() == 0) {
floatWarOrder.setVisibility(View.GONE);
floatWarOrder.setTag(null);
//战令关闭情况下在判断一次Banner是否足够
if (data.getListShow() == 1 && data.getList().size() > 2) {
floatBanner.setVisibility(View.VISIBLE);
floatBanner.setTag(data);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
floatBanner.showBanner(data.getList());
} else {
floatBanner.setVisibility(View.GONE);
floatBanner.setTag(null);
findViewById(R.id.banner_click).setVisibility(View.GONE);
}
} else {
@ -676,8 +690,18 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
}
floatBanner.setVisibility(View.GONE);
floatBanner.setTag(null);
findViewById(R.id.banner_click).setVisibility(View.GONE);
}
if (data.getShowRedPacket() == 0) {
floatRedPacket.setVisibility(View.GONE);
} else if (floatWarOrder.getTag() == null && floatWarOrder.getTag() == null) {
floatRedPacket.setVisibility(View.VISIBLE);
floatRedPacket.setTag(data);
((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setMax(data.getRedPacketTotal());
((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setProgress(data.getRedPacketNum());
((TextView) floatRedPacket.findViewById(R.id.progressText)).setText(data.getRedPacketNum() + "/" + data.getRedPacketTotal());
}
}
@ -1550,18 +1574,37 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
}
}
boolean floatEventShow = true;
@Subscribe(threadMode = ThreadMode.MAIN)
public void onFloatWarOrderEvent(FloatWarOrderEvent event) {
/* if (event.isFloatWarOrder()) {
floatWarOrder.setVisibility(View.GONE);
floatEventShow = event.isFloatWarOrder();
if (event.isFloatWarOrder()) {
if (floatWarOrder.getTag() == null) {
floatWarOrder.setVisibility(View.GONE);
} else {
floatWarOrder.setVisibility(View.VISIBLE);
}
if (floatBanner.getTag() == null) {
floatBanner.setVisibility(View.GONE);
} else {
floatBanner.setVisibility(View.VISIBLE);
}
if (floatRedPacket.getTag() == null) {
floatRedPacket.setVisibility(View.GONE);
} else {
floatRedPacket.setVisibility(View.VISIBLE);
}
} else {
floatWarOrder.setVisibility(View.VISIBLE);
}*/
if(floatWarOrder.getTag()!=null){
floatBanner.setVisibility(View.GONE);
floatWarOrder.setVisibility(View.GONE);
floatRedPacket.setVisibility(View.GONE);
}
/* if(floatWarOrder.getTag()!=null){
floatWarOrder.setVisibility(View.VISIBLE);
}else{
floatWarOrder.setVisibility(View.GONE);
}
}*/
}
private void initRedPacket() {

View File

@ -85,22 +85,22 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
case 0:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
break;
case 1:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
break;
case 2:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
break;
case 3:
floatWarOrder = true;
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
break;
}
if (mViewHolders == null) {

View File

@ -318,9 +318,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
}
String singnature = u.getSignature();
if (TextUtils.equals(singnature, "這個人很懶,什麼也沒留下") || TextUtils.equals(singnature, "这家伙很懒,什么都没留下") || TextUtils.isEmpty(singnature)) {
String ct = Locale.getDefault().getCountry();
ct = TextUtils.equals("CN", ct) ? "HK" : ct;
if (TextUtils.equals(ct, "CN")) {
if (WordUtil.isNewZh()) {
singnature = "這個人很懶,什麼也沒留下";
} else {
singnature = "The guy was lazy and didn't write anything.";