优化首页右下角悬浮层隐藏显示问题

调整直播间购买推荐的UI显示不合设计问题
This commit is contained in:
zlzw 2024-05-24 15:45:06 +08:00
parent c033340aad
commit c33975fe67
3 changed files with 49 additions and 3 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

@ -529,6 +529,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
floatBanner.setVisibility(View.VISIBLE);
} else {
floatBanner.setVisibility(View.GONE);
if (floatRedPacket.getTag() == null) {
floatRedPacket.setVisibility(View.GONE);
} else {
floatRedPacket.setVisibility(View.VISIBLE);
}
}
}
}
@ -673,6 +678,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
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());
@ -1521,9 +1527,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Subscribe(threadMode = ThreadMode.MAIN)
public void onFloatWarOrderEvent(FloatWarOrderEvent event) {
System.out.println("FloatWarOrderEvent:事件" + event.isFloatWarOrder());
System.out.println("战令:" + floatWarOrder.getTag());
System.out.println("Banner:" + floatBanner.getTag());
floatEventShow = event.isFloatWarOrder();
if (event.isFloatWarOrder()) {
if (floatWarOrder.getTag() == null) {
@ -1536,9 +1539,15 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} else {
floatBanner.setVisibility(View.VISIBLE);
}
if (floatRedPacket.getTag() == null) {
floatRedPacket.setVisibility(View.GONE);
} else {
floatRedPacket.setVisibility(View.VISIBLE);
}
} else {
floatBanner.setVisibility(View.GONE);
floatWarOrder.setVisibility(View.GONE);
floatRedPacket.setVisibility(View.GONE);
}
/* if(floatWarOrder.getTag()!=null){
floatWarOrder.setVisibility(View.VISIBLE);