Merge branch 'master' into 声网升级
# Conflicts: # config.gradle # live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java
This commit is contained in:
commit
07d6b959d5
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -30,6 +30,8 @@ import com.lxj.xpopup.XPopup;
|
|||||||
import com.lxj.xpopup.enums.PopupPosition;
|
import com.lxj.xpopup.enums.PopupPosition;
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.stx.xhb.androidx.XBanner;
|
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.utils.MobclickAgent;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.adapter.LiveBuyGuardPrivilegeAdapter;
|
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.setBannerData(R.layout.banner_item_buy_guard, buyGuardBannerModels);
|
||||||
buyGuardBanner.setIsClipChildrenMode(true);
|
buyGuardBanner.setIsClipChildrenMode(true);
|
||||||
|
buyGuardBanner.setCustomPageTransformer(new LiveGuardScalePageTransformer());
|
||||||
guardPrivilegeStrings = data.getGuardData().get(0).getGuardPrivilege();
|
guardPrivilegeStrings = data.getGuardData().get(0).getGuardPrivilege();
|
||||||
buyGuardBanner.postDelayed(new Runnable() {
|
buyGuardBanner.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -337,7 +337,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
loading.setVisibility(View.GONE);
|
loading.setVisibility(View.GONE);
|
||||||
enterRoomLeaveHandler.post(enterRoomLeaveRunnable);
|
enterRoomLeaveHandler.post(enterRoomLeaveRunnable);
|
||||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_LIVE, LiveGuardInfo.isGuard(mLiveGuardInfo));
|
OpenAdManager.getInstance().show(OpenAdManager.TYPE_LIVE, LiveGuardInfo.isGuard(mLiveGuardInfo));
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
final Runnable loadTimeoutRunnableGone = new Runnable() {
|
final Runnable loadTimeoutRunnableGone = new Runnable() {
|
||||||
@ -350,6 +349,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk, boolean isSw) {
|
public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk, boolean isSw) {
|
||||||
Log.e("直播间接口调用排查", "onAdd onAdd onAdd onAdd");
|
Log.e("直播间接口调用排查", "onAdd onAdd onAdd onAdd");
|
||||||
|
@ -50,6 +50,7 @@ import com.tencent.imsdk.v2.V2TIMManager;
|
|||||||
import com.tencent.imsdk.v2.V2TIMSDKConfig;
|
import com.tencent.imsdk.v2.V2TIMSDKConfig;
|
||||||
import com.tencent.imsdk.v2.V2TIMSDKListener;
|
import com.tencent.imsdk.v2.V2TIMSDKListener;
|
||||||
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||||
|
import com.yunbao.common.dialog.DebugDialog;
|
||||||
import com.yunbao.common.utils.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
@ -520,8 +521,25 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> {
|
mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> {
|
||||||
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
isfloatBannernet = true;
|
// isfloatBannernet = true;
|
||||||
initAnchorRecommendBanner();
|
// 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) {
|
} else if (index == 2) {
|
||||||
floatBanner.setVisibility(View.GONE);
|
floatBanner.setVisibility(View.GONE);
|
||||||
floatRedPacket.setVisibility(View.GONE);
|
floatRedPacket.setVisibility(View.GONE);
|
||||||
@ -640,30 +658,26 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
if (isFinishing()) return;
|
if (isFinishing()) return;
|
||||||
if (data.getListShow() == 1 && data.getList().size() > 2) {
|
if (data.getListShow() == 1 && data.getList().size() > 2) {
|
||||||
floatBanner.setVisibility(View.VISIBLE);
|
floatBanner.setVisibility(View.VISIBLE);
|
||||||
|
floatBanner.setTag(data);
|
||||||
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
|
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
|
||||||
floatBanner.showBanner(data.getList());
|
floatBanner.showBanner(data.getList());
|
||||||
} else {
|
} else {
|
||||||
floatBanner.setVisibility(View.GONE);
|
floatBanner.setVisibility(View.GONE);
|
||||||
|
floatBanner.setTag(null);
|
||||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
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) {
|
if (data.getShowWarOrder() == 0) {
|
||||||
floatWarOrder.setVisibility(View.GONE);
|
floatWarOrder.setVisibility(View.GONE);
|
||||||
floatWarOrder.setTag(null);
|
floatWarOrder.setTag(null);
|
||||||
//战令关闭情况下,在判断一次Banner是否足够
|
//战令关闭情况下,在判断一次Banner是否足够
|
||||||
if (data.getListShow() == 1 && data.getList().size() > 2) {
|
if (data.getListShow() == 1 && data.getList().size() > 2) {
|
||||||
floatBanner.setVisibility(View.VISIBLE);
|
floatBanner.setVisibility(View.VISIBLE);
|
||||||
|
floatBanner.setTag(data);
|
||||||
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
|
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
|
||||||
floatBanner.showBanner(data.getList());
|
floatBanner.showBanner(data.getList());
|
||||||
} else {
|
} else {
|
||||||
floatBanner.setVisibility(View.GONE);
|
floatBanner.setVisibility(View.GONE);
|
||||||
|
floatBanner.setTag(null);
|
||||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -676,8 +690,18 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
}
|
}
|
||||||
|
|
||||||
floatBanner.setVisibility(View.GONE);
|
floatBanner.setVisibility(View.GONE);
|
||||||
|
floatBanner.setTag(null);
|
||||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
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)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onFloatWarOrderEvent(FloatWarOrderEvent event) {
|
public void onFloatWarOrderEvent(FloatWarOrderEvent event) {
|
||||||
/* if (event.isFloatWarOrder()) {
|
floatEventShow = event.isFloatWarOrder();
|
||||||
floatWarOrder.setVisibility(View.GONE);
|
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 {
|
} else {
|
||||||
floatWarOrder.setVisibility(View.VISIBLE);
|
floatBanner.setVisibility(View.GONE);
|
||||||
}*/
|
floatWarOrder.setVisibility(View.GONE);
|
||||||
if(floatWarOrder.getTag()!=null){
|
floatRedPacket.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
/* if(floatWarOrder.getTag()!=null){
|
||||||
floatWarOrder.setVisibility(View.VISIBLE);
|
floatWarOrder.setVisibility(View.VISIBLE);
|
||||||
}else{
|
}else{
|
||||||
floatWarOrder.setVisibility(View.GONE);
|
floatWarOrder.setVisibility(View.GONE);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRedPacket() {
|
private void initRedPacket() {
|
||||||
|
@ -85,22 +85,22 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
|||||||
case 0:
|
case 0:
|
||||||
floatWarOrder = false;
|
floatWarOrder = false;
|
||||||
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
|
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
|
||||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
floatWarOrder = false;
|
floatWarOrder = false;
|
||||||
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
|
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
|
||||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
floatWarOrder = false;
|
floatWarOrder = false;
|
||||||
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
|
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
|
||||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
floatWarOrder = true;
|
floatWarOrder = true;
|
||||||
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
|
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
|
||||||
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
|
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (mViewHolders == null) {
|
if (mViewHolders == null) {
|
||||||
|
@ -318,9 +318,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
|||||||
}
|
}
|
||||||
String singnature = u.getSignature();
|
String singnature = u.getSignature();
|
||||||
if (TextUtils.equals(singnature, "這個人很懶,什麼也沒留下") || TextUtils.equals(singnature, "这家伙很懒,什么都没留下") || TextUtils.isEmpty(singnature)) {
|
if (TextUtils.equals(singnature, "這個人很懶,什麼也沒留下") || TextUtils.equals(singnature, "这家伙很懒,什么都没留下") || TextUtils.isEmpty(singnature)) {
|
||||||
String ct = Locale.getDefault().getCountry();
|
if (WordUtil.isNewZh()) {
|
||||||
ct = TextUtils.equals("CN", ct) ? "HK" : ct;
|
|
||||||
if (TextUtils.equals(ct, "CN")) {
|
|
||||||
singnature = "這個人很懶,什麼也沒留下";
|
singnature = "這個人很懶,什麼也沒留下";
|
||||||
} else {
|
} else {
|
||||||
singnature = "The guy was lazy and didn't write anything.";
|
singnature = "The guy was lazy and didn't write anything.";
|
||||||
|
Loading…
Reference in New Issue
Block a user