diff --git a/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java b/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java index a793f9b98..b9787b307 100644 --- a/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java +++ b/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java @@ -8,12 +8,10 @@ import android.os.Looper; import android.util.Log; import android.widget.Toast; -import com.yunbao.common.BuildConfig; import com.yunbao.common.bean.CrashSaveBean; import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.FileUtil; import com.yunbao.common.utils.SpUtil; -import com.yunbao.common.utils.ToastUtil; import java.io.File; import java.io.PrintWriter; diff --git a/common/src/main/java/com/yunbao/common/adapter/GiftWallAchieveAdapter.java b/common/src/main/java/com/yunbao/common/adapter/GiftWallAchieveAdapter.java new file mode 100644 index 000000000..68a6779a4 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/GiftWallAchieveAdapter.java @@ -0,0 +1,84 @@ +package com.yunbao.common.adapter; + +import android.content.Context; +import android.graphics.Color; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.UserMedalListModel; +import com.yunbao.common.bean.UserMedalListModel; +import com.yunbao.common.event.GiftNumberEvent; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.views.GiftNumber; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +import java.util.List; + +public class GiftWallAchieveAdapter extends RecyclerView.Adapter { + private List giftQuantityModels; + private Context mContext; + private OnItemClickListener onItemClickListener; + + public GiftWallAchieveAdapter(List giftQuantityModels, Context context) { + this.giftQuantityModels = giftQuantityModels; + this.mContext = context; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_gift_wall_achieve_item, parent, false); + return new GiftWallAchieveViewHolder(robotSayHelloView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + GiftWallAchieveViewHolder giftWallAchieveViewHolder = (GiftWallAchieveViewHolder) holder; + giftWallAchieveViewHolder.showData(giftQuantityModels.get(position)); + } + + public void setOnItemClickListener(OnItemClickListener onItemClickListener) { + this.onItemClickListener = onItemClickListener; + } + + @Override + public int getItemCount() { + return giftQuantityModels.size(); + } + + class GiftWallAchieveViewHolder extends RecyclerView.ViewHolder { + private TextView achieveName; + private ImageView achieveImg; + + public GiftWallAchieveViewHolder(@NonNull View itemView) { + super(itemView); + itemView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if(onItemClickListener!=null){ + onItemClickListener.onItemClick(getAdapterPosition()); + } + } + }); + achieveName = itemView.findViewById(R.id.achieveName); + achieveImg = itemView.findViewById(R.id.achieve_img); + } + + public void showData(UserMedalListModel quantityModel) { + achieveName.setText(quantityModel.getDressName()); + ImgLoader.display(mContext,quantityModel.getDisplaySrc(),achieveImg); + } + } + + public interface OnItemClickListener { + void onItemClick(int position); + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java b/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java index 4ac5dde3e..7597786ab 100644 --- a/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java +++ b/common/src/main/java/com/yunbao/common/bean/UserMedalModel.java @@ -1,8 +1,9 @@ package com.yunbao.common.bean; import com.google.gson.annotations.SerializedName; +import com.stx.xhb.androidx.entity.BaseBannerInfo; -public class UserMedalModel extends BaseModel { +public class UserMedalModel extends BaseModel implements BaseBannerInfo { @SerializedName("id") private String id; @SerializedName("display_src") @@ -13,9 +14,22 @@ public class UserMedalModel extends BaseModel { private String dressDescription; @SerializedName("sort") private String sort; + @SerializedName("use_status") + private String use_status; @SerializedName("dress_status") private String dressStatus; + @SerializedName("users_dress_id") + private String users_dress_id; + + public String getUsersDressId() { + return users_dress_id; + } + + public String getUseStatus() { + return use_status; + } + public String getId() { return id; } @@ -69,4 +83,14 @@ public class UserMedalModel extends BaseModel { this.dressStatus = dressStatus; return this; } + + @Override + public Object getXBannerUrl() { + return null; + } + + @Override + public String getXBannerTitle() { + return null; + } } diff --git a/common/src/main/java/com/yunbao/common/custom/LiveGifWallAchieveWearTransformer.java b/common/src/main/java/com/yunbao/common/custom/LiveGifWallAchieveWearTransformer.java new file mode 100644 index 000000000..f536fcc71 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/custom/LiveGifWallAchieveWearTransformer.java @@ -0,0 +1,50 @@ +package com.yunbao.common.custom; + +import android.view.View; + +import com.stx.xhb.androidx.transformers.BasePageTransformer; +import com.yunbao.common.utils.L; + +public class LiveGifWallAchieveWearTransformer extends BasePageTransformer { + private float mMinScale = 0.85f; + private float mMinAlpha = 1f; + @Override + public void handleInvisiblePage(View view, float position) { + } + + @Override + public void handleLeftPage(View view, float position) { + float scale = Math.max(mMinScale, 1 + position); + float vertMargin = view.getHeight() * (1 - scale) / 2; + float horzMargin = view.getWidth() * (1 - scale) / 2; + view.setTranslationX(horzMargin - vertMargin / 2); + view.setScaleX(scale); + view.setScaleY( scale); + L.e("handleLeftPage scale:"+scale); + view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha)); + } + + @Override + public void handleRightPage(View view, float position) { + float scale = Math.max(mMinScale, 1 - position); + float vertMargin = view.getHeight() * (1 - scale) / 2; + float horzMargin = view.getWidth() * (1 - scale) / 2; + view.setTranslationX( -horzMargin + vertMargin / 2); + view.setScaleX( scale); + view.setScaleY( scale); + L.e("handleRightPage scale:"+scale); + view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha)); + } + + public void setMinAlpha(float minAlpha) { + if (minAlpha >= 0.6f && minAlpha <= 1.0f) { + mMinAlpha = minAlpha; + } + } + + public void setMinScale(float minScale) { + if (minScale >= 0.6f && minScale <= 1.0f) { + mMinScale = minScale; + } + } +} diff --git a/common/src/main/java/com/yunbao/common/custom/LiveGuardScalePageTransformer.java b/common/src/main/java/com/yunbao/common/custom/LiveGuardScalePageTransformer.java index 19850087d..a335d6e4e 100644 --- a/common/src/main/java/com/yunbao/common/custom/LiveGuardScalePageTransformer.java +++ b/common/src/main/java/com/yunbao/common/custom/LiveGuardScalePageTransformer.java @@ -6,6 +6,7 @@ import androidx.core.view.ViewCompat; import com.stx.xhb.androidx.transformers.BasePageTransformer; import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.utils.L; public class LiveGuardScalePageTransformer extends BasePageTransformer { /** @@ -39,6 +40,7 @@ public class LiveGuardScalePageTransformer extends BasePageTransformer { view.setTranslationX(horzMargin - vertMargin / 2); view.setScaleX(scale); view.setScaleY( scale); + L.e("handleLeftPage scale:"+scale); view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha)); } @@ -49,8 +51,8 @@ public class LiveGuardScalePageTransformer extends BasePageTransformer { float horzMargin = view.getWidth() * (1 - scale) / 2; view.setTranslationX( -horzMargin + vertMargin / 2); view.setScaleX( scale); - view.setScaleY( scale); + L.e("handleRightPage scale:"+scale); view.setAlpha( mMinAlpha + (scale - mMinScale) / (1 - mMinScale) * (1 - mMinAlpha)); } diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveDialog.java new file mode 100644 index 000000000..226f11c47 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveDialog.java @@ -0,0 +1,122 @@ +package com.yunbao.common.dialog; + +import android.content.Context; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.XPopup; +import com.yunbao.common.R; +import com.yunbao.common.adapter.GiftWallAchieveAdapter; +import com.yunbao.common.bean.MedalAchievementModel; +import com.yunbao.common.bean.UserMedalListModel; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.ScreenDimenUtil; +import com.yunbao.common.utils.ToastUtil; + +import java.util.ArrayList; +import java.util.List; + +/** + * 礼物墙-荣誉成就 + */ +public class GiftWallAchieveDialog extends AbsDialogPopupWindow { + + private ImageView mIvBg; + private ImageView mIvBack; + private TextView numCount; + private boolean isFullWindows; + private RecyclerView mRecyclerView; + private GiftWallAchieveAdapter giftWallAchieveAdapter; + private String toUid; + + private List userMedalListModelList = new ArrayList<>(); + + public GiftWallAchieveDialog(@NonNull Context context) { + super(context); + } + + public GiftWallAchieveDialog setFullWindows(boolean fullWindows) { + isFullWindows = fullWindows; + return this; + } + + public GiftWallAchieveDialog setToUid(String toUid) { + this.toUid = toUid; + return this; + } + + @Override + public void buildDialog(XPopup.Builder builder) { + + } + + @Override + public int bindLayoutId() { + return R.layout.dialog_gift_wall_achieve; + } + + @Override + protected int getPopupHeight() { + if (isFullWindows) { + return super.getPopupHeight(); + } + int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight(); + return (int) (screenHeight * 0.8); + } + + void initView() { + mIvBg = findViewById(R.id.iv_root_bg); + mIvBack = findViewById(R.id.iv_back); + mRecyclerView = findViewById(R.id.recyclerView); + mRecyclerView.setLayoutManager(new GridLayoutManager(mContext, 3, GridLayoutManager.VERTICAL, false)); + numCount = findViewById(R.id.numCount); + } + + @Override + protected void onCreate() { + super.onCreate(); + initView(); + /*RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mIvBack.getLayoutParams(); + if (isFullWindows) { + params.width=DpUtil.dp2px(20); + mIvBack.setVisibility(View.VISIBLE); + mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP); + } else { + params.width=DpUtil.dp2px(1); + mIvBack.setVisibility(View.INVISIBLE); + mIvBg.setScaleType(ImageView.ScaleType.FIT_XY); + } + mIvBack.setLayoutParams(params);*/ + initData(); + } + + private void initData() { + LiveNetManager.get(getContext()) + .getGiftHallMedalList(toUid,"",new HttpCallback() { + @Override + public void onSuccess(MedalAchievementModel data) { + numCount.setText(data.getMedalLightNumber()+"/"+data.getMedalTotalNumber()); + userMedalListModelList = data.getMedalData(); + giftWallAchieveAdapter = new GiftWallAchieveAdapter(userMedalListModelList,mContext); + giftWallAchieveAdapter.setOnItemClickListener(new GiftWallAchieveAdapter.OnItemClickListener() { + @Override + public void onItemClick(int position) { + GiftWallAchieveWearDialog giftWallAchieveWearDialog = new GiftWallAchieveWearDialog(mContext,userMedalListModelList.get(position).getDressInfo()); + giftWallAchieveWearDialog.showDialog(); + } + }); + mRecyclerView.setAdapter(giftWallAchieveAdapter); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveWearDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveWearDialog.java new file mode 100644 index 000000000..da69994c8 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallAchieveWearDialog.java @@ -0,0 +1,177 @@ +package com.yunbao.common.dialog; + +import android.content.Context; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.viewpager.widget.ViewPager; + +import com.lxj.xpopup.XPopup; +import com.stx.xhb.androidx.XBanner; +import com.stx.xhb.androidx.transformers.Transformer; +import com.yunbao.common.R; +import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.UserMedalModel; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.ScreenDimenUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; + +import java.util.ArrayList; +import java.util.List; + +/** + * 礼物墙-荣誉成就 + */ +public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow { + + private ImageView mIvBg; + private ImageView mIvBack; + private boolean isFullWindows; + private String toUid; + private XBanner xBanner; + private TextView textAchieveName; + private TextView textAchieveHint; + private TextView btnConfirm; + private int selectPosition = 0; + + String putOn = WordUtil.isNewZh() ? "佩戴" : "wearing"; + String wearing = WordUtil.isNewZh() ? "已佩戴" : "worn"; + private List achieveWearModels = new ArrayList<>(); + + public GiftWallAchieveWearDialog(@NonNull Context context, List achieveWearModels) { + super(context); + this.achieveWearModels = achieveWearModels; + } + + public GiftWallAchieveWearDialog setFullWindows(boolean fullWindows) { + isFullWindows = fullWindows; + return this; + } + + public GiftWallAchieveWearDialog setToUid(String toUid) { + this.toUid = toUid; + return this; + } + + @Override + public void buildDialog(XPopup.Builder builder) { + + } + + @Override + public int bindLayoutId() { + return R.layout.dialog_gift_wall_achieve_wear; + } + + @Override + protected int getPopupHeight() { + if (isFullWindows) { + return super.getPopupHeight(); + } + return ScreenDimenUtil.getInstance().getScreenHeight(); + } + + void initView() { + mIvBg = findViewById(R.id.iv_root_bg); + mIvBack = findViewById(R.id.iv_back); + xBanner = findViewById(R.id.gift_wall_achieve_banner); + textAchieveName = findViewById(R.id.text_achieve_name); + textAchieveHint = findViewById(R.id.text_achieve_hint); + btnConfirm = findViewById(R.id.btn_confirm); + findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + dialog.dismiss(); + } + }); + btnConfirm.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + if (achieveWearModels.get(selectPosition).getUseStatus().equals("2") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) { + LiveNetManager.get(mContext).userUseDress("3", achieveWearModels.get(selectPosition).getUsersDressId(), new HttpCallback() { + @Override + public void onSuccess(BaseModel data) { + dialog.dismiss(); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + } + }); + } + + @Override + protected void onCreate() { + super.onCreate(); + initView(); + /*RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mIvBack.getLayoutParams(); + if (isFullWindows) { + params.width=DpUtil.dp2px(20); + mIvBack.setVisibility(View.VISIBLE); + mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP); + } else { + params.width=DpUtil.dp2px(1); + mIvBack.setVisibility(View.INVISIBLE); + mIvBg.setScaleType(ImageView.ScaleType.FIT_XY); + } + mIvBack.setLayoutParams(params);*/ + initData(); + } + + public void setWearInfo() { + textAchieveName.setText(achieveWearModels.get(selectPosition).getDressName()); + textAchieveHint.setText(achieveWearModels.get(selectPosition).getDressDescription()); + btnConfirm.setText(achieveWearModels.get(selectPosition).getUseStatus().equals("2") ? wearing : putOn); + if (achieveWearModels.get(selectPosition).getUseStatus().equals("2") && achieveWearModels.get(selectPosition).getDressStatus().equals("2")) { + btnConfirm.setBackground(getResources().getDrawable(R.drawable.gift_wall_achieve_wear_sure)); + } else { + btnConfirm.setBackground(getResources().getDrawable(R.drawable.gift_wall_achieve_wear_disable)); + } + } + + private void initData() { + setWearInfo(); + + xBanner.setBannerData(R.layout.dialog_gift_wall_achieve_wear_item, achieveWearModels); + //xBanner.setCustomPageTransformer(new LiveGifWallAchieveWearTransformer()); + xBanner.setIsClipChildrenMode(true); + xBanner.setPageTransformer(Transformer.Scale); + xBanner.getViewPager().setOffscreenPageLimit(3); + xBanner.loadImage(new XBanner.XBannerAdapter() { + @Override + public void loadBanner(XBanner banner, Object model, View view, int position) { + UserMedalModel guardBannerModel = ((UserMedalModel) model); + ImageView wearImg = view.findViewById(R.id.wearImg); + ImageView notUnlocked = view.findViewById(R.id.notUnlocked); + ImgLoader.display(getContext(), guardBannerModel.getDisplaySrc(), wearImg); + notUnlocked.setVisibility(guardBannerModel.getDressStatus().equals("1") ? VISIBLE : View.GONE); + } + }); + xBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int i, float v, int i1) { + + } + + @Override + public void onPageSelected(int i) { + selectPosition = i; + setWearInfo(); + } + + @Override + public void onPageScrollStateChanged(int i) { + + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallDialog.java index 45482b1ea..142f1014c 100644 --- a/common/src/main/java/com/yunbao/common/dialog/GiftWallDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallDialog.java @@ -156,7 +156,12 @@ public class GiftWallDialog extends AbsDialogPopupWindow { mTvTab2.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); mViewPager.setCurrentItem(1, false); }); - + ViewClicksAntiShake.clicksAntiShake(mAchievement, () -> { + new GiftWallAchieveDialog(mContext).setFullWindows(false).setToUid("98889").showDialog(); + }); + ViewClicksAntiShake.clicksAntiShake(mIvTips, () -> { + new GiftWallRuleDialog(mContext).setFullWindows(false).showDialog(); + }); } @Override diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallRuleDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallRuleDialog.java new file mode 100644 index 000000000..c73852980 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallRuleDialog.java @@ -0,0 +1,97 @@ +package com.yunbao.common.dialog; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.lxj.xpopup.XPopup; +import com.yunbao.common.R; +import com.yunbao.common.adapter.GiftWallAchieveAdapter; +import com.yunbao.common.bean.MedalAchievementModel; +import com.yunbao.common.bean.UserMedalListModel; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.ScreenDimenUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; + +import java.util.ArrayList; +import java.util.List; + +/** + * 礼物墙-規則 + */ +public class GiftWallRuleDialog extends AbsDialogPopupWindow { + + private ImageView mIvBg; + private ImageView mIvBack; + private ImageView iv_rule; + private boolean isFullWindows; + public GiftWallRuleDialog(@NonNull Context context) { + super(context); + } + + public GiftWallRuleDialog setFullWindows(boolean fullWindows) { + isFullWindows = fullWindows; + return this; + } + + @Override + public void buildDialog(XPopup.Builder builder) { + + } + + @Override + public int bindLayoutId() { + return R.layout.dialog_gift_wall_rule; + } + + @Override + protected int getPopupHeight() { + if (isFullWindows) { + return super.getPopupHeight(); + } + int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight(); + return (int) (screenHeight * 0.8); + } + + void initView() { + mIvBg = findViewById(R.id.iv_root_bg); + mIvBack = findViewById(R.id.iv_back); + iv_rule= findViewById(R.id.iv_rule); + } + + @Override + protected void onCreate() { + super.onCreate(); + initView(); + /*RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mIvBack.getLayoutParams(); + if (isFullWindows) { + params.width=DpUtil.dp2px(20); + mIvBack.setVisibility(View.VISIBLE); + mIvBg.setScaleType(ImageView.ScaleType.CENTER_CROP); + } else { + params.width=DpUtil.dp2px(1); + mIvBack.setVisibility(View.INVISIBLE); + mIvBg.setScaleType(ImageView.ScaleType.FIT_XY); + } + mIvBack.setLayoutParams(params);*/ + ImgLoader.displayDrawable(mContext, WordUtil.isNewZh() ? "https://downs.yaoulive.com/Group%201384.png" : "https://downs.yaoulive.com/Group%201381.png", -1, -1, new ImgLoader.DrawableCallback() { + @Override + public void onLoadSuccess(Drawable drawable) { + iv_rule.setImageDrawable(drawable); + } + + @Override + public void onLoadFailed() { + + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 2418c5a91..06b2e0644 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -1269,6 +1269,14 @@ public interface PDLiveApi { @Query("type")String type ); + @GET("/api/public/?service=Gift.getGiftHallMedalList") + Observable> getGiftHallMedalList(@Query("to_uid") String liveUid,@Query("type")String type); + + @GET("/api/public/?service=Dress.userUseDress") + Observable> userUseDress(@Query("dress_type") String dress_type,@Query("users_dress_id")String users_dress_id); + + + /** * 个人展馆 */ diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 50a6093f9..9687f4de4 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -3477,6 +3477,51 @@ public class LiveNetManager { }).isDisposed(); } + + public void getGiftHallMedalList(String toUid,String type, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getGiftHallMedalList(toUid,type) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + + public void userUseDress(String dressType,String usersDressId, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .userUseDress(dressType,usersDressId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + private MultipartBody.Part createUploadFile(File file) { RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); return MultipartBody.Part.createFormData("file", file.getName(), requestBody); diff --git a/common/src/main/java/com/yunbao/common/pay/hw/HwBuilder.java b/common/src/main/java/com/yunbao/common/pay/hw/HwBuilder.java index 776fa3873..9ddab63cd 100644 --- a/common/src/main/java/com/yunbao/common/pay/hw/HwBuilder.java +++ b/common/src/main/java/com/yunbao/common/pay/hw/HwBuilder.java @@ -26,7 +26,7 @@ public class HwBuilder { Object invite = clz.getConstructor(Activity.class).newInstance(mActivity); invite.getClass().getMethod("pay", String.class).invoke(invite, changeid); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } @@ -39,7 +39,7 @@ public class HwBuilder { Object invite = clz.getConstructor(Activity.class).newInstance(mActivity); invite.getClass().getMethod("consume").invoke(invite); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } @@ -49,13 +49,13 @@ public class HwBuilder { * @return */ public JSONObject getPayResult(Intent intent) { - JSONObject object; + JSONObject object = null; try { Class clz = mActivity.getClassLoader().loadClass("com.shayu.lib_huawei.utils.HuaWeiPayManage"); Object invite = clz.getConstructor(Activity.class).newInstance(mActivity); object = (JSONObject) invite.getClass().getMethod("getPayResult", Intent.class).invoke(invite, intent); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } return object; } diff --git a/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java b/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java index c97ea4a90..3924ac786 100644 --- a/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/GoogleUtils.java @@ -51,7 +51,7 @@ public class GoogleUtils { googlePay = clz.getConstructor(Activity.class).newInstance(mActivity); flag = (boolean) googlePay.getClass().getMethod("getGoogleService").invoke(googlePay); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } return flag; } @@ -87,13 +87,13 @@ public class GoogleUtils { * @return */ public JSONObject getLoginResult(Intent intent) { - JSONObject object; + JSONObject object = null; try { Class clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleManage"); Object invite = clz.getConstructor(Activity.class).newInstance(mActivity); object = (JSONObject) invite.getClass().getMethod("getLoginResult", Intent.class).invoke(invite, intent); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } return object; } @@ -108,7 +108,7 @@ public class GoogleUtils { googlePay = clz.getConstructor(Activity.class).newInstance(mActivity); googlePay.getClass().getMethod("initGooglePay").invoke(googlePay); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } @@ -120,7 +120,10 @@ public class GoogleUtils { Object invite = clz.getConstructor(Activity.class).newInstance(mActivity); adId = (String) invite.getClass().getMethod("getAdid").invoke(googlePay); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); + return ""; + + /*throw new RuntimeException(e);*/ } return adId; } @@ -132,7 +135,7 @@ public class GoogleUtils { try { googlePay.getClass().getMethod("checkSku", String.class).invoke(googlePay, skuId); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } @@ -147,7 +150,7 @@ public class GoogleUtils { try { googlePay.getClass().getMethod("initResultCode").invoke(googlePay); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } timer = new Timer(); @@ -170,7 +173,7 @@ public class GoogleUtils { billingListener.onPayFailed(mActivity.getString(R.string.pay_fail)); } } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } }; @@ -183,7 +186,7 @@ public class GoogleUtils { Object invite = clz.getConstructor(Context.class).newInstance(context); invite.getClass().getMethod("initializeApp").invoke(invite); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } @@ -201,7 +204,7 @@ public class GoogleUtils { timer.cancel(); } } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } }; @@ -214,7 +217,7 @@ public class GoogleUtils { googlePay = clz.getConstructor(Activity.class).newInstance(activity); googlePay.getClass().getMethod("initToken").invoke(googlePay); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } @@ -224,7 +227,7 @@ public class GoogleUtils { googlePay = clz.getConstructor(Activity.class).newInstance(mActivity); googlePay.getClass().getMethod("consumeAll").invoke(googlePay); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } @@ -237,7 +240,7 @@ public class GoogleUtils { .getMethod("setFirebaseCrashData", String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class) .invoke(googlePay, uid, userData, isGoogle, cpu, runTime, enterRoom, slidingRoom, playSvga, ActivitySize); } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } @@ -255,7 +258,7 @@ public class GoogleUtils { timer.cancel(); } } catch (Exception e) { - throw new RuntimeException(e); + e.printStackTrace(); } } }; diff --git a/common/src/main/res/drawable/gift_wall_achieve_wear_disable.xml b/common/src/main/res/drawable/gift_wall_achieve_wear_disable.xml new file mode 100644 index 000000000..2fcfa1f04 --- /dev/null +++ b/common/src/main/res/drawable/gift_wall_achieve_wear_disable.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common/src/main/res/drawable/gift_wall_achieve_wear_sure.xml b/common/src/main/res/drawable/gift_wall_achieve_wear_sure.xml new file mode 100644 index 000000000..8c8bcb446 --- /dev/null +++ b/common/src/main/res/drawable/gift_wall_achieve_wear_sure.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/common/src/main/res/layout/dialog_gift_wall_achieve.xml b/common/src/main/res/layout/dialog_gift_wall_achieve.xml new file mode 100644 index 000000000..25d50a04f --- /dev/null +++ b/common/src/main/res/layout/dialog_gift_wall_achieve.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_gift_wall_achieve_wear.xml b/common/src/main/res/layout/dialog_gift_wall_achieve_wear.xml new file mode 100644 index 000000000..74d2f78c4 --- /dev/null +++ b/common/src/main/res/layout/dialog_gift_wall_achieve_wear.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_gift_wall_achieve_wear_item.xml b/common/src/main/res/layout/dialog_gift_wall_achieve_wear_item.xml new file mode 100644 index 000000000..6bcbcd300 --- /dev/null +++ b/common/src/main/res/layout/dialog_gift_wall_achieve_wear_item.xml @@ -0,0 +1,37 @@ + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_gift_wall_rule.xml b/common/src/main/res/layout/dialog_gift_wall_rule.xml new file mode 100644 index 000000000..034ba94bd --- /dev/null +++ b/common/src/main/res/layout/dialog_gift_wall_rule.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/view_gift_wall_achieve_item.xml b/common/src/main/res/layout/view_gift_wall_achieve_item.xml new file mode 100644 index 000000000..d71b3fa12 --- /dev/null +++ b/common/src/main/res/layout/view_gift_wall_achieve_item.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-b+en+us/dialog_gift_wall_achieve_top_icon.png b/common/src/main/res/mipmap-b+en+us/dialog_gift_wall_achieve_top_icon.png new file mode 100644 index 000000000..ca11e48e2 Binary files /dev/null and b/common/src/main/res/mipmap-b+en+us/dialog_gift_wall_achieve_top_icon.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve.png new file mode 100644 index 000000000..ca04d20c5 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_top_bg.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_top_bg.png new file mode 100644 index 000000000..d02d53949 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_top_bg.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_top_icon.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_top_icon.png new file mode 100644 index 000000000..612178952 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_top_icon.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_bg.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_bg.png new file mode 100644 index 000000000..c15091644 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_bg.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_cancel.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_cancel.png new file mode 100644 index 000000000..fcf201e5b Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_cancel.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_item_bg.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_item_bg.png new file mode 100644 index 000000000..4e911f40b Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_item_bg.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_item_unlock.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_item_unlock.png new file mode 100644 index 000000000..232f46922 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_achieve_wear_item_unlock.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_back.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_back.png new file mode 100644 index 000000000..9bc24f217 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_back.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_more.png b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_more.png new file mode 100644 index 000000000..d3d3012a4 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/dialog_gift_wall_more.png differ diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 0ca615a3c..f8c82d07b 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1501,4 +1501,6 @@ 短劇 完成*1 主播正在PK,稍後再試 + 佩戴 + 榮譽成就 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index d2ff10baf..4cab841f5 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1500,4 +1500,6 @@ 短劇 完成*1 主播正在PK,稍後再試 + 佩戴 + 榮譽成就 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 32d4f066e..88f7361fb 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1501,6 +1501,8 @@ 個人展館 全站展館 榮譽成就 + 佩戴 + 榮譽成就 全部 已點亮 未點亮 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 5d5b4f53a..8eedc4f83 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1509,6 +1509,8 @@ Personal hal Whole site hal Honors + Put on + Honors All Lit up Not Lit diff --git a/gradle.properties b/gradle.properties index 5759f9c1a..8c8ea2d1f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ #Thu Feb 04 00:05:45 CST 2021 android.injected.testOnly=false org.gradle.daemon=true -org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.parallel=true org.gradle.configureondemand=true @@ -23,8 +23,6 @@ android.enableJetifier=true systemProp.http.proxyHost=127.0.0.1 systemProp.https.proxyHost=127.0.0.1 -systemProp.https.proxyPort=7890 -systemProp.http.proxyPort=7890 - - +systemProp.https.proxyPort=10809 +systemProp.http.proxyPort=10809 #android.enableR8.fullMode=true \ No newline at end of file diff --git a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java index 4271b4ec4..4812111ab 100644 --- a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java +++ b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java @@ -243,7 +243,7 @@ public class SWManager extends BaseCacheManager { // 功能模块的类型为视频截图上传 config.modules[0].type = ContentInspectConfig.CONTENT_INSPECT_TYPE_SUPERVISE; // 视频截图上传的频率为 2 秒一次 - config.modules[0].interval = 2; + config.modules[0].interval = 20; mRtcEngine.enableContentInspect(true, config); } diff --git a/lib_google/src/main/java/com/shayu/lib_google/utils/GoogleBillingManage.java b/lib_google/src/main/java/com/shayu/lib_google/utils/GoogleBillingManage.java index 0ba4267aa..20a2b38a4 100644 --- a/lib_google/src/main/java/com/shayu/lib_google/utils/GoogleBillingManage.java +++ b/lib_google/src/main/java/com/shayu/lib_google/utils/GoogleBillingManage.java @@ -135,7 +135,7 @@ public class GoogleBillingManage implements PurchasesUpdatedListener { object.put("orderList", orderList); object.put("tradeNo", tradeNo); } catch (JSONException e) { - throw new RuntimeException(e); + e.printStackTrace(); } return object; } @@ -196,11 +196,12 @@ public class GoogleBillingManage implements PurchasesUpdatedListener { try { return AdvertisingIdClient.getAdvertisingIdInfo(mContext).getId(); } catch (IOException e) { - throw new RuntimeException(e); + e.printStackTrace(); + return ""; } catch (GooglePlayServicesNotAvailableException e) { - throw new RuntimeException(e); + e.printStackTrace(); return ""; } catch (GooglePlayServicesRepairableException e) { - throw new RuntimeException(e); + e.printStackTrace(); return ""; } } @@ -221,7 +222,7 @@ public class GoogleBillingManage implements PurchasesUpdatedListener { object.put("resultToken", resultToken); object.put("resultOrderId", resultOrderId); } catch (JSONException e) { - throw new RuntimeException(e); + e.printStackTrace(); } return object; } diff --git a/lib_huawei/src/main/java/com/shayu/lib_huawei/utils/HuaWeiPayManage.java b/lib_huawei/src/main/java/com/shayu/lib_huawei/utils/HuaWeiPayManage.java index 15afa1d7c..ff4aed887 100644 --- a/lib_huawei/src/main/java/com/shayu/lib_huawei/utils/HuaWeiPayManage.java +++ b/lib_huawei/src/main/java/com/shayu/lib_huawei/utils/HuaWeiPayManage.java @@ -99,7 +99,7 @@ public class HuaWeiPayManage { object.put("inAppPurchaseData", purchaseResultInfo.getInAppPurchaseData()); object.put("inAppPurchaseDataSignature", purchaseResultInfo.getInAppDataSignature()); } catch (JSONException e) { - throw new RuntimeException(e); + e.printStackTrace(); } return object; } diff --git a/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java b/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java index e35fb773f..b25f9fbf2 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java @@ -67,6 +67,7 @@ public class LiveReceiveGiftBean extends BaseModel { private String msg; private String msg_en; private String guard_type; + private int user_naming_status; private AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent; private boolean showB; @@ -288,6 +289,14 @@ public class LiveReceiveGiftBean extends BaseModel { this.hot_num = hot_num; } + public int getUser_naming_status() { + return user_naming_status; + } + + public void setUser_naming_status(int user_naming_status) { + this.user_naming_status = user_naming_status; + } + public String getUid() { return uid; } diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index 2ca16c616..d2e0c33d8 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -1024,8 +1024,8 @@ public class LiveGiftAnimPresenter { } } } - showGifGift(bean); + showNormalGift(bean); } else { showNormalGift(bean); } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 8be0ec603..8512f5bcb 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -1242,6 +1242,7 @@ public class SocketRyClient { receiveGiftBean.setNamingLiveName(map.getString("naming_live_name")); receiveGiftBean.setNamingUid(map.getString("naming_uid")); receiveGiftBean.setNamingLiveuid(map.getString("naming_liveuid")); + receiveGiftBean.setUser_naming_status(map.getInteger("user_naming_status")); receiveGiftBean.setmLiveUId(mLiveUid); receiveGiftBean.setmTypeBuyGuard(false); receiveGiftBean.setAllServerNotify(false); diff --git a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java index 69c23c515..2dac83908 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java @@ -1142,6 +1142,7 @@ public class SocketSwClient { receiveGiftBean.setNamingLiveName(map.getString("naming_live_name")); receiveGiftBean.setNamingUid(map.getString("naming_uid")); receiveGiftBean.setNamingLiveuid(map.getString("naming_liveuid")); + receiveGiftBean.setUser_naming_status(map.getInteger("user_naming_status")); receiveGiftBean.setmLiveUId(mLiveUid); receiveGiftBean.setmTypeBuyGuard(false); receiveGiftBean.setAllServerNotify(false); diff --git a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java index 10f396bb5..cbc96ad11 100644 --- a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java @@ -19,6 +19,7 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.lxj.xpopup.XPopup; +import com.makeramen.roundedimageview.RoundedImageView; import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.event.LiveGiftDialogEvent; @@ -26,7 +27,9 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.GiftCacheUtil; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.weight.MarqueeTextView; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; import com.yunbao.live.dialog.SendRendPacketPopup; @@ -41,6 +44,9 @@ public class FrameGiftViewHolder extends RecyclerView.ViewHolder { private ScaleAnimation mAnimation; private LinearLayout mLoadingLayout; private ImageView mLoading; + private LinearLayout namingLayout; + private MarqueeTextView naming_name; + private RoundedImageView avatar; public FrameGiftViewHolder(@NonNull View itemView) { super(itemView); @@ -54,6 +60,10 @@ public class FrameGiftViewHolder extends RecyclerView.ViewHolder { mLoadingLayout = itemView.findViewById(R.id.gift_loading_layout); mLoading = itemView.findViewById(R.id.gift_loading); + namingLayout = itemView.findViewById(R.id.namingLayout); + naming_name = itemView.findViewById(R.id.naming_name); + avatar = itemView.findViewById(R.id.avatar); + mAnimation = new ScaleAnimation(0.9f, 1.1f, 0.9f, 1.1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); mAnimation.setInterpolator(new AccelerateDecelerateInterpolator()); mAnimation.setDuration(400); @@ -89,7 +99,8 @@ public class FrameGiftViewHolder extends RecyclerView.ViewHolder { // } else { giftName.setText(model.getName()); // } - + naming_name.setText(model.getNamingLiveName()); + ImgLoader.display(mContext,model.getNamingLiveAvatar(),avatar); //特殊礼物红包 if (model.getType() == 9999999) { mPayIco.setVisibility(View.GONE); @@ -114,7 +125,11 @@ public class FrameGiftViewHolder extends RecyclerView.ViewHolder { } else { mLoadingLayout.setVisibility(GiftCacheUtil.checkGiftIsDownload(model.getId()) ? View.GONE : View.VISIBLE); } - + if(model.isChecked()&& !StringUtil.isEmpty(model.getNamingLiveName())){ + namingLayout.setVisibility(View.VISIBLE); + }else{ + namingLayout.setVisibility(View.GONE); + } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java index 40f0dcec0..4ce21e6f8 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java @@ -41,6 +41,7 @@ public class LiveGiftViewHolder extends AbsViewHolder { private TextView mGiftCount; private TextView mGiftGroupCount; private TextView mMulSign;//乘号 + private ImageView giftNamingIcon; private int mDp214; private ObjectAnimator mAnimator; private Animation mAnimation;//礼物数字执行的放大动画 @@ -73,6 +74,7 @@ public class LiveGiftViewHolder extends AbsViewHolder { mGiftCount = (TextView) findViewById(R.id.gift_count); mGiftGroupCount = (TextView) findViewById(R.id.gift_group_count); mMulSign = (TextView) findViewById(R.id.mul_sign); + giftNamingIcon = (ImageView) findViewById(R.id.gift_naming_icon); mDp214 = DpUtil.dp2px(214); mHandler = new Handler() { @Override @@ -186,7 +188,14 @@ public class LiveGiftViewHolder extends AbsViewHolder { root_back.setBackgroundResource(R.drawable.background_naming); findViewById(R.id.naming_icon).setVisibility(View.VISIBLE); } else { - root_back.setBackgroundResource(R.mipmap.icon_live_gift_anim_3); + if(bean.getUser_naming_status()==1){ + giftNamingIcon.setVisibility(View.VISIBLE); + root_back.setBackgroundResource(R.mipmap.icon_live_gift_anim_11); + }else{ + giftNamingIcon.setVisibility(View.GONE); + root_back.setBackgroundResource(R.mipmap.icon_live_gift_anim_3); + } + //root_back.setBackgroundResource(R.mipmap.icon_live_gift_anim_3); findViewById(R.id.naming_icon).setVisibility(View.GONE); } if (lian && mGiftCount != null && mAnimation != null) { diff --git a/live/src/main/res/layout/item_frame_gift.xml b/live/src/main/res/layout/item_frame_gift.xml index e6495ce45..83e88d9bb 100644 --- a/live/src/main/res/layout/item_frame_gift.xml +++ b/live/src/main/res/layout/item_frame_gift.xml @@ -1,5 +1,7 @@ - - + + + + + + + + + + @@ -119,4 +121,13 @@ android:text="@string/the_title_financier2" android:textColor="#DB7008" android:textSize="10sp" /> + + + diff --git a/live/src/main/res/mipmap-b+en+us/gift_naming_icon.png b/live/src/main/res/mipmap-b+en+us/gift_naming_icon.png new file mode 100644 index 000000000..1dba89d02 Binary files /dev/null and b/live/src/main/res/mipmap-b+en+us/gift_naming_icon.png differ diff --git a/live/src/main/res/mipmap-mdpi/gift_naming_icon.png b/live/src/main/res/mipmap-mdpi/gift_naming_icon.png new file mode 100644 index 000000000..17a42bb86 Binary files /dev/null and b/live/src/main/res/mipmap-mdpi/gift_naming_icon.png differ diff --git a/live/src/main/res/mipmap-mdpi/icon_live_gift_anim_11.png b/live/src/main/res/mipmap-mdpi/icon_live_gift_anim_11.png new file mode 100644 index 000000000..e8f5b1493 Binary files /dev/null and b/live/src/main/res/mipmap-mdpi/icon_live_gift_anim_11.png differ diff --git a/live/src/main/res/mipmap-xhdpi/item_frame_gift_naming_bg.png b/live/src/main/res/mipmap-xhdpi/item_frame_gift_naming_bg.png new file mode 100644 index 000000000..a616e69ed Binary files /dev/null and b/live/src/main/res/mipmap-xhdpi/item_frame_gift_naming_bg.png differ diff --git a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java index 5d50f0f66..a89ec5c31 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java @@ -136,14 +136,14 @@ public class MyWalletActivity extends AbsActivity { } }); } catch (JSONException e) { - throw new RuntimeException(e); + e.printStackTrace(); } } }); } } } catch (JSONException e) { - throw new RuntimeException(e); + e.printStackTrace(); } } }); @@ -491,7 +491,7 @@ public class MyWalletActivity extends AbsActivity { } catch (JSONException e) { - throw new RuntimeException(e); + e.printStackTrace(); } }