Merge branch 'master' into 声网升级
# Conflicts: # common/src/main/java/com/yunbao/common/event/SendBlindGiftEvent.java # common/src/main/java/com/yunbao/common/http/PDLiveApi.java # common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java # common/src/main/java/com/yunbao/common/utils/DialogUitl.java # common/src/main/java/com/yunbao/common/utils/RouteUtil.java # live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java # live/src/main/java/com/yunbao/live/socket/SocketRyLinkMicPkUtil.java # main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java
This commit is contained in:
commit
cbf517bed6
@ -2,7 +2,7 @@ package com.yunbao.faceunity;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.platform.app.Instrimport com.yunbao.common.utils.MobclickAgent;ntationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -1,17 +0,0 @@
|
||||
package com.yunbao.share;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
@ -10,6 +10,26 @@ android {
|
||||
project.tasks.getByName("tasks").doFirst {
|
||||
|
||||
}
|
||||
/* flavorDimensions "packageApk"
|
||||
productFlavors {
|
||||
LinkTest {
|
||||
dimension "packageApk"
|
||||
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
|
||||
}
|
||||
LinkOfficial {
|
||||
dimension "packageApk"
|
||||
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
|
||||
}
|
||||
GoogleTest {
|
||||
dimension "packageApk"
|
||||
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
|
||||
}
|
||||
GoogleOfficial{
|
||||
dimension "packageApk"
|
||||
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
|
||||
}
|
||||
|
||||
}*/
|
||||
/* applicationVariants.all { variant ->
|
||||
variant.mergeAssetsProvider.configure {
|
||||
doLast {
|
||||
@ -119,14 +139,27 @@ android {
|
||||
processManifestTask.doLast { pm ->
|
||||
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
||||
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
||||
if (file(manifestPath).exists() && isGooglePlay) {
|
||||
println "谷歌版本:" + isGooglePlay
|
||||
println "文件存在" + file(manifestPath).exists()
|
||||
println "" + (isGooglePlay != 0)
|
||||
println "" + (file(manifestPath).exists() && isGooglePlay != 0)
|
||||
if (file(manifestPath).exists() && isGooglePlay != 0) {
|
||||
def manifestContent = file(manifestPath).getText()
|
||||
|
||||
println "移除权限"
|
||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
||||
file(manifestPath).write(manifestContent)
|
||||
} else {
|
||||
print "not Exists = " + manifestPath
|
||||
}
|
||||
manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml"
|
||||
if (file(manifestPath).exists() && isGooglePlay != 0) {
|
||||
def manifestContent = file(manifestPath).getText()
|
||||
println "移除权限2"
|
||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
||||
file(manifestPath).write(manifestContent)
|
||||
}
|
||||
}
|
||||
variant.mergeAssetsProvider.configure {
|
||||
doLast {
|
||||
@ -183,7 +216,6 @@ android {
|
||||
isTest = "正式服"
|
||||
}
|
||||
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||
|
||||
}
|
||||
}
|
||||
signingConfigs {
|
||||
|
12
app/proguard-rules.pro
vendored
12
app/proguard-rules.pro
vendored
@ -277,6 +277,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.** {*;}
|
||||
|
||||
|
@ -30,14 +30,14 @@ import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.event.SudGameSocketImEvent;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
@ -142,6 +142,7 @@ public class AppContext extends CommonAppContext {
|
||||
registerError();
|
||||
registerFirebaseCrash();
|
||||
LogUtils.start(this);
|
||||
//DebugDialog.getInstance().setParams("初始化","启动");
|
||||
sInstance = this;
|
||||
L.setDeBug(BuildConfig.DEBUG);
|
||||
AppEventsLogger.activateApp(this);
|
||||
@ -164,20 +165,20 @@ public class AppContext extends CommonAppContext {
|
||||
OpenInstall.init(this);
|
||||
}
|
||||
//设置LOG开关,默认为false
|
||||
UMConfigure.setLogEnabled(true);
|
||||
//UMConfigure.setLogEnabled(true);
|
||||
|
||||
|
||||
//友盟正式初始化
|
||||
UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
||||
//UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
||||
|
||||
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
||||
MobclickAgent.setCatchUncaughtExceptions(false);
|
||||
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
||||
|
||||
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
||||
UMConfigure.setProcessEvent(true);//支持多进程打点
|
||||
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
||||
UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
||||
//UMConfigure.setProcessEvent(true);//支持多进程打点
|
||||
//MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
||||
//UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
||||
|
||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||
//初始化 AndroidUtilCode
|
||||
|
@ -201,9 +201,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'
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
@ -24,13 +25,12 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.R;
|
||||
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,6 +92,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
protected void main() {
|
||||
|
||||
}
|
||||
|
||||
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();
|
||||
@ -382,6 +394,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isKefu(String url) {
|
||||
if (url.contains("kefu")) {
|
||||
return true;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,81 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.DebugViewHolder> {
|
||||
HashMap<String, View> paramMap = new HashMap<>();
|
||||
private Context mContext;
|
||||
|
||||
public DebugDialogAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setParamMap(HashMap<String, View> paramMap) {
|
||||
Log.i("debug弹窗", "setParamMap: 添加值到view " + paramMap.size());
|
||||
this.paramMap = paramMap;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public DebugViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
Log.i("debug弹窗", "onCreateViewHolder: 创建适配器");
|
||||
return new DebugViewHolder(new LinearLayout(mContext));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull DebugViewHolder holder, int position) {
|
||||
List<String> 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();
|
||||
}
|
||||
|
||||
public class DebugViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public DebugViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
public void setData(String msg, View view) {
|
||||
Log.i("debug弹窗", "setData: 添加值到view " + view + "|" + msg + "|" + ((LinearLayout) itemView).indexOfChild(view));
|
||||
if (view instanceof TextView && StringUtil.isEmpty(((TextView) view).getText().toString())) {
|
||||
((TextView) view).setText(msg);
|
||||
}
|
||||
int indexOfChild = ((LinearLayout) itemView).indexOfChild(view);
|
||||
if (indexOfChild != -1) {
|
||||
if (((LinearLayout) itemView).getChildAt(indexOfChild) instanceof TextView) {
|
||||
((TextView) ((LinearLayout) itemView).getChildAt(indexOfChild)).setText(msg);
|
||||
} else {
|
||||
((LinearLayout) itemView).removeViewAt(indexOfChild);
|
||||
}
|
||||
} else {
|
||||
if (view.getParent() != null) {
|
||||
((ViewGroup) view.getParent()).removeView(view);
|
||||
}
|
||||
((LinearLayout) itemView).addView(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.PagerSnapHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/28.
|
||||
*/
|
||||
|
||||
public class ImagePreviewAdapter extends RecyclerView.Adapter<ImagePreviewAdapter.Vh> {
|
||||
|
||||
private LayoutInflater mInflater;
|
||||
private ActionListener mActionListener;
|
||||
private int mPageCount;
|
||||
private LinearLayoutManager mLayoutManager;
|
||||
private int mCurPosition;
|
||||
|
||||
public ImagePreviewAdapter(Context context, int pageCount) {
|
||||
mPageCount = pageCount;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_preview_img, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Vh vh, int position) {
|
||||
vh.setData(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mPageCount;
|
||||
}
|
||||
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView mImg;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
mImg = (ImageView) itemView;
|
||||
}
|
||||
|
||||
void setData(int position) {
|
||||
if (mActionListener != null) {
|
||||
mActionListener.loadImage(mImg, position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setActionListener(ActionListener actionListener) {
|
||||
mActionListener = actionListener;
|
||||
}
|
||||
|
||||
public void setCurPosition(int curPosition) {
|
||||
mCurPosition = curPosition;
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onPageChanged(curPosition);
|
||||
}
|
||||
}
|
||||
|
||||
public int getCurPosition(){
|
||||
return mCurPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
||||
super.onAttachedToRecyclerView(recyclerView);
|
||||
mLayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
|
||||
PagerSnapHelper pagerSnapHelper = new PagerSnapHelper();
|
||||
pagerSnapHelper.attachToRecyclerView(recyclerView);
|
||||
recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
||||
int position = mLayoutManager.findFirstCompletelyVisibleItemPosition();
|
||||
if (position >= 0 && mCurPosition != position) {
|
||||
mCurPosition = position;
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onPageChanged(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public interface ActionListener {
|
||||
void onPageChanged(int position);
|
||||
|
||||
void loadImage(ImageView imageView, int position);
|
||||
}
|
||||
}
|
@ -18,10 +18,14 @@ import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 侧边栏游戏列表适配器,改游戏列表数量在这里改
|
||||
*/
|
||||
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
private List<CustomSidebarChildModel> 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<CustomSidebarChildModel> 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();
|
||||
}
|
||||
|
||||
|
@ -67,13 +67,14 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> 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();
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,8 @@ 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消息
|
||||
@ -22,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;
|
||||
@ -47,6 +52,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;
|
||||
}
|
||||
@ -76,6 +90,9 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
if (!WordUtil.isNewZh() && !StringUtil.isEmpty(iconEn)) {
|
||||
return iconEn;
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
25
common/src/main/java/com/yunbao/common/bean/AvatarBean.java
Normal file
25
common/src/main/java/com/yunbao/common/bean/AvatarBean.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class AvatarBean extends BaseModel {
|
||||
private String avatar;
|
||||
private String avatarThumb;
|
||||
|
||||
public AvatarBean() {
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getAvatarThumb() {
|
||||
return avatarThumb;
|
||||
}
|
||||
|
||||
public void setAvatarThumb(String avatarThumb) {
|
||||
this.avatarThumb = avatarThumb;
|
||||
}
|
||||
}
|
@ -7,12 +7,21 @@ import java.util.Map;
|
||||
|
||||
public class LiveBattlePassRewardsBean extends BaseModel{
|
||||
private int level;
|
||||
private int is_received;
|
||||
private List<BattlePassType> live_battle_pass_type;
|
||||
private Map<Integer,Map<Integer,LiveBattlePassReward>> 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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -865,11 +865,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;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
@ -46,6 +46,9 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 半屏创建游戏房间
|
||||
*/
|
||||
public class CreateSudGamePopup extends BottomPopupView {
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
private TextView createGameType, selectCurrencyType;
|
||||
@ -315,6 +318,15 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
animator.setDuration(animDuration);
|
||||
animator.setInterpolator(new LinearInterpolator());
|
||||
animator.start();
|
||||
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)
|
||||
@ -329,6 +341,27 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
})
|
||||
)
|
||||
.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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
169
common/src/main/java/com/yunbao/common/dialog/DebugDialog.java
Normal file
169
common/src/main/java/com/yunbao/common/dialog/DebugDialog.java
Normal file
@ -0,0 +1,169 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
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.adapter.DebugDialogAdapter;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
|
||||
public class DebugDialog {
|
||||
RecyclerView recyclerView;
|
||||
HashMap<String, View> params;
|
||||
DebugDialogAdapter adapter;
|
||||
private static DebugDialog debugDialog;
|
||||
Context mContext;
|
||||
private ShowPattern showPattern = ShowPattern.CURRENT_ACTIVITY;
|
||||
|
||||
private DebugDialogRunnable runnable;
|
||||
|
||||
public static void getInstance(DebugDialogRunnable runnable) {
|
||||
if (debugDialog == null) {
|
||||
debugDialog = new DebugDialog(runnable);
|
||||
} else {
|
||||
runnable.run(debugDialog);
|
||||
}
|
||||
debugDialog.showPattern = ShowPattern.CURRENT_ACTIVITY;
|
||||
}
|
||||
|
||||
public static boolean checkShow() {
|
||||
return EasyFloat.isShow("debug");
|
||||
}
|
||||
|
||||
public DebugDialog clear() {
|
||||
params.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setParams(String tag, String msg) {
|
||||
Log.i("debug弹窗", "setParams: " + tag + "|" + msg);
|
||||
if (params.containsKey(tag)) {
|
||||
((TextView) params.get(tag)).setText(tag + ":" + msg);
|
||||
} else {
|
||||
TextView textView = new TextView(mContext);
|
||||
textView.setText(tag + ":" + msg);
|
||||
params.put(tag, textView);
|
||||
adapter.setParamMap(params);
|
||||
}
|
||||
EasyFloat.updateFloat("debug");
|
||||
}
|
||||
|
||||
private DebugDialog(DebugDialogRunnable runnable) {
|
||||
this.runnable = runnable;
|
||||
if (params == null) {
|
||||
Log.i("debug弹窗", "DebugDialog: 初始化参数");
|
||||
params = new HashMap<>();
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
this.mContext = AppManager.getInstance().getMainActivity();
|
||||
if (mContext == null) {
|
||||
startWaitMainActivity();
|
||||
return;
|
||||
}
|
||||
runnable.run(this);
|
||||
// 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);
|
||||
}
|
||||
|
||||
public void close() {
|
||||
EasyFloat.dismiss("debug");
|
||||
}
|
||||
|
||||
public void show() {
|
||||
if (showPattern == ShowPattern.CURRENT_ACTIVITY) {
|
||||
createView();
|
||||
return;
|
||||
}
|
||||
if (PermissionUtils.checkPermission(mContext)) {
|
||||
createView();
|
||||
} else {
|
||||
PermissionUtils.requestPermission((Activity) mContext, new OnPermissionResult() {
|
||||
@Override
|
||||
public void permissionResult(boolean b) {
|
||||
ToastUtil.show("悬浮权限" + b);
|
||||
if (b) {
|
||||
createView();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
TextView textView = new TextView(mContext);
|
||||
textView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ToastUtil.show("debug弹窗:" + params.size());
|
||||
EasyFloat.updateFloat("debug");
|
||||
}
|
||||
});
|
||||
params.put("debug弹窗", textView);
|
||||
adapter.setParamMap(params);
|
||||
|
||||
EasyFloat.with(mContext)
|
||||
.setTag("debug")
|
||||
.setShowPattern(this.showPattern)
|
||||
.setLayout(recyclerView)
|
||||
.show();
|
||||
runnable.run(this);
|
||||
Log.i("debug弹窗", "createView: 创建");
|
||||
}
|
||||
|
||||
public void setView(String value, View view, View.OnClickListener onClickListener) {
|
||||
if (params.containsKey(value)) {
|
||||
params.get(value).setOnClickListener(onClickListener);
|
||||
} else {
|
||||
view.setOnClickListener(onClickListener);
|
||||
params.put(value, view);
|
||||
}
|
||||
adapter.setParamMap(params);
|
||||
EasyFloat.updateFloat("debug");
|
||||
}
|
||||
|
||||
public void setShowPattern(ShowPattern showPattern) {
|
||||
this.showPattern = showPattern;
|
||||
}
|
||||
|
||||
public interface DebugDialogRunnable {
|
||||
void run(DebugDialog dialog);
|
||||
}
|
||||
}
|
@ -73,10 +73,10 @@ public class GuardBuyTipsDialog {
|
||||
buyTypeTextView.setVisibility(View.GONE);
|
||||
content2.setVisibility(View.VISIBLE);
|
||||
|
||||
} else if (guardType == mGuardUserInfoModel.getGuardType()) {
|
||||
content1.setVisibility(View.GONE);
|
||||
} else {
|
||||
} else if (TextUtils.equals(mGuardUserInfoModel.getIsOpen(), "1") && guardType > mGuardUserInfoModel.getGuardType()) {
|
||||
content1.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
content1.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
content1.setVisibility(View.GONE);
|
||||
|
@ -149,11 +149,11 @@ public class GuardUpgradePopup extends CenterPopupView {
|
||||
IMLoginModel userInfo = IMLoginManager.get(getContext()).getUserInfo();
|
||||
htmlUrl.append(CommonAppConfig.HOST)
|
||||
.append("/h5/Guard/level.html?")
|
||||
.append("&token=")
|
||||
.append("token=")
|
||||
.append(userInfo.getToken())
|
||||
.append("&uid=")
|
||||
.append(userInfo.getId())
|
||||
.append("&&anchorUid=")
|
||||
.append("&anchorUid=")
|
||||
.append(mLiveUid)
|
||||
.append("&isZh=")
|
||||
.append(((WordUtil.isNewZh()) ? "1" : "0"));
|
||||
|
@ -0,0 +1,160 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.ImagePreviewAdapter;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
/**
|
||||
* Created by Martin on 2024/3/15.
|
||||
* 图片预览弹窗
|
||||
*/
|
||||
|
||||
public class ImagePreviewDialog extends AbsDialogFragment implements View.OnClickListener {
|
||||
|
||||
private View mBg;
|
||||
private RecyclerView mRecyclerView;
|
||||
private ValueAnimator mAnimator;
|
||||
private int mPosition;
|
||||
private int mPageCount;
|
||||
private ActionListener mActionListener;
|
||||
private TextView mCount;
|
||||
private ImagePreviewAdapter mAdapter;
|
||||
private boolean mNeedDelete;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_preview_image;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDialogStyle() {
|
||||
return R.style.dialog2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canCancel() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
mBg = mRootView.findViewById(R.id.bg);
|
||||
mCount = (TextView) findViewById(R.id.count);
|
||||
findViewById(R.id.btn_close).setOnClickListener(this);
|
||||
if (mNeedDelete) {
|
||||
View btnDelete = findViewById(R.id.btn_delete);
|
||||
btnDelete.setVisibility(View.VISIBLE);
|
||||
btnDelete.setOnClickListener(this);
|
||||
}
|
||||
mRecyclerView = mRootView.findViewById(R.id.recyclerView);
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
mAnimator = ValueAnimator.ofFloat(0, 1);
|
||||
mAnimator.setDuration(150);
|
||||
mAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
float v = (float) animation.getAnimatedValue();
|
||||
mBg.setAlpha(v);
|
||||
}
|
||||
});
|
||||
mAnimator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
if (mRecyclerView != null && mPageCount > 0) {
|
||||
ImagePreviewAdapter adapter = new ImagePreviewAdapter(mContext, mPageCount);
|
||||
mAdapter = adapter;
|
||||
adapter.setActionListener(new ImagePreviewAdapter.ActionListener() {
|
||||
@Override
|
||||
public void onPageChanged(int position) {
|
||||
if (mCount != null) {
|
||||
mCount.setText(StringUtil.contact(String.valueOf(position + 1), "/", String.valueOf(mPageCount)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadImage(ImageView imageView, int position) {
|
||||
if (mActionListener != null) {
|
||||
mActionListener.loadImage(imageView, position);
|
||||
}
|
||||
}
|
||||
});
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
if (mPosition >= 0 && mPosition < mPageCount) {
|
||||
adapter.setCurPosition(mPosition);
|
||||
mRecyclerView.scrollToPosition(mPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mAnimator.start();
|
||||
}
|
||||
|
||||
public void setImageInfo(int pageCount, int position, boolean needDelete, ActionListener actionListener) {
|
||||
mActionListener = actionListener;
|
||||
mPageCount = pageCount;
|
||||
mPosition = position;
|
||||
mNeedDelete = needDelete;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mAnimator != null) {
|
||||
mAnimator.cancel();
|
||||
}
|
||||
mContext = null;
|
||||
mActionListener = null;
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int i = v.getId();
|
||||
if (i == R.id.btn_close) {
|
||||
dismiss();
|
||||
} else if (i == R.id.btn_delete) {
|
||||
delete();
|
||||
}
|
||||
}
|
||||
|
||||
private void delete() {
|
||||
if (mAdapter != null && mActionListener != null) {
|
||||
mActionListener.onDeleteClick(mAdapter.getCurPosition());
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
public interface ActionListener {
|
||||
void loadImage(ImageView imageView, int position);
|
||||
|
||||
void onDeleteClick(int position);
|
||||
}
|
||||
|
||||
}
|
@ -21,6 +21,7 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//游戏弹窗
|
||||
public class LiveNewRolePopup extends BottomPopupView {
|
||||
private boolean showRed = false;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -121,6 +121,7 @@ public class SendBlindGiftEvent extends BaseModel {
|
||||
private String specialGiftName;
|
||||
@SerializedName("special_gift_name_en")
|
||||
private String specialGiftNameEn;
|
||||
|
||||
public int getSpecialGift() {
|
||||
return specialGift;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ import java.util.Locale;
|
||||
*/
|
||||
|
||||
public class CommonHttpUtil {
|
||||
|
||||
public static final String GET_UPLOAD_QI_NIU_TOKEN = "getUploadQiNiuToken";
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
@ -450,6 +450,16 @@ public class CommonHttpUtil {
|
||||
public static void getUserBaseinfo(String touid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO).params("touid", touid).execute(callback);
|
||||
}
|
||||
/**
|
||||
* 上传文件 获取七牛云token的接口
|
||||
*/
|
||||
public static void getUploadQiNiuToken(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);
|
||||
}
|
||||
//
|
||||
// //埋点唯一性
|
||||
// public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
||||
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.AvatarBean;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
@ -83,10 +84,13 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
@ -1187,12 +1191,48 @@ public interface PDLiveApi {
|
||||
|
||||
@GET("/api/public/?service=Guard.participateMoneyLong")
|
||||
Observable<ResponseModel<String>> participateMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
||||
|
||||
@GET("/api/public/?service=Guard.endSendMoneyLong")
|
||||
Observable<ResponseModel<SendMoneyLongModel>> endSendMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
||||
|
||||
@GET("/api/public/?service=Guard.checkUpgrades")
|
||||
Observable<ResponseModel<CheckUpgradesModel>> checkUpgrades(@Query("liveuid") String liveUid);
|
||||
|
||||
@GET("/api/public/?service=Guard.getRewards")
|
||||
Observable<ResponseModel<Object>> guardGetRewards(@Query("guard_level") String guardLevel, @Query("liveuid") String liveUid);
|
||||
|
||||
@Multipart
|
||||
@POST("/api/public/?service=Pdlinfos.updateAvatar")
|
||||
Observable<ResponseModel<AvatarBean>> updateFile(@Part MultipartBody.Part file, @Query("uid") String uid, @Query("token") String token);
|
||||
|
||||
@GET("/api/public/?service=User.userFeedback")
|
||||
Observable<ResponseModel<List<BaseModel>>> feedback(@Query("problem_description") String content, @Query("problem_image") String images, @Query("contact_information") String ci);
|
||||
|
||||
|
||||
@GET("/api/public/?service=User.userFeedbackRestrict")
|
||||
Observable<ResponseModel<List<BaseModel>>> 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<ResponseModel<List<BaseModel>>> 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
|
||||
);
|
||||
@GET("/api/public/?service=Tx.getShengwangToken")
|
||||
Observable<ResponseModel<SwTokenModel>> getSwToken();
|
||||
}
|
||||
|
@ -4,9 +4,12 @@ import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AvatarBean;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
@ -80,6 +83,7 @@ import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -89,6 +93,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
|
||||
/**
|
||||
@ -3184,6 +3192,123 @@ public class LiveNetManager {
|
||||
|
||||
}
|
||||
|
||||
public void updateFile(File file, HttpCallback<AvatarBean> callback) {
|
||||
MultipartBody.Part uploadFile = createUploadFile(file);
|
||||
API.get().pdLiveApi(mContext)
|
||||
.updateFile(uploadFile, CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<AvatarBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<AvatarBean> model) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(model.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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 feedback(
|
||||
String content,
|
||||
JSONArray images,
|
||||
String ci
|
||||
, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.feedback(content, images.toString(), ci)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
||||
if (callback != null) {
|
||||
HttpCallbackModel model = new HttpCallbackModel();
|
||||
model.setCode(responseModel.getData().getCode());
|
||||
model.setMsg(responseModel.getData().getMsg());
|
||||
callback.onSuccess(model);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.checkFeedback()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
||||
if (callback != null) {
|
||||
HttpCallbackModel model = new HttpCallbackModel();
|
||||
model.setCode(responseModel.getData().getCode());
|
||||
model.setMsg(responseModel.getData().getMsg());
|
||||
callback.onSuccess(model);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@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<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createGameOrder(roomId, cmd, value, gameId, fromUid, toUid,payload)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
||||
if (callback != null) {
|
||||
HttpCallbackModel model = new HttpCallbackModel();
|
||||
model.setCode(responseModel.getData().getCode());
|
||||
model.setMsg(responseModel.getData().getMsg());
|
||||
callback.onSuccess(model);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
private MultipartBody.Part createUploadFile(File file) {
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
@ -1,16 +1,62 @@
|
||||
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.
|
||||
*/
|
||||
|
||||
public interface ImageResultCallback {
|
||||
public abstract class ImageResultCallback {
|
||||
//跳转相机前执行
|
||||
void beforeCamera();
|
||||
|
||||
void onSuccess(File file);
|
||||
|
||||
void onFailure();
|
||||
public void beforeCamera() {
|
||||
}
|
||||
|
||||
public void onSuccess(File file) {
|
||||
}
|
||||
|
||||
public void onFailure() {
|
||||
}
|
||||
|
||||
public void onSuccessToUrl(File file, OnItemClickListener<String> listener) {
|
||||
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||
.updateFile(file, new com.yunbao.common.http.base.HttpCallback<AvatarBean>() {
|
||||
@Override
|
||||
public void onSuccess(AvatarBean data) {
|
||||
listener.onItemClick(data.getAvatar(), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
listener.onItemClick(error, -1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onSuccessToQiNiuUrl(Context mContext, File file, OnItemClickListener<String> listener) {
|
||||
UploadQnImpl mUploadStrategy = new UploadQnImpl(mContext);
|
||||
List<UploadBean> beans = new ArrayList<>();
|
||||
beans.add(new UploadBean(file, UploadBean.IMG));
|
||||
mUploadStrategy.upload(beans, true, new UploadCallback() {
|
||||
@Override
|
||||
public void onFinish(List<UploadBean> list, boolean success) {
|
||||
if (success) {
|
||||
listener.onItemClick("https://downs.yaoulive.com/" + list.get(0).getRemoteAccessUrl(), 0);
|
||||
} else {
|
||||
listener.onItemClick(null, -1);
|
||||
}
|
||||
}
|
||||
}, true);
|
||||
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ import androidx.annotation.NonNull;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.DataUserInfoEvent;
|
||||
|
@ -17,6 +17,7 @@ import com.iflytek.cloud.SpeechUtility;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.dialog.DebugDialog;
|
||||
import com.yunbao.common.event.RongIMConnectionStatusEvent;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
|
@ -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,28 @@ 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) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,7 +59,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
||||
/**
|
||||
* 游戏的语言代码
|
||||
*/
|
||||
public String languageCode = "zh-CN";
|
||||
public String languageCode = "zh-TW";
|
||||
|
||||
public final MutableLiveData<View> 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";
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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,8 +272,14 @@ public interface SudFSMMGListener {
|
||||
* mg_common_game_create_order
|
||||
*/
|
||||
default void onGameMGCommonGameCreateOrder(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameCreateOrder model) {
|
||||
if ("addHeart".equals(model.cmd)) {
|
||||
JumpEvent.addHeart(model);
|
||||
} else if ("hit".equals(model.cmd)) {
|
||||
JumpEvent.hit(model);
|
||||
} else {
|
||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 26. 游戏通知app玩家角色(仅对狼人杀有效)
|
||||
|
@ -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<HttpCallbackModel>() {
|
||||
@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) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
105
common/src/main/java/com/yunbao/common/upload/UploadBean.java
Normal file
105
common/src/main/java/com/yunbao/common/upload/UploadBean.java
Normal file
@ -0,0 +1,105 @@
|
||||
package com.yunbao.common.upload;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/16.
|
||||
*/
|
||||
|
||||
public class UploadBean {
|
||||
|
||||
public static final int IMG = 0;
|
||||
public static final int VIDEO = 1;
|
||||
public static final int VOICE = 2;
|
||||
private File mOriginFile;//要被上传的源文件
|
||||
private File mCompressFile;//压缩后的图片文件
|
||||
private String mRemoteFileName;//上传成功后在云存储上的文件名字
|
||||
private String mRemoteAccessUrl;//上传成功后在云存储上的访问地址
|
||||
private boolean mSuccess;//是否上传成功了
|
||||
private int mType;
|
||||
private Object mTag;
|
||||
|
||||
public UploadBean() {
|
||||
}
|
||||
|
||||
public UploadBean(File originFile, int type) {
|
||||
mOriginFile = originFile;
|
||||
mType = type;
|
||||
}
|
||||
|
||||
public File getOriginFile() {
|
||||
return mOriginFile;
|
||||
}
|
||||
|
||||
public void setOriginFile(File originFile) {
|
||||
mOriginFile = originFile;
|
||||
}
|
||||
|
||||
public String getRemoteFileName() {
|
||||
return mRemoteFileName;
|
||||
}
|
||||
|
||||
public void setRemoteFileName(String remoteFileName) {
|
||||
mRemoteFileName = remoteFileName;
|
||||
}
|
||||
|
||||
public String getRemoteAccessUrl() {
|
||||
return mRemoteAccessUrl;
|
||||
}
|
||||
|
||||
public void setRemoteAccessUrl(String remoteAccessUrl) {
|
||||
mRemoteAccessUrl = remoteAccessUrl;
|
||||
}
|
||||
|
||||
public File getCompressFile() {
|
||||
return mCompressFile;
|
||||
}
|
||||
|
||||
public void setCompressFile(File compressFile) {
|
||||
mCompressFile = compressFile;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return mSuccess;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
mSuccess = success;
|
||||
}
|
||||
|
||||
|
||||
public void setEmpty() {
|
||||
mOriginFile = null;
|
||||
mRemoteFileName = null;
|
||||
mRemoteAccessUrl = null;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return mOriginFile == null && mRemoteFileName == null && mRemoteAccessUrl == null;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return mType;
|
||||
}
|
||||
|
||||
public Object getTag() {
|
||||
return mTag;
|
||||
}
|
||||
|
||||
public void setTag(Object tag) {
|
||||
mTag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UploadBean{" +
|
||||
"mOriginFile=" + mOriginFile +
|
||||
", mCompressFile=" + mCompressFile +
|
||||
", mRemoteFileName='" + mRemoteFileName + '\'' +
|
||||
", mRemoteAccessUrl='" + mRemoteAccessUrl + '\'' +
|
||||
", mSuccess=" + mSuccess +
|
||||
", mType=" + mType +
|
||||
", mTag=" + mTag +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.yunbao.common.upload;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/16.
|
||||
*/
|
||||
|
||||
public interface UploadCallback {
|
||||
void onFinish(List<UploadBean> list, boolean success);
|
||||
}
|
224
common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java
Normal file
224
common/src/main/java/com/yunbao/common/upload/UploadQnImpl.java
Normal file
@ -0,0 +1,224 @@
|
||||
package com.yunbao.common.upload;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
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.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import top.zibin.luban.Luban;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/16.
|
||||
* 七牛上传文件
|
||||
*/
|
||||
|
||||
public class UploadQnImpl implements UploadStrategy {
|
||||
|
||||
private static final String TAG = "UploadQnImpl";
|
||||
private Context mContext;
|
||||
private List<UploadBean> mList;
|
||||
private int mIndex;
|
||||
private boolean mNeedCompress;
|
||||
private UploadCallback mUploadCallback;
|
||||
private HttpCallback mGetUploadTokenCallback;
|
||||
private String mToken;
|
||||
private UploadManager mUploadManager;
|
||||
private UpCompletionHandler mCompletionHandler;//上传回调
|
||||
private Luban.Builder mLubanBuilder;
|
||||
|
||||
public UploadQnImpl(Context context) {
|
||||
mContext = context;
|
||||
mCompletionHandler = new UpCompletionHandler() {
|
||||
@Override
|
||||
public void complete(String key, ResponseInfo info, JSONObject response) {
|
||||
System.out.println("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
||||
//L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
||||
try {
|
||||
assert response != null;
|
||||
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (mList == null || mList.size() == 0) {
|
||||
if (mUploadCallback != null) {
|
||||
mUploadCallback.onFinish(mList, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
UploadBean uploadBean = mList.get(mIndex);
|
||||
if (info.isOK()) {
|
||||
uploadBean.setSuccess(true);
|
||||
if (uploadBean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||
//上传完成后把 压缩后的图片 删掉
|
||||
File compressedFile = uploadBean.getCompressFile();
|
||||
if (compressedFile != null && compressedFile.exists()) {
|
||||
File originFile = uploadBean.getOriginFile();
|
||||
if (originFile != null && !compressedFile.getAbsolutePath().equals(originFile.getAbsolutePath())) {
|
||||
compressedFile.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
mIndex++;
|
||||
if (mIndex < mList.size()) {
|
||||
uploadNext();
|
||||
} else {
|
||||
if (mUploadCallback != null) {
|
||||
mUploadCallback.onFinish(mList, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
upload(mList.get(mIndex));//上传失败后 重新上传
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback, boolean isImg) {
|
||||
System.err.println("-------upload------>" + list.size());
|
||||
if (callback == null) {
|
||||
return;
|
||||
}
|
||||
if (list == null || list.size() == 0) {
|
||||
callback.onFinish(list, false);
|
||||
return;
|
||||
}
|
||||
boolean hasFile = false;
|
||||
for (UploadBean bean : list) {
|
||||
if (bean.getOriginFile() != null) {
|
||||
hasFile = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasFile) {
|
||||
callback.onFinish(list, true);
|
||||
return;
|
||||
}
|
||||
mList = list;
|
||||
mNeedCompress = needCompress;
|
||||
mUploadCallback = callback;
|
||||
mIndex = 0;
|
||||
|
||||
if (mGetUploadTokenCallback == null) {
|
||||
mGetUploadTokenCallback = new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
mToken = info[0];
|
||||
System.err.println("-------上传的token------>" + mToken);
|
||||
L.e(TAG, "-------上传的token------>" + mToken);
|
||||
uploadNext();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
CommonHttpUtil.getUploadQiNiuToken(mGetUploadTokenCallback, isImg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelUpload() {
|
||||
CommonHttpUtil.cancel(CommonHttpUtil.GET_UPLOAD_QI_NIU_TOKEN);
|
||||
if (mList != null) {
|
||||
mList.clear();
|
||||
}
|
||||
mUploadCallback = null;
|
||||
}
|
||||
|
||||
private void uploadNext() {
|
||||
UploadBean bean = null;
|
||||
while (mIndex < mList.size() && (bean = mList.get(mIndex)).getOriginFile() == null) {
|
||||
mIndex++;
|
||||
}
|
||||
System.err.println("-------mIndex >= mList.size() mIndex------>" + mIndex);
|
||||
if (mIndex >= mList.size()) {
|
||||
System.err.println("-------mIndex >= mList.size()------>" + mList.size());
|
||||
if (mUploadCallback != null) {
|
||||
mUploadCallback.onFinish(mList, true);
|
||||
}
|
||||
System.err.println("-------mIndex >= mList.returnreturnreturnreturn------>" + mList.size());
|
||||
return;
|
||||
}
|
||||
if (bean.getType() == UploadBean.IMG) {
|
||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".jpg"));
|
||||
} else if (bean.getType() == UploadBean.VIDEO) {
|
||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".mp4"));
|
||||
} else if (bean.getType() == UploadBean.VOICE) {
|
||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".m4a"));
|
||||
}
|
||||
System.err.println("-------mIndex >= bean.getType() == UploadBean.IMG------>" + bean);
|
||||
upload(bean);
|
||||
/*if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||
System.err.println("-------UploadBean.IMG && mNeedCompress------>" + bean + "UploadBean.IMG:" + UploadBean.IMG + "__mNeedCompress" + mNeedCompress);
|
||||
if (mLubanBuilder == null) {
|
||||
mLubanBuilder = Luban.with(mContext).ignoreBy(8)//8k以下不压缩
|
||||
.setTargetDir(CommonAppConfig.INNER_PATH).setRenameListener(new OnRenameListener() {
|
||||
@Override
|
||||
public String rename(String filePath) {
|
||||
return mList.get(mIndex).getRemoteFileName();
|
||||
}
|
||||
}).setCompressListener(new OnCompressListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(File file) {
|
||||
UploadBean uploadBean = mList.get(mIndex);
|
||||
uploadBean.setCompressFile(file);
|
||||
upload(uploadBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
upload(mList.get(mIndex));
|
||||
}
|
||||
});
|
||||
}
|
||||
mLubanBuilder.load(bean.getOriginFile()).launch();
|
||||
} else {
|
||||
System.err.println("-------bean.getType() == UploadBean.IMG && mNeedCompress else");
|
||||
upload(bean);
|
||||
}*/
|
||||
}
|
||||
|
||||
private void upload(UploadBean bean) {
|
||||
System.err.println("-------upload(UploadBean bean)------>" + bean);
|
||||
if (bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null) {
|
||||
System.err.println("bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
|
||||
if (mUploadManager == null) {
|
||||
Zone zone = new Zone(new ServiceAddress("http://upload-z0.qiniup.com"), new ServiceAddress("http://up-z0.qiniup.com"));
|
||||
Configuration configuration = new Configuration.Builder().zone(zone).build();
|
||||
mUploadManager = new UploadManager(configuration);
|
||||
}
|
||||
File uploadFile = bean.getOriginFile();
|
||||
if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
||||
File compressedFile = bean.getCompressFile();
|
||||
if (compressedFile != null && compressedFile.exists()) {
|
||||
uploadFile = compressedFile;
|
||||
}
|
||||
}
|
||||
mUploadManager.put(uploadFile, bean.getRemoteFileName(), mToken, mCompletionHandler, null);
|
||||
} else {
|
||||
System.err.println("else bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
|
||||
if (mUploadCallback != null) {
|
||||
mUploadCallback.onFinish(mList, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.yunbao.common.upload;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/16.
|
||||
*/
|
||||
|
||||
public interface UploadStrategy {
|
||||
|
||||
/**
|
||||
* 执行上传
|
||||
*
|
||||
* @param list 被上传的文件列表
|
||||
* @param needCompress 是否需要压缩
|
||||
* @param callback 上传回调
|
||||
*/
|
||||
void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback,boolean isImg);
|
||||
|
||||
/**
|
||||
* 取消上传
|
||||
*/
|
||||
void cancelUpload();
|
||||
}
|
@ -11,6 +11,7 @@ public class AppManager {
|
||||
private static Stack<Activity> activityStack;
|
||||
|
||||
public AppManager() {
|
||||
activityStack=new Stack<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -20,6 +21,33 @@ public class AppManager {
|
||||
return SingleApp.INSTANCE;
|
||||
}
|
||||
|
||||
public static Activity getActivity(String activityName) {
|
||||
for (Activity activity : activityStack) {
|
||||
if (activity.getClass().getSimpleName().contains(activityName)) {
|
||||
return activity;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Activity getMainActivity() {
|
||||
for (Activity activity : activityStack) {
|
||||
if (activity.getClass().getSimpleName().contains("MainActivity")) {
|
||||
return activity;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Activity getLiveActivity() {
|
||||
for (Activity activity : activityStack) {
|
||||
if (activity.getClass().getSimpleName().contains("LiveAudienceActivity")) {
|
||||
return activity;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static class SingleApp {
|
||||
public static AppManager INSTANCE = new AppManager();
|
||||
}
|
||||
@ -67,7 +95,14 @@ public class AppManager {
|
||||
* 获取当前显示Activity(堆栈中最后一个传入的activity)
|
||||
*/
|
||||
public Activity getLastActivity() {
|
||||
if (activityStack.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Activity activity = activityStack.lastElement();
|
||||
if (activity == null || activity.isFinishing()) {
|
||||
activityStack.remove(activity);
|
||||
return getLastActivity();
|
||||
}
|
||||
return activity;
|
||||
}
|
||||
|
||||
|
@ -359,6 +359,7 @@ public class DialogUitl {
|
||||
private boolean mBackgroundDimEnabled;//显示区域以外是否使用黑色半透明背景
|
||||
private boolean mInput;//是否是输入框的
|
||||
private boolean isShowCancelButton=true;
|
||||
private boolean isSHowConfirmButton=true;
|
||||
private String mHint;
|
||||
private int mInputType;
|
||||
private int mLength;
|
||||
@ -460,6 +461,11 @@ public class DialogUitl {
|
||||
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) {
|
||||
@ -499,10 +505,19 @@ 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);
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
|
||||
public class MobclickAgent {
|
||||
public static void onEvent(Context content, String key, Object value){
|
||||
|
||||
}
|
||||
|
||||
public static void setCatchUncaughtExceptions(boolean b) {
|
||||
}
|
||||
public static void setPageCollectionMode(int type){
|
||||
|
||||
}
|
||||
|
||||
public static void onPageStart(String mTag) {
|
||||
|
||||
}
|
||||
|
||||
public static void onPageEnd(String mTag) {
|
||||
}
|
||||
|
||||
public static void onProfileSignOff() {
|
||||
|
||||
}
|
||||
|
||||
public static void onProfileSignIn(String s) {
|
||||
|
||||
}
|
||||
}
|
@ -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);
|
||||
@ -93,17 +100,41 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
@Override
|
||||
public void onFailure() {
|
||||
ToastUtil.show(mContext.getString(R.string.img_camera_cancel));
|
||||
if (mResultCallback != null) {
|
||||
mResultCallback.onFailure();
|
||||
}
|
||||
}
|
||||
};
|
||||
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());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure() {
|
||||
ToastUtil.show(mContext.getString(R.string.img_alumb_cancel));
|
||||
if (mResultCallback != null) {
|
||||
mResultCallback.onFailure();
|
||||
}
|
||||
}
|
||||
};
|
||||
mCropResultCallback = new ActivityResultCallback() {
|
||||
@ -117,6 +148,9 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
@Override
|
||||
public void onFailure() {
|
||||
ToastUtil.show(mContext.getString(R.string.img_crop_cancel));
|
||||
if (mResultCallback != null) {
|
||||
mResultCallback.onFailure();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -143,6 +177,11 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||
}
|
||||
|
||||
public void getImageByAlumb(boolean needCrop) {
|
||||
this.mNeedCrop = needCrop;
|
||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开启摄像头,执行照相
|
||||
@ -163,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() {
|
||||
@ -180,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 {
|
||||
|
@ -52,6 +52,10 @@ public class RouteUtil {
|
||||
public static final String PATH_SudRyGameActivity = "/live/SudRyGameActivity";
|
||||
|
||||
public static final String PATH_COMMUNITY_Activity = "/main/MainHomeCommunityActivity";
|
||||
public static final String PATH_SudGameActivity="/live/SudGameActivity";
|
||||
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 forwardCommunityActivity() {
|
||||
@ -371,4 +375,8 @@ public class RouteUtil {
|
||||
ARouter.getInstance().build(PATH_BattlePassActivity)
|
||||
.navigation();
|
||||
}
|
||||
public static void forwardActivity(String path){
|
||||
ARouter.getInstance().build(path)
|
||||
.navigation();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
@ -160,4 +161,15 @@ public class StringUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取随机文件名
|
||||
*/
|
||||
public static String generateFileName() {
|
||||
return contact("android_",
|
||||
CommonAppConfig.getInstance().getUid(),
|
||||
"_",
|
||||
DateFormatUtil.getVideoCurTimeString(),
|
||||
UUID.randomUUID().toString());
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.FunGamesAdapter;
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rootView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -15,6 +16,7 @@
|
||||
android:id="@+id/ft_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="72dp"
|
||||
|
||||
android:paddingTop="24dp"
|
||||
android:background="@color/white">
|
||||
|
||||
@ -67,6 +69,5 @@
|
||||
<WebView
|
||||
android:id="@+id/webView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
8
common/src/main/res/layout/item_preview_img.xml
Normal file
8
common/src/main/res/layout/item_preview_img.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitCenter"
|
||||
android:background="#000"
|
||||
/>
|
@ -6,7 +6,7 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--身份特权-->
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="40dp"
|
||||
|
@ -46,12 +46,21 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fun_game_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:maxLines="1"
|
||||
android:text="@string/guard_guard"
|
||||
android:textColor="#9A9A9A"
|
||||
|
||||
app:autoSizeMaxTextSize="14sp"
|
||||
app:autoSizeMinTextSize="5sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
78
common/src/main/res/layout/view_preview_image.xml
Normal file
78
common/src/main/res/layout/view_preview_image.xml
Normal file
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<View
|
||||
android:id="@+id/bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:background="#000" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/preview"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_close"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:padding="9dp"
|
||||
android:src="@mipmap/icon_back"
|
||||
app:tint="@color/white" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|right"
|
||||
android:layout_marginRight="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="40dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_delete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="#000"
|
||||
android:gravity="center"
|
||||
android:text="@string/delete"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
@ -1374,7 +1374,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="sud_in_game_game_game_peer_user_nodata">" Currently No Records~"</string>
|
||||
<string name="sud_in_game_game_game_peer_today">"Today "</string>
|
||||
<string name="sud_in_game_rule_hint1">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;</string>
|
||||
<string name="sud_in_game_rule_hint2">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;</string>
|
||||
<string name="sud_in_game_rule_hint2">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;</string>
|
||||
<string name="sud_in_game_rule_hint3">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;</string>
|
||||
<string name="sud_in_game_rule_hint4">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;</string>
|
||||
<string name="sud_in_game_rule_hint5">5.The final interpretation right of the event belongs to PDLIVE.</string>
|
||||
@ -1466,7 +1466,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="six_month">6 month</string>
|
||||
<string name="one_two_month">12 month</string>
|
||||
<string name="guardian_for_your_favorite_anchor">Quickly activate guardian for your favorite anchor!</string>
|
||||
<string name="guardian_task">Guardian Task</string>
|
||||
<string name="guardian_task">Guard tasks</string>
|
||||
<string name="my_graud_grade">My level ></string>
|
||||
<string name="no_one_guarding_the_anchor_yet">No one is guarding the anchor yet, come and guard it now~</string>
|
||||
<string name="this_week_contribution">Contribution/week</string>
|
||||
|
@ -1371,7 +1371,7 @@
|
||||
<string name="sud_in_game_game_game_peer_user_nodata">暫無記錄~</string>
|
||||
<string name="sud_in_game_game_game_peer_today">今日</string>
|
||||
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與;</string>
|
||||
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待;</string>
|
||||
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【飛行棋】、【碰碰我最強】、【怪物消消樂】、【跳一跳】、【友情闖關】、【魔法大樂鬥】、【美式8球】後續將會提供更多遊戲種類,敬請期期待;</string>
|
||||
<string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數;</string>
|
||||
<string name="sud_in_game_rule_hint4">4、 遊戲開始時將會收取參與遊戲用戶的籌碼,在遊戲結束後,將收取10%的籌碼作為門票,剩餘籌碼將全部給予勝利用戶,平局時將會扣除相應籌碼门票後返還給用戶;</string>
|
||||
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
|
||||
|
@ -1370,7 +1370,7 @@
|
||||
<string name="sud_in_game_game_game_peer_user_nodata">暫無記錄~</string>
|
||||
<string name="sud_in_game_game_game_peer_today">今日</string>
|
||||
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與;</string>
|
||||
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待;</string>
|
||||
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【飛行棋】、【碰碰我最強】、【怪物消消樂】、【跳一跳】、【友情闖關】、【魔法大樂鬥】、【美式8球】後續將會提供更多遊戲種類,敬請期期待;</string>
|
||||
<string name="sud_in_game_rule_hint3">3、用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數;</string>
|
||||
<string name="sud_in_game_rule_hint4">4、 遊戲開始時將會收取參與遊戲用戶的籌碼,在遊戲結束後,將收取10%的籌碼作為門票,剩餘籌碼將全部給予勝利用戶,平局時將會扣除相應籌碼门票後返還給用戶;</string>
|
||||
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
|
||||
|
@ -1369,7 +1369,7 @@
|
||||
<string name="sud_in_game_game_game_peer_user_nodata">暫無記錄~</string>
|
||||
<string name="sud_in_game_game_game_peer_today">今日</string>
|
||||
<string name="sud_in_game_rule_hint1">1、互動遊戲是PDLIVE為用戶提供的全新板塊,用戶可以在首頁【遊戲專區】或直播間內參與;</string>
|
||||
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【碰碰我最強】、【飛行棋】、【扫雷】、【飞镖达人】、【怪兽消消乐】,後續將會提供更多遊戲種類,敬請期待;</string>
|
||||
<string name="sud_in_game_rule_hint2">2、目前已上線【五子棋】、【飛行棋】、【碰碰我最強】、【怪物消消樂】、【跳一跳】、【友情闖關】、【魔法大樂鬥】、【美式8球】後續將會提供更多遊戲種類,敬請期期待;</string>
|
||||
<string name="sud_in_game_rule_hint3">3、 用戶可自定義設定遊戲門檻,要求在100~50000金豆之間,數額必須為10的倍數;</string>
|
||||
<string name="sud_in_game_rule_hint4">4、 遊戲開始時將會收取參與遊戲用戶的籌碼,在遊戲結束後,將收取10%的籌碼作為門票,剩餘籌碼將全部給予勝利用戶,平局時將會扣除相應籌碼门票後返還給用戶;</string>
|
||||
<string name="sud_in_game_rule_hint5">5、活動最終解釋權歸PDLIVE所有。</string>
|
||||
|
@ -1382,8 +1382,8 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="sud_in_game_game_game_peer_today_7">"≤7 days "</string>
|
||||
<string name="sud_in_game_game_game_peer_today_30">≤ 30 days</string>
|
||||
<string name="sud_in_game_rule_hint1">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;</string>
|
||||
<string name="sud_in_game_rule_hint2">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;</string>
|
||||
<string name="sud_in_game_rule_hint3">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;</string>
|
||||
<string name="sud_in_game_rule_hint2">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;</string>
|
||||
<string name="sud_in_game_rule_hint3">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;</string>
|
||||
<string name="sud_in_game_rule_hint4">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;</string>
|
||||
<string name="sud_in_game_rule_hint5">5. The final interpretation right of the event belongs to PDLIVE.</string>
|
||||
<string name="room_sill0_100">0-100 coins</string>
|
||||
@ -1469,7 +1469,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="six_month">6 month</string>
|
||||
<string name="one_two_month">12 month</string>
|
||||
<string name="guardian_for_your_favorite_anchor">Quickly activate guardian for your favorite anchor!</string>
|
||||
<string name="guardian_task">Guardian Task</string>
|
||||
<string name="guardian_task">Guard tasks</string>
|
||||
<string name="my_graud_grade">My level ></string>
|
||||
<string name="no_one_guarding_the_anchor_yet">No one is guarding the anchor yet, come and guard it now~</string>
|
||||
<string name="this_week_contribution">Contribution/week</string>
|
||||
|
@ -4,8 +4,8 @@ ext {
|
||||
buildToolsVersion: "29.0.2",
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 33,
|
||||
versionCode : 469,
|
||||
versionName : "6.6.6"
|
||||
versionCode : 473,
|
||||
versionName : "6.6.8"
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
//正式、
|
||||
@ -25,6 +25,6 @@ ext {
|
||||
//是否上报异常日志
|
||||
isUploadLog : true,
|
||||
//是否打包成插件包模式
|
||||
isPluginModel : false,
|
||||
isPluginModel : true,
|
||||
]
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
package com.shayu.lib_huawei;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
BIN
libs/umeng-common-9.6.8+000.aar
Normal file
BIN
libs/umeng-common-9.6.8+000.aar
Normal file
Binary file not shown.
@ -18,7 +18,7 @@ import com.blankj.utilcode.util.StringUtils;
|
||||
import com.ms.banner.Banner;
|
||||
import com.ms.banner.BannerConfig;
|
||||
import com.ms.banner.listener.OnBannerClickListener;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
|
@ -21,7 +21,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
@ -535,7 +535,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
mLiveRoomViewHolder.onGuardInfoChanged(bean);
|
||||
LiveChatBean chatBean = new LiveChatBean();
|
||||
chatBean.setContent(bean.getUserName());
|
||||
chatBean.setType(LiveChatBean.SYSTEM);
|
||||
chatBean.setType(LiveChatBean.SYSTEM2);
|
||||
mLiveRoomViewHolder.insertChat(chatBean, 1);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.lxj.xpopup.interfaces.XPopupCallback;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
|
@ -43,6 +43,7 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.GameRyMicManager;
|
||||
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;
|
||||
|
@ -29,6 +29,7 @@ import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.manager.MicUserManager;
|
||||
import com.yunbao.common.manager.MicedUserManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@ -181,7 +182,7 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(bean.getId(), conversationType, messageContent);
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(io.rong.imlib.model.Message message) {
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
@ -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;
|
||||
@ -225,6 +227,9 @@ public class LiveChatBean {
|
||||
}
|
||||
|
||||
public String getMedal_new() {
|
||||
if (!WordUtil.isNewZh() && !StringUtil.isEmpty(medal_new_en)) {
|
||||
return medal_new_en;
|
||||
}
|
||||
return medal_new;
|
||||
}
|
||||
|
||||
@ -232,6 +237,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;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
@ -30,7 +30,7 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.stx.xhb.androidx.XBanner;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.adapter.LiveBuyGuardPrivilegeAdapter;
|
||||
import com.yunbao.common.bean.CheckUpgradesModel;
|
||||
|
@ -18,7 +18,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
@ -23,7 +23,7 @@ import androidx.annotation.Nullable;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
|
@ -44,7 +44,7 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
|
@ -17,7 +17,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.CheckUpgradesModel;
|
||||
@ -291,11 +291,11 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
htmlUrl.append(CommonAppConfig.HOST)
|
||||
.append("/h5/Guard/mission.html?")
|
||||
.append("&token=")
|
||||
.append("token=")
|
||||
.append(userInfo.getToken())
|
||||
.append("&uid=")
|
||||
.append(userInfo.getId())
|
||||
.append("&&anchorUid=")
|
||||
.append("&anchorUid=")
|
||||
.append(mLiveUid)
|
||||
.append("&isZh=")
|
||||
.append(((WordUtil.isNewZh()) ? "1" : "0"));
|
||||
@ -317,11 +317,11 @@ public class LiveGuardDialog extends AbsDialogPopupWindow {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
htmlUrl.append(CommonAppConfig.HOST)
|
||||
.append("/h5/Guard/level.html?")
|
||||
.append("&token=")
|
||||
.append("token=")
|
||||
.append(userInfo.getToken())
|
||||
.append("&uid=")
|
||||
.append(userInfo.getId())
|
||||
.append("&&anchorUid=")
|
||||
.append("&anchorUid=")
|
||||
.append(mLiveUid)
|
||||
.append("&isZh=")
|
||||
.append(((WordUtil.isNewZh()) ? "1" : "0"));
|
||||
|
@ -27,7 +27,7 @@ import android.widget.RadioGroup;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
|
@ -25,6 +25,7 @@ import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@ -204,7 +205,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
|
||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(io.rong.imlib.model.Message message) {
|
||||
|
||||
@ -253,7 +254,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(io.rong.imlib.model.Message message) {
|
||||
|
||||
|
@ -22,7 +22,7 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.FansModel;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
@ -16,13 +18,15 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.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();
|
||||
}
|
||||
|
||||
|
@ -491,6 +491,7 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
PK_RANK_START(76, "PK排位赛开始"),
|
||||
GuardSpecialEffect(77, "PK排位赛开始"),
|
||||
LIVE_DIALOG_ANCHOR_TIPS(78, "主播公会赛tips");
|
||||
|
||||
private int type;
|
||||
private String name;
|
||||
|
||||
|
@ -39,7 +39,7 @@ import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.opensource.svgaplayer.utils.SVGARect;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
@ -101,6 +101,7 @@ import pl.droidsonroids.gif.GifImageView;
|
||||
/**
|
||||
* Created by cxf on 2018/10/13.
|
||||
* 产品让改礼物效果
|
||||
* 全服通知效果实现
|
||||
*/
|
||||
|
||||
public class LiveGiftAnimPresenter {
|
||||
@ -381,11 +382,16 @@ public class LiveGiftAnimPresenter {
|
||||
.setIsContactGift(true));
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
if (mIvLook.getTag()!=null&&mIvLook.getTag()instanceof LiveReceiveGiftBean){
|
||||
changeLiveRoom((LiveReceiveGiftBean) mIvLook.getTag());
|
||||
}else {
|
||||
changeLiveRoom();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
mGifGiftTipGroupAllServer.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -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();
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
@ -55,7 +56,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -99,6 +100,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())
|
||||
@ -120,7 +122,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -180,6 +182,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())
|
||||
@ -190,7 +193,7 @@ public class SocketRyChatUtil {
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -254,7 +257,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -307,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 + "")
|
||||
@ -346,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())
|
||||
@ -391,7 +396,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -461,7 +466,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -508,7 +513,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -545,7 +550,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -588,7 +593,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -625,7 +630,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -665,7 +670,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
@ -711,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)
|
||||
@ -741,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();
|
||||
|
||||
@ -769,7 +776,7 @@ public class SocketRyChatUtil {
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
|
@ -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;
|
||||
|
@ -5,7 +5,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
|
@ -19,7 +19,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
@ -6,7 +6,7 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.custom.DrawableTextView;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
@ -25,7 +25,7 @@ import android.widget.ViewFlipper;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
|
@ -16,7 +16,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
|
@ -62,7 +62,7 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
@ -1644,6 +1644,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)));
|
||||
@ -1669,6 +1670,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);
|
||||
@ -1693,6 +1695,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(110);
|
||||
dragonImmediateParticipation.setLayoutParams(layoutParams);
|
||||
} if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(110);
|
||||
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
|
||||
}
|
||||
anchorTimeHandler.removeCallbacks(anchorTimeRunnable);
|
||||
LiveNetManager.get(mContext).
|
||||
@ -1725,6 +1731,20 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
layoutParams.topMargin = DpUtil.dp2px(190);
|
||||
dragonImmediateParticipation.setLayoutParams(layoutParams);
|
||||
}
|
||||
if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE&&mContext instanceof LiveRyAnchorActivity) {
|
||||
RelativeLayout.LayoutParams layoutParamsredPacket = (RelativeLayout.LayoutParams) redPacket.getLayoutParams();
|
||||
layoutParamsredPacket.topMargin = DpUtil.dp2px(110);
|
||||
redPacket.setLayoutParams(layoutParamsredPacket);
|
||||
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipationTime.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(190);
|
||||
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
|
||||
}
|
||||
if (dragonImmediateParticipationTime.getVisibility() == View.GONE&&mContext instanceof LiveRyAnchorActivity){
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) redPacket.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(110);
|
||||
redPacket.setLayoutParams(layoutParams);
|
||||
}
|
||||
if (redPacketModel.getCountdown() > 180) {
|
||||
redPacketQueue.setVisibility(View.GONE);
|
||||
redPacketCountdown.setVisibility(View.VISIBLE);
|
||||
@ -1801,6 +1821,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
layoutParams.topMargin = DpUtil.dp2px(110);
|
||||
dragonImmediateParticipation.setLayoutParams(layoutParams);
|
||||
}
|
||||
if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipationTime.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(110);
|
||||
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
public void setRedPacketInfoModel(RedPacketInfoModel redPacket) {
|
||||
@ -3207,6 +3232,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
sendMoneyTime = Long.parseLong(sendMoneyLongModel.getCountdown());
|
||||
participation_time.removeCallbacks(sendMoneyRunnable);
|
||||
dragonImmediateParticipationTime.setVisibility(View.VISIBLE);
|
||||
if (redPacket.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(190);
|
||||
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
|
||||
} else {
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(110);
|
||||
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
|
||||
}
|
||||
String s1 = StringUtil.getDurationText(sendMoneyTime * 1000);
|
||||
participation_time.setText(s1);
|
||||
participation_time.post(sendMoneyRunnable);
|
||||
@ -3228,6 +3262,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
public void onSendMoneyLongEndEvent(SendMoneyLongEndEvent moneyLongEndEvent) {
|
||||
if (mLiveUid.contains(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()))) {
|
||||
dragonImmediateParticipationTime.setVisibility(View.GONE);
|
||||
if (redPacket.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(190);
|
||||
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
|
||||
} else {
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(110);
|
||||
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
|
||||
}
|
||||
} else {
|
||||
dragonImmediateParticipation.setVisibility(View.GONE);
|
||||
|
||||
@ -3983,6 +4026,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);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,8 @@ import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.lzf.easyfloat.permission.PermissionUtils;
|
||||
import com.lzf.easyfloat.utils.LifecycleUtils;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
@ -767,6 +768,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.initPkRank(null);
|
||||
String pkUid = pkInfo.getString("pkuid");
|
||||
if (!StringUtil.isEmpty(pkUid)) {
|
||||
//初始化天梯赛信息
|
||||
mLiveRoomViewHolder.initRankPKInfo(String.valueOf(data.getLiveInfo().getUid()), pkUid);
|
||||
}
|
||||
}
|
||||
if (mLivePlayViewHolder != null) {
|
||||
JSONArray array = pkInfo.getJSONArray("userlist");
|
||||
@ -1110,7 +1116,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(liveID, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(io.rong.imlib.model.Message message) {
|
||||
|
||||
|
@ -59,6 +59,7 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.interfaces.OnItemLongClickListener;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
@ -589,7 +590,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
messagesList.remove(position);
|
||||
setDellPosition(position);
|
||||
}
|
||||
RongIMClient.getInstance().sendMessage(inMessage, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
RongcloudIMManager.sendMessage(inMessage, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
@ -99,7 +99,7 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/hor_recycler"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:scrollbars="none" />
|
||||
|
@ -2,7 +2,8 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="180dp"
|
||||
android:minHeight="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal|top"
|
||||
android:paddingTop="10dp"
|
||||
android:orientation="vertical"
|
||||
|
@ -1205,12 +1205,14 @@
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<!--全服通知 通用模板-->
|
||||
<FrameLayout
|
||||
android:id="@+id/full_service_notice_new"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="51dp"
|
||||
android:translationX="500dp"
|
||||
tools:translationX="0dp"
|
||||
tools:visibility="visible"
|
||||
android:visibility="invisible">
|
||||
<ImageView
|
||||
android:id="@+id/full_service_notice_new_bg"
|
||||
@ -2316,7 +2318,7 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:visibility="gone">
|
||||
android:visibility="invisible">
|
||||
|
||||
<View
|
||||
android:layout_width="41dp"
|
||||
|
@ -70,6 +70,7 @@
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/value_icon"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginStart="15dp"
|
||||
@ -145,6 +146,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/red_packet_list"
|
||||
|
@ -162,6 +162,9 @@
|
||||
|
||||
<activity android:name=".activity.MainHomeCommunityActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".activity.FeedbackActivity" />
|
||||
<activity android:name=".activity.FeedbackSuccessActivity" />
|
||||
<activity android:name=".activity.FeedbackEditActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user