diff --git a/app/build.gradle b/app/build.gradle index b9255e4bd..256ba9cb8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -268,7 +268,6 @@ repositories { dependencies { implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) - //implementation platform('com.google.firebase:firebase-bom:30.5.0') //implementation 'com.google.firebase:firebase-crashlytics' diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 8fd155fc8..87cfa033e 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -278,6 +278,18 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode; -keep class tech.sud.mgp.hello.ui.main.settings.model.** {*;} -keep class tech.sud.mgp.hello.ui.main.nft.model.** {*;} -keep class tech.sud.mgp.hello.common.event.model.** {*;} +-keep class tech.sud.mgp.**{*;} + +-keep class bitter.jnibridge.** { *; } +-keep class com.google.androidgamesdk.** { *; } +-keep class com.unity3d.** { *; } +-keep class do.do.do.** { *; } +-keep class do.if.do.** { *; } +-keep class for.do.** { *; } +-keep class if.do.do.do.** { *; } +-keep class org.fmod.** { *; } +-keep class tech.sud.** { *; } +-keep class tech.unity3d.** { *; } -keep class com.yunbao.common.sud.** {*;} diff --git a/common/build.gradle b/common/build.gradle index 45a880334..69510f1a0 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -211,9 +211,7 @@ dependencies { //自定义圆角图片 api 'com.makeramen:roundedimageview:2.3.0' // 友盟统计SDK - api 'com.umeng.umsdk:common:9.6.3'// 必选 - api 'com.umeng.umsdk:asms:1.8.0'// 必选 - api 'com.umeng.umsdk:uyumao:1.1.2' + api(name: 'umeng-common-9.6.8+000', ext: 'aar') //高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。 // 标准版本SudMGP SDK api 'tech.sud.mgp:SudMGP:1.3.3.1158' diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java index 9152dba72..fb7003cc0 100644 --- a/common/src/main/java/com/yunbao/common/Constants.java +++ b/common/src/main/java/com/yunbao/common/Constants.java @@ -274,6 +274,8 @@ public class Constants { public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦 public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦 + public static final String SOCKET_LIVE_ANCHOR_PK_DIALOG="GuildCompetitionNotice";//公会赛弹窗 + //视频举报获取位置 public static int xIndex = 0; public static int yindex = 0; diff --git a/common/src/main/java/com/yunbao/common/HtmlConfig.java b/common/src/main/java/com/yunbao/common/HtmlConfig.java index dea26de6c..782b3b439 100644 --- a/common/src/main/java/com/yunbao/common/HtmlConfig.java +++ b/common/src/main/java/com/yunbao/common/HtmlConfig.java @@ -39,7 +39,7 @@ public class HtmlConfig { public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index"; //在线商城 - public static final String SHOP = CommonAppConfig.HOST + "/h5/shoppingMall.html"; + public static final String SHOP = CommonAppConfig.HOST + "/h5/shop/index.html"; //社区 public static final String ENCOURAGE = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ"; diff --git a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java index 59851d060..7b9c9ba53 100644 --- a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java @@ -6,6 +6,7 @@ import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; +import android.graphics.Typeface; import android.os.Build; import android.os.Bundle; import android.provider.Settings; @@ -30,7 +31,6 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.interfaces.LifeCycleListener; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.ClickUtil; -import com.yunbao.common.utils.ToastUtil; import java.util.ArrayList; import java.util.List; @@ -92,7 +92,8 @@ public abstract class AbsActivity extends AppCompatActivity { protected void main() { } - protected void create(){ + + protected void create() { } @@ -107,6 +108,17 @@ public abstract class AbsActivity extends AppCompatActivity { } } + protected void setTitleBold(boolean bold) { + TextView titleView = (TextView) findViewById(R.id.titleView); + if (titleView != null) { + if (bold) { + titleView.setTypeface(Typeface.DEFAULT_BOLD); + } else { + titleView.setTypeface(Typeface.DEFAULT); + } + } + } + public void backClick(View v) { if (v.getId() == R.id.btn_back) { onBackPressed(); @@ -181,14 +193,14 @@ public abstract class AbsActivity extends AppCompatActivity { //友盟统计 // MobclickAgent.onResume(this); MobclickAgent.onPageStart(this.mTag); - Log.e("MobclickAgent","MobclickAgent:_onResume_"+this.mTag); + Log.e("MobclickAgent", "MobclickAgent:_onResume_" + this.mTag); } @Override protected void onPause() { super.onPause(); MobclickAgent.onPageEnd(this.mTag); - Log.e("MobclickAgent","MobclickAgent:_onPause_"+this.mTag); + Log.e("MobclickAgent", "MobclickAgent:_onPause_" + this.mTag); if (mLifeCycleListeners != null) { for (LifeCycleListener listener : mLifeCycleListeners) { listener.onPause(); @@ -382,11 +394,12 @@ public abstract class AbsActivity extends AppCompatActivity { break; } } - public boolean isKefu(String url){ - if(url.contains("kefu")){ + + public boolean isKefu(String url) { + if (url.contains("kefu")) { return true; } - if(url.contains("https://newkf.yaoulive.com/")){ + if (url.contains("https://newkf.yaoulive.com/")) { return true; } return url.startsWith("https://kefu.yaoulive.com"); diff --git a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java index aeec0100e..2a1046b0d 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -29,6 +29,7 @@ import com.lxj.xpopup.XPopup; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; +import com.yunbao.common.HtmlConfig; import com.yunbao.common.R; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.event.JavascriptInterfaceEvent; @@ -100,7 +101,6 @@ public class WebViewActivity extends AbsActivity { ft_title = (FrameLayout) findViewById(R.id.ft_title); v_spacing = (View) findViewById(R.id.v_spacing); mWebView = findViewById(R.id.webView); - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); params.topMargin = DpUtil.dp2px(1); // mWebView.setLayoutParams(params); @@ -136,11 +136,17 @@ public class WebViewActivity extends AbsActivity { if (url.contains("for")) { mWebView.loadUrl("javascript:goAnchorTab()"); } + + + if(url.startsWith(HtmlConfig.SHOP)){ + //商店页不做动态变换 + return; + } //真实屏幕高度-(ft_title的高度+导航栏高度) //屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效 int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext); if (!navigationGestureEnabled(mContext)) { - view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)"); + // view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)"); } } @@ -194,6 +200,8 @@ public class WebViewActivity extends AbsActivity { mWebView.getSettings().setAllowFileAccess(true); mWebView.getSettings().setUseWideViewPort(true); // 关键点 mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件 + mWebView.setHorizontalScrollBarEnabled(false); + mWebView.setVerticalScrollBarEnabled(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); @@ -213,6 +221,9 @@ public class WebViewActivity extends AbsActivity { ft_title.setVisibility(View.VISIBLE); v_spacing.setVisibility(View.GONE); } + if(!StringUtil.isEmpty(url)&&url.startsWith(HtmlConfig.SHOP)){ + ft_title.setVisibility(View.GONE); + } } diff --git a/common/src/main/java/com/yunbao/common/adapter/DebugDialogAdapter.java b/common/src/main/java/com/yunbao/common/adapter/DebugDialogAdapter.java index ca04fe7b4..478007151 100644 --- a/common/src/main/java/com/yunbao/common/adapter/DebugDialogAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/DebugDialogAdapter.java @@ -2,7 +2,7 @@ package com.yunbao.common.adapter; import android.content.Context; import android.graphics.Color; -import android.view.TextureView; +import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; @@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.TreeMap; public class DebugDialogAdapter extends RecyclerView.Adapter { @@ -24,6 +23,7 @@ public class DebugDialogAdapter extends RecyclerView.Adapter paramMap) { + Log.i("debug弹窗", "setParamMap: 添加值到view " + paramMap.size()); this.paramMap = paramMap; notifyDataSetChanged(); } @@ -37,11 +37,13 @@ public class DebugDialogAdapter extends RecyclerView.Adapter list = new ArrayList<>(paramMap.keySet()); + Log.i("debug弹窗", "onBindViewHolder: 添加值到view " + list.size() + "|" + paramMap.size()); holder.setData(list.get(position), paramMap.get(list.get(position))); } @Override public int getItemCount() { + Log.i("debug弹窗", "getItemCount: " + paramMap.size()); return paramMap.size(); } @@ -52,6 +54,7 @@ public class DebugDialogAdapter extends RecyclerView.Adapter child = new ArrayList<>(); + private List srcChild = new ArrayList<>(); public InteractionGamesAdapter(Context mContext, boolean rigts) { this.mContext = mContext; @@ -46,7 +50,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter { long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc()); if (activityID != 0) { Bus.get().post(new CustomDrawerPopupEvent() - .setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(child)); + .setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild)); } @@ -61,6 +65,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter { public void updateData(List mChild) { child.clear(); + srcChild.clear(); if (mChild.size() > 8) { for (int i = 0; i < 8; i++) { child.add(mChild.get(i)); @@ -68,6 +73,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter { } else { child.addAll(mChild); } + srcChild.addAll(mChild); notifyDataSetChanged(); } diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java index 38a531bce..3d17bf60e 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java @@ -67,13 +67,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter { public void updateData(List mChild) { child.clear(); - if (mChild.size() > 8) { + /* if (mChild.size() > 8) { for (int i = 0; i < 8; i++) { child.add(mChild.get(i)); } } else { child.addAll(mChild); - } + }*/ + child.addAll(mChild); notifyDataSetChanged(); } diff --git a/common/src/main/java/com/yunbao/common/bean/AiAutomaticSpeechModel.java b/common/src/main/java/com/yunbao/common/bean/AiAutomaticSpeechModel.java index 140e86000..72bec43e9 100644 --- a/common/src/main/java/com/yunbao/common/bean/AiAutomaticSpeechModel.java +++ b/common/src/main/java/com/yunbao/common/bean/AiAutomaticSpeechModel.java @@ -1,6 +1,9 @@ package com.yunbao.common.bean; +import com.alibaba.fastjson.annotation.JSONField; import com.google.gson.annotations.SerializedName; +import com.yunbao.common.utils.StringUtil; +import com.yunbao.common.utils.WordUtil; /** * 机器人助手IM消息 @@ -21,6 +24,9 @@ public class AiAutomaticSpeechModel extends BaseModel { //标签图片 @SerializedName("icon") private String icon; + @SerializedName("icon_en") + @JSONField(name = "icon_en") + private String iconEn; //气泡背景 @SerializedName("system_bubble") private String systemBubble; @@ -35,7 +41,7 @@ public class AiAutomaticSpeechModel extends BaseModel { } public String getAiName() { - return aiName+":"; + return aiName + ":"; } public AiAutomaticSpeechModel setAiName(String aiName) { @@ -43,6 +49,15 @@ public class AiAutomaticSpeechModel extends BaseModel { return this; } + public String getIconEn() { + return iconEn; + } + + public AiAutomaticSpeechModel setIconEn(String iconEn) { + this.iconEn = iconEn; + return this; + } + public String getContent() { return content; } @@ -62,6 +77,9 @@ public class AiAutomaticSpeechModel extends BaseModel { } public String getIcon() { + if (!WordUtil.isNewZh() && !StringUtil.isEmpty(iconEn)) { + return iconEn; + } return icon; } diff --git a/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java b/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java index 7467819fb..fe8b274c2 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveBattlePassRewardsBean.java @@ -7,12 +7,21 @@ import java.util.Map; public class LiveBattlePassRewardsBean extends BaseModel{ private int level; + private int is_received; private List live_battle_pass_type; private Map> live_battle_pass_rewards; public LiveBattlePassRewardsBean() { } + public int getIs_received() { + return is_received; + } + + public void setIs_received(int is_received) { + this.is_received = is_received; + } + public int getLevel() { return level; } diff --git a/common/src/main/java/com/yunbao/common/bean/RedPacketInfoModel.java b/common/src/main/java/com/yunbao/common/bean/RedPacketInfoModel.java index a28783b02..7bb3f8e60 100644 --- a/common/src/main/java/com/yunbao/common/bean/RedPacketInfoModel.java +++ b/common/src/main/java/com/yunbao/common/bean/RedPacketInfoModel.java @@ -49,6 +49,16 @@ public class RedPacketInfoModel extends BaseModel { //超级红包ID @SerializedName("super_jackpot_id") private String superJackpotId; + @SerializedName("red_packet_type") + private int redPacketType;// 1.普通红包 2.特殊红包 + + public int getRedPacketType() { + return redPacketType; + } + + public void setRedPacketType(int redPacketType) { + this.redPacketType = redPacketType; + } public String getSuperJackpotId() { return superJackpotId; diff --git a/common/src/main/java/com/yunbao/common/bean/UserBean.java b/common/src/main/java/com/yunbao/common/bean/UserBean.java index 5a8128c02..2cd6e34b3 100644 --- a/common/src/main/java/com/yunbao/common/bean/UserBean.java +++ b/common/src/main/java/com/yunbao/common/bean/UserBean.java @@ -934,11 +934,20 @@ public class UserBean implements Parcelable { private String medal; private String bubble; private String medal_new; + private String medal_new_en; public String getMedal_new() { return medal_new; } + public String getMedal_new_en() { + return medal_new_en; + } + + public void setMedal_new_en(String medal_new_en) { + this.medal_new_en = medal_new_en; + } + public void setMedal_new(String medal_new) { this.medal_new = medal_new; } diff --git a/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java b/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java index d265f74ea..d8759af91 100644 --- a/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java @@ -45,6 +45,9 @@ import java.util.List; import java.util.Locale; import java.util.Random; +/** + * 半屏创建游戏房间 + */ public class CreateSudGamePopup extends BottomPopupView { private List customSidebarChildModels = new ArrayList<>(); private TextView createGameType, selectCurrencyType; @@ -312,20 +315,50 @@ public class CreateSudGamePopup extends BottomPopupView { animator.setDuration(animDuration); animator.setInterpolator(new LinearInterpolator()); animator.start(); - XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type)); - builder.hasShadowBg(false) - .isDestroyOnDismiss(true) - .isLightStatusBar(false) - .popupPosition(PopupPosition.Bottom) - .asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao) - .setOnDismissListener(new DialogInterface.OnDismissListener() { - @Override - public void onDismiss(DialogInterface dialog) { - closeAnimSudGameListEvent(); - } - }) - ) - .show(); + if (hasMoveUp) { + InputMethodManager imm = getSystemService(getContext(), InputMethodManager.class); + if (imm != null) { + imm.hideSoftInputFromWindow(roomName.getWindowToken(), 0); + imm.hideSoftInputFromWindow(gameSill.getWindowToken(), 0); + } + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type)); + builder.hasShadowBg(false) + .isDestroyOnDismiss(true) + .isLightStatusBar(false) + .popupPosition(PopupPosition.Bottom) + .asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao) + .setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + closeAnimSudGameListEvent(); + } + }) + ) + .show(); + } + }, 500); + }else { + XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type)); + builder.hasShadowBg(false) + .isDestroyOnDismiss(true) + .isLightStatusBar(false) + .popupPosition(PopupPosition.Bottom) + .asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao) + .setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + closeAnimSudGameListEvent(); + } + }) + ) + .show(); + } + + + } }); } diff --git a/common/src/main/java/com/yunbao/common/dialog/DebugDialog.java b/common/src/main/java/com/yunbao/common/dialog/DebugDialog.java index ea6f6ea0e..900d421e9 100644 --- a/common/src/main/java/com/yunbao/common/dialog/DebugDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/DebugDialog.java @@ -3,6 +3,10 @@ package com.yunbao.common.dialog; import android.app.Activity; import android.content.Context; import android.graphics.Color; +import android.os.Handler; +import android.os.Looper; +import android.util.Log; +import android.view.ViewGroup; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -11,10 +15,12 @@ import com.lzf.easyfloat.EasyFloat; import com.lzf.easyfloat.enums.ShowPattern; import com.lzf.easyfloat.interfaces.OnPermissionResult; import com.lzf.easyfloat.permission.PermissionUtils; -import com.yunbao.common.CommonAppContext; import com.yunbao.common.adapter.DebugDialogAdapter; +import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.ToastUtil; +import java.util.Timer; +import java.util.TimerTask; import java.util.TreeMap; @@ -25,9 +31,9 @@ public class DebugDialog { private static DebugDialog debugDialog; Context mContext; - public static DebugDialog getInstance(Activity mainActivity) { + public static DebugDialog getInstance() { if (debugDialog == null) { - debugDialog = new DebugDialog(mainActivity); + debugDialog = new DebugDialog(); } return debugDialog; } @@ -38,14 +44,25 @@ public class DebugDialog { } public void setParams(String tag, String msg) { + Log.i("debug弹窗", "setParams: "+tag+"|"+msg); params.put(tag, msg); if (adapter != null) adapter.setParamMap(params); } - private DebugDialog(Context mContext) { - this.mContext = mContext; - params = new TreeMap<>(); + private DebugDialog() { + if(params==null) { + Log.i("debug弹窗", "DebugDialog: 初始化参数"); + params = new TreeMap<>(); + } + init(); + } + private void init(){ + this.mContext = AppManager.getInstance().getMainActivity(); + if (mContext == null) { + startWaitMainActivity(); + return; + } if (PermissionUtils.checkPermission(mContext)) { createView(); } else { @@ -59,18 +76,44 @@ public class DebugDialog { } }); } + // createView(); + } + + private void startWaitMainActivity() { + new Timer().schedule(new TimerTask() { + @Override + public void run() { + Log.i("debug弹窗", "run: "+AppManager.getInstance().getMainActivity()); + if (AppManager.getInstance().getMainActivity() != null) { + init(); + cancel(); + } + } + }, 0,1000); } protected void createView() { recyclerView = new RecyclerView(mContext); adapter = new DebugDialogAdapter(mContext); recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); + recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT)); recyclerView.setAdapter(adapter); recyclerView.setBackgroundColor(Color.WHITE); EasyFloat.with(mContext) .setTag("debug") - .setShowPattern(ShowPattern.ALL_TIME) + .setShowPattern(ShowPattern.FOREGROUND) .setLayout(recyclerView) .show(); + if(!params.isEmpty()){ + + new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { + @Override + public void run() { + adapter.setParamMap(params); + } + },1000); + Log.i("debug弹窗", "createView: 有值"); + } + Log.i("debug弹窗", "createView: 创建"); } } diff --git a/common/src/main/java/com/yunbao/common/dialog/LiveNewRolePopup.java b/common/src/main/java/com/yunbao/common/dialog/LiveNewRolePopup.java index 442bc2577..95fd1368d 100644 --- a/common/src/main/java/com/yunbao/common/dialog/LiveNewRolePopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/LiveNewRolePopup.java @@ -21,6 +21,7 @@ import org.greenrobot.eventbus.ThreadMode; import java.util.List; +//游戏弹窗 public class LiveNewRolePopup extends BottomPopupView { private boolean showRed = false; diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameListSelectPopup.java b/common/src/main/java/com/yunbao/common/dialog/SudGameListSelectPopup.java index 40b01008b..fbca07bed 100644 --- a/common/src/main/java/com/yunbao/common/dialog/SudGameListSelectPopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameListSelectPopup.java @@ -19,6 +19,7 @@ import com.yunbao.common.event.LiveSudGameHistoryEvent; import com.yunbao.common.event.RoomHolderTypeEvent; import com.yunbao.common.event.SudGameListEvent; import com.yunbao.common.event.SudGameListSillEvent; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.views.weight.ViewClicksAntiShake; @@ -87,6 +88,11 @@ public class SudGameListSelectPopup extends AttachPopupView { if (mType == 0 || mType == 4) { topSelect.setText(getContext().getString(R.string.interactive_game_room_all)); for (int i = 0; i < customSidebarChildModels.size(); i++) { + /* if (!IMLoginManager.get(getContext()).getUserInfo().anchorUserType()) { + if ("1490944230389182466".equals(customSidebarChildModels.get(i).getSrc())) {//友尽闯关 + continue; + } + }*/ selectString.add(customSidebarChildModels.get(i).getTitle()); if (TextUtils.equals(String.valueOf(interactionID), customSidebarChildModels.get(i).getSrc())) { index = i; diff --git a/common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java b/common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java index 9c99fab9b..e9efbc93a 100644 --- a/common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java +++ b/common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java @@ -115,6 +115,36 @@ public class SendBlindGiftEvent extends BaseModel { private String liveGiftNotify; @SerializedName("userNiceName") private String userNiceName; + @SerializedName("special_gift") + private int specialGift; + @SerializedName("special_gift_name") + private String specialGiftName; + @SerializedName("special_gift_name_en") + private String specialGiftNameEn; + + public int getSpecialGift() { + return specialGift; + } + + public void setSpecialGift(int specialGift) { + this.specialGift = specialGift; + } + + public String getSpecialGiftName() { + return specialGiftName; + } + + public void setSpecialGiftName(String specialGiftName) { + this.specialGiftName = specialGiftName; + } + + public String getSpecialGiftNameEn() { + return specialGiftNameEn; + } + + public void setSpecialGiftNameEn(String specialGiftNameEn) { + this.specialGiftNameEn = specialGiftNameEn; + } public String getUserNiceName() { return userNiceName; diff --git a/common/src/main/java/com/yunbao/common/event/SubGameEvent.java b/common/src/main/java/com/yunbao/common/event/SubGameEvent.java new file mode 100644 index 000000000..d88b9f54c --- /dev/null +++ b/common/src/main/java/com/yunbao/common/event/SubGameEvent.java @@ -0,0 +1,44 @@ +package com.yunbao.common.event; + +import com.yunbao.common.bean.HttpCallbackModel; + +public class SubGameEvent { + int type; + HttpCallbackModel model; + String dataJson; + + public SubGameEvent(int type, HttpCallbackModel model, String dataJson) { + this.type = type; + this.model = model; + this.dataJson = dataJson; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public HttpCallbackModel getModel() { + return model; + } + + public void setModel(HttpCallbackModel model) { + this.model = model; + } + + public String getDataJson() { + return dataJson; + } + + @Override + public String toString() { + return "SubGameEvent{" + + "type=" + type + + ", model=" + model + + ", dataJson='" + dataJson + '\'' + + '}'; + } +} diff --git a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java index a047ebeec..348558d19 100644 --- a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java @@ -43,7 +43,6 @@ import java.util.Locale; */ public class CommonHttpUtil { - public static final String GET_UPLOAD_QI_NIU_TOKEN = "getUploadQiNiuToken"; /** @@ -643,7 +642,16 @@ public class CommonHttpUtil { .params("ext", isImg ? ".jpeg" : ".mp4") .execute(callback); } - + /** + * 上传文件 获取七牛云token的接口 + */ + public static void getUploadQiNiuTokenNew(HttpCallback callback, boolean isImg) { + HttpClient.getInstance().get("Pdluserhome.getQiNiuToken2", "Pdluserhome.getQiNiuToken2") + .params("uid", CommonAppConfig.getInstance().getUid()) + .params("token", CommonAppConfig.getInstance().getToken()) + .params("ext", isImg ? ".jpeg" : ".mp4") + .execute(callback); + } /** * 修改用户背景墙 */ 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 3c380d201..cf0e9f038 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -129,7 +129,7 @@ public interface PDLiveApi { @Field("uuid_Device") String uuidDevice, @Field("pushid") String pushid, @Field("lastlogindevice") String lastlogindevice, - @Field("langue")String langue + @Field("langue") String langue ); /** @@ -1329,11 +1329,43 @@ public interface PDLiveApi { @GET("/api/public/?service=Guard.participateMoneyLong") Observable> participateMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey); + @GET("/api/public/?service=Guard.endSendMoneyLong") Observable> endSendMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey); + @GET("/api/public/?service=Guard.checkUpgrades") Observable> checkUpgrades(@Query("liveuid") String liveUid); + @GET("/api/public/?service=Guard.getRewards") - Observable> guardGetRewards(@Query("guard_level") String guardLevel,@Query("liveuid") String liveUid); + Observable> guardGetRewards(@Query("guard_level") String guardLevel, @Query("liveuid") String liveUid); + + @GET("/api/public/?service=User.userFeedback") + Observable>> feedback(@Query("problem_description") String content, @Query("problem_image") String images, @Query("contact_information") String ci); + + + @GET("/api/public/?service=User.userFeedbackRestrict") + Observable>> checkFeedback(); + + /** + * + * @param roomId 房间ID + * @param cmd 事件名称 生命值:addHeart 自动跳:hit + * @param value 价格 + * @param gameId 游戏ID + * @param fromUid 付费用户uid + * @param toUid 目标用户uid + * @param payload 附加值 + * @return + */ + @GET("/api/public/?service=Sudgameserver.createOrder") + Observable>> createGameOrder( + @Query("room_id")String roomId, + @Query("cmd")String cmd, + @Query("value")String value, + @Query("mg_id")String gameId, + @Query("from_uid")String fromUid, + @Query("to_uid")String toUid, + @Query("payload")String payload + ); } 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 46328d6bd..ddfba2000 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 @@ -4,6 +4,7 @@ import android.content.Context; import android.text.TextUtils; import android.util.Log; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; @@ -3159,6 +3160,97 @@ public class LiveNetManager { } + + public void feedback( + String content, + JSONArray images, + String ci + , HttpCallback callback) { + API.get().pdLiveApi(mContext) + .feedback(content, images.toString(), ci) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> responseModel) { + if (callback != null) { + HttpCallbackModel model = new HttpCallbackModel(); + model.setCode(responseModel.getData().getCode()); + model.setMsg(responseModel.getData().getMsg()); + callback.onSuccess(model); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(com.yunbao.common.R.string.net_error)); + } + } + }).isDisposed(); + } + + public void checkFeedback( + HttpCallback callback) { + API.get().pdLiveApi(mContext) + .checkFeedback() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> responseModel) { + if (callback != null) { + HttpCallbackModel model = new HttpCallbackModel(); + model.setCode(responseModel.getData().getCode()); + model.setMsg(responseModel.getData().getMsg()); + callback.onSuccess(model); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(com.yunbao.common.R.string.net_error)); + } + } + }).isDisposed(); + } + + public void createGameOrder( + String roomId, + String cmd, + String value, + String gameId, + String fromUid, + String toUid, + String roundId, + String payload + , HttpCallback callback) { + API.get().pdLiveApi(mContext) + .createGameOrder(roomId, cmd, value, gameId, fromUid, toUid,payload) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> responseModel) { + if (callback != null) { + HttpCallbackModel model = new HttpCallbackModel(); + model.setCode(responseModel.getData().getCode()); + model.setMsg(responseModel.getData().getMsg()); + callback.onSuccess(model); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(com.yunbao.common.R.string.net_error)); + } + } + }).isDisposed(); + } + + public void guardGetRewards(String guardLevel, String liveUid, HttpCallback callback) { API.get().pdLiveApi(mContext) .guardGetRewards("0", liveUid) diff --git a/common/src/main/java/com/yunbao/common/interfaces/ImageResultCallback.java b/common/src/main/java/com/yunbao/common/interfaces/ImageResultCallback.java index f253123e7..0d66a31b9 100644 --- a/common/src/main/java/com/yunbao/common/interfaces/ImageResultCallback.java +++ b/common/src/main/java/com/yunbao/common/interfaces/ImageResultCallback.java @@ -1,10 +1,17 @@ package com.yunbao.common.interfaces; +import android.content.Context; + import com.yunbao.common.CommonAppContext; import com.yunbao.common.bean.AvatarBean; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.upload.UploadBean; +import com.yunbao.common.upload.UploadCallback; +import com.yunbao.common.upload.UploadQnImpl; import java.io.File; +import java.util.ArrayList; +import java.util.List; /** * Created by cxf on 2018/9/29. @@ -35,4 +42,20 @@ public abstract class ImageResultCallback { } }); } + public void onSuccessToQiNiuUrl(Context mContext, File file, OnItemClickListener listener) { + UploadQnImpl mUploadStrategy = new UploadQnImpl(mContext); + List beans = new ArrayList<>(); + beans.add(new UploadBean(file, UploadBean.IMG)); + mUploadStrategy.upload(beans, true, new UploadCallback() { + @Override + public void onFinish(List list, boolean success) { + if (success) { + listener.onItemClick("https://downs.yaoulive.com/" + list.get(0).getRemoteAccessUrl(), 0); + } else { + listener.onItemClick(null, -1); + } + } + }, true); + + } } diff --git a/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java b/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java index 141e829f4..ddda03a1d 100644 --- a/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java +++ b/common/src/main/java/com/yunbao/common/sud/BaseGameViewModel.java @@ -9,6 +9,7 @@ import android.view.View; import android.view.ViewTreeObserver; import android.widget.Toast; +import com.alibaba.fastjson.JSONObject; import com.yunbao.common.sud.decorator.SudFSMMGCache; import com.yunbao.common.sud.decorator.SudFSMMGDecorator; import com.yunbao.common.sud.decorator.SudFSMMGListener; @@ -16,7 +17,10 @@ import com.yunbao.common.sud.decorator.SudFSTAPPDecorator; import com.yunbao.common.sud.model.GameConfigModel; import com.yunbao.common.sud.model.GameViewInfoModel; import com.yunbao.common.sud.state.MGStateResponse; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.SudJsonUtils; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import tech.sud.mgp.core.ISudFSMStateHandle; import tech.sud.mgp.core.ISudFSTAPP; @@ -142,7 +146,10 @@ public abstract class BaseGameViewModel implements SudFSMMGListener { // 给装饰类设置回调 sudFSMMGDecorator.setSudFSMMGListener(this); - + sudFSMMGDecorator.setGameId(gameId); + sudFSMMGDecorator.setRoomId(gameRoomId); + sudFSMMGDecorator.setUserId(getUserId()); + Log.i("游戏回调", code + " " + gameId + " " + gameRoomId + " "); // 调用游戏sdk加载游戏 ISudFSTAPP iSudFSTAPP = SudMGP.loadMG(activity, getUserId(), gameRoomId, code, gameId, getLanguageCode(), sudFSMMGDecorator); @@ -282,6 +289,29 @@ public abstract class BaseGameViewModel implements SudFSMMGListener { public void onGameLog(String str) { SudFSMMGListener.super.onGameLog(str); Log.e("onGameStarted", "游戏日志:" + str); + /*if (!StringUtil.isEmpty()) { + try { + JSONObject json = JSONObject.parseObject(str); + if ("error".equals(json.getString("level"))) { + String msg = json.getString("msg"); + JSONObject error = JSONObject.parseObject(msg); + if (error.containsKey("msg")) { + + int resultCode = error.getInteger("resultCode"); + switch (resultCode) { + case 100503: + ToastUtil.show(WordUtil.isNewZh()?"有玩家未點擊準備":"There are players who haven't clicked \"Ready\" yet."); + break; + case 100504: + ToastUtil.show(WordUtil.isNewZh()?"小於遊戲最小開始人數":"The number of players is less than the minimum required to start the game."); + break; + } + } + } + } catch (Exception ignore) { + + } + }*/ } /** diff --git a/common/src/main/java/com/yunbao/common/sud/QuickStartGameViewModel.java b/common/src/main/java/com/yunbao/common/sud/QuickStartGameViewModel.java index 4a98859bd..e7fa09b58 100644 --- a/common/src/main/java/com/yunbao/common/sud/QuickStartGameViewModel.java +++ b/common/src/main/java/com/yunbao/common/sud/QuickStartGameViewModel.java @@ -59,7 +59,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel { /** * 游戏的语言代码 */ - public String languageCode = "zh-CN"; + public String languageCode = "zh-TW"; public final MutableLiveData gameViewLiveData = new MutableLiveData<>(); // 游戏View回调 @@ -69,7 +69,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel { @Override protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) { if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { - languageCode = "zh-CN"; + languageCode = "zh-TW"; }else { languageCode = "en-US"; } diff --git a/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGDecorator.java b/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGDecorator.java index a52a68409..1bfba5b82 100644 --- a/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGDecorator.java +++ b/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGDecorator.java @@ -23,6 +23,10 @@ import tech.sud.mgp.core.ISudFSMStateHandle; */ public class SudFSMMGDecorator implements ISudFSMMG { + private static final String TAG = "游戏回调"; + private long gameId; + private String gameRoomId; + private String userId; // 回调 private SudFSMMGListener sudFSMMGListener; @@ -227,10 +231,10 @@ public class SudFSMMGDecorator implements ISudFSMMG { } break; case SudMGPMGState.MG_COMMON_GAME_STATE: // 10. 游戏状态 - Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::"+dataJson); + Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::" + dataJson); SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class); sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState); - if (mgCommonGameState.gameState==2){ + if (mgCommonGameState.gameState == 2) { Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE)); } if (listener == null) { @@ -354,6 +358,14 @@ public class SudFSMMGDecorator implements ISudFSMMG { break; case SudMGPMGState.MG_COMMON_GAME_CREATE_ORDER: // 25. 创建订单 SudMGPMGState.MGCommonGameCreateOrder mgCommonGameCreateOrder = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameCreateOrder.class); + if (mgCommonGameCreateOrder != null) { + mgCommonGameCreateOrder.gameId = gameId; + mgCommonGameCreateOrder.gameRoomId = gameRoomId; + mgCommonGameCreateOrder.userId = userId; + mgCommonGameCreateOrder.dataJson = dataJson; + } + + Log.i(TAG, "onGameStateChange: " + dataJson); if (listener == null) { ISudFSMStateHandleUtils.handleSuccess(handle); } else { @@ -1021,4 +1033,15 @@ public class SudFSMMGDecorator implements ISudFSMMG { return sudFSMMGCache; } + public void setGameId(long gameId) { + this.gameId = gameId; + } + + public void setRoomId(String gameRoomId) { + this.gameRoomId = gameRoomId; + } + + public void setUserId(String userId) { + this.userId = userId; + } } diff --git a/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGListener.java b/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGListener.java index 8b6da8ba1..2bc23c6e9 100644 --- a/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGListener.java +++ b/common/src/main/java/com/yunbao/common/sud/decorator/SudFSMMGListener.java @@ -5,6 +5,7 @@ package com.yunbao.common.sud.decorator; +import com.yunbao.common.sud.decorator.game.JumpEvent; import com.yunbao.common.sud.state.SudMGPMGState; import com.yunbao.common.utils.ISudFSMStateHandleUtils; @@ -271,7 +272,13 @@ public interface SudFSMMGListener { * mg_common_game_create_order */ default void onGameMGCommonGameCreateOrder(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameCreateOrder model) { - ISudFSMStateHandleUtils.handleSuccess(handle); + if ("addHeart".equals(model.cmd)) { + JumpEvent.addHeart(model); + } else if ("hit".equals(model.cmd)) { + JumpEvent.hit(model); + } else { + ISudFSMStateHandleUtils.handleSuccess(handle); + } } /** diff --git a/common/src/main/java/com/yunbao/common/sud/decorator/game/JumpEvent.java b/common/src/main/java/com/yunbao/common/sud/decorator/game/JumpEvent.java new file mode 100644 index 000000000..c6a05d011 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/sud/decorator/game/JumpEvent.java @@ -0,0 +1,55 @@ +package com.yunbao.common.sud.decorator.game; + +import com.yunbao.common.bean.HttpCallbackModel; +import com.yunbao.common.event.SubGameEvent; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.sud.state.SudMGPMGState; +import com.yunbao.common.utils.AppManager; +import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.ToastUtil; + +public class JumpEvent { + private static long clickTimer = 0; + + public static void addHeart(SudMGPMGState.MGCommonGameCreateOrder order) { + createOrder(order); + } + + public static void hit(SudMGPMGState.MGCommonGameCreateOrder order) { + createOrder(order); + } + + private synchronized static void createOrder(SudMGPMGState.MGCommonGameCreateOrder order) { + if (System.currentTimeMillis() - clickTimer < 500) { + //TODO 防止重复点击 + HttpCallbackModel _data=new HttpCallbackModel(1001,""); + Bus.get().post(new SubGameEvent(0, _data,order.dataJson)); + return; + } + clickTimer = System.currentTimeMillis(); + LiveNetManager.get(AppManager.getInstance().getLastActivity()) + .createGameOrder(order.gameRoomId, + order.cmd, + order.value + "", + order.gameId + "", + order.fromUid, + order.toUid, + order.gameRoomId, + order.payload, + new HttpCallback() { + @Override + public void onSuccess(HttpCallbackModel data) { + if (data.getCode() != 0) { + ToastUtil.show(data.getMsg()); + Bus.get().post(new SubGameEvent(0, data,order.dataJson)); + } + } + + @Override + public void onError(String error) { + + } + }); + } +} diff --git a/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java b/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java index 1523a5a16..dc358b332 100644 --- a/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java +++ b/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java @@ -496,6 +496,11 @@ public class SudMGPMGState implements Serializable { public String toUid; // 目标用户uid public long value; // 所属的游戏价值 public String payload; // 扩展数据 json 字符串, 特殊可选 + + public long gameId; + public String gameRoomId; + public String userId; + public String dataJson; } /** diff --git a/common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java b/common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java index a96ce6a21..f1140759a 100644 --- a/common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java +++ b/common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java @@ -3,14 +3,12 @@ package com.yunbao.common.upload; import android.content.Context; import android.text.TextUtils; -import com.alibaba.fastjson.JSON; import com.qiniu.android.common.ServiceAddress; import com.qiniu.android.common.Zone; import com.qiniu.android.http.ResponseInfo; import com.qiniu.android.storage.Configuration; import com.qiniu.android.storage.UpCompletionHandler; import com.qiniu.android.storage.UploadManager; -import com.yunbao.common.CommonAppConfig; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.L; @@ -23,8 +21,6 @@ import java.io.File; import java.util.List; import top.zibin.luban.Luban; -import top.zibin.luban.OnCompressListener; -import top.zibin.luban.OnRenameListener; /** * Created by cxf on 2019/4/16. @@ -131,7 +127,7 @@ public class UploadQnImpl implements UploadStrategy { } }; } - CommonHttpUtil.getUploadQiNiuToken(mGetUploadTokenCallback, isImg); + CommonHttpUtil.getUploadQiNiuTokenNew(mGetUploadTokenCallback, isImg); } @Override diff --git a/common/src/main/java/com/yunbao/common/utils/AppManager.java b/common/src/main/java/com/yunbao/common/utils/AppManager.java index 8aadb61a5..23f590dcf 100644 --- a/common/src/main/java/com/yunbao/common/utils/AppManager.java +++ b/common/src/main/java/com/yunbao/common/utils/AppManager.java @@ -11,6 +11,7 @@ public class AppManager { private static Stack activityStack; public AppManager() { + activityStack=new Stack<>(); } /** diff --git a/common/src/main/java/com/yunbao/common/utils/DialogUitl.java b/common/src/main/java/com/yunbao/common/utils/DialogUitl.java index adf6ced3c..72a88646a 100644 --- a/common/src/main/java/com/yunbao/common/utils/DialogUitl.java +++ b/common/src/main/java/com/yunbao/common/utils/DialogUitl.java @@ -358,6 +358,8 @@ public class DialogUitl { private boolean mCancelable; private boolean mBackgroundDimEnabled;//显示区域以外是否使用黑色半透明背景 private boolean mInput;//是否是输入框的 + private boolean isShowCancelButton=true; + private boolean isSHowConfirmButton=true; private String mHint; private int mInputType; private int mLength; @@ -454,6 +456,16 @@ public class DialogUitl { return this; } + public Builder setShowCancelButton(boolean showCancelButton) { + isShowCancelButton = showCancelButton; + return this; + } + + public Builder setShowConfirmButton(boolean showConfirmButton) { + isSHowConfirmButton = showConfirmButton; + return this; + } + public Dialog build() { final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2); if (mView != 0) { @@ -493,10 +505,22 @@ public class DialogUitl { TextView btnConfirm = (TextView) dialog.findViewById(R.id.btn_confirm); if (!TextUtils.isEmpty(mConfirmString)) { btnConfirm.setText(mConfirmString); + btnConfirm.setVisibility(View.VISIBLE); + }else if(mConfirmString==null){ + // btnConfirm.setVisibility(View.GONE); } TextView btnCancel = (TextView) dialog.findViewById(R.id.btn_cancel); if (!TextUtils.isEmpty(mCancelString)) { btnCancel.setText(mCancelString); + btnCancel.setVisibility(View.VISIBLE); + }else if(mCancelString==null){ + //btnCancel.setVisibility(View.GONE); + } + if(!isSHowConfirmButton){ + btnConfirm.setVisibility(View.GONE); + } + if(!isShowCancelButton){ + btnCancel.setVisibility(View.GONE); } View.OnClickListener listener = new View.OnClickListener() { @Override diff --git a/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java b/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java index 13e780d00..1c848afe0 100644 --- a/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java @@ -6,10 +6,12 @@ import android.content.Intent; import android.net.Uri; import android.os.Build; import android.provider.MediaStore; + import androidx.fragment.app.FragmentActivity; import androidx.core.content.FileProvider; import com.yalantis.ucrop.UCrop; +import com.yalantis.ucrop.util.FileUtils; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.R; import com.yunbao.common.interfaces.ActivityResultCallback; @@ -36,6 +38,11 @@ public class ProcessImageUtil extends ProcessResultUtil { private File mCorpResult;//裁剪后得到的图片 private ImageResultCallback mResultCallback; private boolean mNeedCrop;//是否需要裁剪 + private boolean mNeedGif;//允许gif图 + + public void setNeedGif(boolean mNeedGif) { + this.mNeedGif = mNeedGif; + } public ProcessImageUtil(FragmentActivity activity) { super(activity); @@ -101,6 +108,24 @@ public class ProcessImageUtil extends ProcessResultUtil { mAlumbResultCallback = new ActivityResultCallback() { @Override public void onSuccess(Intent intent) { + if (!mNeedCrop) { + if (mResultCallback != null) { + if (intent.getData() == null) { + if (mResultCallback != null) { + mResultCallback.onFailure(); + } + return; + } + String path = FileUtils.getPath(mContext, intent.getData()); + File file = new File(path); + if (file.exists()) { + mResultCallback.onSuccess(file); + } else { + mResultCallback.onFailure(); + } + } + return; + } crop(intent.getData()); } @@ -152,6 +177,11 @@ public class ProcessImageUtil extends ProcessResultUtil { requestPermissions(mAlumbPermissions, mAlumbPermissionCallback); } + public void getImageByAlumb(boolean needCrop) { + this.mNeedCrop = needCrop; + requestPermissions(mAlumbPermissions, mAlumbPermissionCallback); + } + /** * 开启摄像头,执行照相 @@ -172,7 +202,9 @@ public class ProcessImageUtil extends ProcessResultUtil { } intent.putExtra(MediaStore.EXTRA_OUTPUT, uri); startActivityForResult(intent, mCameraResultCallback); - }catch (Exception e){e.printStackTrace();} + } catch (Exception e) { + e.printStackTrace(); + } } private File getNewFile() { @@ -189,9 +221,14 @@ public class ProcessImageUtil extends ProcessResultUtil { * 打开相册,选择文件 */ private void chooseFile() { + String[] mimeTypes = {"image/png", "image/jpg", "image/jpeg"}; Intent intent = new Intent(); intent.addCategory(Intent.CATEGORY_OPENABLE); - intent.setType("image/*"); + intent.setType("*/*"); + if (mNeedGif) { + mimeTypes = new String[]{"image/png", "image/jpg", "image/jpeg", "image/gif"}; + } + intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes); if (Build.VERSION.SDK_INT < 19) { intent.setAction(Intent.ACTION_GET_CONTENT); } else { diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index 7ccc481cf..001b1ec50 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -59,6 +59,10 @@ public class RouteUtil { public static final String PATH_VIDEO_NEW_PLAY = "/video/VideoPlayNewActivity"; + public static final String PATH_FEEDBACK_SUCCESS_ACTIVITY = "/main/FeedbackSuccessActivity"; + public static final String PATH_FEEDBACK_ACTIVITY = "/main/FeedbackActivity"; + public static final String PATH_FEEDBACK_EDIT_ACTIVITY = "/main/FeedbackEditActivity"; + public static void forwardVideoPlayNewActivity(ActiveBean bean) { ARouter.getInstance().build(PATH_VIDEO_NEW_PLAY) .withParcelable("ActiveBean", bean) diff --git a/common/src/main/java/com/yunbao/common/utils/StringUtil.java b/common/src/main/java/com/yunbao/common/utils/StringUtil.java index c6da9ecb5..389490fa4 100644 --- a/common/src/main/java/com/yunbao/common/utils/StringUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/StringUtil.java @@ -6,6 +6,7 @@ import java.io.File; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.Random; +import java.util.UUID; import java.util.regex.Pattern; /** @@ -172,4 +173,5 @@ public class StringUtil { DateFormatUtil.getVideoCurTimeString(), String.valueOf(sRandom.nextInt(9999))); } + } diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java index 98380e2f6..4a30f3397 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewRoleInteractionGamesViewHolder.java @@ -9,7 +9,6 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.yunbao.common.R; -import com.yunbao.common.adapter.InteractionGamesAdapter; import com.yunbao.common.adapter.LiveNewRoleInteractionGamesAdapter; import com.yunbao.common.bean.CustomSidebarChildModel; import com.yunbao.common.bean.CustomSidebarInfoModel; diff --git a/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java b/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java index 01776f158..9bb18cb88 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveSudGamePopup.java @@ -2,6 +2,7 @@ package com.yunbao.common.views; import android.app.Activity; import android.content.Context; +import android.util.Log; import android.view.View; import android.widget.FrameLayout; import android.widget.TextView; @@ -9,6 +10,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.lifecycle.Observer; +import com.alibaba.fastjson.JSONObject; import com.lxj.xpopup.XPopup; import com.lxj.xpopup.core.BottomPopupView; import com.makeramen.roundedimageview.RoundedImageView; @@ -17,16 +19,19 @@ import com.yunbao.common.bean.CheckRemainingBalance; import com.yunbao.common.bean.CreateSudRoomModel; import com.yunbao.common.bean.CustomSidebarChildModel; import com.yunbao.common.bean.CustomSidebarInfoModel; +import com.yunbao.common.dialog.DebugDialog; import com.yunbao.common.event.CheckRemainingBalanceEvent; import com.yunbao.common.event.HideShowEvent; import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent; import com.yunbao.common.event.ShowHideEvent; +import com.yunbao.common.event.SubGameEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.sud.QuickStartGameViewModel; import com.yunbao.common.sud.model.GameConfigModel; +import com.yunbao.common.sud.state.SudMGPAPPState; import com.yunbao.common.sud.state.SudMGPMGState; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; @@ -229,7 +234,7 @@ public class LiveSudGamePopup extends BottomPopupView { if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); } else { - ToastUtil.show("Shortage of money"); + ToastUtil.show("Insufficient number of currency"); } } @@ -240,7 +245,7 @@ public class LiveSudGamePopup extends BottomPopupView { if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); } else { - ToastUtil.show("Shortage of money"); + ToastUtil.show("Insufficient number of currency"); } } }); @@ -276,4 +281,16 @@ public class LiveSudGamePopup extends BottomPopupView { } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onSudGameStatus(SubGameEvent event) { + if (event.getType() == 0) { + Log.i("游戏回调", "onGameStateChange: event :" + event.toString()); + if (event.getModel().getCode() == 1001 || event.getModel().getCode() == 1002) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("result", 0); + gameViewModel.sudFSTAPPDecorator.notifyStateChange(SudMGPAPPState.APP_COMMON_GAME_CREATE_ORDER_RESULT, jsonObject.toString()); + } + } + } } diff --git a/common/src/main/res/layout/activity_webview.xml b/common/src/main/res/layout/activity_webview.xml index ec83eebe4..44c9ef453 100644 --- a/common/src/main/res/layout/activity_webview.xml +++ b/common/src/main/res/layout/activity_webview.xml @@ -1,5 +1,6 @@ @@ -67,6 +69,5 @@ \ No newline at end of file diff --git a/common/src/main/res/layout/view_fun_games_child_view.xml b/common/src/main/res/layout/view_fun_games_child_view.xml index 4ac669274..cf798f976 100644 --- a/common/src/main/res/layout/view_fun_games_child_view.xml +++ b/common/src/main/res/layout/view_fun_games_child_view.xml @@ -6,7 +6,7 @@ android:layout_marginTop="12dp" android:gravity="center" android:orientation="vertical"> - + \ No newline at end of file diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 17f8d63ff..900a43108 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1379,11 +1379,11 @@ Limited ride And limited avatar frame "Paired Users " " Currently No Records~" "Today " - 1. Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; - 2. Currently, we have launched \'GoBang\',\' Bumper car \',\' Flying Chess\', \'Minesweeping\', \'Dart Master\', and \'Monster Eliminating\'. We will provide more game types in the future. Stay tuned; + 1.Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; + 2.Currently, [Backgammon], [Flying Chess], [Bumper I’m the Strongest], [Monster Match], [Jump], [Friendly Challenge], [Magic Battle], [American 8 Ball] More game types will be provided in the future, so stay tuned; 3.Users can customize the game threshold, which must be between 100 to 50000 gold beans , and the amount must be a multiple of 10; 4.At the beginning of the game, chips from participating users will be collected. After the game ends, 10% of the chips will be collected as tickets, and all remaining chips will be given to the winning users.In a draw, the corresponding chips will be deducted from the tickets and returned to the users; - 5. The final interpretation right of the event belongs to PDLIVE. + 5.The final interpretation right of the event belongs to PDLIVE. Currency Currency: Time: diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 38834b271..7e5719bef 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1374,7 +1374,7 @@ 暫無記錄~ 今日 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; - 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; + 2、目前已上線【五子棋】、【飛行棋】、【碰碰我最強】、【怪物消消樂】、【跳一跳】、【友情闖關】、【魔法大樂鬥】、【美式8球】後續將會提供更多遊戲種類,敬請期期待; 3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; 4、 遊戲開始時將會收取參與遊戲用戶的籌碼,在遊戲結束後,將收取10%的籌碼作為門票,剩餘籌碼將全部給予勝利用戶,平局時將會扣除相應籌碼门票後返還給用戶; 5、活動最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 8dc3f6422..2b88b006d 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1373,7 +1373,7 @@ 暫無記錄~ 今日 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; - 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; + 2、目前已上線【五子棋】、【飛行棋】、【碰碰我最強】、【怪物消消樂】、【跳一跳】、【友情闖關】、【魔法大樂鬥】、【美式8球】後續將會提供更多遊戲種類,敬請期期待; 3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; 4、 遊戲開始時將會收取參與遊戲用戶的籌碼,在遊戲結束後,將收取10%的籌碼作為門票,剩餘籌碼將全部給予勝利用戶,平局時將會扣除相應籌碼门票後返還給用戶; 5、活動最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 92d712ec2..66abfaf6d 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1373,7 +1373,7 @@ 暫無記錄~ 今日 1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與; - 2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待; + 2、目前已上線【五子棋】、【飛行棋】、【碰碰我最強】、【怪物消消樂】、【跳一跳】、【友情闖關】、【魔法大樂鬥】、【美式8球】後續將會提供更多遊戲種類,敬請期期待; 3、 用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數; 4、 遊戲開始時將會收取參與遊戲用戶的籌碼,在遊戲結束後,將收取10%的籌碼作為門票,剩餘籌碼將全部給予勝利用戶,平局時將會扣除相應籌碼门票後返還給用戶; 5、活動最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 743b344fd..ae6af410d 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1385,9 +1385,9 @@ Limited ride And limited avatar frame "Today " "≤7 days " ≤ 30 days - 1. Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; - 2.Currently, we have launched \'GoBang\',\' Bumper car \',\' Flying Chess\', \'Minesweeping\', \'Dart Master\', and \'Monster Eliminating\'. We will provide more game types in the future. Stay tuned; - 3.. Users can customize the game threshold, which must be between 100 to 50000 gold beans , and the amount must be a multiple of 10; + 1.Interactive games are a new section provided by PDLIVE for users, who can participate in the game section on the homepage or in the live room; + 2.Currently, [Backgammon], [Flying Chess], [Bumper I’m the Strongest], [Monster Match], [Jump], [Friendly Challenge], [Magic Battle], [American 8 Ball] More game types will be provided in the future, so stay tuned; + 3. Users can customize the game threshold, which must be between 100 to 50000 gold beans , and the amount must be a multiple of 10; 4.At the beginning of the game, chips from participating users will be collected. After the game ends, 10% of the chips will be collected as tickets, and all remaining chips will be given to the winning users.In a draw, the corresponding chips will be deducted from the tickets and returned to the users; 5. The final interpretation right of the event belongs to PDLIVE. 0-100 coins diff --git a/config.gradle b/config.gradle index 453725f5b..25d88349b 100644 --- a/config.gradle +++ b/config.gradle @@ -4,15 +4,15 @@ ext { buildToolsVersion: "29.0.2", minSdkVersion : 23, targetSdkVersion : 33, - versionCode : 523, - versionName : "6.6.7", + versionCode : 524, + versionName : "6.6.8", namespace : "com.pandoralive.shayu" ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 -// serverHost : " https://ceshi.yaoulive.com", + serverHost : " https://ceshi.yaoulive.com", //百度语音识别 baiduAppId : "23774720", diff --git a/libs/umeng-common-9.6.8+000.aar b/libs/umeng-common-9.6.8+000.aar new file mode 100644 index 000000000..5d4c09710 Binary files /dev/null and b/libs/umeng-common-9.6.8+000.aar differ diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index bf7d090bb..cbb84123a 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -1712,6 +1712,15 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl liveInputDialogFragment.setArguments(liveInputBundle); liveInputDialogFragment.show(getSupportFragmentManager(), "LiveInputDialogFragment"); break; + case LIVE_DIALOG_ANCHOR_TIPS: + new DialogUitl.Builder(mContext) + .setContent(event.getObject().toString()) + .setConfirmString(WordUtil.isNewZh() ? "確定" : "confirm") + .setCancelable(true) + .setShowCancelButton(false) + .build() + .show(); + break; } } @@ -1850,6 +1859,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl .setIcon("https://downs.yaoulive.com/xzs_tab.png") .setNameColor("#f19ec2") .setSystemBubble("https://downs.yaoulive.com/xzs_qipao.9.png") + .setIconEn("https://downs.yaoulive.com/Robot_en.png") .setUserName("") .setContent(content); SocketSendBean msg = diff --git a/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java index 7c4122ed9..5385e5801 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java @@ -5,6 +5,7 @@ import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.text.TextUtils; +import android.util.Log; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; @@ -15,6 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.alibaba.android.arouter.facade.annotation.Route; +import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.lxj.xpopup.XPopup; import com.yunbao.common.Constants; @@ -32,6 +34,7 @@ import com.yunbao.common.bean.SudGameChatImModel; import com.yunbao.common.bean.SudGameUserModel; import com.yunbao.common.dialog.SudGameInputPopupWindow; import com.yunbao.common.event.CheckRemainingBalanceEvent; +import com.yunbao.common.event.SubGameEvent; import com.yunbao.common.event.SudGameSocketImEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.base.HttpCallback; @@ -39,8 +42,10 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.imrongcloud.GameMicManager; import com.yunbao.common.sud.QuickStartGameViewModel; +import com.yunbao.common.sud.decorator.SudFSMMGDecorator; import com.yunbao.common.sud.model.GameConfigModel; import com.yunbao.common.sud.model.GameViewInfoModel; +import com.yunbao.common.sud.state.SudMGPAPPState; import com.yunbao.common.sud.state.SudMGPMGState; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; @@ -460,7 +465,7 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); } else { - ToastUtil.show("Shortage of money"); + ToastUtil.show("Insufficient number of currency"); } } @@ -473,7 +478,7 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { ToastUtil.show("貨幣数量不足 "); } else { - ToastUtil.show("Shortage of money"); + ToastUtil.show("Insufficient number of currency"); } } @@ -679,4 +684,16 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti } } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onSudGameStatus(SubGameEvent event) { + if (event.getType() == 0) { + Log.i("游戏回调", "onGameStateChange: event :" + event.toString()); + if (event.getModel().getCode() == 1001 || event.getModel().getCode() == 1002) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("result", 0); + gameViewModel.sudFSTAPPDecorator.notifyStateChange(SudMGPAPPState.APP_COMMON_GAME_CREATE_ORDER_RESULT, jsonObject.toString()); + } + } + } } diff --git a/live/src/main/java/com/yunbao/live/bean/ImUserBean.java b/live/src/main/java/com/yunbao/live/bean/ImUserBean.java index d83fea755..9bc4ba7f9 100644 --- a/live/src/main/java/com/yunbao/live/bean/ImUserBean.java +++ b/live/src/main/java/com/yunbao/live/bean/ImUserBean.java @@ -2,8 +2,11 @@ package com.yunbao.live.bean; import android.text.TextUtils; +import com.alibaba.fastjson.annotation.JSONField; import com.google.gson.annotations.SerializedName; import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.utils.StringUtil; +import com.yunbao.common.utils.WordUtil; import java.text.SimpleDateFormat; import java.util.Date; @@ -30,8 +33,21 @@ public class ImUserBean extends BaseModel { String _method_ = "";//融雲消息類型 @SerializedName("new_image") private String newImage; + @JSONField(name = "en_image") + private String newImageEn; + + public String getNewImageEn() { + return newImageEn; + } + + public void setNewImageEn(String newImageEn) { + this.newImageEn = newImageEn; + } public String getNewImage() { + if (!WordUtil.isNewZh() && !StringUtil.isEmpty(newImageEn)) { + return newImageEn; + } return newImage; } diff --git a/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java b/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java index d33e53a4a..90cd294c8 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.annotation.JSONField; import com.google.gson.annotations.SerializedName; import com.yunbao.common.bean.AiAutomaticSpeechModel; import com.yunbao.common.bean.MsgModel; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.WordUtil; /** @@ -28,7 +29,7 @@ public class LiveChatBean { public static final int XYD_COMPLETE = 207;//心愿单完成通知 public static final int WISH_LIST_PROGRESS = 307;//心愿单进度通知 public static final int BLIND_BOX = 409;//盲盒礼物消息 - public static final int TYPE_TO_USER_MSG=500;//指定信息 + public static final int TYPE_TO_USER_MSG = 500;//指定信息 private String id; @@ -47,6 +48,7 @@ public class LiveChatBean { private String bubble;//气泡 private String medal;//勋章 private String medal_new; + private String medal_new_en; private String medal_honor;//荣誉勋章 private String hot_num; private String good_nub; @@ -63,7 +65,7 @@ public class LiveChatBean { } public String getGiftName() { - return WordUtil.isNewZh()?giftName:giftname_en; + return WordUtil.isNewZh() ? giftName : giftname_en; } public LiveChatBean setGiftName(String giftName) { @@ -215,6 +217,9 @@ public class LiveChatBean { } public String getMedal_new() { + if (!WordUtil.isNewZh() && !StringUtil.isEmpty(medal_new_en)) { + return medal_new_en; + } return medal_new; } @@ -222,6 +227,10 @@ public class LiveChatBean { this.medal_new = medal_new; } + public void setMedal_new_en(String medal_new_en) { + this.medal_new_en = medal_new_en; + } + public String getPrankIcon() { return prankIcon; } diff --git a/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java b/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java index c08778b6b..b871f19cf 100644 --- a/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/ReceiveRendPacketPopup.java @@ -4,6 +4,7 @@ import android.content.Context; import android.os.Handler; import android.text.TextUtils; import android.util.TypedValue; +import android.view.View; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; @@ -97,6 +98,12 @@ public class ReceiveRendPacketPopup extends CenterPopupView { .getString(R.string.together_to_achieve_goal), redPacketInfoModel.getUserNicename())); } + if(redPacketInfoModel.getRedPacketType()==2){ + ((ImageView)findViewById(R.id.value_icon)).setImageResource(R.mipmap.gold_coin); + redPacketValue.setText(redPacketInfoModel.getRedPacketMoney()); + findViewById(R.id.red_packet_list).setVisibility(View.INVISIBLE); + findViewById(R.id.tips).setVisibility(View.INVISIBLE); + } userID = redPacketInfoModel.getUserId(); diff --git a/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java b/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java index 153709be1..4a90883e3 100644 --- a/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java @@ -2,7 +2,9 @@ package com.yunbao.live.dialog; import static com.yunbao.common.utils.RouteUtil.PATH_COIN; +import android.app.Dialog; import android.content.Context; +import android.content.DialogInterface; import android.graphics.Color; import android.text.Editable; import android.text.TextUtils; @@ -19,10 +21,12 @@ import com.lxj.xpopup.core.CenterPopupView; import com.umeng.analytics.MobclickAgent; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; +import com.yunbao.live.event.LiveAudienceEvent; public class SendRendPacketPopup extends CenterPopupView { private Button thereIsNo, followingAnchor, joinFansGroup; @@ -31,6 +35,8 @@ public class SendRendPacketPopup extends CenterPopupView { private FrameLayout redPacketIllustrate; private ImageView iconInstructions, illustrateClose; private String mLiveID, conditions = "0"; + private DialogInterface onDismissListener; + private boolean sendSuccess; public SendRendPacketPopup(@NonNull Context context, String liveID) { super(context); @@ -51,6 +57,23 @@ public class SendRendPacketPopup extends CenterPopupView { initView(); } + public void setOnDismissListener(DialogInterface onDismissListener) { + this.onDismissListener = onDismissListener; + } + + @Override + protected void onDismiss() { + super.onDismiss(); + + if (sendSuccess) { + // onDismissListener.dismiss(); + } else { + // onDismissListener.cancel(); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)); + } + } + private void initView() { thereIsNo = findViewById(R.id.there_is_no); followingAnchor = findViewById(R.id.following_anchor); @@ -222,6 +245,7 @@ public class SendRendPacketPopup extends CenterPopupView { MobclickAgent.onEvent(getContext(), "gif_list_redpk_seed", "用户发送红包"); ToastUtil.show(getContext().getString(R.string.red_envelope_released_successfully)); + sendSuccess = true; dismiss(); } diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 54afe4314..4a8c493d2 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -489,7 +489,8 @@ public class LiveAudienceEvent extends BaseModel { UPDATE_FANS_TASK_STATUS(74, "更新粉丝任务状态"), SUD_GAME_CREATE_ROOM(75, "主播创建sud游戏"), PK_RANK_START(76, "PK排位赛开始"), - GuardSpecialEffect(77, "PK排位赛开始"); + GuardSpecialEffect(77, "PK排位赛开始"), + LIVE_DIALOG_ANCHOR_TIPS(78, "主播公会赛tips"); private int type; private String name; 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 b73e45d18..9abde5e76 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -101,6 +101,7 @@ import pl.droidsonroids.gif.GifImageView; /** * Created by cxf on 2018/10/13. * 产品让改礼物效果 + * 全服通知效果实现 */ public class LiveGiftAnimPresenter { @@ -382,7 +383,12 @@ public class LiveGiftAnimPresenter { } }, 1000); } else { - changeLiveRoom(); + if (mIvLook.getTag()!=null&&mIvLook.getTag()instanceof LiveReceiveGiftBean){ + changeLiveRoom((LiveReceiveGiftBean) mIvLook.getTag()); + }else { + changeLiveRoom(); + } + } } @@ -430,12 +436,57 @@ public class LiveGiftAnimPresenter { } }); } + private void changeLiveRoom(LiveReceiveGiftBean mTempGifGiftBean) { + if (mTempGifGiftBean != null) { + String uid = mTempGifGiftBean.getUid(); + String userId = CommonAppConfig.getInstance().getUid(); + if (!TextUtils.isEmpty(mLiveUid)) { + userId = mLiveUid; + } + if (userId.equals(uid)) { + ToastUtil.show(WordUtil.isNewZh() ? "已在当前直播间" : "Already in the current studio"); + return; + } + } + if (mTempGifGiftBean.getRoomnum() == null || mTempGifGiftBean.getRoomnum().isEmpty()) { + return; + } + LiveHttpUtil.getLiveInfo(mTempGifGiftBean.getRoomnum(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); + new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { + @Override + public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { + if (liveBean == null) { + return; + } + if (MicStatusManager.getInstance().isMic(liveUid)) { + MicStatusManager.getInstance().showDownMicDialog(mContext); + return; + } + EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true)); + } + + @Override + public void onCheckError(String contextError) { + + } + }); + } + } + }); + } private void changeLiveRoom() { if (mTempGifGiftBean != null) { String uid = mTempGifGiftBean.getUid(); String userId = CommonAppConfig.getInstance().getUid(); + if (!TextUtils.isEmpty(mLiveUid)) { + userId = mLiveUid; + } if (userId.equals(uid)) { ToastUtil.show(WordUtil.isNewZh() ? "已在当前直播间" : "Already in the current studio"); return; @@ -1008,11 +1059,13 @@ public class LiveGiftAnimPresenter { superNotice.setBackgroundResource(R.mipmap.super_notice); mIvLook.setText(R.string.live_onlookers); mAncherName = mTempGifGiftBean.getAncherName(); + mRoomNum = bean.getRoomnum(); mGifGiftTipAllServer.setSelected(false); mGifGiftTipGroupAllServer.setAlpha(1f); mGifGiftTipGroupAllServer.setVisibility(View.VISIBLE); textRender.render(mContext, mGifGiftTipAllServer, mTempGifGiftBean.getGiftIcon(), mTempGifGiftBean.getUserNiceName(), mAncherName, mTempGifGiftBean.getGiftName(), 1, mWindowManager, ""); mIvLook.setVisibility(View.VISIBLE); + mIvLook.setTag(bean); mGifGiftTipShowAnimatorAllServer.start(); } @@ -1137,12 +1190,12 @@ public class LiveGiftAnimPresenter { int unameSize = textMsg.length(); builder.setSpan(new ForegroundColorSpan(Color.parseColor(dto.getColour())), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } - if (!showB){ + if (!showB) { iv_look_full_service_notice_new3.setVisibility(View.GONE); - }else { - if (TextUtils.equals(event.getJumpType(),"0")){ + } else { + if (TextUtils.equals(event.getJumpType(), "0")) { iv_look_full_service_notice_new3.setVisibility(View.GONE); - }else { + } else { iv_look_full_service_notice_new3.setVisibility(View.VISIBLE); } } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java index 6192c56cc..be8a115f3 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java @@ -99,6 +99,7 @@ public class SocketRyChatUtil { .param("medal_honor", u.getMedal_no_display_src()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("uid", u.getId()) .param("liangname", u.getGoodName()) .param("vip_type", u.getVip().getType()) @@ -180,6 +181,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("guard_type", IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getGuardType()) .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) @@ -308,6 +310,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("medal_name", u.getMedalName()) .param("medal_level", u.getMedalLevel()) .param("guard_type", guard_type + "") @@ -347,6 +350,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("ct", giftToken) .param("ancherName", ancherName) .param("medal_name", u.getMedalName()) @@ -712,6 +716,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("uname", u.getUserNiceName()) .param("uhead", u.getAvatar()) .param("votestotal", votes) @@ -742,6 +747,7 @@ public class SocketRyChatUtil { .param("bubble", u.getDress().getBubble()) .param("medal", u.getDress().getMedal()) .param("medal_new", u.getDress().getMedal_new()) + .param("medal_new_en", u.getDress().getMedal_new_en()) .param("guard_type", IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getGuardType()); msg.create(); 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 549c32778..6237cff21 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -52,6 +52,7 @@ import com.yunbao.common.manager.MicedUserManager; import com.yunbao.common.manager.NewLevelManager; import com.yunbao.common.manager.RandomPkManager; import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; @@ -389,7 +390,7 @@ public class SocketRyClient { receiveGiftBean.setSendtype(map.getIntValue("action")); receiveGiftBean.setAllServerNotify(true); mListener.onSys(receiveGiftBean); - } else if (action2 == 61) {//赠送礼物 + } else if (action2 == 61) {//赠送礼物 超级头条 sendGiftByNotify(map); } else if (action2 == 62) {//购买守护 // buyGuardByNotify(map); @@ -402,7 +403,7 @@ public class SocketRyClient { buyZuoJiByNotify(map); } else if (action2 == 66) {//购买贵族 buyVipByNotify(map); - } else if (action2 == 88) { + } else if (action2 == 88) {//盲盒 JSONObject mCt = map.getJSONObject("ct"); String boxType = map.getString("box_type"); String boxTypeName = ""; @@ -445,7 +446,7 @@ public class SocketRyClient { NewAllServerNotifyGuardEvent notifyGuardEvent = GsonUtils.fromJson(map.toString(), NewAllServerNotifyGuardEvent.class); Bus.get().post(notifyGuardEvent); buyGuardInSameRoom(map); - }else if (action2==91){ + } else if (action2 == 91) {//通用模板 AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent = GsonUtils.fromJson(map.toString(), AllServerNotifyFFGGGDJANEvent.class); Bus.get().post(notifyFFGGGDJANEvent); } @@ -820,6 +821,13 @@ public class SocketRyClient { case "SendMoneyLongEnd": Bus.get().post(new SendMoneyLongEndEvent()); break; + case Constants.SOCKET_LIVE_ANCHOR_PK_DIALOG: + item = map.getJSONObject("ct"); + //DialogUitl.showSimpleDialog(mContext,WordUtil.isNewZh()?item.getString("text"):item.getString("text_en"),null); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_DIALOG_ANCHOR_TIPS) + .setObject(WordUtil.isNewZh() ? item.getString("text") : item.getString("text_en"))); + break; } } @@ -982,6 +990,7 @@ public class SocketRyClient { chatBean.setBubble(map.getString("bubble")); chatBean.setMedal(map.getString("medal")); chatBean.setMedal_new(map.getString("medal_new")); + chatBean.setMedal_new_en(map.getString("medal_new_en")); chatBean.setVipType(map.getIntValue("vip_type")); chatBean.setVipType(map.getIntValue("vip_type")); chatBean.setMedal_honor(map.getString("medal_honor")); @@ -1039,6 +1048,7 @@ public class SocketRyClient { chatBean.setBubble(obj.getString("bubble")); chatBean.setMedal(obj.getString("medal")); chatBean.setMedal_new(obj.getString("medal_new")); + chatBean.setMedal_new_en(map.getString("medal_new_en")); chatBean.setHot_num(obj.getString("hot_num")); UserBean.DressBean dressBean = new UserBean.DressBean(); dressBean.setAvatar_frame(obj.getString("avatar_frame")); @@ -1154,6 +1164,7 @@ public class SocketRyClient { chatBean.setBubble(map.getString("bubble")); chatBean.setMedal(map.getString("medal")); chatBean.setMedal_new(map.getString("medal_new")); + chatBean.setMedal_new_en(map.getString("medal_new_en")); chatBean.setGood_nub(map.getString("good_num")); chatBean.setType(LiveChatBean.GIFT); if (map.get("guard_type") != null && !"".equals(map.get("guard_type")) && !"null".equals(map.get("guard_type"))) { @@ -1201,16 +1212,26 @@ public class SocketRyClient { chatBean.setBubble(map.getString("bubble")); chatBean.setMedal(map.getString("medal")); chatBean.setMedal_new(map.getString("medal_new")); + chatBean.setMedal_new_en(map.getString("medal_new_en")); chatBean.setGood_nub(map.getString("good_num")); chatBean.setType(LiveChatBean.GIFT); if (map.get("guard_type") != null && !"".equals(map.get("guard_type")) && !"null".equals(map.get("guard_type"))) { chatBean.setGuardType(map.getInteger("guard_type")); } - - if (WordUtil.isNewZh()) { - chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName()); + String special = ""; + if (sendBlindGiftEvent.getSpecialGift() == 1) { + if (WordUtil.isNewZh()) { + special = "送出" + receiveGiftBean.getGiftName() + sendBlindGiftEvent.getSpecialGiftName(); + } else { + special = "Send " + receiveGiftBean.getGiftName() + sendBlindGiftEvent.getSpecialGiftNameEn(); + } + chatBean.setContent(special); } else { - chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen()); + if (WordUtil.isNewZh()) { + chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName() + special); + } else { + chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen() + special); + } } //增加粉丝徽章信息 chatBean.setMedalNmae(map.getString("medal_name")); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 3d2cb2d03..bf096330d 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1637,6 +1637,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private Runnable timeRunnable = new Runnable() { @Override public void run() { + Log.i("红包", "run: 红包倒计时 "+redTimeCountdown); if (redTimeCountdown > 1) { timeHandler.postDelayed(timeRunnable, 1000); redPacketCountdown.setText(String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(redTimeCountdown))); @@ -1662,6 +1663,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private Runnable anchorTimeRunnable = new Runnable() { @Override public void run() { + Log.i("红包", "anchorTimeRunnable run: "+mCountdown); if (mCountdown > 0) { mCountdown = mCountdown - 1; anchorTimeHandler.postDelayed(anchorTimeRunnable, 1000); @@ -3990,6 +3992,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (mLiveGiftAnimPresenter == null) { mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); } + mLiveGiftAnimPresenter.setLiveUidStream(mLiveUid,mStream); mLiveGiftAnimPresenter.showGiftAnim(bean, isAncher); } diff --git a/live/src/main/res/layout/activity_compensate.xml b/live/src/main/res/layout/activity_compensate.xml index 3eec71ab9..f6a09f57a 100644 --- a/live/src/main/res/layout/activity_compensate.xml +++ b/live/src/main/res/layout/activity_compensate.xml @@ -99,7 +99,7 @@ diff --git a/live/src/main/res/layout/item_msg_sys_gift.xml b/live/src/main/res/layout/item_msg_sys_gift.xml index 3b3a8730c..fb67f8078 100644 --- a/live/src/main/res/layout/item_msg_sys_gift.xml +++ b/live/src/main/res/layout/item_msg_sys_gift.xml @@ -2,7 +2,8 @@ - + + android:visibility="invisible"> + + + + \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java b/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java index 6eb699604..5f91acbfb 100644 --- a/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/BattlePassActivity.java @@ -6,6 +6,7 @@ import android.annotation.SuppressLint; import android.app.Activity; import android.app.Dialog; import android.os.Bundle; +import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.ProgressBar; @@ -21,6 +22,7 @@ import com.alibaba.android.arouter.launcher.ARouter; import com.lxj.xpopup.XPopup; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.bean.BattlePassUserInfoBean; +import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.LiveBattlePassRewardsBean; import com.yunbao.common.dialog.ActivateEliteBattleOrderPopupWindow; import com.yunbao.common.dialog.ActivityEndPopupWindow; @@ -69,6 +71,7 @@ public class BattlePassActivity extends AbsActivity { Button moreIntegralButton; String enjoySpendMoney = ""; String quintessenceSpendMoney = ""; + Button allGet; BattlePassUserInfoBean data; @@ -99,6 +102,7 @@ public class BattlePassActivity extends AbsActivity { tab3 = findViewById(R.id.tab_3); expText = findViewById(R.id.exp_text); viewPager = findViewById(R.id.context_layout); + allGet = findViewById(R.id.all_get); fragments.add(new BattlePassRewardFragment(() -> data)); fragments.add(new BattlePassMissionFragment(() -> data)); fragments.add(new BattlePassExchangeFragment(() -> data)); @@ -171,21 +175,44 @@ public class BattlePassActivity extends AbsActivity { .show(); } }); + ViewClicksAntiShake.clicksAntiShake(allGet, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + LiveNetManager.get(mContext) + .getRewards("0", "0", new HttpCallback() { + @Override + public void onSuccess(HttpCallbackModel data) { + ToastUtil.show(data.getMsg()); + initData(); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + }); } private void clickView(int position) { switch (position) { case 0: + if (allGet.getTag() != null) { + allGet.setVisibility(View.VISIBLE); + } tab1.setImageResource(R.mipmap.ic_zl_tab1); tab2.setImageResource(R.mipmap.ic_zl_tab2_unselect); tab3.setImageResource(R.mipmap.ic_zl_tab3_unselect); break; case 1: + event(new BattlePassTypeEvent(2)); tab1.setImageResource(R.mipmap.ic_zl_tab1_unselect); tab2.setImageResource(R.mipmap.ic_zl_tab2); tab3.setImageResource(R.mipmap.ic_zl_tab3_unselect); break; case 2: + event(new BattlePassTypeEvent(2)); tab1.setImageResource(R.mipmap.ic_zl_tab1_unselect); tab2.setImageResource(R.mipmap.ic_zl_tab2_unselect); tab3.setImageResource(R.mipmap.ic_zl_tab3); @@ -210,8 +237,8 @@ public class BattlePassActivity extends AbsActivity { levelView.setText("Lv." + data.getLevel()); expText.setText(data.getBattlePassExp() + "/" + (data.getNextLevelExp() == 0 ? data.getBattlePassExp() : data.getNextLevelExp())); - levelProgressView.setMax(data.getNextLevelExp()-data.getLastLevelExp()); - levelProgressView.setProgress(data.getBattlePassExp()-data.getLastLevelExp()); + levelProgressView.setMax(data.getNextLevelExp() - data.getLastLevelExp()); + levelProgressView.setProgress(data.getBattlePassExp() - data.getLastLevelExp()); integralView.setText(String.format(WordUtil.getNewString(R.string.battlepass_user_my_integral), data.getPoints())); for (LiveBattlePassRewardsBean.BattlePassType passType : data.getLive_battle_pass_type()) { @@ -251,6 +278,11 @@ public class BattlePassActivity extends AbsActivity { public void event(BattlePassTypeEvent event) { if (event.getType() == 0) { initData(); + } else if (event.getType() == 1) { + allGet.setVisibility(View.VISIBLE); + allGet.setTag(event.getBean()); + } else if (event.getType() == 2) { + allGet.setVisibility(View.GONE); } } } diff --git a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java index ee93e7001..3a0c24902 100644 --- a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java @@ -636,7 +636,7 @@ public class EntryActivity extends AppCompatActivity { Contexts.startActivity(new Intent(Contexts, BindUserActivity.class).putExtra("uid", uid).putExtra("token", token)); } } else { - ToastUtil.show(msg + "11212"); + ToastUtil.show(msg); } } diff --git a/main/src/main/java/com/yunbao/main/activity/FeedbackActivity.java b/main/src/main/java/com/yunbao/main/activity/FeedbackActivity.java new file mode 100644 index 000000000..4b9984982 --- /dev/null +++ b/main/src/main/java/com/yunbao/main/activity/FeedbackActivity.java @@ -0,0 +1,82 @@ +package com.yunbao.main.activity; + +import android.app.Dialog; + +import com.alibaba.android.arouter.facade.annotation.Route; +import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.HttpCallbackModel; +import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.DialogUitl; +import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.main.R; +import com.yunbao.main.http.MainHttpUtil; + +@Route(path = RouteUtil.PATH_FEEDBACK_ACTIVITY) +public class FeedbackActivity extends AbsActivity { + @Override + protected int getLayoutId() { + return R.layout.activity_feedback; + } + + @Override + protected void main() { + super.main(); + setTitle(WordUtil.getNewString(R.string.activity_feedback_top_title)); + setTitleBold(true); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_cs), new ViewClicksAntiShake.ViewClicksCallBack() { + Dialog loading; + @Override + public void onViewClicks() { + //TODO 客服 + loading= DialogUitl.loadingDialog(mContext); + loading.show(); + MainHttpUtil.getCustomerService(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + loading.dismiss(); + loading=null; + if (info.length == 1) { + String url = info[0]; + RouteUtil.forwardCustomerService(url); + } + } + + @Override + public void onError() { + super.onError(); + loading.dismiss(); + loading=null; + } + }); + + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_feedback), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + //TODO 意见反馈 + LiveNetManager.get(mContext) + .checkFeedback(new com.yunbao.common.http.base.HttpCallback() { + @Override + public void onSuccess(HttpCallbackModel data) { + if (data.getCode() == 0) { + RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY); + } else { + ToastUtil.show(R.string.activity_feedback_edit_submit_tip3); + } + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + + } + }); + } +} diff --git a/main/src/main/java/com/yunbao/main/activity/FeedbackEditActivity.java b/main/src/main/java/com/yunbao/main/activity/FeedbackEditActivity.java new file mode 100644 index 000000000..61a3df228 --- /dev/null +++ b/main/src/main/java/com/yunbao/main/activity/FeedbackEditActivity.java @@ -0,0 +1,396 @@ +package com.yunbao.main.activity; + +import android.app.Dialog; +import android.graphics.Color; +import android.text.Editable; +import android.text.InputFilter; +import android.text.Spanned; +import android.text.TextWatcher; +import android.util.SparseArray; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +import com.alibaba.android.arouter.facade.annotation.Route; +import com.alibaba.fastjson.JSONArray; +import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.HttpCallbackModel; +import com.yunbao.common.dialog.ImagePreviewDialog; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.interfaces.ImageResultCallback; +import com.yunbao.common.interfaces.OnItemClickListener; +import com.yunbao.common.utils.DialogUitl; +import com.yunbao.common.utils.ProcessImageUtil; +import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.main.R; + +import java.io.File; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +@Route(path = RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY) +public class FeedbackEditActivity extends AbsActivity { + EditText feedbackEdit; + ImageView img1, img2, img3; + EditText ciEdit; + Button submit; + TextView editNumber; + ProcessImageUtil imageUtil; + Dialog loadingDialog = null; + int clickImage = 0; + View img1Layout, img2Layout, img3Layout; + View img1Del, img2Del, img3Del; + + @Override + protected int getLayoutId() { + return R.layout.activity_feedback_edit; + } + + @Override + protected void main() { + super.main(); + setTitle(WordUtil.getNewString(R.string.activity_feedback_edit_feedback_top)); + setTitleBold(true); + initView(); + imageUtil = new ProcessImageUtil(this); + feedbackEdit.setFilters(new InputFilter[]{new InputFilter.LengthFilter(501)}); + ciEdit.setFilters(new InputFilter[]{new InputFilter.LengthFilter(30), new InputFilter() { + @Override + public CharSequence filter(CharSequence charSequence, int i, int i1, Spanned spanned, int i2, int i3) { + /* String regex = "[A-Za-z0-9]+"; // 正则表达式 + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(charSequence.toString()); + if (matcher.matches()) { + return null; + } + return "";*/ + return null; + } + }}); + feedbackEdit.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + if (charSequence.length() >= 500) { + editNumber.setTextColor(Color.parseColor("#FF5656")); + } else { + editNumber.setTextColor(Color.parseColor("#333333")); + } + + editNumber.setText(String.format(Locale.getDefault(), "%d", charSequence.length())); + } + + @Override + public void afterTextChanged(Editable editable) { + if (editable.length() > 500) { + ToastUtil.show(R.string.activity_feedback_edit_submit_tip2); + feedbackEdit.setText(editable.toString().substring(0, 500)); + feedbackEdit.setSelection(feedbackEdit.getText().length()); + } + } + }); + ViewClicksAntiShake.clicksAntiShake(img1, () -> { + clickImage = 101; + if (img1.getTag() == null) { + uploadImage(img1); + } else { + showImage(img1); + } + }); + ViewClicksAntiShake.clicksAntiShake(img2, () -> { + clickImage = 201; + if (img2.getTag() == null) { + uploadImage(img2); + } else { + showImage(img2); + } + }); + ViewClicksAntiShake.clicksAntiShake(img3, () -> { + clickImage = 301; + if (img3.getTag() == null) { + uploadImage(img3); + } else { + showImage(img3); + } + }); + ViewClicksAntiShake.clicksAntiShake(img1Del, () -> { + deleteImage(1); + }); + ViewClicksAntiShake.clicksAntiShake(img2Del, () -> { + deleteImage(2); + }); + ViewClicksAntiShake.clicksAntiShake(img3Del, () -> { + deleteImage(3); + }); + ViewClicksAntiShake.clicksAntiShake(submit, () -> { + if (feedbackEdit.getText().length() == 0) { + ToastUtil.show(R.string.activity_feedback_edit_submit_tip1); + return; + } + JSONArray images = new JSONArray(); + if (img1.getTag() != null) { + images.add(((String) img1.getTag()).replace("https://downs.yaoulive.com/" ,"")); + } + if (img2.getTag() != null) { + images.add(((String) img2.getTag()).replace("https://downs.yaoulive.com/" ,"")); + } + if (img3.getTag() != null) { + images.add(((String) img3.getTag()).replace("https://downs.yaoulive.com/" ,"")); + } + LiveNetManager.get(mContext) + .feedback(feedbackEdit.getText().toString(), + images, + ciEdit.getText().toString(), + new HttpCallback() { + @Override + public void onSuccess(HttpCallbackModel data) { + finish(); + RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_SUCCESS_ACTIVITY); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + } + ); + + }); + img1.setOnLongClickListener(view -> { + ToastUtil.showDebug("1"); + return true; + }); + img2.setOnLongClickListener(view -> { + ToastUtil.showDebug("2"); + return true; + }); + img3.setOnLongClickListener(view -> { + ToastUtil.showDebug("3"); + return true; + }); + imageUtil.setImageResultCallback(new ImageResultCallback() { + + + @Override + public void onSuccess(File file) { + ToastUtil.showDebug("图片地址:" + file.getAbsolutePath()); + onSuccessToQiNiuUrl(mContext, file, new OnItemClickListener() { + @Override + public void onItemClick(String bean, int position) { + if (loadingDialog != null) { + loadingDialog.dismiss(); + loadingDialog = null; + } + switch (clickImage) { + case 101: + case 112: + setShowImage(img1, img1Del, bean); + if (img2.getTag() == null) { + setDefImage(img2, img2Del, img2Layout); + } else if (img3.getTag() == null) { + setDefImage(img3, img3Del, img3Layout); + } + break; + case 201: + case 212: + setShowImage(img2, img2Del, bean); + if (img3.getTag() == null) { + setDefImage(img3, img3Del, img3Layout); + } + break; + case 301: + case 312: + setShowImage(img3, img3Del, bean); + break; + } + } + }); + } + + @Override + public void onFailure() { + super.onFailure(); + if (loadingDialog != null) { + loadingDialog.dismiss(); + loadingDialog = null; + } + } + }); + } + + private void showImage(ImageView iv) { + ImagePreviewDialog dialog = new ImagePreviewDialog(); + dialog.setImageInfo(1, 1, false, new ImagePreviewDialog.ActionListener() { + @Override + public void loadImage(ImageView imageView, int position) { + ImgLoader.display(mContext, (String) iv.getTag(), imageView); + } + + @Override + public void onDeleteClick(int position) { + + } + }); + dialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "ImagePreviewDialog"); + + } + + private void showUploadImage(SparseArray list) { + DialogUitl.showStringArrayDialog(mContext, list, new DialogUitl.StringArrayDialogCallback() { + @Override + public void onItemClick(String text, int tag) { + clickImage = tag; + switch (tag) { + case 101: + uploadImage(img1); + break; + case 201: + uploadImage(img2); + break; + case 301: + uploadImage(img3); + break; + case 111: + deleteImage(1); + break; + case 211: + deleteImage(2); + break; + case 311: + deleteImage(3); + break; + case 112: + changeImage(img1); + break; + case 212: + changeImage(img2); + break; + case 312: + changeImage(img3); + break; + } + } + }); + } + + private void uploadImage(ImageView imageView) { + if (loadingDialog != null) { + loadingDialog.dismiss(); + loadingDialog = null; + } + SparseArray array = new SparseArray<>(); + array.put(1, WordUtil.getNewString(R.string.activity_feedback_edit_img_select)); + array.put(2, WordUtil.getNewString(R.string.activity_feedback_edit_img_camera)); + DialogUitl.showStringArrayDialog(mContext, array, new DialogUitl.StringArrayDialogCallback() { + @Override + public void onItemClick(String text, int tag) { + loadingDialog = DialogUitl.loadingDialog(mContext); + loadingDialog.show(); + if (tag == 1) { + imageUtil.getImageByAlumb(false); + } else { + imageUtil.getImageByCamera(false); + } + } + }); + + } + + private void deleteImage(int index) { + if (index == 1) { + if (img2.getTag() != null) { + img1.setTag(img2.getTag()); + ImgLoader.display(mContext, (String) img1.getTag(), img1); + if (img3.getTag() != null) { + img2.setTag(img3.getTag()); + ImgLoader.display(mContext, (String) img2.getTag(), img2); + setDefImage(img3, img3Del, img3Layout); + } else { + setDefImage(img2, img2Del, img2Layout); + setGoneImage(img3, img3Del, img3Layout); + } + } else { + setDefImage(img1, img1Del, img1Layout); + setGoneImage(img2, img2Del, img2Layout); + setGoneImage(img3, img3Del, img3Layout); + } + } else if (index == 2) { + if (img3.getTag() != null) { + img2.setTag(img3.getTag()); + ImgLoader.display(mContext, (String) img2.getTag(), img2); + setDefImage(img3, img3Del, img3Layout); + } else { + setDefImage(img2, img2Del, img2Layout); + setGoneImage(img3, img3Del, img3Layout); + } + } else if (index == 3) { + setDefImage(img3, img3Del, img3Layout); + } + + } + + private void setDefImage(ImageView iv, View ivDel, View ivLayout) { + iv.setTag(null); + ivDel.setVisibility(View.GONE); + iv.setImageResource(R.mipmap.icon_activity_feedback_edit_img_add); + ivLayout.setVisibility(View.VISIBLE); + } + + private void setGoneImage(ImageView iv, View ivDel, View ivLayout) { + iv.setTag(null); + ivDel.setVisibility(View.GONE); + ivLayout.setVisibility(View.GONE); + } + + private void setShowImage(ImageView iv, View ivDel, String url) { + iv.setTag(url); + ImgLoader.display(mContext, url, iv); + ivDel.setVisibility(View.VISIBLE); + } + + private void changeImage(ImageView imageView) { + uploadImage(imageView); + } + + private SparseArray getImageType1(int key) { + SparseArray array = new SparseArray<>(); + array.put(key + 1, WordUtil.getNewString(R.string.activity_feedback_edit_img_type1_upload)); + return array; + } + + private SparseArray getImageType2(int key) { + SparseArray array = new SparseArray<>(); + array.put(key + 1, WordUtil.getNewString(R.string.activity_feedback_edit_img_type2_delete)); + array.put(key + 2, WordUtil.getNewString(R.string.activity_feedback_edit_img_type2_change)); + return array; + } + + private void initView() { + feedbackEdit = findViewById(R.id.tv_feedback); + ciEdit = findViewById(R.id.edit_ci); + img1 = findViewById(R.id.img1); + img2 = findViewById(R.id.img2); + img3 = findViewById(R.id.img3); + img1Layout = findViewById(R.id.img1Layout); + img2Layout = findViewById(R.id.img2Layout); + img3Layout = findViewById(R.id.img3Layout); + img1Del = findViewById(R.id.img1_del); + img2Del = findViewById(R.id.img2_del); + img3Del = findViewById(R.id.img3_del); + submit = findViewById(R.id.btn_sub); + editNumber = findViewById(R.id.tv_number); + editNumber.setTextColor(Color.parseColor("#333333")); + } +} diff --git a/main/src/main/java/com/yunbao/main/activity/FeedbackSuccessActivity.java b/main/src/main/java/com/yunbao/main/activity/FeedbackSuccessActivity.java new file mode 100644 index 000000000..c44e85a2a --- /dev/null +++ b/main/src/main/java/com/yunbao/main/activity/FeedbackSuccessActivity.java @@ -0,0 +1,29 @@ +package com.yunbao.main.activity; + +import com.alibaba.android.arouter.facade.annotation.Route; +import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.main.R; + +@Route(path = RouteUtil.PATH_FEEDBACK_SUCCESS_ACTIVITY) +public class FeedbackSuccessActivity extends AbsActivity { + @Override + protected int getLayoutId() { + return R.layout.activity_feedback_success; + } + + @Override + protected void main() { + super.main(); + setTitleBold(true); + setTitle(WordUtil.getNewString(R.string.activity_feedback_edit_feedback_top)); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sub), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + finish(); + } + }); + } +} diff --git a/main/src/main/java/com/yunbao/main/activity/SettingActivity.java b/main/src/main/java/com/yunbao/main/activity/SettingActivity.java index b34529661..b1af4fb45 100644 --- a/main/src/main/java/com/yunbao/main/activity/SettingActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/SettingActivity.java @@ -285,9 +285,9 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener< } else { ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, studioRideEffects); } - if(IMLoginManager.get(mContext).isLiveNotifySettings()){ + if (IMLoginManager.get(mContext).isLiveNotifySettings()) { ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_on, liveNotifySettings); - }else{ + } else { ImgLoader.display(mContext, com.yunbao.common.R.mipmap.special_icon_off, liveNotifySettings); } } @@ -316,12 +316,16 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener< .show(); } + } else if (bean.getId() == 17 || bean.getId() == 26) { + RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY); } } else { - if (bean.getId() == 17) {//意见反馈要在url上加版本号和设备号 + if (bean.getId() == 17 || bean.getId() == 26) {//意见反馈要在url上加版本号和设备号 href += "&version=" + android.os.Build.VERSION.RELEASE + "&model=" + android.os.Build.MODEL; + RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY); + } else { + WebViewActivity.forward(mContext, href, false); } - WebViewActivity.forward(mContext, href,false); } } diff --git a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java index bf2ac850f..81c65ad64 100644 --- a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java @@ -34,6 +34,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; +import com.yunbao.common.HtmlConfig; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.event.JavascriptInterfaceEvent; @@ -49,6 +50,7 @@ import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SVGAViewUtils; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.main.R; @@ -86,6 +88,7 @@ public class ZhuangBanActivity extends AbsActivity { if (!"".equals(Constants.myPackageUrl)) { url = Constants.myPackageUrl; } + v_spacing = (View) findViewById(R.id.v_spacing); lt_title = (LinearLayout) findViewById(R.id.lt_title); LinearLayout rootView = (LinearLayout) findViewById(com.yunbao.live.R.id.rootView); @@ -102,13 +105,12 @@ public class ZhuangBanActivity extends AbsActivity { } L.e("H5---5>" + url); - mProgressBar = (ProgressBar) findViewById(R.id.progressbar); svga = (SVGAImageView) findViewById(R.id.svga); mWebView = new WebView(mContext); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); params.topMargin = DpUtil.dp2px(1); - params.bottomMargin = DpUtil.dp2px(15); + //params.bottomMargin = DpUtil.dp2px(15); mWebView.setLayoutParams(params); mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); rootView.addView(mWebView); @@ -194,6 +196,9 @@ public class ZhuangBanActivity extends AbsActivity { } mWebView.loadUrl(url); AndroidBug5497Workaround.assistActivity(this); + if(!StringUtil.isEmpty(url)&&url.startsWith(HtmlConfig.SHOP)){ + lt_title.setVisibility(View.GONE); + } } diff --git a/main/src/main/java/com/yunbao/main/event/BattlePassTypeEvent.java b/main/src/main/java/com/yunbao/main/event/BattlePassTypeEvent.java index 577f756c5..98540437a 100644 --- a/main/src/main/java/com/yunbao/main/event/BattlePassTypeEvent.java +++ b/main/src/main/java/com/yunbao/main/event/BattlePassTypeEvent.java @@ -6,6 +6,16 @@ import java.util.List; public class BattlePassTypeEvent { int type; + LiveBattlePassRewardsBean bean; + + public LiveBattlePassRewardsBean getBean() { + return bean; + } + + public BattlePassTypeEvent setBean(LiveBattlePassRewardsBean bean) { + this.bean = bean; + return this; + } public BattlePassTypeEvent(int liveBattlePassType) { this.type=liveBattlePassType; diff --git a/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java b/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java index 389c7b1b7..11ee058cc 100644 --- a/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/BattlePassRewardFragment.java @@ -190,6 +190,11 @@ public class BattlePassRewardFragment extends BaseFragment { } } + if(data.getIs_received()>=2){ + Bus.get().post(new BattlePassTypeEvent(1).setBean(data)); + }else{ + Bus.get().post(new BattlePassTypeEvent(2).setBean(data)); + } Collection> values = data.getLive_battle_pass_rewards().values(); List> list = new ArrayList<>(values); /* list.get(1).get(1).setReceived(2); diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index 01e7f539b..6a5b0a65a 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -357,7 +357,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi if (u.getDress().getMedal() != null) { Log.e("tag", u.getDress().getMedal()); - ImgLoader.displayWithError(mContext, u.getDress().getMedal(), user_noble_ico,R.mipmap.icon_vip_gold); + ImgLoader.displayWithError(mContext, u.getDress().getMedal(), user_noble_ico, R.mipmap.icon_vip_gold); } else { user_noble_ico.setImageResource(R.mipmap.icon_vip_gold); } @@ -470,6 +470,10 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi MobclickAgent.onEvent(mContext, "my_room", "个人中心点房间管理"); forwardRoomManage(); break; + case 26: + case 17: + RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY); + break; } } else { //21 在线客服 @@ -508,7 +512,10 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi if (bean.getId() == 24) { MobclickAgent.onEvent(mContext, "my_pack", "个人中心点包裹"); } - WebViewActivity.forward(mContext, url, false); + if (bean.getId() == 17 || bean.getId() == 26) { + RouteUtil.forwardActivity(RouteUtil.PATH_FEEDBACK_ACTIVITY); + } else + WebViewActivity.forward(mContext, url, false); } } diff --git a/main/src/main/res/drawable/bg_btn_feedback_edit_tv_edit.xml b/main/src/main/res/drawable/bg_btn_feedback_edit_tv_edit.xml new file mode 100644 index 000000000..0d58b3038 --- /dev/null +++ b/main/src/main/res/drawable/bg_btn_feedback_edit_tv_edit.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/main/src/main/res/drawable/bg_btn_feedback_success.xml b/main/src/main/res/drawable/bg_btn_feedback_success.xml new file mode 100644 index 000000000..cb81e4f44 --- /dev/null +++ b/main/src/main/res/drawable/bg_btn_feedback_success.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/main/src/main/res/layout/activity_battlepass.xml b/main/src/main/res/layout/activity_battlepass.xml index 4639d1bc0..aaad2a686 100644 --- a/main/src/main/res/layout/activity_battlepass.xml +++ b/main/src/main/res/layout/activity_battlepass.xml @@ -2,6 +2,7 @@ @@ -112,6 +113,20 @@ - + +