Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee5d3bb028 | ||
|
|
1346a1de52 | ||
|
|
9fa0109c2e | ||
| 94a96ba91a | |||
|
|
5006b8414e | ||
|
|
5eac127142 | ||
|
|
8e89fdfa65 | ||
| 5f210af804 |
@@ -71,7 +71,7 @@ public class FaceManager implements SensorEventListener {
|
||||
* 配置美颜SDK
|
||||
*/
|
||||
public void initFURender(Context context) {
|
||||
initFaceUnity(context);
|
||||
|
||||
mFURenderer = FURenderer.getInstance();
|
||||
mFURenderer.setInputTextureType(FUInputTextureEnum.FU_ADM_FLAG_COMMON_TEXTURE);
|
||||
mFURenderer.setCameraFacing(CameraFacingEnum.CAMERA_FRONT);
|
||||
@@ -105,11 +105,9 @@ public class FaceManager implements SensorEventListener {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void loadConfig() {
|
||||
public void loadConfig(){
|
||||
initFaceBeauty();
|
||||
}
|
||||
|
||||
public void initFaceBeauty() {
|
||||
FaceBeautyDataFactory faceBeautyDataFactory;
|
||||
faceBeautyDataFactory = new FaceBeautyDataFactory();
|
||||
@@ -117,13 +115,9 @@ public class FaceManager implements SensorEventListener {
|
||||
for (String key : configMap.keySet()) {
|
||||
if ("FilterViewHolder_".equals(key)) {
|
||||
for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) {
|
||||
if (filter.getKey().equals(configMap.get(key)) && !"origin".equals(configMap.get(key))) {
|
||||
try {
|
||||
faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"))) / 100, filter.getDesRes());
|
||||
Log.i(TAG, "test: 设置滤镜 =" + filter.getKey() + " val = " + configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (filter.getKey().equals(configMap.get(key))&&!"origin".equals(configMap.get(key))) {
|
||||
faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")))/100, filter.getDesRes());
|
||||
Log.i(TAG, "test: 设置滤镜 ="+filter.getKey()+" val = "+configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -131,25 +125,17 @@ public class FaceManager implements SensorEventListener {
|
||||
String name = key.replace("BeautySkinViewHolder_", "");
|
||||
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||
if (bean.getKey().equals(name)) {
|
||||
try {
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美颜 = " + bean.getKey() + " val = " + configMap.get(key));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美颜 = "+bean.getKey()+" val = "+configMap.get(key));
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (key.startsWith("BeautyShapeViewHolder")) {
|
||||
}else if(key.startsWith("BeautyShapeViewHolder")){
|
||||
String name = key.replace("BeautyShapeViewHolder_", "");
|
||||
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||
if (bean.getKey().equals(name)) {
|
||||
try {
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美肤 = " + bean.getKey() + " val = " + configMap.get(key));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||
Log.i(TAG, "test: 设置美肤 = "+bean.getKey()+" val = "+configMap.get(key));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -291,7 +277,6 @@ public class FaceManager implements SensorEventListener {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
isInit = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +80,11 @@ public class ContainerRecyclerAdapter extends RecyclerView.Adapter<BaseViewHolde
|
||||
}
|
||||
|
||||
public void hideSeekBar() {
|
||||
if (seekBar.getVisibility() == View.INVISIBLE) {
|
||||
if (seekBar.getVisibility() == View.GONE) {
|
||||
return;
|
||||
}
|
||||
seekBar.setOnProgressChangeListener(null);
|
||||
seekBar.setVisibility(View.INVISIBLE);
|
||||
seekBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
<string name="beautify_hip_slim">Hip</string>
|
||||
<string name="beautify_head_slim">Head shrink</string>
|
||||
<string name="beautify_leg_thin_slim">Thin leg</string>
|
||||
<string name="toast_not_detect_body">No message tracking</string>
|
||||
<string name="toast_not_detect_body">No body tracking</string>
|
||||
<string name="pta_human_full_body">Body driver</string>
|
||||
<string name="pta_human_half_body">Bust driver</string>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'img-optimizer'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
android {
|
||||
dexOptions {
|
||||
jumboMode = true
|
||||
@@ -230,7 +230,6 @@ dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||
|
||||
// implementation rootProject.ext.dependencies["leakcanary"]
|
||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
|
||||
<!-- Android11新增 -->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
|
||||
<application
|
||||
android:name="com.shayu.phonelive.AppContext"
|
||||
android:allowBackup="true"
|
||||
|
||||
@@ -17,6 +17,10 @@ import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustConfig;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.adjust.sdk.LogLevel;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.Utils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
@@ -24,7 +28,6 @@ import com.fm.openinstall.OpenInstall;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.shayu.phonelive.utils.LogUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||
@@ -34,6 +37,8 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
@@ -41,6 +46,7 @@ import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.faceunity.FaceManager;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
import com.yunbao.live.views.PortraitLiveManager;
|
||||
@@ -80,10 +86,12 @@ public class AppContext extends CommonAppContext {
|
||||
private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
Adjust.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
Adjust.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,7 +137,6 @@ public class AppContext extends CommonAppContext {
|
||||
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
||||
registerError();
|
||||
registerFirebaseCrash();
|
||||
LogUtils.start(this);
|
||||
sInstance = this;
|
||||
L.setDeBug(BuildConfig.DEBUG);
|
||||
AppEventsLogger.activateApp(this);
|
||||
@@ -154,8 +161,38 @@ public class AppContext extends CommonAppContext {
|
||||
OpenInstall.init(this);
|
||||
}
|
||||
|
||||
|
||||
String environment = AdjustConfig.ENVIRONMENT_PRODUCTION;
|
||||
AdjustConfig config = new AdjustConfig(this, "3om5fbglyqdc", environment);
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY == false) {
|
||||
config.setDefaultTracker("xa7k5ut");
|
||||
}
|
||||
Adjust.onCreate(config);
|
||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||
config.setLogLevel(LogLevel.WARN);
|
||||
//激活操作记录
|
||||
AdjustEvent adjustEvent = new AdjustEvent("m7wk0c");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_activation", null);
|
||||
|
||||
//FB激活
|
||||
logger.logEvent("FB_activation");
|
||||
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("p7igfz");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("p7igfz", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_complete_1st_loading", null);
|
||||
//FB激活
|
||||
logger.logEvent("FB_complete_1st_loading");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//初始化 AndroidUtilCode
|
||||
Utils.init(this);
|
||||
liveImDeletUtil = new LiveImDeletUtil();
|
||||
@@ -231,11 +268,10 @@ public class AppContext extends CommonAppContext {
|
||||
mSocketHandler.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
configSPApp();
|
||||
//初始化美颜SDK
|
||||
// FaceManager.initFaceUnity(this);
|
||||
FaceManager.initFaceUnity(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.shayu.phonelive.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -19,8 +21,9 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -104,6 +107,14 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
EventBus.getDefault().register(this);
|
||||
setStatusBar();
|
||||
setContentView(R.layout.activity_launcher);
|
||||
//开屏
|
||||
AdjustEvent adjustEvent = new AdjustEvent("vjqk8g");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
|
||||
//谷歌激活
|
||||
mFirebaseAnalytics.logEvent("FS_screen", null);
|
||||
//FB激活
|
||||
logger.logEvent("FB_screen");
|
||||
mContext = this;
|
||||
mRoot = findViewById(R.id.root);
|
||||
mCover = findViewById(R.id.cover);
|
||||
@@ -129,7 +140,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
};
|
||||
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
||||
LogUtil.uploadErrorLog(AppContext.sInstance);
|
||||
SpUtil.getInstance().setBooleanValue("NOTIFICATION", NotificationManagerCompat.from(this).areNotificationsEnabled());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@ package com.shayu.phonelive.utils;
|
||||
|
||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
@@ -20,7 +17,6 @@ import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
@@ -35,12 +31,9 @@ import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.phonelive.AppContext;
|
||||
import com.shayu.phonelive.activity.LauncherActivity;
|
||||
import com.yunbao.common.bean.NotificationMsgBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
@@ -59,7 +52,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
NotificationManager manager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
|
||||
NotificationChannel channel = new NotificationChannel(channelID, channelNAME, level);
|
||||
channel.setSound(Uri.parse("android.resource://" + context.getPackageName() + "/raw/pdlive_sound"), null);
|
||||
channel.setSound(Uri.parse("android.resource://" + context.getPackageName() + "/raw/pdlive_sound"),null);
|
||||
manager.createNotificationChannel(channel);
|
||||
return channelID;
|
||||
} else {
|
||||
@@ -88,26 +81,6 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
@Override
|
||||
public boolean onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage notificationMessage) {
|
||||
Log.i("gmc", notificationMessage.getPushContent() + "VVV" + notificationMessage.getPushTitle() + "gmc11112222" + notificationMessage.getExtra());
|
||||
if (!SpUtil.getInstance().getBooleanValue("NOTIFICATION")) {
|
||||
if (AppContext.activityWeakReference != null) {
|
||||
Activity activity = AppContext.activityWeakReference.get();
|
||||
if (activity != null) {
|
||||
DialogUitl.showSimpleDialog(activity, "应用需要通知权限", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
|
||||
intent.putExtra("app_package", context.getPackageName());
|
||||
intent.putExtra("app_uid", context.getApplicationInfo().uid);
|
||||
// for Android 8 and above
|
||||
intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
|
||||
activity.startActivity(intent);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (notificationMessage.getExtra() == null) {
|
||||
msg.setImg("" + notificationMessage.getSenderPortrait());
|
||||
msg.setTitle(notificationMessage.getPushTitle());
|
||||
@@ -226,7 +199,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
} else {
|
||||
}else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
@@ -260,7 +233,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
} else {
|
||||
}else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
@@ -303,7 +276,7 @@ public class CustomMessageReceiver extends PushMessageReceiver {
|
||||
PendingIntent pendingIntent;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
} else {
|
||||
}else {
|
||||
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
String channelId = createNotificationChannel(context, "my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
package com.shayu.phonelive.utils;
|
||||
|
||||
import static java.text.DateFormat.DEFAULT;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class LogUtils {
|
||||
/**
|
||||
* 采集所有日志
|
||||
*/
|
||||
public static void start(Context context) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
String[] exec = new String[]{"logcat", "-c"};
|
||||
Runtime.getRuntime().exec(exec).waitFor();
|
||||
|
||||
exec = new String[]{"logcat", "-v", "UTC", "-D"};
|
||||
|
||||
Process process = Runtime.getRuntime().exec(exec);
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
String line;
|
||||
PrintWriter writer = null;
|
||||
String title = "[PDLIVE]" + CommonAppConfig.getInstance().getUid() + "_";
|
||||
String today = title + SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).format(new Date());
|
||||
File dir = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator);
|
||||
if (dir.listFiles() != null) {
|
||||
for (File file : dir.listFiles()) {
|
||||
if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) {
|
||||
String fileName = file.getName().replace(".log", "").split("_")[1];
|
||||
if (isDelLog(fileName)) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File saveFile = new File(context.getDir("files", Context.MODE_PRIVATE).getAbsolutePath() + File.separator + today + ".log");
|
||||
FileOutputStream os = new FileOutputStream(saveFile, true);
|
||||
writer = new PrintWriter(os);
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
writer.append(line).write("\n");
|
||||
}
|
||||
writer.flush();
|
||||
writer.close();
|
||||
exec = new String[]{"logcat", "-c"};
|
||||
Runtime.getRuntime().exec(exec).waitFor();
|
||||
bufferedReader.close();
|
||||
start(context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是要删除的日志
|
||||
**/
|
||||
private static boolean isDelLog(String time) {
|
||||
try {
|
||||
Calendar timeCal = Calendar.getInstance(Locale.CHINA);
|
||||
timeCal.setTime(Objects.requireNonNull(SimpleDateFormat.getDateInstance(DEFAULT, Locale.CHINA).parse(time)));
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE, -3);
|
||||
return calendar.after(timeCal);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">PDLIVE</string>
|
||||
<string name="leak_canary_test_class_name">assertk.Assert</string>
|
||||
</resources>
|
||||
@@ -22,7 +22,6 @@ buildscript {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
|
||||
classpath 'com.google.gms:google-services:4.3.3'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
||||
classpath "com.alibaba:arouter-register:1.0.2"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ dependencies {
|
||||
//谷歌支付
|
||||
//谷歌内购
|
||||
api 'com.android.billingclient:billing:5.0.0'
|
||||
implementation 'com.teprinciple:updateapputils:2.3.0'
|
||||
api 'com.squareup.picasso:picasso:2.5.2'
|
||||
api "com.immomo.cosmos.mediax:beautyutils:2.2.1_01071700"
|
||||
api files('libs/liteavsdk.jar')
|
||||
@@ -154,11 +155,9 @@ dependencies {
|
||||
//腾讯im
|
||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||
api 'com.google.code.gson:gson:2.8.8'
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.0' // 音视频通话基础能力库
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.2.0.2'
|
||||
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.5.8' // 音视频通话基础能力库
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.2.5.4' // 即时通讯基础能力库
|
||||
api 'cn.rongcloud.sdk:im_kit:5.2.5.4' // 即时通讯 UI 基础组件
|
||||
//融云小视频模块
|
||||
api 'cn.rongcloud.sdk:sight:5.2.5.4'
|
||||
@@ -169,6 +168,7 @@ dependencies {
|
||||
transitive = true
|
||||
}
|
||||
api 'com.linecorp:linesdk:5.0.1'
|
||||
api 'com.adjust.sdk:adjust-android:4.30.1'
|
||||
api 'com.android.installreferrer:installreferrer:2.2'
|
||||
//Retrofit2库
|
||||
api 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||
@@ -188,6 +188,4 @@ dependencies {
|
||||
api 'com.github.princekin-f:EasyFloat:2.0.4'
|
||||
api files('libs/Msc.jar')
|
||||
|
||||
api 'com.github.li-xiaojun:XPopup:2.9.1'
|
||||
|
||||
}
|
||||
|
||||
@@ -32,9 +32,8 @@
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
<!--
|
||||
|
||||
支付宝
|
||||
<!--支付宝-->
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5PayActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||
@@ -47,8 +46,7 @@
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||
支付宝 end
|
||||
-->
|
||||
<!--支付宝 end-->
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.ErrorActivity"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,22 +1,22 @@
|
||||
package com.yunbao.common;
|
||||
|
||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||
import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.rong.imlib.RongIMClient;
|
||||
@@ -24,6 +24,9 @@ import io.rong.push.RongPushClient;
|
||||
import io.rong.push.pushconfig.PushConfig;
|
||||
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||
|
||||
import static com.facebook.FacebookSdk.setAdvertiserIDCollectionEnabled;
|
||||
import static com.facebook.FacebookSdk.setAutoLogAppEventsEnabled;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/3.
|
||||
@@ -32,12 +35,13 @@ import me.leolin.shortcutbadger.ShortcutBadger;
|
||||
public class CommonAppContext extends MultiDexApplication {
|
||||
|
||||
public static CommonAppContext sInstance;
|
||||
public static WeakReference<Activity> activityWeakReference;
|
||||
private int mCount;
|
||||
private boolean mFront;//是否前台
|
||||
public static int jpushMsgNum;
|
||||
public static int Ingroup = 0;
|
||||
public static String lang = "chinese";
|
||||
public static FirebaseAnalytics mFirebaseAnalytics;
|
||||
public static AppEventsLogger logger;
|
||||
public static boolean isReady = false;
|
||||
public static String home_zdy_img_us = "";
|
||||
public static String home_zdy_img_cn = "";
|
||||
@@ -63,29 +67,33 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
//初始化友盟统计
|
||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||
mFirebaseAnalytics.setAnalyticsCollectionEnabled(true);
|
||||
mFirebaseAnalytics.setUserProperty("ALLOW_AD_PERSONALIZATION_SIGNALS", "true" );
|
||||
|
||||
|
||||
|
||||
logger = AppEventsLogger.newLogger(this);
|
||||
setAutoLogAppEventsEnabled(true);
|
||||
FacebookSdk.fullyInitialize();
|
||||
setAdvertiserIDCollectionEnabled(true);
|
||||
registerActivityLifecycleCallbacks();
|
||||
|
||||
Locale locale;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
locale = getResources().getConfiguration().getLocales().get(0);
|
||||
} else {
|
||||
locale = getResources().getConfiguration().locale;
|
||||
}
|
||||
if (locale.getLanguage().equals("en")) {
|
||||
lang = "english";
|
||||
} else {
|
||||
lang = "chinese";
|
||||
}
|
||||
Log.i("lang", lang);
|
||||
Locale locale;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
locale = getResources().getConfiguration().getLocales().get(0);
|
||||
} else {
|
||||
locale = getResources().getConfiguration().locale;
|
||||
}
|
||||
if(locale.getLanguage().equals("en")){
|
||||
lang = "english";
|
||||
}else{
|
||||
lang = "chinese";
|
||||
}
|
||||
Log.i("lang",lang);
|
||||
|
||||
}
|
||||
|
||||
public static Activity getTopActivity() {
|
||||
return activityWeakReference.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
@@ -103,12 +111,11 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
mCount++;
|
||||
activityWeakReference = new WeakReference<>(activity);
|
||||
if (!mFront) {
|
||||
mFront = true;
|
||||
L.e("AppContext------->处于前台");
|
||||
ShortcutBadger.applyCount(activity, 0);
|
||||
jpushMsgNum = 0;
|
||||
ShortcutBadger.applyCount(activity,0);
|
||||
jpushMsgNum=0;
|
||||
CommonAppConfig.getInstance().setFrontGround(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
public class Constants {
|
||||
public static final String NEW_ENTER_ROOM = "enterRoom";
|
||||
|
||||
public static final String URL = "url";
|
||||
public static final String PAYLOAD = "payload";
|
||||
public static final String SEX = "sex";
|
||||
@@ -76,7 +74,7 @@ public class Constants {
|
||||
public static final String PAY_BUY_COIN_ALI = "Charge.getAliOrder";
|
||||
public static final String PAY_BUY_COIN_WX = "Charge.getWxOrder";
|
||||
|
||||
// public static final String PACKAGE_NAME_ALI = "com.eg.android.AlipayGphone";//支付宝的包名
|
||||
public static final String PACKAGE_NAME_ALI = "com.eg.android.AlipayGphone";//支付宝的包名
|
||||
public static final String PACKAGE_NAME_WX = "com.tencent.mm";//微信的包名
|
||||
public static final String PACKAGE_NAME_QQ = "com.tencent.mobileqq";//QQ的包名
|
||||
public static final String LAT = "lat";
|
||||
@@ -132,8 +130,6 @@ public class Constants {
|
||||
public static final int LIVE_FUNC_MIC = 2013;//語音
|
||||
public static final int LIVE_FUNC_WKS = 2014;//語音
|
||||
public static final int LIVE_FUNC_ZSLK = 2015;//語音
|
||||
public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK
|
||||
public static final int LIVE_ROBOT= 2017;//机器人
|
||||
|
||||
//socket
|
||||
public static final String SOCKET_CONN = "conn";
|
||||
@@ -147,7 +143,6 @@ public class Constants {
|
||||
public static final String SOCKET_ALL_SERVER_NOTIFY = "AllServerNotify";//全服通知
|
||||
public static final String SOCKET_SEND_BARRAGE = "SendBarrage";//发弹幕
|
||||
public static final String SOCKET_LIVE_DRPK = "LiveDRPK";//多人PK
|
||||
public static final String SOCKET_LIVE_DRPK_RANDOM = "LiveRandomPK";//随机PK
|
||||
public static final String SOCKET_LEAVE_ROOM = "disconnect";//用户离开房间
|
||||
public static final String SOCKET_LIVE_END = "StartEndLive";//主播关闭直播
|
||||
public static final String SOCKET_SYSTEM = "SystemNot";//系统消息
|
||||
@@ -172,11 +167,7 @@ public class Constants {
|
||||
public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息
|
||||
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
|
||||
public static final String AI_AUTOMATIC_SPEECH = "aiAutomaticSpeech";//机器人助手
|
||||
public static final String AI_AUTOMATIC_SPEECH_LIVE = "aiAutomaticSpeechNew";//机器人助手
|
||||
public static final String STAR_CHALLENGE_UPGRADE_NOTIFY = "starChallengeUpgradeNotify";//星级挑战成功
|
||||
public static final String SUPER_VISION = "supervision";//超级发言警告
|
||||
public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据
|
||||
public static final String CUSTOM_FULL_SERVICE_NOTIFY = "customFullServiceNotify";//全服通知
|
||||
|
||||
//游戏socket
|
||||
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
||||
@@ -191,7 +182,6 @@ public class Constants {
|
||||
public static final String LOVE_CHECK = "LoveCheck";//热度卡消息
|
||||
public static final String TRUMPET_NOTIFY = "TrumpetNotify";//全栈喇叭
|
||||
public static final String LuckyAngel = "LuckyCheck";//幸运天使
|
||||
public static final String Lucky100Check = "Lucky100Check";//幸运天使
|
||||
|
||||
public static final int SOCKET_WHAT_CONN = 0;
|
||||
public static final int SOCKET_WHAT_DISCONN = 2;
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@@ -55,8 +54,8 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
Intent intent=getIntent();
|
||||
if(intent!=null) {
|
||||
isFullWindow = getIntent().getBooleanExtra("isFull", false);
|
||||
if (isFullWindow) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
@@ -359,15 +358,4 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrimMemory(int level) {
|
||||
super.onTrimMemory(level);
|
||||
Log.i("memory", "onTrimMemory: " + level);
|
||||
switch (level) {
|
||||
case TRIM_MEMORY_RUNNING_CRITICAL://内存低值危险值
|
||||
break;
|
||||
case TRIM_MEMORY_RUNNING_LOW://内存过低
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,12 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
@@ -20,23 +23,16 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
*/
|
||||
@@ -68,13 +64,14 @@ public class WebViewActivity extends AbsActivity {
|
||||
btnEdit = (ImageView) findViewById(R.id.btn_edit);
|
||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
||||
mWebView = findViewById(R.id.webView);
|
||||
AndroidBug5497Workaround.assistActivity(this);
|
||||
|
||||
mWebView = new WebView(mContext);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
params.topMargin = DpUtil.dp2px(1);
|
||||
// mWebView.setLayoutParams(params);
|
||||
//mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
mWebView.setLayoutParams(params);
|
||||
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
rootView.addView(mWebView);
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
@@ -96,11 +93,6 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (url.contains("for")) {
|
||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||
}
|
||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||
if (!navigationGestureEnabled(mContext)) {
|
||||
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -144,7 +136,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
});
|
||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
||||
mWebView.addJavascriptInterface(new JsInteration(), "androidObject");
|
||||
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
@@ -173,6 +165,58 @@ public class WebViewActivity extends AbsActivity {
|
||||
}
|
||||
}
|
||||
|
||||
//js调用原生
|
||||
public class JsInteration {
|
||||
@JavascriptInterface
|
||||
public void onBack() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void modifyMydata() {
|
||||
indexInto = 1;
|
||||
RouteUtil.forwardEditProfileActivity();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void reportUser(String touid) {
|
||||
RouteUtil.forwardLiveReportActivity(touid);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void gotoHomePage(String indexStr) {
|
||||
Log.e("tgasss","indexStr4"+indexStr);
|
||||
|
||||
if (!"".equals(indexStr) && indexStr != null) {
|
||||
int index = -1;
|
||||
if ("0".equals(indexStr)) {
|
||||
index = 0;
|
||||
} else if ("1".equals(indexStr)) {
|
||||
index = 1;
|
||||
} else if ("2".equals(indexStr)) {
|
||||
index = 2;
|
||||
} else if ("3".equals(indexStr)) {
|
||||
index = 3;
|
||||
}
|
||||
if (index != -1) {
|
||||
finish();
|
||||
Constants.isShowPage = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWebView(String url) {
|
||||
Constants.isTitle = false;
|
||||
RouteUtil.forwardZhuangBanActivity(url);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWebViewTitle(String url) {
|
||||
Constants.isTitle = true;
|
||||
RouteUtil.forwardZhuangBanActivity(url);
|
||||
}
|
||||
}
|
||||
|
||||
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {
|
||||
mValueCallback = valueCallback;
|
||||
@@ -304,10 +348,11 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (Constants.isShowPage != -1) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
indexInto = event.getIndexInto();
|
||||
// new Handler().postDelayed(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// mWebView.reload();
|
||||
// }
|
||||
// }, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.http.main.MainNetManager;
|
||||
import com.yunbao.common.views.DrawerRecommendViewHolder;
|
||||
import com.yunbao.common.views.DrawerTaskViewHolder;
|
||||
import com.yunbao.common.views.FunGamesViewHolder;
|
||||
import com.yunbao.common.views.RecommendViewHolder;
|
||||
import com.yunbao.common.views.RigtsInterestsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新侧边栏适配器
|
||||
*/
|
||||
public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
// "type": 1,//模块类型 1 充值送好礼类型2 任务中心类型 3趣味游戏类4 权益 ,5为你推荐
|
||||
private final int GOOD_GIFTS = 1;
|
||||
private final int TASK_CENTER = 2;
|
||||
private final int FUN_GAMES = 3;
|
||||
private final int RIGHTS_INTERESTS = 4;
|
||||
private final int RECOMMEND = 5;
|
||||
private String liveId;
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
|
||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||
|
||||
public CustomDrawerPopupAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
|
||||
public CustomDrawerPopupAdapter setLiveId(String liveId) {
|
||||
this.liveId = liveId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupAdapter setList(List<AnchorRecommendItemModel> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
switch (viewType) {
|
||||
case GOOD_GIFTS:
|
||||
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_good_gifts, parent, false);
|
||||
return new DrawerRecommendViewHolder(goodGiftsView);
|
||||
case TASK_CENTER:
|
||||
View taskCenterView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_tsak_center, parent, false);
|
||||
return new DrawerTaskViewHolder(taskCenterView);
|
||||
case FUN_GAMES:
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_fun_games_view, parent, false);
|
||||
return new FunGamesViewHolder(runGamesView);
|
||||
case RIGHTS_INTERESTS:
|
||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_rights_interests, parent, false);
|
||||
return new RigtsInterestsViewHolder(rightsInterestsView);
|
||||
default:
|
||||
View recommendView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_recommend, parent, false);
|
||||
return new RecommendViewHolder(recommendView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder instanceof DrawerRecommendViewHolder) {
|
||||
DrawerRecommendViewHolder recommendViewHolder = (DrawerRecommendViewHolder) holder;
|
||||
recommendViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof DrawerTaskViewHolder) {
|
||||
DrawerTaskViewHolder taskViewHolder = (DrawerTaskViewHolder) holder;
|
||||
taskViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof FunGamesViewHolder) {
|
||||
FunGamesViewHolder funGamesViewHolder = (FunGamesViewHolder) holder;
|
||||
funGamesViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof RigtsInterestsViewHolder) {
|
||||
RigtsInterestsViewHolder rigtsInterestsViewHolder = (RigtsInterestsViewHolder) holder;
|
||||
rigtsInterestsViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof RecommendViewHolder) {
|
||||
|
||||
RecommendViewHolder recommendViewHolder = (RecommendViewHolder) holder;
|
||||
recommendViewHolder.setData(infoModels.get(position));
|
||||
recommendViewHolder.updateData(list);
|
||||
|
||||
recommendViewHolder.setListener(new RecommendViewHolder.RecommendViewListener() {
|
||||
@Override
|
||||
public void changeOneBatch() {
|
||||
//推荐位
|
||||
MainNetManager.get((Activity) mContext)
|
||||
.anchorRecommend("9", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
|
||||
@Override
|
||||
public void onSuccess(AnchorRecommendModel anchorRecommendModel) {
|
||||
|
||||
List<AnchorRecommendItemModel> models = anchorRecommendModel.getList();
|
||||
int userIndex = -1;
|
||||
for (int i = 0; i < models.size(); i++) {
|
||||
if (TextUtils.equals(models.get(i).getUid(), liveId)) {
|
||||
userIndex = i;
|
||||
}
|
||||
}
|
||||
if (userIndex != -1) {
|
||||
models.remove(userIndex);
|
||||
}
|
||||
recommendViewHolder.updateData(models);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void goToLive(AnchorRecommendItemModel model) {
|
||||
if (listener != null) {
|
||||
listener.goToLive(model);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return infoModels.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
CustomSidebarInfoModel model = infoModels.get(position);
|
||||
switch (model.getType()) {
|
||||
case "1":
|
||||
return GOOD_GIFTS;
|
||||
case "2":
|
||||
return TASK_CENTER;
|
||||
case "3":
|
||||
return FUN_GAMES;
|
||||
case "4":
|
||||
return RIGHTS_INTERESTS;
|
||||
case "5":
|
||||
return RECOMMEND;
|
||||
}
|
||||
return super.getItemViewType(position);
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarInfoModel> mInfoModels) {
|
||||
infoModels.clear();
|
||||
infoModels.addAll(mInfoModels);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private CustomDrawerListener listener;
|
||||
|
||||
public CustomDrawerPopupAdapter setListener(CustomDrawerListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface CustomDrawerListener {
|
||||
void goToLive(AnchorRecommendItemModel model);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.views.DrawerRecommendChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DrawerRecommendAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public DrawerRecommendAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_drawer_recommend_child, parent, false);
|
||||
return new DrawerRecommendChildViewHolder(goodGiftsView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
DrawerRecommendChildViewHolder childViewHolder = (DrawerRecommendChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.DrawerTaskChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DrawerTaskAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public DrawerTaskAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View taskCenterView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_tsak_center_child, parent, false);
|
||||
return new DrawerTaskChildViewHolder(taskCenterView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
DrawerTaskChildViewHolder taskChildViewHolder = (DrawerTaskChildViewHolder) holder;
|
||||
taskChildViewHolder.setData(child.get(position), position);
|
||||
taskChildViewHolder.setListener(new DrawerTaskChildViewHolder.DrawerTaskChildListener() {
|
||||
@Override
|
||||
public void giftSuccess(CustomSidebarChildModel model, int index) {
|
||||
//将领取的任务移动至任务列表尾部
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
.setDisMiss(false).setRefresh(true));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.views.FunGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FunGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public FunGamesAdapter(Context mContext, boolean rigts) {
|
||||
this.mContext = mContext;
|
||||
this.rigts = rigts;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_fun_games_child_view, parent, false);
|
||||
return new FunGamesChildViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
FunGamesChildViewHolder childViewHolder = (FunGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
if (mChild.size() > 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
child.add(mChild.get(i));
|
||||
}
|
||||
} else {
|
||||
child.addAll(mChild);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void selectAll(List<CustomSidebarChildModel> mChild){
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.views.RecommendChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecommendAdapter extends RecyclerView.Adapter {
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
private Context mContext;
|
||||
|
||||
public RecommendAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new RecommendChildViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_sidebar_lives_new, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
RecommendChildViewHolder itemViewHolder = (RecommendChildViewHolder) holder;
|
||||
itemViewHolder.setData(list.get(position));
|
||||
itemViewHolder.setListener(new RecommendChildViewHolder.RecommendChildListener() {
|
||||
@Override
|
||||
public void goToLive(AnchorRecommendItemModel model) {
|
||||
if (callback != null) {
|
||||
callback.goToLive(model);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public void updateData(List<AnchorRecommendItemModel> mList) {
|
||||
list.clear();
|
||||
list.addAll(mList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private RecommendCallback callback;
|
||||
|
||||
public RecommendAdapter setCallback(RecommendCallback callback) {
|
||||
this.callback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface RecommendCallback {
|
||||
void goToLive(AnchorRecommendItemModel model);
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public abstract class RefreshAdapter<T> extends RecyclerView.Adapter {
|
||||
return position;
|
||||
}
|
||||
|
||||
protected static boolean canClick() {
|
||||
protected boolean canClick() {
|
||||
return ClickUtil.canClick();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.views.RobotMessageViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RobotMessageAdapter extends RecyclerView.Adapter {
|
||||
private List<LiveAiRobotBean.Message> messageList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotMessageView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_robot_message, parent, false);
|
||||
return new RobotMessageViewHolder(robotMessageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
RobotMessageViewHolder messageViewHolder = (RobotMessageViewHolder) holder;
|
||||
messageViewHolder.setData(messageList.get(position), position + 1);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return messageList.size();
|
||||
}
|
||||
|
||||
|
||||
public void setDataAll(List<LiveAiRobotBean.Message> messages) {
|
||||
messageList.clear();
|
||||
messageList.addAll(messages);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
// 删除数据
|
||||
public void removeData(int position) {
|
||||
messageList.remove(position);
|
||||
//删除动画
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.views.RobotSayHelloViewHoler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RobotSayHelloAdapter extends RecyclerView.Adapter {
|
||||
private List<LiveAiRobotBean.Message> messageList = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_robot_message, parent, false);
|
||||
return new RobotSayHelloViewHoler(robotSayHelloView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
RobotSayHelloViewHoler robotSayHelloViewHoler = (RobotSayHelloViewHoler) holder;
|
||||
robotSayHelloViewHoler.setData(messageList.get(position), position + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return messageList.size();
|
||||
}
|
||||
|
||||
|
||||
public void setDataAll(List<LiveAiRobotBean.Message> messages) {
|
||||
messageList.clear();
|
||||
messageList.addAll(messages);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
// 删除数据
|
||||
public void removeData(int position) {
|
||||
messageList.remove(position);
|
||||
//删除动画
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class AnchorRecommendItemModel extends BaseModel {
|
||||
private String avatarThumb = "";
|
||||
@SerializedName("avatar2")
|
||||
private String avatar2 = "";
|
||||
@SerializedName(value = "user_nicename", alternate = "userNiceName")
|
||||
@SerializedName("user_nicename")
|
||||
private String userNicename = "";
|
||||
@SerializedName("level")
|
||||
private String level = "";
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CheckLiveModel extends BaseModel {
|
||||
|
||||
@SerializedName("type")
|
||||
private int type;
|
||||
@SerializedName("type_val")
|
||||
private String typeVal;
|
||||
@SerializedName("type_msg")
|
||||
private String typeMsg;
|
||||
@SerializedName("live_sdk")
|
||||
private String liveSdk;
|
||||
|
||||
public static CheckLiveModel objectFromData(String str) {
|
||||
|
||||
return new Gson().fromJson(str, CheckLiveModel.class);
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTypeVal() {
|
||||
return typeVal;
|
||||
}
|
||||
|
||||
public void setTypeVal(String typeVal) {
|
||||
this.typeVal = typeVal;
|
||||
}
|
||||
|
||||
public String getTypeMsg() {
|
||||
return typeMsg;
|
||||
}
|
||||
|
||||
public void setTypeMsg(String typeMsg) {
|
||||
this.typeMsg = typeMsg;
|
||||
}
|
||||
|
||||
public String getLiveSdk() {
|
||||
return liveSdk;
|
||||
}
|
||||
|
||||
public void setLiveSdk(String liveSdk) {
|
||||
this.liveSdk = liveSdk;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.yunbao.common.bean;
|
||||
import android.app.Activity;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -15,7 +14,7 @@ public class CrashSaveBean {
|
||||
private long enterRoom;//进入房间次数
|
||||
private long slidingRoom;//滑动直播间次数
|
||||
private long playSvga;//加载播放svga次数
|
||||
private List<WeakReference<Activity>> activities = new ArrayList<>();//Activity数量
|
||||
private List<WeakReference<Activity>> activities;//Activity数量
|
||||
|
||||
private CrashSaveBean() {
|
||||
|
||||
@@ -61,14 +60,10 @@ public class CrashSaveBean {
|
||||
}
|
||||
|
||||
public String getActivitySize() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
StringBuilder builder=new StringBuilder();
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
try {
|
||||
if (activity.get() != null) {
|
||||
builder.append(activity.get().getClass().getSimpleName()).append(",");
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
|
||||
if(activity.get()!=null){
|
||||
builder.append(activity.get()).append(",");
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CustomSidebarChildModel extends BaseModel {
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("parent_id")
|
||||
private String parentId;
|
||||
@SerializedName("title")
|
||||
private String title;
|
||||
@SerializedName("subtitle")
|
||||
private String subtitle;
|
||||
@SerializedName("icon")
|
||||
private String icon;
|
||||
@SerializedName("src")
|
||||
private String src;
|
||||
@SerializedName("show_type")
|
||||
private String showType;
|
||||
@SerializedName("sort")
|
||||
private String sort;
|
||||
@SerializedName("english")
|
||||
private String english;
|
||||
//奖励领取状态 0未达到领取要求 1已领取 2未领取
|
||||
@SerializedName("status")
|
||||
private String status;
|
||||
@SerializedName("need_num")
|
||||
private String needNum;
|
||||
@SerializedName("now_num")
|
||||
private String nowNum;
|
||||
@SerializedName("activity_id")
|
||||
private String activityId;
|
||||
@SerializedName("flag")
|
||||
private String flag;
|
||||
|
||||
public String getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setFlag(String flag) {
|
||||
this.flag = flag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setActivityId(String activityId) {
|
||||
this.activityId = activityId;
|
||||
return this;
|
||||
}
|
||||
|
||||
private int resIcon;
|
||||
|
||||
public int getResIcon() {
|
||||
return resIcon;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setResIcon(int resIcon) {
|
||||
this.resIcon = resIcon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setSubtitle(String subtitle) {
|
||||
this.subtitle = subtitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setSrc(String src) {
|
||||
this.src = src;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShowType() {
|
||||
return showType;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setShowType(String showType) {
|
||||
this.showType = showType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setSort(String sort) {
|
||||
this.sort = sort;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEnglish() {
|
||||
return english;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setEnglish(String english) {
|
||||
this.english = english;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setStatus(String status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNeedNum() {
|
||||
return needNum;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setNeedNum(String needNum) {
|
||||
this.needNum = needNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNowNum() {
|
||||
return nowNum;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setNowNum(String nowNum) {
|
||||
this.nowNum = nowNum;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新版自定义侧边栏
|
||||
*/
|
||||
public class CustomSidebarInfoModel extends BaseModel {
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
//一级标题
|
||||
@SerializedName("title")
|
||||
private String title;
|
||||
//二级标题
|
||||
@SerializedName("subtitle")
|
||||
private String subtitle;
|
||||
@SerializedName("sort")
|
||||
private String sort;
|
||||
//1全屏 2半屏
|
||||
@SerializedName("show_type")
|
||||
private String showType;
|
||||
//跳转链接
|
||||
@SerializedName("src")
|
||||
private String src;
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
@SerializedName("child")
|
||||
private List<CustomSidebarChildModel> child;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setSubtitle(String subtitle) {
|
||||
this.subtitle = subtitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setSort(String sort) {
|
||||
this.sort = sort;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShowType() {
|
||||
return showType;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setShowType(String showType) {
|
||||
this.showType = showType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setSrc(String src) {
|
||||
this.src = src;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<CustomSidebarChildModel> getChild() {
|
||||
return child;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setChild(List<CustomSidebarChildModel> child) {
|
||||
this.child = child;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,554 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EnterRoomInfoModel extends BaseModel {
|
||||
@SerializedName("votestotal")
|
||||
private String votestotal;
|
||||
@SerializedName("medalRankNum")
|
||||
private String medalRankNum;
|
||||
@SerializedName("barrage_fee")
|
||||
private String barrageFee;
|
||||
@SerializedName("userlist_time")
|
||||
private String userlistTime;
|
||||
@SerializedName("chatserver")
|
||||
private String chatserver;
|
||||
@SerializedName("linkmic_uid")
|
||||
private String linkmicUid;
|
||||
@SerializedName("linkmic_pull")
|
||||
private String linkmicPull;
|
||||
@SerializedName("nums")
|
||||
private String nums;
|
||||
@SerializedName("game")
|
||||
private List<?> game;
|
||||
@SerializedName("gamebet")
|
||||
private List<String> gamebet;
|
||||
@SerializedName("gametime")
|
||||
private String gametime;
|
||||
@SerializedName("gameid")
|
||||
private String gameid;
|
||||
@SerializedName("gameaction")
|
||||
private String gameaction;
|
||||
@SerializedName("game_bankerid")
|
||||
private String gameBankerid;
|
||||
@SerializedName("game_banker_name")
|
||||
private String gameBankerName;
|
||||
@SerializedName("game_banker_avatar")
|
||||
private String gameBankerAvatar;
|
||||
@SerializedName("game_banker_coin")
|
||||
private String gameBankerCoin;
|
||||
@SerializedName("game_banker_limit")
|
||||
private String gameBankerLimit;
|
||||
@SerializedName("shut_time")
|
||||
private String shutTime;
|
||||
@SerializedName("kick_time")
|
||||
private String kickTime;
|
||||
@SerializedName("speak_limit")
|
||||
private String speakLimit;
|
||||
@SerializedName("barrage_limit")
|
||||
private String barrageLimit;
|
||||
@SerializedName("coin")
|
||||
private String coin;
|
||||
@SerializedName("vip")
|
||||
private VipModel vip;
|
||||
@SerializedName("liang")
|
||||
private LiangModel liang;
|
||||
@SerializedName("medal_level")
|
||||
private String medalLevel;
|
||||
@SerializedName("medal_name")
|
||||
private String medalName;
|
||||
@SerializedName("issuper")
|
||||
private String issuper;
|
||||
@SerializedName("usertype")
|
||||
private String usertype;
|
||||
@SerializedName("front_task")
|
||||
private String frontTask;
|
||||
@SerializedName("ismic")
|
||||
private String ismic;
|
||||
@SerializedName("isattention")
|
||||
private String isattention;
|
||||
@SerializedName("userlists")
|
||||
private List<LiveUserGiftBean> userlists;
|
||||
@SerializedName("guard")
|
||||
private GuardModel guard;
|
||||
@SerializedName("guard_nums")
|
||||
private String guardNums;
|
||||
@SerializedName("pkinfo")
|
||||
private PkinfoModel pkinfo;
|
||||
@SerializedName("lminfo")
|
||||
private LminfoModel lminfo;
|
||||
@SerializedName("isred")
|
||||
private String isred;
|
||||
@SerializedName("is_fans")
|
||||
private String isFans;
|
||||
@SerializedName("count_fans")
|
||||
private String countFans;
|
||||
@SerializedName("isconnection")
|
||||
private String isconnection;
|
||||
@SerializedName("isleave")
|
||||
private String isleave;
|
||||
@SerializedName("landscape")
|
||||
private String landscape;
|
||||
@SerializedName("un_charge")
|
||||
private String unCharge;
|
||||
@SerializedName("see_time")
|
||||
private String seeTime;
|
||||
@SerializedName("greetings")
|
||||
private List<String> greetings;
|
||||
@SerializedName("live_bg")
|
||||
private String liveBg;
|
||||
@SerializedName("anchor_goodnum")
|
||||
private String anchorGoodnum;
|
||||
@SerializedName("jackpot_level")
|
||||
private String jackpotLevel="-1";
|
||||
|
||||
public String getJackpotLevel() {
|
||||
|
||||
return jackpotLevel;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setJackpotLevel(String jackpotLevel) {
|
||||
this.jackpotLevel = jackpotLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getVotestotal() {
|
||||
return votestotal;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setVotestotal(String votestotal) {
|
||||
this.votestotal = votestotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMedalRankNum() {
|
||||
return medalRankNum;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setMedalRankNum(String medalRankNum) {
|
||||
this.medalRankNum = medalRankNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarrageFee() {
|
||||
return barrageFee;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setBarrageFee(String barrageFee) {
|
||||
this.barrageFee = barrageFee;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserlistTime() {
|
||||
return userlistTime;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setUserlistTime(String userlistTime) {
|
||||
this.userlistTime = userlistTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getChatserver() {
|
||||
return chatserver;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setChatserver(String chatserver) {
|
||||
this.chatserver = chatserver;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLinkmicUid() {
|
||||
return linkmicUid;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setLinkmicUid(String linkmicUid) {
|
||||
this.linkmicUid = linkmicUid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLinkmicPull() {
|
||||
return linkmicPull;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setLinkmicPull(String linkmicPull) {
|
||||
this.linkmicPull = linkmicPull;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNums() {
|
||||
return nums;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setNums(String nums) {
|
||||
this.nums = nums;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<?> getGame() {
|
||||
return game;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGame(List<?> game) {
|
||||
this.game = game;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getGamebet() {
|
||||
return gamebet;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGamebet(List<String> gamebet) {
|
||||
this.gamebet = gamebet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGametime() {
|
||||
return gametime;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGametime(String gametime) {
|
||||
this.gametime = gametime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGameid() {
|
||||
return gameid;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGameid(String gameid) {
|
||||
this.gameid = gameid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGameaction() {
|
||||
return gameaction;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGameaction(String gameaction) {
|
||||
this.gameaction = gameaction;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGameBankerid() {
|
||||
return gameBankerid;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGameBankerid(String gameBankerid) {
|
||||
this.gameBankerid = gameBankerid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGameBankerName() {
|
||||
return gameBankerName;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGameBankerName(String gameBankerName) {
|
||||
this.gameBankerName = gameBankerName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGameBankerAvatar() {
|
||||
return gameBankerAvatar;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGameBankerAvatar(String gameBankerAvatar) {
|
||||
this.gameBankerAvatar = gameBankerAvatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGameBankerCoin() {
|
||||
return gameBankerCoin;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGameBankerCoin(String gameBankerCoin) {
|
||||
this.gameBankerCoin = gameBankerCoin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGameBankerLimit() {
|
||||
return gameBankerLimit;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGameBankerLimit(String gameBankerLimit) {
|
||||
this.gameBankerLimit = gameBankerLimit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShutTime() {
|
||||
return shutTime;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setShutTime(String shutTime) {
|
||||
this.shutTime = shutTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getKickTime() {
|
||||
return kickTime;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setKickTime(String kickTime) {
|
||||
this.kickTime = kickTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSpeakLimit() {
|
||||
return speakLimit;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setSpeakLimit(String speakLimit) {
|
||||
this.speakLimit = speakLimit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarrageLimit() {
|
||||
return barrageLimit;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setBarrageLimit(String barrageLimit) {
|
||||
this.barrageLimit = barrageLimit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCoin() {
|
||||
return coin;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setCoin(String coin) {
|
||||
this.coin = coin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public VipModel getVip() {
|
||||
return vip;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setVip(VipModel vip) {
|
||||
this.vip = vip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiangModel getLiang() {
|
||||
return liang;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setLiang(LiangModel liang) {
|
||||
this.liang = liang;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMedalLevel() {
|
||||
return medalLevel;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setMedalLevel(String medalLevel) {
|
||||
this.medalLevel = medalLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMedalName() {
|
||||
return medalName;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setMedalName(String medalName) {
|
||||
this.medalName = medalName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIssuper() {
|
||||
return issuper;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setIssuper(String issuper) {
|
||||
this.issuper = issuper;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUsertype() {
|
||||
return usertype;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setUsertype(String usertype) {
|
||||
this.usertype = usertype;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFrontTask() {
|
||||
return frontTask;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setFrontTask(String frontTask) {
|
||||
this.frontTask = frontTask;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsmic() {
|
||||
return ismic;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setIsmic(String ismic) {
|
||||
this.ismic = ismic;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsattention() {
|
||||
return isattention;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setIsattention(String isattention) {
|
||||
this.isattention = isattention;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<LiveUserGiftBean> getUserlists() {
|
||||
return userlists;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setUserlists(List<LiveUserGiftBean> userlists) {
|
||||
this.userlists = userlists;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GuardModel getGuard() {
|
||||
return guard;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGuard(GuardModel guard) {
|
||||
this.guard = guard;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGuardNums() {
|
||||
return guardNums;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGuardNums(String guardNums) {
|
||||
this.guardNums = guardNums;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PkinfoModel getPkinfo() {
|
||||
return pkinfo;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setPkinfo(PkinfoModel pkinfo) {
|
||||
this.pkinfo = pkinfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LminfoModel getLminfo() {
|
||||
return lminfo;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setLminfo(LminfoModel lminfo) {
|
||||
this.lminfo = lminfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsred() {
|
||||
return isred;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setIsred(String isred) {
|
||||
this.isred = isred;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsFans() {
|
||||
return isFans;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setIsFans(String isFans) {
|
||||
this.isFans = isFans;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCountFans() {
|
||||
return countFans;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setCountFans(String countFans) {
|
||||
this.countFans = countFans;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsconnection() {
|
||||
if(StringUtil.isEmpty(isconnection)){
|
||||
isconnection="0";
|
||||
}
|
||||
return isconnection;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setIsconnection(String isconnection) {
|
||||
this.isconnection = isconnection;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsleave() {
|
||||
return isleave;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setIsleave(String isleave) {
|
||||
this.isleave = isleave;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLandscape() {
|
||||
return landscape;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setLandscape(String landscape) {
|
||||
this.landscape = landscape;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUnCharge() {
|
||||
return unCharge;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setUnCharge(String unCharge) {
|
||||
this.unCharge = unCharge;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSeeTime() {
|
||||
return seeTime;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setSeeTime(String seeTime) {
|
||||
this.seeTime = seeTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getGreetings() {
|
||||
return greetings;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGreetings(List<String> greetings) {
|
||||
this.greetings = greetings;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLiveBg() {
|
||||
return liveBg;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setLiveBg(String liveBg) {
|
||||
this.liveBg = liveBg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnchorGoodnum() {
|
||||
return anchorGoodnum;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setAnchorGoodnum(String anchorGoodnum) {
|
||||
this.anchorGoodnum = anchorGoodnum;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 整合进入直播间接口
|
||||
*/
|
||||
public class EnterRoomNewModel extends BaseModel {
|
||||
|
||||
@SerializedName("liveInfo")
|
||||
private LiveInfoModel liveInfo = new LiveInfoModel();//直播间信息
|
||||
@SerializedName("enterRoomInfo")
|
||||
private EnterRoomInfoModel enterRoomInfo = new EnterRoomInfoModel();//原接口进入直播间数据返回
|
||||
@SerializedName("rankHour")
|
||||
private RankHourModel rankHour = new RankHourModel();//.热度卡
|
||||
@SerializedName("newPeopleTask")
|
||||
private NewPeopleTaskModel newPeopleTask = new NewPeopleTaskModel();//新人任务
|
||||
@SerializedName("wishList")
|
||||
private WishListModel wishList = new WishListModel();//心愿单
|
||||
@SerializedName("guardUser")
|
||||
private GuardUserModel guardUserAvatar = new GuardUserModel();//守护
|
||||
@SerializedName("activeList")
|
||||
private List<ActiveModel> activeList = new ArrayList<>();//活动列表
|
||||
@SerializedName("isUseHotCard")
|
||||
private String isUseHotCard = "";//是否使用热度卡
|
||||
@SerializedName("liveRoomActivity")
|
||||
private List<LiveRoomActivityModel> liveRoomActivityModels = new ArrayList<>();//活动列表
|
||||
@SerializedName("clarityType")
|
||||
private int clarityType;
|
||||
|
||||
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
|
||||
return liveRoomActivityModels;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setLiveRoomActivityModels(List<LiveRoomActivityModel> liveRoomActivityModels) {
|
||||
this.liveRoomActivityModels = liveRoomActivityModels;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiveInfoModel getLiveInfo() {
|
||||
return liveInfo;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setLiveInfo(LiveInfoModel liveInfo) {
|
||||
this.liveInfo = liveInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel getEnterRoomInfo() {
|
||||
return enterRoomInfo;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setEnterRoomInfo(EnterRoomInfoModel enterRoomInfo) {
|
||||
this.enterRoomInfo = enterRoomInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RankHourModel getRankHour() {
|
||||
return rankHour;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setRankHour(RankHourModel rankHour) {
|
||||
this.rankHour = rankHour;
|
||||
return this;
|
||||
}
|
||||
|
||||
public NewPeopleTaskModel getNewPeopleTask() {
|
||||
return newPeopleTask;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setNewPeopleTask(NewPeopleTaskModel newPeopleTask) {
|
||||
this.newPeopleTask = newPeopleTask;
|
||||
return this;
|
||||
}
|
||||
|
||||
public WishListModel getWishList() {
|
||||
return wishList;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setWishList(WishListModel wishList) {
|
||||
this.wishList = wishList;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GuardUserModel getGuardUserAvatar() {
|
||||
return guardUserAvatar;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setGuardUserAvatar(GuardUserModel guardUserAvatar) {
|
||||
this.guardUserAvatar = guardUserAvatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ActiveModel> getActiveList() {
|
||||
return activeList;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setActiveList(List<ActiveModel> activeList) {
|
||||
this.activeList = activeList;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsUseHotCard() {
|
||||
return isUseHotCard;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setIsUseHotCard(String isUseHotCard) {
|
||||
this.isUseHotCard = isUseHotCard;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getClarityType() {
|
||||
return clarityType;
|
||||
}
|
||||
|
||||
public void setClarityType(int clarityType) {
|
||||
this.clarityType = clarityType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EnterRoomNewModel{" +
|
||||
"liveInfo=" + liveInfo +
|
||||
", enterRoomInfo=" + enterRoomInfo +
|
||||
", rankHour=" + rankHour +
|
||||
", newPeopleTask=" + newPeopleTask +
|
||||
", wishList=" + wishList +
|
||||
", guardUserAvatar=" + guardUserAvatar +
|
||||
", activeList=" + activeList +
|
||||
", isUseHotCard='" + isUseHotCard + '\'' +
|
||||
", liveRoomActivityModels=" + liveRoomActivityModels +
|
||||
", clarityType=" + clarityType +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GiftModel extends BaseModel{
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("sendtype")
|
||||
private String sendtype;
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
@SerializedName("mark")
|
||||
private String mark;
|
||||
@SerializedName("giftname")
|
||||
private String giftname;
|
||||
@SerializedName("needcoin")
|
||||
private String needcoin;
|
||||
@SerializedName("gifticon")
|
||||
private String gifticon;
|
||||
@SerializedName("swf")
|
||||
private String swf;
|
||||
@SerializedName("gift_uid")
|
||||
private String giftUid;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public GiftModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSendtype() {
|
||||
return sendtype;
|
||||
}
|
||||
|
||||
public GiftModel setSendtype(String sendtype) {
|
||||
this.sendtype = sendtype;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public GiftModel setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMark() {
|
||||
return mark;
|
||||
}
|
||||
|
||||
public GiftModel setMark(String mark) {
|
||||
this.mark = mark;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftname() {
|
||||
return giftname;
|
||||
}
|
||||
|
||||
public GiftModel setGiftname(String giftname) {
|
||||
this.giftname = giftname;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNeedcoin() {
|
||||
return needcoin;
|
||||
}
|
||||
|
||||
public GiftModel setNeedcoin(String needcoin) {
|
||||
this.needcoin = needcoin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGifticon() {
|
||||
return gifticon;
|
||||
}
|
||||
|
||||
public GiftModel setGifticon(String gifticon) {
|
||||
this.gifticon = gifticon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSwf() {
|
||||
return swf;
|
||||
}
|
||||
|
||||
public GiftModel setSwf(String swf) {
|
||||
this.swf = swf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftUid() {
|
||||
return giftUid;
|
||||
}
|
||||
|
||||
public GiftModel setGiftUid(String giftUid) {
|
||||
this.giftUid = giftUid;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GuardModel extends BaseModel {
|
||||
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
@SerializedName("endtime")
|
||||
private String endtime;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public GuardModel setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEndtime() {
|
||||
return endtime;
|
||||
}
|
||||
|
||||
public GuardModel setEndtime(String endtime) {
|
||||
this.endtime = endtime;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GuardUserModel extends BaseModel{
|
||||
|
||||
@SerializedName("guardUserAvatar")
|
||||
private String guardUserAvatar;
|
||||
@SerializedName("guardType")
|
||||
private String guardType;
|
||||
|
||||
public static GuardUserModel objectFromData(String str) {
|
||||
|
||||
return new Gson().fromJson(str, GuardUserModel.class);
|
||||
}
|
||||
|
||||
public String getGuardUserAvatar() {
|
||||
return guardUserAvatar;
|
||||
}
|
||||
|
||||
public void setGuardUserAvatar(String guardUserAvatar) {
|
||||
this.guardUserAvatar = guardUserAvatar;
|
||||
}
|
||||
|
||||
public String getGuardType() {
|
||||
return guardType;
|
||||
}
|
||||
|
||||
public void setGuardType(String guardType) {
|
||||
this.guardType = guardType;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
|
||||
public class HttpCallbackModel extends BaseModel {
|
||||
private int code;
|
||||
private String msg;
|
||||
|
||||
public HttpCallbackModel() {
|
||||
}
|
||||
|
||||
public HttpCallbackModel(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
@@ -66,7 +64,6 @@ public class IMLoginModel extends BaseModel {
|
||||
* noble_name : 贵族
|
||||
* sex : 1
|
||||
* slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}]
|
||||
* slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}]
|
||||
* users_type : A
|
||||
* votes : 0.00
|
||||
* votestotal : 0
|
||||
@@ -225,126 +222,6 @@ public class IMLoginModel extends BaseModel {
|
||||
//超皇字体颜色
|
||||
@SerializedName("contentColor")
|
||||
private String contentColor = "";
|
||||
//创建时间
|
||||
@SerializedName("create_time")
|
||||
private String createTime = "";
|
||||
|
||||
@SerializedName("is_guess")
|
||||
private String isGuess = "";
|
||||
|
||||
@SerializedName("goodnum_expire_time")
|
||||
private String goodnumExpireTime = "";
|
||||
|
||||
@SerializedName("version")
|
||||
private String version = "";
|
||||
|
||||
@SerializedName("max_noble_end_time")
|
||||
private String maxNobleEndTime = "";
|
||||
|
||||
@SerializedName("custom_color_id")
|
||||
private String customColorId = "";
|
||||
|
||||
@SerializedName("is_chat")
|
||||
private String isChat = "";
|
||||
|
||||
@SerializedName("is_rong")
|
||||
private String isRong = "";
|
||||
|
||||
@SerializedName("contribution")
|
||||
private String contribution = "";
|
||||
|
||||
@SerializedName("guard_type")
|
||||
private String guardType = "";
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public IMLoginModel setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsGuess() {
|
||||
return isGuess;
|
||||
}
|
||||
|
||||
public IMLoginModel setIsGuess(String isGuess) {
|
||||
this.isGuess = isGuess;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGoodnumExpireTime() {
|
||||
return goodnumExpireTime;
|
||||
}
|
||||
|
||||
public IMLoginModel setGoodnumExpireTime(String goodnumExpireTime) {
|
||||
this.goodnumExpireTime = goodnumExpireTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public IMLoginModel setVersion(String version) {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMaxNobleEndTime() {
|
||||
return maxNobleEndTime;
|
||||
}
|
||||
|
||||
public IMLoginModel setMaxNobleEndTime(String maxNobleEndTime) {
|
||||
this.maxNobleEndTime = maxNobleEndTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCustomColorId() {
|
||||
return customColorId;
|
||||
}
|
||||
|
||||
public IMLoginModel setCustomColorId(String customColorId) {
|
||||
this.customColorId = customColorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsChat() {
|
||||
return isChat;
|
||||
}
|
||||
|
||||
public IMLoginModel setIsChat(String isChat) {
|
||||
this.isChat = isChat;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsRong() {
|
||||
return isRong;
|
||||
}
|
||||
|
||||
public IMLoginModel setIsRong(String isRong) {
|
||||
this.isRong = isRong;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContribution() {
|
||||
return contribution;
|
||||
}
|
||||
|
||||
public IMLoginModel setContribution(String contribution) {
|
||||
this.contribution = contribution;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGuardType() {
|
||||
return guardType;
|
||||
}
|
||||
|
||||
public IMLoginModel setGuardType(String guardType) {
|
||||
this.guardType = guardType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNobleEndTime() {
|
||||
return nobleEndTime;
|
||||
@@ -802,15 +679,6 @@ public class IMLoginModel extends BaseModel {
|
||||
return usersType;
|
||||
}
|
||||
|
||||
/**
|
||||
* usersType ==C 是主播身份
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean anchorUserType() {
|
||||
return TextUtils.equals("C", usersType);
|
||||
}
|
||||
|
||||
public IMLoginModel setUsersType(String usersType) {
|
||||
this.usersType = usersType;
|
||||
return this;
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LinkMicUserBean extends BaseModel {
|
||||
@SerializedName("user_nicename")
|
||||
private String uname;
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
@SerializedName("dress_avatar")
|
||||
private String dress_avatar;
|
||||
private String uid = "";
|
||||
private String action;
|
||||
@SerializedName("id")
|
||||
private String id;//连麦显示右侧头像时要用
|
||||
@SerializedName("level")
|
||||
private int level;
|
||||
@SerializedName("sex")
|
||||
private int sex;
|
||||
|
||||
public String getUname() {
|
||||
return uname;
|
||||
}
|
||||
|
||||
public void setUname(String uname) {
|
||||
this.uname = uname;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public String getDress_avatar() {
|
||||
return dress_avatar;
|
||||
}
|
||||
|
||||
public void setDress_avatar(String dress_avatar) {
|
||||
this.dress_avatar = dress_avatar;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LinkMicUserBean{" +
|
||||
"uname='" + uname + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", dress_avatar='" + dress_avatar + '\'' +
|
||||
", uid='" + uid + '\'' +
|
||||
", action='" + action + '\'' +
|
||||
", id='" + id + '\'' +
|
||||
", level=" + level +
|
||||
", sex=" + sex +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LinkMicUserBeanV2 extends BaseModel {
|
||||
private String roomuserid;
|
||||
private int status;
|
||||
private List<LinkMicUserBean> userlist;
|
||||
|
||||
public String getRoomuserid() {
|
||||
return roomuserid;
|
||||
}
|
||||
|
||||
public void setRoomuserid(String roomuserid) {
|
||||
this.roomuserid = roomuserid;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public List<LinkMicUserBean> getUserlist() {
|
||||
return userlist;
|
||||
}
|
||||
|
||||
public void setUserlist(List<LinkMicUserBean> userlist) {
|
||||
this.userlist = userlist;
|
||||
}
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 机器人bean
|
||||
*/
|
||||
public class LiveAiRobotBean extends BaseModel {
|
||||
@SerializedName("ai_name")
|
||||
private String name;
|
||||
@SerializedName("ai_state")
|
||||
private int status;//1=开 0=关
|
||||
@SerializedName("ai_time")
|
||||
private int time;
|
||||
@SerializedName("ai_sayhi")
|
||||
private int autoSeyHiNumber;// 自动打招呼已配置数量
|
||||
@SerializedName("ai_gz")
|
||||
private int autoRequestFollowNumber;//自动求关注已配置数量
|
||||
|
||||
public LiveAiRobotBean() {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(int time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public int getAutoSeyHiNumber() {
|
||||
return autoSeyHiNumber;
|
||||
}
|
||||
|
||||
public void setAutoSeyHiNumber(int autoSeyHiNumber) {
|
||||
this.autoSeyHiNumber = autoSeyHiNumber;
|
||||
}
|
||||
|
||||
public int getAutoRequestFollowNumber() {
|
||||
return autoRequestFollowNumber;
|
||||
}
|
||||
|
||||
public void setAutoRequestFollowNumber(int autoRequestFollowNumber) {
|
||||
this.autoRequestFollowNumber = autoRequestFollowNumber;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LiveAiRobotBean{" +
|
||||
"name='" + name + '\'' +
|
||||
", status=" + status +
|
||||
", time=" + time +
|
||||
", autoSeyHiNumber=" + autoSeyHiNumber +
|
||||
", autoRequestFollowNumber=" + autoRequestFollowNumber +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* 机器人消息
|
||||
*/
|
||||
public static class Message {
|
||||
public static final int TYPE_SAY_HI=1;//自动打招呼
|
||||
public static final int TYPE_FOLLOW=3;//自动求关注
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("uid")
|
||||
private int uid;
|
||||
@SerializedName("type")
|
||||
private int type;
|
||||
@SerializedName("content")
|
||||
private String content;
|
||||
|
||||
public Message() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Message{" +
|
||||
"id=" + id +
|
||||
", uid=" + uid +
|
||||
", type=" + type +
|
||||
", content='" + content + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,11 @@ import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/9.
|
||||
@@ -52,8 +53,6 @@ public class LiveBean implements Parcelable {
|
||||
private String recommendCardIconSizeTwo = "";
|
||||
private String recommendCardIconSizeThree = "";
|
||||
|
||||
private Map<String,String> params;//用于跳转Activity时扩展参数,例:从首页Banner跳转到直播间时需要根据携带参数判断是否弹出新人特惠对话框
|
||||
|
||||
public String getRecommendCardIconSizeTwo() {
|
||||
return recommendCardIconSizeTwo;
|
||||
}
|
||||
@@ -84,14 +83,6 @@ public class LiveBean implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
public String getRecommendcardtype() {
|
||||
return recommendCardtype;
|
||||
}
|
||||
@@ -387,28 +378,27 @@ public class LiveBean implements Parcelable {
|
||||
*/
|
||||
public String getLiangNameTip() {
|
||||
if (!TextUtils.isEmpty(this.goodNum) && !"0".equals(this.goodNum)) {
|
||||
return this.goodNum;
|
||||
return WordUtil.getString(R.string.live_liang) + ":" + this.goodNum;
|
||||
}
|
||||
return this.uid;
|
||||
return "ID:" + this.uid;
|
||||
}
|
||||
|
||||
public LiveBean() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private LiveBean(Parcel in) {
|
||||
this.uid = in.readString();
|
||||
this.avatar = in.readString();
|
||||
this.avatarThumb = in.readString();
|
||||
this.userNiceName = in.readString();
|
||||
this.sex = in.readInt();
|
||||
this.title = in.readString();
|
||||
this.city = in.readString();
|
||||
this.stream = in.readString();
|
||||
this.pull = in.readString();
|
||||
this.thumb = in.readString();
|
||||
this.nums = in.readString();
|
||||
this.sex = in.readInt();
|
||||
this.distance = in.readString();
|
||||
this.levelAnchor = in.readInt();
|
||||
this.type = in.readInt();
|
||||
@@ -416,23 +406,6 @@ public class LiveBean implements Parcelable {
|
||||
this.goodNum = in.readString();
|
||||
this.gameAction = in.readInt();
|
||||
this.game = in.readString();
|
||||
this.islive = in.readString();
|
||||
this.isTop = in.readString();
|
||||
this.pk_avatar_thumb = in.readString();
|
||||
this.landscape = in.readInt();
|
||||
this.hot_num = in.readString();
|
||||
this.content_pic_size_one = in.readString();
|
||||
this.content_pic_size_two = in.readString();
|
||||
this.content_pic_size_three = in.readString();
|
||||
this.is_week = in.readString();
|
||||
this.img = in.readString();
|
||||
this.url = in.readString();
|
||||
this.drpk_status = in.readString();
|
||||
this.is_rong = in.readInt();
|
||||
this.isattention = in.readString();
|
||||
this.recommendCardtype = in.readString();
|
||||
this.recommendCardIconSizeTwo = in.readString();
|
||||
this.recommendCardIconSizeThree = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -446,13 +419,13 @@ public class LiveBean implements Parcelable {
|
||||
dest.writeString(this.avatar);
|
||||
dest.writeString(this.avatarThumb);
|
||||
dest.writeString(this.userNiceName);
|
||||
dest.writeInt(this.sex);
|
||||
dest.writeString(this.title);
|
||||
dest.writeString(this.city);
|
||||
dest.writeString(this.stream);
|
||||
dest.writeString(this.pull);
|
||||
dest.writeString(this.thumb);
|
||||
dest.writeString(this.nums);
|
||||
dest.writeInt(this.sex);
|
||||
dest.writeString(this.distance);
|
||||
dest.writeInt(this.levelAnchor);
|
||||
dest.writeInt(this.type);
|
||||
@@ -460,23 +433,6 @@ public class LiveBean implements Parcelable {
|
||||
dest.writeString(this.goodNum);
|
||||
dest.writeInt(this.gameAction);
|
||||
dest.writeString(this.game);
|
||||
dest.writeString(this.islive);
|
||||
dest.writeString(this.isTop);
|
||||
dest.writeString(this.pk_avatar_thumb);
|
||||
dest.writeInt(this.landscape);
|
||||
dest.writeString(this.hot_num);
|
||||
dest.writeString(this.content_pic_size_one);
|
||||
dest.writeString(this.content_pic_size_two);
|
||||
dest.writeString(this.content_pic_size_three);
|
||||
dest.writeString(this.is_week);
|
||||
dest.writeString(this.img);
|
||||
dest.writeString(this.url);
|
||||
dest.writeString(this.drpk_status);
|
||||
dest.writeInt(this.is_rong);
|
||||
dest.writeString(this.isattention);
|
||||
dest.writeString(this.recommendCardtype);
|
||||
dest.writeString(this.recommendCardIconSizeTwo);
|
||||
dest.writeString(this.recommendCardIconSizeThree);
|
||||
}
|
||||
|
||||
public static final Creator<LiveBean> CREATOR = new Creator<LiveBean>() {
|
||||
@@ -493,44 +449,6 @@ public class LiveBean implements Parcelable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LiveBean{" +
|
||||
"uid='" + uid + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", avatarThumb='" + avatarThumb + '\'' +
|
||||
", userNiceName='" + userNiceName + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", city='" + city + '\'' +
|
||||
", stream='" + stream + '\'' +
|
||||
", pull='" + pull + '\'' +
|
||||
", thumb='" + thumb + '\'' +
|
||||
", nums='" + nums + '\'' +
|
||||
", sex=" + sex +
|
||||
", distance='" + distance + '\'' +
|
||||
", levelAnchor=" + levelAnchor +
|
||||
", type=" + type +
|
||||
", typeVal='" + typeVal + '\'' +
|
||||
", goodNum='" + goodNum + '\'' +
|
||||
", gameAction=" + gameAction +
|
||||
", game='" + game + '\'' +
|
||||
", islive='" + islive + '\'' +
|
||||
", isTop='" + isTop + '\'' +
|
||||
", pk_avatar_thumb='" + pk_avatar_thumb + '\'' +
|
||||
", landscape=" + landscape +
|
||||
", hot_num='" + hot_num + '\'' +
|
||||
", content_pic_size_one='" + content_pic_size_one + '\'' +
|
||||
", content_pic_size_two='" + content_pic_size_two + '\'' +
|
||||
", content_pic_size_three='" + content_pic_size_three + '\'' +
|
||||
", is_week='" + is_week + '\'' +
|
||||
", img='" + img + '\'' +
|
||||
", url='" + url + '\'' +
|
||||
", drpk_status='" + drpk_status + '\'' +
|
||||
", is_rong=" + is_rong +
|
||||
", isattention='" + isattention + '\'' +
|
||||
", recommendCardtype='" + recommendCardtype + '\'' +
|
||||
", recommendCardIconSizeTwo='" + recommendCardIconSizeTwo + '\'' +
|
||||
", recommendCardIconSizeThree='" + recommendCardIconSizeThree + '\'' +
|
||||
", params=" + params +
|
||||
", mWeekList=" + mWeekList +
|
||||
'}';
|
||||
return "uid: " + uid + " , userNiceName: " + userNiceName + " ,playUrl: " + pull;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class LiveInfoModel extends BaseModel {
|
||||
@SerializedName("islive")
|
||||
private long islive;
|
||||
@SerializedName("landscape")
|
||||
private int landscape = 0;
|
||||
private long landscape = 0;
|
||||
@SerializedName("is_rong")
|
||||
private long isRong = 0;
|
||||
@SerializedName("nums")
|
||||
@@ -208,11 +208,11 @@ public class LiveInfoModel extends BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getLandscape() {
|
||||
public long getLandscape() {
|
||||
return landscape;
|
||||
}
|
||||
|
||||
public LiveInfoModel setLandscape(int landscape) {
|
||||
public LiveInfoModel setLandscape(long landscape) {
|
||||
this.landscape = landscape;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 活动列表
|
||||
*/
|
||||
public class LiveRoomActivityModel extends BaseModel {
|
||||
|
||||
@SerializedName("name")
|
||||
private String name;
|
||||
@SerializedName("img")
|
||||
private String img;
|
||||
@SerializedName("link")
|
||||
private String link;
|
||||
@SerializedName("is_hidden")
|
||||
private String isHidden;
|
||||
@SerializedName("show_type")
|
||||
private String showType;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public LiveRoomActivityModel setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public LiveRoomActivityModel setImg(String img) {
|
||||
this.img = img;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public LiveRoomActivityModel setLink(String link) {
|
||||
this.link = link;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsHidden() {
|
||||
return isHidden;
|
||||
}
|
||||
|
||||
public LiveRoomActivityModel setIsHidden(String isHidden) {
|
||||
this.isHidden = isHidden;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShowType() {
|
||||
return showType;
|
||||
}
|
||||
|
||||
public LiveRoomActivityModel setShowType(String showType) {
|
||||
this.showType = showType;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LiveStetUpStatusModel extends BaseModel {
|
||||
|
||||
@SerializedName("wishList")
|
||||
private String wishList;
|
||||
@SerializedName("ai_state")
|
||||
private String aiState;
|
||||
|
||||
/**
|
||||
* wishList 1设置 0 未设置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean getWishListState() {
|
||||
return TextUtils.equals(wishList, "1");
|
||||
}
|
||||
|
||||
/**
|
||||
* aiState 1打开机器人 0 未设置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean getAiStateState() {
|
||||
return TextUtils.equals(aiState, "1");
|
||||
}
|
||||
|
||||
public String getWishList() {
|
||||
return wishList;
|
||||
}
|
||||
|
||||
public LiveStetUpStatusModel setWishList(String wishList) {
|
||||
this.wishList = wishList;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAiState() {
|
||||
return aiState;
|
||||
}
|
||||
|
||||
public LiveStetUpStatusModel setAiState(String aiState) {
|
||||
this.aiState = aiState;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/27.
|
||||
* 直播间用户列表实体类
|
||||
*/
|
||||
|
||||
public class LiveUserGiftBean extends UserBean {
|
||||
|
||||
private String contribution;
|
||||
private int guardType;
|
||||
private int nub;
|
||||
|
||||
public LiveUserGiftBean() {
|
||||
}
|
||||
|
||||
public int getNub() {
|
||||
return nub;
|
||||
}
|
||||
|
||||
public void setNub(int nub) {
|
||||
this.nub = nub;
|
||||
}
|
||||
|
||||
public String getContribution() {
|
||||
return contribution;
|
||||
}
|
||||
|
||||
public void setContribution(String contribution) {
|
||||
this.contribution = contribution;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否送过礼物
|
||||
*/
|
||||
public boolean hasContribution() {
|
||||
return !TextUtils.isEmpty(this.contribution) && !"0".equals(this.contribution);
|
||||
}
|
||||
|
||||
@JSONField(name = "guard_type")
|
||||
public int getGuardType() {
|
||||
return guardType;
|
||||
}
|
||||
|
||||
@JSONField(name = "guard_type")
|
||||
public void setGuardType(int guardType) {
|
||||
this.guardType = guardType;
|
||||
}
|
||||
|
||||
public LiveUserGiftBean(Parcel in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LiveUserGiftBean{" +
|
||||
"contribution='" + contribution + '\'' +
|
||||
", guardType=" + guardType +
|
||||
", nub=" + nub +
|
||||
", id='" + id + '\'' +
|
||||
", userNiceName='" + userNiceName + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", avatarThumb='" + avatarThumb + '\'' +
|
||||
", sex=" + sex +
|
||||
", signature='" + signature + '\'' +
|
||||
", coin='" + coin + '\'' +
|
||||
", gold='" + gold + '\'' +
|
||||
", votes='" + votes + '\'' +
|
||||
", consumption='" + consumption + '\'' +
|
||||
", votestotal='" + votestotal + '\'' +
|
||||
", province='" + province + '\'' +
|
||||
", city='" + city + '\'' +
|
||||
", location='" + location + '\'' +
|
||||
", birthday='" + birthday + '\'' +
|
||||
", level=" + level +
|
||||
", levelAnchor=" + levelAnchor +
|
||||
", lives=" + lives +
|
||||
", follows=" + follows +
|
||||
", fans=" + fans +
|
||||
", vip=" + vip +
|
||||
", liang=" + liang +
|
||||
", car=" + car +
|
||||
", medal_level=" + medal_level +
|
||||
", medal_name='" + medal_name + '\'' +
|
||||
", Dress=" + Dress +
|
||||
", noble_id='" + noble_id + '\'' +
|
||||
", yuanbao='" + yuanbao + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LminfoModel extends BaseModel{
|
||||
|
||||
@SerializedName("status")
|
||||
private int status;
|
||||
|
||||
public static LminfoModel objectFromData(String str) {
|
||||
|
||||
return new Gson().fromJson(str, LminfoModel.class);
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 新用户等级牌
|
||||
*/
|
||||
public class NewLevelModel extends BaseModel {
|
||||
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("levelmin")
|
||||
private String levemin;
|
||||
@SerializedName("levelmax")
|
||||
private String levemax;
|
||||
@SerializedName("thumb")
|
||||
private String thumb;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public NewLevelModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevemin() {
|
||||
return levemin;
|
||||
}
|
||||
|
||||
public int getLeveMin() {
|
||||
if (TextUtils.isEmpty(levemin)) {
|
||||
levemin = "0";
|
||||
}
|
||||
return Integer.parseInt(levemin);
|
||||
}
|
||||
|
||||
public int getLeveMax() {
|
||||
if (TextUtils.isEmpty(levemax)) {
|
||||
levemax = "0";
|
||||
}
|
||||
return Integer.parseInt(levemax);
|
||||
}
|
||||
|
||||
public NewLevelModel setLevemin(String levemin) {
|
||||
this.levemin = levemin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevemax() {
|
||||
return levemax;
|
||||
}
|
||||
|
||||
public NewLevelModel setLevemax(String levemax) {
|
||||
this.levemax = levemax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
public NewLevelModel setThumb(String thumb) {
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class NewPeopleTaskModel extends BaseModel {
|
||||
|
||||
@SerializedName("task")
|
||||
private TaskModel task = new TaskModel();
|
||||
@SerializedName("gift")
|
||||
private GiftModel gift = new GiftModel();
|
||||
@SerializedName("reward_all")
|
||||
private RewardAllModel rewardAll = new RewardAllModel();
|
||||
@SerializedName("reward_one")
|
||||
private RewardAllModel rewardOne = new RewardAllModel();
|
||||
|
||||
public TaskModel getTask() {
|
||||
return task;
|
||||
}
|
||||
|
||||
public NewPeopleTaskModel setTask(TaskModel task) {
|
||||
this.task = task;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GiftModel getGift() {
|
||||
return gift;
|
||||
}
|
||||
|
||||
public NewPeopleTaskModel setGift(GiftModel gift) {
|
||||
this.gift = gift;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RewardAllModel getRewardAll() {
|
||||
return rewardAll;
|
||||
}
|
||||
|
||||
public NewPeopleTaskModel setRewardAll(RewardAllModel rewardAll) {
|
||||
this.rewardAll = rewardAll;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RewardAllModel getRewardOne() {
|
||||
return rewardOne;
|
||||
}
|
||||
|
||||
public NewPeopleTaskModel setRewardOne(RewardAllModel rewardOne) {
|
||||
this.rewardOne = rewardOne;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class PKTopThreeModel extends BaseModel {
|
||||
@SerializedName("uid")
|
||||
private String uid;
|
||||
@SerializedName("img")
|
||||
private String img;
|
||||
@SerializedName("liveuid")
|
||||
private String liveuid;
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public PKTopThreeModel setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public PKTopThreeModel setImg(String img) {
|
||||
this.img = img;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLiveuid() {
|
||||
return liveuid;
|
||||
}
|
||||
|
||||
public PKTopThreeModel setLiveuid(String liveuid) {
|
||||
this.liveuid = liveuid;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
/**
|
||||
* 直播间PK排位赛
|
||||
*/
|
||||
public class PkRankBean extends BaseModel {
|
||||
@SerializedName("anchor_id")
|
||||
public int id;
|
||||
@SerializedName("rank_name")
|
||||
public String name;
|
||||
@SerializedName("rank_img")
|
||||
public String img;
|
||||
@SerializedName("win_continuity1")
|
||||
public String redVal;
|
||||
@SerializedName("win_continuity2")
|
||||
public String blueVal;
|
||||
@SerializedName("pktt_img")
|
||||
public String pkTopImgUrl;
|
||||
@SerializedName("link")
|
||||
public String clickUrl;
|
||||
@SerializedName("vs_img")
|
||||
public String vsImgUrl;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getRedVal() {
|
||||
if (StringUtil.isEmpty(redVal)) {
|
||||
redVal = "0";
|
||||
}
|
||||
return redVal;
|
||||
}
|
||||
|
||||
public void setRedVal(String redVal) {
|
||||
this.redVal = redVal;
|
||||
}
|
||||
|
||||
public String getBlueVal() {
|
||||
if (StringUtil.isEmpty(blueVal)) {
|
||||
blueVal = "0";
|
||||
}
|
||||
return blueVal;
|
||||
}
|
||||
|
||||
public void setBlueVal(String blueVal) {
|
||||
this.blueVal = blueVal;
|
||||
}
|
||||
|
||||
public String getPkTopImgUrl() {
|
||||
return pkTopImgUrl;
|
||||
}
|
||||
|
||||
public void setPkTopImgUrl(String pkTopImgUrl) {
|
||||
this.pkTopImgUrl = pkTopImgUrl;
|
||||
}
|
||||
|
||||
public String getClickUrl() {
|
||||
return clickUrl;
|
||||
}
|
||||
|
||||
public void setClickUrl(String clickUrl) {
|
||||
this.clickUrl = clickUrl;
|
||||
}
|
||||
|
||||
public String getVsImgUrl() {
|
||||
return vsImgUrl;
|
||||
}
|
||||
|
||||
public void setVsImgUrl(String vsImgUrl) {
|
||||
this.vsImgUrl = vsImgUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PkRankBean{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", img='" + img + '\'' +
|
||||
", redVal='" + redVal + '\'' +
|
||||
", blueVal='" + blueVal + '\'' +
|
||||
", pkTopImgUrl='" + pkTopImgUrl + '\'' +
|
||||
", clickUrl='" + clickUrl + '\'' +
|
||||
", vsImgUrl='" + vsImgUrl + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class PkTopUsersModel extends BaseModel {
|
||||
@SerializedName("red_one")
|
||||
private PKTopThreeModel redOne;
|
||||
@SerializedName("red_two")
|
||||
private PKTopThreeModel redTwo;
|
||||
@SerializedName("red_three")
|
||||
private PKTopThreeModel redThree;
|
||||
@SerializedName("blue_one")
|
||||
private PKTopThreeModel blueOne;
|
||||
@SerializedName("blue_two")
|
||||
private PKTopThreeModel blueTwo;
|
||||
@SerializedName("blue_three")
|
||||
private PKTopThreeModel blueThree;
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class PkinfoModel extends BaseModel {
|
||||
|
||||
@SerializedName("pkuid")
|
||||
private String pkuid;
|
||||
@SerializedName("pkuname")
|
||||
private String pkuname;
|
||||
@SerializedName("pkuimg")
|
||||
private String pkuimg;
|
||||
@SerializedName("pkpull")
|
||||
private String pkpull;
|
||||
@SerializedName("ifpk")
|
||||
private String ifpk;
|
||||
@SerializedName("pk_time")
|
||||
private String pkTime;
|
||||
@SerializedName("end_pk_time")
|
||||
private String endPkTime;
|
||||
@SerializedName("pk_gift_liveuid")
|
||||
private String pkGiftLiveuid;
|
||||
@SerializedName("pk_gift_pkuid")
|
||||
private String pkGiftPkuid;
|
||||
@SerializedName("anyway")
|
||||
private String anyway;
|
||||
@SerializedName("drpk_status")
|
||||
private String drpkStatus;
|
||||
@SerializedName("drpk_roomid")
|
||||
private String drpkRoomid;
|
||||
@SerializedName("drpk_time")
|
||||
private String drpkTime;
|
||||
@SerializedName("pk_top_users")
|
||||
private PkTopUsersModel pkTopUsers;
|
||||
@SerializedName("userlist")
|
||||
private JsonArray userlist;
|
||||
|
||||
public JsonArray getUserlist() {
|
||||
return userlist;
|
||||
}
|
||||
|
||||
public void setUserlist(JsonArray userlist) {
|
||||
this.userlist = userlist;
|
||||
}
|
||||
|
||||
public String getPkuid() {
|
||||
return pkuid;
|
||||
}
|
||||
|
||||
public PkinfoModel setPkuid(String pkuid) {
|
||||
this.pkuid = pkuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPkuname() {
|
||||
return pkuname;
|
||||
}
|
||||
|
||||
public PkinfoModel setPkuname(String pkuname) {
|
||||
this.pkuname = pkuname;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPkuimg() {
|
||||
return pkuimg;
|
||||
}
|
||||
|
||||
public PkinfoModel setPkuimg(String pkuimg) {
|
||||
this.pkuimg = pkuimg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPkpull() {
|
||||
return pkpull;
|
||||
}
|
||||
|
||||
public PkinfoModel setPkpull(String pkpull) {
|
||||
this.pkpull = pkpull;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIfpk() {
|
||||
return ifpk;
|
||||
}
|
||||
|
||||
public PkinfoModel setIfpk(String ifpk) {
|
||||
this.ifpk = ifpk;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPkTime() {
|
||||
return pkTime;
|
||||
}
|
||||
|
||||
public PkinfoModel setPkTime(String pkTime) {
|
||||
this.pkTime = pkTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEndPkTime() {
|
||||
return endPkTime;
|
||||
}
|
||||
|
||||
public PkinfoModel setEndPkTime(String endPkTime) {
|
||||
this.endPkTime = endPkTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPkGiftLiveuid() {
|
||||
return pkGiftLiveuid;
|
||||
}
|
||||
|
||||
public PkinfoModel setPkGiftLiveuid(String pkGiftLiveuid) {
|
||||
this.pkGiftLiveuid = pkGiftLiveuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPkGiftPkuid() {
|
||||
return pkGiftPkuid;
|
||||
}
|
||||
|
||||
public PkinfoModel setPkGiftPkuid(String pkGiftPkuid) {
|
||||
this.pkGiftPkuid = pkGiftPkuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnyway() {
|
||||
return anyway;
|
||||
}
|
||||
|
||||
public PkinfoModel setAnyway(String anyway) {
|
||||
this.anyway = anyway;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDrpkStatus() {
|
||||
return drpkStatus;
|
||||
}
|
||||
|
||||
public PkinfoModel setDrpkStatus(String drpkStatus) {
|
||||
this.drpkStatus = drpkStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDrpkRoomid() {
|
||||
return drpkRoomid;
|
||||
}
|
||||
|
||||
public PkinfoModel setDrpkRoomid(String drpkRoomid) {
|
||||
this.drpkRoomid = drpkRoomid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDrpkTime() {
|
||||
return drpkTime;
|
||||
}
|
||||
|
||||
public PkinfoModel setDrpkTime(String drpkTime) {
|
||||
this.drpkTime = drpkTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PkTopUsersModel getPkTopUsers() {
|
||||
return pkTopUsers;
|
||||
}
|
||||
|
||||
public PkinfoModel setPkTopUsers(PkTopUsersModel pkTopUsers) {
|
||||
this.pkTopUsers = pkTopUsers;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class PrankGiftBean extends BaseModel{
|
||||
@SerializedName("prank_content")
|
||||
private String title;
|
||||
@SerializedName("gift_name")
|
||||
private String name;
|
||||
@SerializedName("gift_icon")
|
||||
private String icon;
|
||||
@SerializedName("gift_num")
|
||||
private int num;
|
||||
@SerializedName("gift_id")
|
||||
private String giftId;
|
||||
|
||||
public PrankGiftBean() {
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(int num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public void setGiftId(String giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
public class PrankHttpTurntableBean extends BaseModel {
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("anchor_id")
|
||||
private String anchor_id;
|
||||
@SerializedName("coin")
|
||||
private long coin = 1000;
|
||||
@SerializedName("hope_coin")
|
||||
private long hopeCoin = 1000;
|
||||
@SerializedName("turntable_one")
|
||||
private String turntable1;
|
||||
@SerializedName("turntable_two")
|
||||
private String turntable2;
|
||||
@SerializedName("turntable_three")
|
||||
private String turntable3;
|
||||
@SerializedName("turntable_four")
|
||||
private String turntable4;
|
||||
@SerializedName("turntable_five")
|
||||
private String turntable5;
|
||||
@SerializedName("turntable_six")
|
||||
private String turntable6;
|
||||
@SerializedName("status")
|
||||
private int status;
|
||||
|
||||
public PrankHttpTurntableBean() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAnchor_id() {
|
||||
return anchor_id;
|
||||
}
|
||||
|
||||
public void setAnchor_id(String anchor_id) {
|
||||
this.anchor_id = anchor_id;
|
||||
}
|
||||
|
||||
public long getCoin() {
|
||||
return coin;
|
||||
}
|
||||
|
||||
public void setCoin(long coin) {
|
||||
this.coin = coin;
|
||||
}
|
||||
|
||||
public long getHopeCoin() {
|
||||
return hopeCoin;
|
||||
}
|
||||
|
||||
public void setHopeCoin(long hopeCoin) {
|
||||
this.hopeCoin = hopeCoin;
|
||||
}
|
||||
|
||||
public String getTurntable1() {
|
||||
return turntable1;
|
||||
}
|
||||
|
||||
public void setTurntable1(String turntable1) {
|
||||
this.turntable1 = turntable1;
|
||||
}
|
||||
|
||||
public String getTurntable2() {
|
||||
return turntable2;
|
||||
}
|
||||
|
||||
public void setTurntable2(String turntable2) {
|
||||
this.turntable2 = turntable2;
|
||||
}
|
||||
|
||||
public String getTurntable3() {
|
||||
return turntable3;
|
||||
}
|
||||
|
||||
public void setTurntable3(String turntable3) {
|
||||
this.turntable3 = turntable3;
|
||||
}
|
||||
|
||||
public String getTurntable4() {
|
||||
return turntable4;
|
||||
}
|
||||
|
||||
public void setTurntable4(String turntable4) {
|
||||
this.turntable4 = turntable4;
|
||||
}
|
||||
|
||||
public String getTurntable5() {
|
||||
return turntable5;
|
||||
}
|
||||
|
||||
public void setTurntable5(String turntable5) {
|
||||
this.turntable5 = turntable5;
|
||||
}
|
||||
|
||||
public String getTurntable6() {
|
||||
return turntable6;
|
||||
}
|
||||
|
||||
public void setTurntable6(String turntable6) {
|
||||
this.turntable6 = turntable6;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
|
||||
public class PrankTurntableBean extends BaseModel {
|
||||
private int id;
|
||||
private String context;
|
||||
|
||||
public PrankTurntableBean() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 随机PK UserBean
|
||||
*/
|
||||
public class RandomPkUserBean extends UserBean {
|
||||
@SerializedName("is_pk")
|
||||
private int pk;
|
||||
@SerializedName("isattention")
|
||||
private String attention;
|
||||
@SerializedName("user_nicename")
|
||||
private String userNiceName;
|
||||
|
||||
public RandomPkUserBean() {
|
||||
}
|
||||
|
||||
public boolean isPk() {
|
||||
return pk==1;
|
||||
}
|
||||
|
||||
public boolean isAttention() {
|
||||
return attention.equals("1");
|
||||
}
|
||||
|
||||
public String getAttention() {
|
||||
return attention;
|
||||
}
|
||||
|
||||
public void setAttention(String attention) {
|
||||
this.attention = attention;
|
||||
}
|
||||
|
||||
public int getPk() {
|
||||
return pk;
|
||||
}
|
||||
|
||||
public void setPk(int pk) {
|
||||
this.pk = pk;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserNiceName() {
|
||||
return userNiceName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserNiceName(String userNiceName) {
|
||||
this.userNiceName = userNiceName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RandomPkUserBean{" +
|
||||
"pk=" + pk +
|
||||
", attention='" + attention + '\'' +
|
||||
", userNiceName='" + userNiceName + '\'' +
|
||||
", id='" + id + '\'' +
|
||||
", userNiceName='" + userNiceName + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", avatarThumb='" + avatarThumb + '\'' +
|
||||
", sex=" + sex +
|
||||
", signature='" + signature + '\'' +
|
||||
", coin='" + coin + '\'' +
|
||||
", gold='" + gold + '\'' +
|
||||
", votes='" + votes + '\'' +
|
||||
", consumption='" + consumption + '\'' +
|
||||
", votestotal='" + votestotal + '\'' +
|
||||
", province='" + province + '\'' +
|
||||
", city='" + city + '\'' +
|
||||
", location='" + location + '\'' +
|
||||
", birthday='" + birthday + '\'' +
|
||||
", level=" + level +
|
||||
", levelAnchor=" + levelAnchor +
|
||||
", lives=" + lives +
|
||||
", follows=" + follows +
|
||||
", fans=" + fans +
|
||||
", vip=" + vip +
|
||||
", liang=" + liang +
|
||||
", car=" + car +
|
||||
", medal_level=" + medal_level +
|
||||
", medal_name='" + medal_name + '\'' +
|
||||
", Dress=" + Dress +
|
||||
", noble_id='" + noble_id + '\'' +
|
||||
", yuanbao='" + yuanbao + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class RankHourModel extends BaseModel {
|
||||
@SerializedName("liveuid")
|
||||
private String liveuid;
|
||||
@SerializedName("hourchart_h5_url")
|
||||
private String hourchartH5Url;
|
||||
@SerializedName("rank")
|
||||
private String rank;
|
||||
@SerializedName("starlightVal")
|
||||
private String starlightVal;
|
||||
@SerializedName("isshow")
|
||||
private String isshow;
|
||||
|
||||
public String getLiveuid() {
|
||||
return liveuid;
|
||||
}
|
||||
|
||||
public RankHourModel setLiveuid(String liveuid) {
|
||||
this.liveuid = liveuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getHourchartH5Url() {
|
||||
return hourchartH5Url;
|
||||
}
|
||||
|
||||
public RankHourModel setHourchartH5Url(String hourchartH5Url) {
|
||||
this.hourchartH5Url = hourchartH5Url;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRank() {
|
||||
return rank;
|
||||
}
|
||||
|
||||
public RankHourModel setRank(String rank) {
|
||||
this.rank = rank;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStarlightVal() {
|
||||
return starlightVal;
|
||||
}
|
||||
|
||||
public RankHourModel setStarlightVal(String starlightVal) {
|
||||
this.starlightVal = starlightVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsshow() {
|
||||
return isshow;
|
||||
}
|
||||
|
||||
public RankHourModel setIsshow(String isshow) {
|
||||
this.isshow = isshow;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class RankPkInfoBean extends BaseModel {
|
||||
private int id;
|
||||
@SerializedName("start_time")
|
||||
private String startTime;
|
||||
@SerializedName("end_time")
|
||||
private String endTime;
|
||||
@SerializedName("pk_start_hour1")
|
||||
private String pkStartHour1;
|
||||
@SerializedName("pk_end_hour1")
|
||||
private String pkEndHour1;
|
||||
@SerializedName("pk_start_hour2")
|
||||
private String pkStartHour2;
|
||||
@SerializedName("pk_end_hour2")
|
||||
private String pkEndHour2;
|
||||
|
||||
public RankPkInfoBean() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getPkStartHour1() {
|
||||
return pkStartHour1;
|
||||
}
|
||||
|
||||
public void setPkStartHour1(String pkStartHour1) {
|
||||
this.pkStartHour1 = pkStartHour1;
|
||||
}
|
||||
|
||||
public String getPkEndHour1() {
|
||||
return pkEndHour1;
|
||||
}
|
||||
|
||||
public void setPkEndHour1(String pkEndHour1) {
|
||||
this.pkEndHour1 = pkEndHour1;
|
||||
}
|
||||
|
||||
public String getPkStartHour2() {
|
||||
return pkStartHour2;
|
||||
}
|
||||
|
||||
public void setPkStartHour2(String pkStartHour2) {
|
||||
this.pkStartHour2 = pkStartHour2;
|
||||
}
|
||||
|
||||
public String getPkEndHour2() {
|
||||
return pkEndHour2;
|
||||
}
|
||||
|
||||
public void setPkEndHour2(String pkEndHour2) {
|
||||
this.pkEndHour2 = pkEndHour2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否在排位赛时间范围内
|
||||
*/
|
||||
public boolean isRankPKTime() {
|
||||
try {
|
||||
Date now =new Date();
|
||||
Date startDate = simpleDateToDate(startTime, "yyyy-MM-dd HH:mm:ss");
|
||||
Date endDate = simpleDateToDate(endTime, "yyyy-MM-dd HH:mm:ss");
|
||||
if (startDate == null || endDate == null) {
|
||||
return false;
|
||||
}
|
||||
Calendar calendarStart = Calendar.getInstance(Locale.CHINA);
|
||||
Calendar calendarEnd = Calendar.getInstance(Locale.CHINA);
|
||||
Calendar calendarNow = Calendar.getInstance(Locale.CHINA);
|
||||
calendarNow.setTime(now);
|
||||
calendarStart.setTime(startDate);
|
||||
calendarEnd.setTime(endDate);
|
||||
if (calendarStart.before(calendarNow) && calendarEnd.after(calendarNow)) {
|
||||
calendarNow.setTime(simpleDateToDate(dateToSimpleDate(now,"HH:mm:ss"),"HH:mm:ss"));
|
||||
calendarStart.setTime(simpleDateToDate(pkStartHour1, "HH:mm:ss"));
|
||||
calendarEnd.setTime(simpleDateToDate(pkEndHour1, "HH:mm:ss"));
|
||||
if (calendarStart.before(calendarNow) && calendarEnd.after(calendarNow)) {
|
||||
return true;
|
||||
} else {
|
||||
calendarNow.setTime(simpleDateToDate(dateToSimpleDate(now,"HH:mm:ss"),"HH:mm:ss"));
|
||||
calendarStart.setTime(simpleDateToDate(pkStartHour2, "HH:mm:ss"));
|
||||
calendarEnd.setTime(simpleDateToDate(pkEndHour2, "HH:mm:ss"));
|
||||
return calendarStart.before(calendarNow) && calendarEnd.after(calendarNow);
|
||||
}
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private Date simpleDateToDate(String time, String pattern) throws ParseException {
|
||||
return new SimpleDateFormat(pattern, Locale.CHINA).parse(time);
|
||||
}
|
||||
private String dateToSimpleDate(Date date,String pattern){
|
||||
return new SimpleDateFormat(pattern,Locale.CHINA).format(date);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class RewardAllModel extends BaseModel{
|
||||
@SerializedName("gold")
|
||||
private String gold;
|
||||
@SerializedName("experience")
|
||||
private String experience;
|
||||
|
||||
public String getGold() {
|
||||
return gold;
|
||||
}
|
||||
|
||||
public RewardAllModel setGold(String gold) {
|
||||
this.gold = gold;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getExperience() {
|
||||
return experience;
|
||||
}
|
||||
|
||||
public RewardAllModel setExperience(String experience) {
|
||||
this.experience = experience;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class TaskModel extends BaseModel{
|
||||
@SerializedName("uid")
|
||||
private String uid;
|
||||
@SerializedName("attent")
|
||||
private String attent;
|
||||
@SerializedName("illumine")
|
||||
private String illumine;
|
||||
@SerializedName("sendgift")
|
||||
private String sendgift;
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public TaskModel setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAttent() {
|
||||
return attent;
|
||||
}
|
||||
|
||||
public TaskModel setAttent(String attent) {
|
||||
this.attent = attent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIllumine() {
|
||||
return illumine;
|
||||
}
|
||||
|
||||
public TaskModel setIllumine(String illumine) {
|
||||
this.illumine = illumine;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSendgift() {
|
||||
return sendgift;
|
||||
}
|
||||
|
||||
public TaskModel setSendgift(String sendgift) {
|
||||
this.sendgift = sendgift;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,6 @@ import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/14.
|
||||
@@ -58,30 +56,8 @@ public class UserBean implements Parcelable {
|
||||
private String mobile;
|
||||
private String front_task;
|
||||
private String is_admin;
|
||||
@SerializedName("user_love_num")
|
||||
private int praise;
|
||||
//是否隐藏
|
||||
private boolean isHide = false;
|
||||
//是否为随机PK,仅在主播PK时使用
|
||||
private boolean randomPk;
|
||||
//随机天梯排位赛PK img,仅在主播PK时使用
|
||||
private String mRankPkImgUrl;
|
||||
|
||||
public boolean isRandomPk() {
|
||||
return randomPk;
|
||||
}
|
||||
|
||||
public void setRandomPk(boolean randomPk) {
|
||||
this.randomPk = randomPk;
|
||||
}
|
||||
|
||||
public String getRankPkImgUrl() {
|
||||
return mRankPkImgUrl;
|
||||
}
|
||||
|
||||
public void setRankPkImgUrl(String mRankPkImgUrl) {
|
||||
this.mRankPkImgUrl = mRankPkImgUrl;
|
||||
}
|
||||
|
||||
public boolean isHide() {
|
||||
return isHide;
|
||||
@@ -117,9 +93,6 @@ public class UserBean implements Parcelable {
|
||||
}
|
||||
|
||||
public String getIs_bind() {
|
||||
if(StringUtil.isEmpty(is_bind)){
|
||||
is_bind="0";
|
||||
}
|
||||
return is_bind;
|
||||
}
|
||||
|
||||
@@ -390,14 +363,6 @@ public class UserBean implements Parcelable {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int getPraise() {
|
||||
return praise;
|
||||
}
|
||||
|
||||
public void setPraise(int praise) {
|
||||
this.praise = praise;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WishListModel extends BaseModel {
|
||||
@SerializedName("wishList")
|
||||
private List<WishModel> wishList;
|
||||
@SerializedName("img")
|
||||
private String img;
|
||||
|
||||
public List<WishModel> getWishList() {
|
||||
return wishList;
|
||||
}
|
||||
|
||||
public WishListModel setWishList(List<WishModel> wishList) {
|
||||
this.wishList = wishList;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public WishListModel setImg(String img) {
|
||||
this.img = img;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class WishModel extends BaseModel {
|
||||
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("dtime")
|
||||
private String dtime;
|
||||
@SerializedName("luid")
|
||||
private String luid;
|
||||
@SerializedName("lid")
|
||||
private String lid;
|
||||
@SerializedName("wishlist_icon")
|
||||
private String wishlistIcon;
|
||||
@SerializedName("wishlist_num")
|
||||
private String wishlistNum;
|
||||
@SerializedName("wishlist_progress")
|
||||
private String wishlistProgress;
|
||||
@SerializedName("wishlist_name")
|
||||
private String wishlistName;
|
||||
@SerializedName("create_time")
|
||||
private String createTime;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public WishModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDtime() {
|
||||
return dtime;
|
||||
}
|
||||
|
||||
public WishModel setDtime(String dtime) {
|
||||
this.dtime = dtime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLuid() {
|
||||
return luid;
|
||||
}
|
||||
|
||||
public WishModel setLuid(String luid) {
|
||||
this.luid = luid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLid() {
|
||||
return lid;
|
||||
}
|
||||
|
||||
public WishModel setLid(String lid) {
|
||||
this.lid = lid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWishlistIcon() {
|
||||
return wishlistIcon;
|
||||
}
|
||||
|
||||
public WishModel setWishlistIcon(String wishlistIcon) {
|
||||
this.wishlistIcon = wishlistIcon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWishlistNum() {
|
||||
return wishlistNum;
|
||||
}
|
||||
|
||||
public WishModel setWishlistNum(String wishlistNum) {
|
||||
this.wishlistNum = wishlistNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWishlistProgress() {
|
||||
return wishlistProgress;
|
||||
}
|
||||
|
||||
public WishModel setWishlistProgress(String wishlistProgress) {
|
||||
this.wishlistProgress = wishlistProgress;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWishlistName() {
|
||||
return wishlistName;
|
||||
}
|
||||
|
||||
public WishModel setWishlistName(String wishlistName) {
|
||||
this.wishlistName = wishlistName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public WishModel setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,13 @@ import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
|
||||
@@ -37,7 +34,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
||||
} else {
|
||||
mRootView = LayoutInflater.from(mContext).inflate(getLayoutId(), null);
|
||||
}
|
||||
Dialog dialog = new Dialog(mContext, getDialogStyle());
|
||||
final Dialog dialog = new Dialog(mContext, getDialogStyle());
|
||||
dialog.setContentView(mRootView);
|
||||
dialog.setCancelable(canCancel());
|
||||
dialog.setCanceledOnTouchOutside(canCancel());
|
||||
@@ -77,12 +74,4 @@ public abstract class AbsDialogFragment extends DialogFragment {
|
||||
return ClickUtil.canClick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
|
||||
try {
|
||||
super.show(manager, tag);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
import static com.yunbao.common.CommonAppContext.lang;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@@ -16,14 +12,30 @@ import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.event.InstructorOperationEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_cn;
|
||||
import static com.yunbao.common.CommonAppContext.home_zdy_img_us;
|
||||
import static com.yunbao.common.CommonAppContext.lang;
|
||||
|
||||
public class InstructorOperationDialog extends AbsDialogFragment {
|
||||
|
||||
@Override
|
||||
@@ -84,16 +96,40 @@ public class InstructorOperationDialog extends AbsDialogFragment {
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
ImageView to_msg = mRootView.findViewById(R.id.to_msg);
|
||||
if (lang.equals("english")) {
|
||||
ImgLoader.display(mContext, home_zdy_img_us, to_msg);
|
||||
} else {
|
||||
ImgLoader.display(mContext, home_zdy_img_cn, to_msg);
|
||||
if(lang.equals("english")){
|
||||
ImgLoader.display(mContext,home_zdy_img_us, to_msg);
|
||||
}else{
|
||||
ImgLoader.display(mContext,home_zdy_img_cn, to_msg);
|
||||
}
|
||||
|
||||
|
||||
mRootView.findViewById(R.id.to_msg).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("82nzkz");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("82nzkz", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_director_enter", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_director_enter");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("ykpmj8");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("ykpmj8", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_director_message_box", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_director_message_box");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
EventBus.getDefault().post(new InstructorOperationEvent());
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
public class AnchorInfoEvent {
|
||||
protected boolean clear;
|
||||
protected String id;
|
||||
protected String userNiceName;
|
||||
protected String avatar;
|
||||
|
||||
public AnchorInfoEvent(boolean clears,String ids, String userNiceNames,String avatars) {
|
||||
clear = clears;
|
||||
id = ids;
|
||||
userNiceName = userNiceNames;
|
||||
avatar = avatars;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserNiceName() {
|
||||
return userNiceName;
|
||||
}
|
||||
|
||||
public void setUserNiceName(String userNiceName) {
|
||||
this.userNiceName = userNiceName;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public boolean isClear() {
|
||||
return clear;
|
||||
}
|
||||
|
||||
public void setClear(boolean clear) {
|
||||
this.clear = clear;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@ public class CoinChangeEvent {
|
||||
private String goldCoinNum;
|
||||
private boolean chargeSuccess;
|
||||
|
||||
|
||||
public CoinChangeEvent(String coin) {
|
||||
this.coin = coin;
|
||||
}
|
||||
@@ -20,8 +19,7 @@ public class CoinChangeEvent {
|
||||
this.coin = coin;
|
||||
this.chargeSuccess = chargeSuccess;
|
||||
}
|
||||
|
||||
public CoinChangeEvent(String coin, String goldCoinNum, boolean chargeSuccess) {
|
||||
public CoinChangeEvent(String coin,String goldCoinNum, boolean chargeSuccess) {
|
||||
this.coin = coin;
|
||||
this.goldCoinNum = goldCoinNum;
|
||||
this.chargeSuccess = chargeSuccess;
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class CustomDrawerPopupEvent extends BaseModel {
|
||||
//是否关闭弹窗
|
||||
private boolean isDisMiss = false;
|
||||
//权益的名字
|
||||
private String rightsInterests = "";
|
||||
//活动的id
|
||||
private int activityId = 0;
|
||||
//跳转网页地址
|
||||
private String htmlUrl;
|
||||
//是否半屏展示
|
||||
private boolean screen = false;
|
||||
//系统消息
|
||||
private boolean systemNotice = false;
|
||||
//在线客服
|
||||
private boolean online = false;
|
||||
//举报
|
||||
private boolean reportLayout = false;
|
||||
//刷新
|
||||
private boolean refresh = false;
|
||||
|
||||
public boolean isRefresh() {
|
||||
return refresh;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setRefresh(boolean refresh) {
|
||||
this.refresh = refresh;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSystemNotice() {
|
||||
return systemNotice;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setSystemNotice(boolean systemNotice) {
|
||||
this.systemNotice = systemNotice;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isOnline() {
|
||||
return online;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setOnline(boolean online) {
|
||||
this.online = online;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isReportLayout() {
|
||||
return reportLayout;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setReportLayout(boolean reportLayout) {
|
||||
this.reportLayout = reportLayout;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getHtmlUrl() {
|
||||
return htmlUrl;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setHtmlUrl(String htmlUrl) {
|
||||
this.htmlUrl = htmlUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isScreen() {
|
||||
return screen;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setScreen(boolean screen) {
|
||||
this.screen = screen;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setActivityId(int activityId) {
|
||||
this.activityId = activityId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRightsInterests() {
|
||||
return rightsInterests;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setRightsInterests(String rightsInterests) {
|
||||
this.rightsInterests = rightsInterests;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDisMiss() {
|
||||
return isDisMiss;
|
||||
}
|
||||
|
||||
public CustomDrawerPopupEvent setDisMiss(boolean disMiss) {
|
||||
isDisMiss = disMiss;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
/**
|
||||
* 全服通知
|
||||
*/
|
||||
public class CustomFullServiceNotifyEvent extends BaseModel {
|
||||
|
||||
@SerializedName("_method_")
|
||||
private String method;
|
||||
@SerializedName("action")
|
||||
private String action;
|
||||
@SerializedName("content")//内容
|
||||
private String content;
|
||||
@SerializedName("duration")//展示时长 单位秒
|
||||
private int duration;
|
||||
@SerializedName("img")//图片路径
|
||||
private String img;
|
||||
@SerializedName("msgtype")
|
||||
private String msgtype;
|
||||
@SerializedName("type")//通知类型 1 图片通知 2文字通知
|
||||
private int type;
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public CustomFullServiceNotifyEvent setMethod(String method) {
|
||||
this.method = method;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public CustomFullServiceNotifyEvent setAction(String action) {
|
||||
this.action = action;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public CustomFullServiceNotifyEvent setContent(String content) {
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public CustomFullServiceNotifyEvent setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public CustomFullServiceNotifyEvent setImg(String img) {
|
||||
this.img = img;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsgtype() {
|
||||
return msgtype;
|
||||
}
|
||||
|
||||
public CustomFullServiceNotifyEvent setMsgtype(String msgtype) {
|
||||
this.msgtype = msgtype;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public CustomFullServiceNotifyEvent setType(int type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.VideoBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class JavascriptInterfaceEvent extends BaseModel {
|
||||
private String method = "";
|
||||
private String svg = "";
|
||||
private String postsId = "";
|
||||
private String isClose;
|
||||
private List<VideoBean> videoBeanList = new ArrayList<>();
|
||||
private int position;
|
||||
private String liveId;
|
||||
private String userId;
|
||||
private int indexInto;
|
||||
private String productId;
|
||||
private String orderNumber;
|
||||
private String moneyUsd;
|
||||
private boolean isUpdataUser;
|
||||
private String data;
|
||||
private String name;
|
||||
private String image;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setImage(String image) {
|
||||
this.image = image;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setData(String data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isUpdataUser() {
|
||||
return isUpdataUser;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setUpdataUser(boolean updataUser) {
|
||||
isUpdataUser = updataUser;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setProductId(String productId) {
|
||||
this.productId = productId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getOrderNumber() {
|
||||
return orderNumber;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setOrderNumber(String orderNumber) {
|
||||
this.orderNumber = orderNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMoneyUsd() {
|
||||
return moneyUsd;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setMoneyUsd(String moneyUsd) {
|
||||
this.moneyUsd = moneyUsd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIndexInto() {
|
||||
return indexInto;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setIndexInto(int indexInto) {
|
||||
this.indexInto = indexInto;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLiveId() {
|
||||
return liveId;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setLiveId(String liveId) {
|
||||
this.liveId = liveId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<VideoBean> getVideoBeanList() {
|
||||
return videoBeanList;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setVideoBeanList(List<VideoBean> videoBeanList) {
|
||||
this.videoBeanList = videoBeanList;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setPosition(int position) {
|
||||
this.position = position;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsClose() {
|
||||
return isClose;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setIsClose(String isClose) {
|
||||
this.isClose = isClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPostsId() {
|
||||
return postsId;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setPostsId(String postsId) {
|
||||
this.postsId = postsId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSvg() {
|
||||
return svg;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setSvg(String svg) {
|
||||
this.svg = svg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public JavascriptInterfaceEvent setMethod(String method) {
|
||||
this.method = method;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class LivePushRyEvent extends BaseModel {
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class LiveRobotMessageEvent extends BaseModel {
|
||||
private int index = -1;
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public LiveRobotMessageEvent setIndex(int index) {
|
||||
this.index = index;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class LiveRobotSayHelloEvent extends BaseModel {
|
||||
private int index = -1;
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public LiveRobotSayHelloEvent setIndex(int index) {
|
||||
this.index = index;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class ImgLoader {
|
||||
private static final boolean SKIP_MEMORY_CACHE = true;
|
||||
|
||||
private static BlurTransformation sBlurTransformation;
|
||||
private final static float thumbnail = 1.0f;
|
||||
private final static float thumbnail = 0.1f;
|
||||
|
||||
static {
|
||||
sBlurTransformation = new BlurTransformation(25);
|
||||
@@ -70,7 +70,7 @@ public class ImgLoader {
|
||||
}
|
||||
RequestBuilder<Drawable> builder = Glide.with(context)
|
||||
.load(url)
|
||||
|
||||
|
||||
.thumbnail(thumbnail)
|
||||
.placeholder(imageView.getDrawable());
|
||||
if (width != -1 && height != -1) {
|
||||
@@ -86,21 +86,7 @@ public class ImgLoader {
|
||||
Glide.with(context)
|
||||
.asDrawable()
|
||||
.load(url)
|
||||
|
||||
.thumbnail(thumbnail)
|
||||
.placeholder(imageView.getDrawable())
|
||||
.dontAnimate()
|
||||
.skipMemoryCache(SKIP_MEMORY_CACHE)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
public static void display2(Context context, Drawable drawable, ImageView imageView) {
|
||||
if (!contextIsExist(context)) {
|
||||
return;
|
||||
}
|
||||
Glide.with(context)
|
||||
.asDrawable()
|
||||
.load(drawable)
|
||||
|
||||
.thumbnail(thumbnail)
|
||||
.placeholder(imageView.getDrawable())
|
||||
.dontAnimate()
|
||||
@@ -155,7 +141,7 @@ public class ImgLoader {
|
||||
RequestBuilder<Drawable> builder = Glide.with(context)
|
||||
.load(url)
|
||||
.thumbnail(thumbnail)
|
||||
|
||||
|
||||
.error(R.mipmap.icon_avatar_placeholder);
|
||||
if (width != -1 && height != -1) {
|
||||
builder = builder.override(width, height);
|
||||
@@ -178,7 +164,7 @@ public class ImgLoader {
|
||||
Glide.with(context)
|
||||
.asDrawable()
|
||||
.load(file)
|
||||
|
||||
|
||||
.thumbnail(thumbnail)
|
||||
.skipMemoryCache(SKIP_MEMORY_CACHE)
|
||||
.into(imageView);
|
||||
@@ -191,7 +177,7 @@ public class ImgLoader {
|
||||
Glide.with(context)
|
||||
.asDrawable()
|
||||
.load(res)
|
||||
|
||||
|
||||
.thumbnail(thumbnail)
|
||||
.skipMemoryCache(SKIP_MEMORY_CACHE)
|
||||
.into(imageView);
|
||||
@@ -239,7 +225,6 @@ public class ImgLoader {
|
||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||
if (callback != null) {
|
||||
callback.onLoadSuccess(resource);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ public class API extends BaseApi {
|
||||
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
OkHttpClient.Builder builder = new OkHttpClient()
|
||||
.newBuilder()
|
||||
|
||||
.addInterceptor(initQuery(isNeedUid,CommonAppContext.sInstance.getApplicationContext()))
|
||||
.addInterceptor(loggingInterceptor);
|
||||
|
||||
return create(builder.build(),
|
||||
GsonConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
@@ -17,9 +17,7 @@ import com.yunbao.common.activity.ErrorActivity;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.APKManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
@@ -192,32 +190,6 @@ public class CommonHttpUtil {
|
||||
if (obj.containsKey("is_chat")) {
|
||||
IMLoginManager.get(context).initChat(String.valueOf(obj.getInteger("is_chat")));
|
||||
}
|
||||
if (obj.containsKey("level_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("level_new");
|
||||
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("levelanchor_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("levelanchor_new");
|
||||
new NewLevelManager(context).UpAnchorDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
if (obj.containsKey("apk_ver")) {
|
||||
APKManager.get().setApkVer(obj.getString("apk_ver"));
|
||||
}
|
||||
if (obj.containsKey("apk_url")) {
|
||||
APKManager.get().setAPKUrl(obj.getString("apk_url"));
|
||||
}
|
||||
if (obj.containsKey("apk_des")) {
|
||||
APKManager.get().setAPKDes(obj.getString("apk_des"));
|
||||
}
|
||||
if (obj.containsKey("google_isup")) {
|
||||
APKManager.get().setAPKGoogleIsUp(obj.getInteger("google_isup"));
|
||||
}
|
||||
if (obj.containsKey("isup")) {
|
||||
APKManager.get().setAPKIsUp(obj.getInteger("isup"));
|
||||
}
|
||||
if (obj.containsKey("clarity")) {
|
||||
IMLoginManager.get(context).setClarity(obj.getString("clarity"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||
@@ -439,14 +411,14 @@ public class CommonHttpUtil {
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
}
|
||||
//
|
||||
// //埋点唯一性
|
||||
// public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
||||
// HttpClient.getInstance().get("Tx.setAdvertisingChannels", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
// .params("operation", operation)
|
||||
// .params("marking", Adjust.getAdid())
|
||||
// .execute(callback);
|
||||
// }
|
||||
|
||||
//埋点唯一性
|
||||
public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Tx.setAdvertisingChannels", CommonHttpConsts.GET_USER_BASEINFO)
|
||||
.params("operation", operation)
|
||||
.params("marking", Adjust.getAdid())
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,28 +3,16 @@ package com.yunbao.common.http;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.HourRank;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||
import com.yunbao.common.bean.NewPeopleInfo;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.RandomPkUserBean;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.SlideInBannerModel;
|
||||
@@ -32,7 +20,6 @@ import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -40,7 +27,6 @@ import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
/**
|
||||
* PDLive网络接口访问
|
||||
@@ -183,10 +169,10 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<List<ActiveModel>>> getActiveList();
|
||||
|
||||
/**
|
||||
* 获取多人连麦列表
|
||||
* 获取活动
|
||||
*/
|
||||
@GET("/api/public/?service=live.getDrLm")
|
||||
Observable<ResponseModel<List<LinkMicUserBeanV2>>> getDrLm(@Query("uid") String uid);
|
||||
Observable<ResponseModel<List<ActiveModel>>> getDrLm();
|
||||
|
||||
/**
|
||||
* 获取日榜、周榜数据
|
||||
@@ -250,8 +236,7 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<NobleRankHideUserListModel>> getNobleRankHideUserList();
|
||||
|
||||
/**
|
||||
* 获取当前星级
|
||||
*
|
||||
*获取当前星级
|
||||
* @param liveUid
|
||||
* @return
|
||||
*/
|
||||
@@ -263,278 +248,4 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getLiveRoomActivtyBanner")
|
||||
Observable<ResponseModel<List<LiveRoomActivityBanner>>> getLiveRoomActivityBanner();
|
||||
|
||||
/**
|
||||
* 新侧边栏请求
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getCustomSidebarInfo")
|
||||
Observable<ResponseModel<List<CustomSidebarInfoModel>>> getCustomSidebarInfo();
|
||||
|
||||
/**
|
||||
* 任务领取接口
|
||||
*/
|
||||
@GET("/api/public/?service=Task.sendTaskGift")
|
||||
Observable<ResponseModel<List<Observable>>> sendTaskGift(@Query("flag") String flag, @Query("type") String type);
|
||||
|
||||
/**
|
||||
* PK排位赛接口
|
||||
*/
|
||||
@GET("/api/public/?service=Ranking.getAnchorRankData")
|
||||
Observable<ResponseModel<PkRankBean>> getPkRanksList(@Query("anchor_id") String anchorId, @Query("anchor_id2") String pkUid);
|
||||
|
||||
/**
|
||||
* 多人连麦-创建房间
|
||||
*/
|
||||
@GET("/api/public/?service=Live.createDrLm")
|
||||
Observable<ResponseModel<BaseModel>> createDrLm();
|
||||
|
||||
/**
|
||||
* 多人连麦-关闭房间
|
||||
*/
|
||||
@GET("/api/public/?service=Live.delDrLm")
|
||||
Observable<ResponseModel<BaseModel>> delDrLm();
|
||||
|
||||
/**
|
||||
* 多人连麦-踢出用户
|
||||
*
|
||||
* @param uid 对方uid
|
||||
* @param roomId 当前房间号
|
||||
*/
|
||||
@GET("/api/public/?service=Live.killDrLm")
|
||||
Observable<ResponseModel<BaseModel>> killDrLm(@Query("uid") String uid, @Query("roomid") String roomId);
|
||||
|
||||
/**
|
||||
* 新进入房间接口
|
||||
*
|
||||
* @param groupId 房间名 g+liveUid
|
||||
* @param stream
|
||||
* @param liveUid
|
||||
* @param city
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Live.enterRoomNew")
|
||||
Observable<ResponseModel<EnterRoomNewModel>> enterRoomNew(
|
||||
@Query("GroupId") String groupId,
|
||||
@Query("stream") String stream,
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("city") String city
|
||||
);
|
||||
|
||||
/**
|
||||
* 检查直播间状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/api/public/?service=Live.checkLive")
|
||||
Observable<ResponseModel<List<CheckLiveModel>>> checkLive(
|
||||
@Query("liveuid") String liveUid,
|
||||
@Query("stream") String stream
|
||||
);
|
||||
|
||||
/**
|
||||
* 加入房间推送Im欢迎语
|
||||
*/
|
||||
@GET("/api/public/?service=Tx.userJoinRoomNew")
|
||||
Observable<ResponseModel<String>> userJoinRoomNew(
|
||||
@Query("GroupId") String GroupId,
|
||||
@Query("stream") String stream
|
||||
);
|
||||
|
||||
/**
|
||||
* 加入房间推送Im欢迎语
|
||||
*/
|
||||
@GET("/api/public/?service=Tx.leaveRoomNew")
|
||||
Observable<ResponseModel<List<Object>>> leaveRoomNew(
|
||||
@Query("GroupId") String GroupId,
|
||||
@Query("stream") String stream
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取随机PK开关
|
||||
*
|
||||
* @return 1=开,0=关
|
||||
*/
|
||||
@GET("/api/public/?service=Livepk.getRandomPKType")
|
||||
Observable<ResponseModel<List<Integer>>> getRandomPkSwitch();
|
||||
|
||||
/**
|
||||
* 设置随机PK开关
|
||||
*
|
||||
* @param pk 1=开,0=关
|
||||
*/
|
||||
@GET("/api/public/?service=Livepk.setRandomPKType")
|
||||
Observable<ResponseModel<List<BaseModel>>> changeRandomPkSwitch(@Query("random_pk") int pk);
|
||||
|
||||
/**
|
||||
* 获取自由PK次数
|
||||
*/
|
||||
@GET("/api/public/?service=Livepk.getActivePkNum")
|
||||
Observable<ResponseModel<Integer>> getFreePkNumber();
|
||||
|
||||
/**
|
||||
* 发起随机PK
|
||||
*/
|
||||
@GET("/api/public/?service=Livepk.setRandomPK")
|
||||
Observable<ResponseModel<String>> randomPK();
|
||||
|
||||
/**
|
||||
* 随机PK后调用接口给后台记录
|
||||
*/
|
||||
@GET("/api/public/?service=Livepk.startRandomPK")
|
||||
Observable<ResponseModel<BaseModel>> startRandomPK(@Query("pkuid") String pkuid);
|
||||
|
||||
/**
|
||||
* 自由PK开始后调用接口扣掉次数
|
||||
*/
|
||||
@GET("/api/public/?service=Livepk.setActivePkNum")
|
||||
Observable<ResponseModel<BaseModel>> setFreePkNum();
|
||||
|
||||
/**
|
||||
* 随机PK搜索用户
|
||||
*
|
||||
* @param cs 简体关键字/uid
|
||||
* @param ct 繁体关键字/uid
|
||||
*/
|
||||
@GET("/api/public/?service=Livepk.searchUser")
|
||||
Observable<ResponseModel<List<RandomPkUserBean>>> randomPkSearchUser(@Query("jian_key") String cs, @Query("fan_key") String ct);
|
||||
|
||||
/**
|
||||
* 拒绝随机PK
|
||||
*/
|
||||
@GET("/api/public/?service=Livepk.setBanRandomPK")
|
||||
Observable<ResponseModel<BaseModel>> setBanRandomPK();
|
||||
|
||||
/**
|
||||
* 拒绝随机PK
|
||||
*/
|
||||
@GET("/api/public/?service=Ranking.getRankingInfo")
|
||||
Observable<ResponseModel<RankPkInfoBean>> getRankingInfo();
|
||||
|
||||
/**
|
||||
* 获取转盘整蛊列表
|
||||
*/
|
||||
@GET("/api/public/?service=Prank.getAnchorPrankTurntable")
|
||||
Observable<ResponseModel<PrankHttpTurntableBean>> getAnchorPrankTurntable(
|
||||
@Query("anchor_id") String anchor_id
|
||||
);
|
||||
|
||||
/**
|
||||
* 提交整蛊
|
||||
*/
|
||||
@GET("/api/public/?service=Prank.setAnchorPrankTurntable")
|
||||
Observable<ResponseModel<List<BaseModel>>> setAnchorPrankTurntable(
|
||||
@Query("anchor_id") String anchor_id,
|
||||
@Query("coin") String coin,
|
||||
@Query("turntable_one") String turntable_one,
|
||||
@Query("turntable_two") String turntable_two,
|
||||
@Query("turntable_three") String turntable_three,
|
||||
@Query("turntable_four") String turntable_four,
|
||||
@Query("turntable_five") String turntable_five,
|
||||
@Query("turntable_six") String turntable_six,
|
||||
@Query("status") String status
|
||||
);
|
||||
|
||||
/**
|
||||
* 转盘整蛊结束后调用的接口
|
||||
*/
|
||||
@GET("/api/public/?service=Prank.endPrankTurntable")
|
||||
Observable<ResponseModel<List<BaseModel>>> endPrankTurntable(
|
||||
@Query("anchor_id") String anchor_id
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* 获取整蛊列表
|
||||
*/
|
||||
@GET("/api/public/?service=Prank.prankList")
|
||||
Observable<ResponseModel<List<PrankGiftBean>>> prankList(@Query("anchor_id") String anchor_id);
|
||||
|
||||
/**
|
||||
* 设置礼物整蛊
|
||||
*/
|
||||
@GET("/api/public/?service=Prank.setPrank")
|
||||
Observable<ResponseModel<List<BaseModel>>> setPrank(
|
||||
@Query("anchor_id") String anchor_id,
|
||||
@Query("gift_id") String gift_id,
|
||||
@Query("gift_num") String gift_num,
|
||||
@Query("prank_content") String prank_content
|
||||
);
|
||||
|
||||
/**
|
||||
* 删除礼物整蛊
|
||||
*/
|
||||
@GET("/api/public/?service=Prank.deletePrank")
|
||||
Observable<ResponseModel<List<BaseModel>>> deletePrank(
|
||||
@Query("anchor_id") String anchor_id,
|
||||
@Query("prank_index") String prank_index
|
||||
);
|
||||
|
||||
/**
|
||||
* 设置机器人开关
|
||||
*/
|
||||
@GET("/api/public/?service=Live.setAnchorAiState")
|
||||
Observable<ResponseModel<HttpCallbackModel>> setAnchorAiState(
|
||||
@Query("ai_state") String ai_state
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取机器人信息
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getAnchorAiState")
|
||||
Observable<ResponseModel<LiveAiRobotBean>> getAnchorAiState(
|
||||
);
|
||||
|
||||
/**
|
||||
* 修改机器人信息
|
||||
*/
|
||||
@GET("/api/public/?service=Live.setAnchorAiState")
|
||||
Observable<ResponseModel<Integer>> setAnchorAiState(
|
||||
@QueryMap Map<String, Object> map
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取机器人自定义话术
|
||||
*
|
||||
* @param type 1(自定义打招呼) 3(自定义求关注)
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getAiAutomaticSpeech")
|
||||
Observable<ResponseModel<List<LiveAiRobotBean.Message>>> getAiAutomaticSpeech(
|
||||
@Query("type") String type
|
||||
);
|
||||
|
||||
/**
|
||||
* 机器人添加话术
|
||||
*/
|
||||
@GET("/api/public/?service=Live.addAiAutomaticSpeech")
|
||||
Observable<ResponseModel<List<String>>> addAiAutomaticSpeech(
|
||||
@Query("type") String type,
|
||||
@Query("content") String content
|
||||
);
|
||||
|
||||
/**
|
||||
* 机器人删除话术
|
||||
*/
|
||||
@GET("/api/public/?service=Live.delAiAutomaticSpeech ")
|
||||
Observable<ResponseModel<List<String>>> delAiAutomaticSpeech(
|
||||
@Query("type") String type,
|
||||
@Query("id") String id
|
||||
);
|
||||
|
||||
/**
|
||||
* 机器人修改话术
|
||||
*/
|
||||
@GET("/api/public/?service=Live.updateAiAutomaticSpeech")
|
||||
Observable<ResponseModel<List<String>>> updateAiAutomaticSpeech(
|
||||
@Query("type") String type,
|
||||
@Query("id") String id,
|
||||
@Query("content") String content
|
||||
);
|
||||
|
||||
/**
|
||||
* 开播获取机器人状态和心愿单状态
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getLiveStetUpStatus")
|
||||
Observable<ResponseModel<LiveStetUpStatusModel>> getLiveStetUpStatus(
|
||||
@Query("liveuid") String liveUid
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.yunbao.common.http.base;
|
||||
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
|
||||
/**
|
||||
* 直播间类型返回
|
||||
*/
|
||||
public interface CheckLiveCallBack {
|
||||
/**
|
||||
* ;普通房
|
||||
*/
|
||||
void forwardNormalRoom(CheckLiveModel model);
|
||||
|
||||
/**
|
||||
* 密码房
|
||||
*/
|
||||
void forwardPwdRoom(CheckLiveModel model);
|
||||
|
||||
/**
|
||||
* 收费房
|
||||
*/
|
||||
void forwardPayRoom(CheckLiveModel model);
|
||||
|
||||
/**
|
||||
* 请求失败
|
||||
*
|
||||
* @param error
|
||||
*/
|
||||
void onError(String error);
|
||||
}
|
||||
@@ -2,44 +2,24 @@ package com.yunbao.common.http.live;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.PrankGiftBean;
|
||||
import com.yunbao.common.bean.PrankHttpTurntableBean;
|
||||
import com.yunbao.common.bean.RandomPkUserBean;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
@@ -83,7 +63,6 @@ public class LiveNetManager {
|
||||
if (callback != null)
|
||||
callback.onError(throwable.getMessage());
|
||||
}).isDisposed();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,6 +237,7 @@ public class LiveNetManager {
|
||||
|
||||
/**
|
||||
* 获取 【新人特惠】【趣味游戏】【幸运天使】
|
||||
*
|
||||
*/
|
||||
public void getLiveRoomActivityBanner(HttpCallback<List<LiveRoomActivityBanner>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
@@ -273,808 +253,4 @@ public class LiveNetManager {
|
||||
throwable.printStackTrace();
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新侧边数据
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void getCustomSidebarInfo(HttpCallback<List<CustomSidebarInfoModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getCustomSidebarInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> callback.onSuccess(listResponseModel.getData().getInfo()), throwable -> {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
throwable.printStackTrace();
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务领取接口
|
||||
*/
|
||||
public void sendTaskGift(String flag, HttpCallback<String> callback) {
|
||||
|
||||
API.get().pdLiveApi(mContext)
|
||||
.sendTaskGift(flag, "2")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(observableResponseModel -> {
|
||||
if (observableResponseModel.getData().getCode() == 0) {
|
||||
callback.onSuccess("");
|
||||
} else {
|
||||
callback.onError(observableResponseModel.getData().getMsg());
|
||||
}
|
||||
}, throwable -> callback.onError(throwable.getMessage())).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查直播间状态
|
||||
*
|
||||
* @param liveUid
|
||||
* @param stream
|
||||
* @param callBack
|
||||
*/
|
||||
public void checkLive(String liveUid, String stream, CheckLiveCallBack callBack) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.checkLive(liveUid, stream)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<CheckLiveModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<CheckLiveModel>> listResponseModel) throws Exception {
|
||||
if (listResponseModel.getData().getCode() == 0) {
|
||||
List<CheckLiveModel> checkLiveModels = listResponseModel.getData().getInfo();
|
||||
if (checkLiveModels.size() > 0) {
|
||||
CheckLiveModel liveModel = checkLiveModels.get(0);
|
||||
switch (liveModel.getType()) {
|
||||
case Constants.LIVE_TYPE_NORMAL:
|
||||
if (callBack != null) {
|
||||
callBack.forwardNormalRoom(liveModel);
|
||||
}
|
||||
break;
|
||||
case Constants.LIVE_TYPE_PWD:
|
||||
if (callBack != null) {
|
||||
callBack.forwardPwdRoom(liveModel);
|
||||
}
|
||||
break;
|
||||
case Constants.LIVE_TYPE_PAY:
|
||||
case Constants.LIVE_TYPE_TIME:
|
||||
if (callBack != null) {
|
||||
callBack.forwardPayRoom(liveModel);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (callBack != null) {
|
||||
callBack.onError(listResponseModel.getData().getMsg());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (callBack != null) {
|
||||
callBack.onError(listResponseModel.getData().getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callBack != null) {
|
||||
callBack.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新进入直播间接口
|
||||
*
|
||||
* @param stream
|
||||
* @param liveUid
|
||||
* @param city
|
||||
* @param callback
|
||||
*/
|
||||
private Disposable enterRoomDisposable = null;
|
||||
|
||||
public void enterRoomNew(String stream, String liveUid, String city, HttpCallback<EnterRoomNewModel> callback) {
|
||||
enterRoomDisposable = API.get().pdLiveApi(mContext)
|
||||
.enterRoomNew("g" + liveUid, stream, liveUid, city)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<EnterRoomNewModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<EnterRoomNewModel> enterRoomNewModelResponseModel) throws Exception {
|
||||
Log.e("进入房间", "enterRoomNew--------------------------------------------");
|
||||
enterRoomDisposable = null;
|
||||
if (callback != null) {
|
||||
callback.onSuccess(enterRoomNewModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
enterRoomDisposable = null;
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 加入房间推送IM消息
|
||||
*
|
||||
* @param stream
|
||||
* @param liveUid
|
||||
*/
|
||||
private Disposable userJoinDisposable = null;
|
||||
|
||||
public void userJoinRoomNew(String stream, String liveUid) {
|
||||
userJoinDisposable = API.get().pdLiveApi(mContext)
|
||||
.userJoinRoomNew("g" + liveUid, stream)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<String>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<String> stringResponseModel) throws Exception {
|
||||
Log.e("进入房间", "userJoinRoomNew--------------------------------------------");
|
||||
userJoinDisposable = null;
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
userJoinDisposable = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 离开直播间
|
||||
*
|
||||
* @param stream
|
||||
* @param liveUid
|
||||
*/
|
||||
public void leaveRoomNew(String stream, String liveUid, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.leaveRoomNew("g" + liveUid, stream)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<Object>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<Object>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(null);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取多人连麦用户列表
|
||||
*/
|
||||
public void getDRMicUserList(String uid, HttpCallback<List<LinkMicUserBean>> callback) {
|
||||
API.get().createPDLiveApi(false)
|
||||
.getDrLm(uid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<LinkMicUserBeanV2>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<LinkMicUserBeanV2>> listResponseModel) throws Exception {
|
||||
List<LinkMicUserBean> list = new ArrayList<>();
|
||||
for (LinkMicUserBeanV2 bean : listResponseModel.getData().getInfo()) {
|
||||
list.addAll(bean.getUserlist());
|
||||
for (LinkMicUserBean userBean : bean.getUserlist()) {
|
||||
Log.i("多人连麦", "list: " + userBean.toString());
|
||||
}
|
||||
}
|
||||
Log.i("多人连麦", "accept: " + list.size());
|
||||
if (callback != null) {
|
||||
callback.onSuccess(list);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
private Disposable randomPkApi;
|
||||
|
||||
/**
|
||||
* PK排位赛接口
|
||||
*/
|
||||
public void getRandomPk(String mLiveUid, String pkUid, HttpCallback<PkRankBean> callback) {
|
||||
randomPkApi = API.get().pdLiveApi(mContext)
|
||||
.getPkRanksList(mLiveUid, pkUid)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(listResponseModel -> {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取随机PK开关
|
||||
* 1=开,0=关
|
||||
*/
|
||||
public void getRandomPkSwitch(HttpCallback<Integer> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getRandomPkSwitch()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo().get(0));
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置随机PK开关
|
||||
*
|
||||
* @param pk 1=开,0=关
|
||||
* @param callback @{@link HttpCallbackModel#getCode()} 0=成功
|
||||
*/
|
||||
public void changeRandomPkSwitch(int pk, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.changeRandomPkSwitch(pk)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BaseModel>> responseModel) throws Exception {
|
||||
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(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自由PK次数
|
||||
*/
|
||||
public void getFreePkNumber(HttpCallback<Integer> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getFreePkNumber()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<Integer>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<Integer> responseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起随机PK
|
||||
*/
|
||||
public void randomPK(HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.randomPK()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<String>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<String> responseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 自由PK开始后调用接口扣掉次数
|
||||
*/
|
||||
public void setFreePkNum(HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setFreePkNum()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<BaseModel> responseModel) throws Exception {
|
||||
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 随机PK后调用接口给后台记录
|
||||
*/
|
||||
public void startRandomPK(String pkuid, HttpCallback<Boolean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.startRandomPK(pkuid)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<BaseModel> responseModel) throws Exception {
|
||||
if (responseModel.getData().getCode() == 0) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(true);
|
||||
}
|
||||
} else {
|
||||
callback.onSuccess(false);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 随机PK后调用接口给后台记录
|
||||
*
|
||||
* @param cs 简体关键字/uid
|
||||
* @param ct 繁体关键字/uid
|
||||
*/
|
||||
public void randomPkSearchUser(String cs, String ct, HttpCallback<List<RandomPkUserBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.randomPkSearchUser(cs, ct)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<List<RandomPkUserBean>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<RandomPkUserBean>> responseModel) throws Exception {
|
||||
if (responseModel.getData().getCode() == 0) {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 拒绝随机PK
|
||||
*/
|
||||
public void setBanRandomPK(HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setBanRandomPK()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<BaseModel> responseModel) throws Exception {
|
||||
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取随机排位赛信息
|
||||
*/
|
||||
public void getRankPkInfoBean(HttpCallback<RankPkInfoBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getRankingInfo()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<RankPkInfoBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<RankPkInfoBean> rankPkInfoBeanResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(rankPkInfoBeanResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转盘整蛊列表
|
||||
*/
|
||||
public void getAnchorPrankTurntable(String mLiveUid, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getAnchorPrankTurntable(mLiveUid)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交转盘整蛊
|
||||
*/
|
||||
public void setAnchorPrankTurntable(String mLiveUid, String coin,
|
||||
String turntable_one,
|
||||
String turntable_two,
|
||||
String turntable_three,
|
||||
String turntable_four,
|
||||
String turntable_five,
|
||||
String turntable_six,
|
||||
String status,
|
||||
HttpCallback<Object> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setAnchorPrankTurntable(mLiveUid,
|
||||
coin,
|
||||
turntable_one,
|
||||
turntable_two,
|
||||
turntable_three,
|
||||
turntable_four,
|
||||
turntable_five,
|
||||
turntable_six,
|
||||
status)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess("");
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转盘整蛊列表
|
||||
*/
|
||||
public void getPrankGiftList(String mLiveUid, HttpCallback<List<PrankGiftBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.prankList(mLiveUid)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼物整蛊
|
||||
*/
|
||||
public void setPrankGift(String mLiveUid, String gift_id, String gift_num, String prank_content, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setPrank(mLiveUid, gift_id, gift_num, prank_content)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(null);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除礼物整蛊
|
||||
*/
|
||||
public void deletePrankGift(String mLiveUid, String prank_index, HttpCallback<PrankHttpTurntableBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.deletePrank(mLiveUid, prank_index)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(null);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 整蛊结束
|
||||
*/
|
||||
public void endPrankTurntable(String mLiveUid, HttpCallback<BaseModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.endPrankTurntable(mLiveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(null);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
|
||||
}
|
||||
|
||||
public void getAiRobotStatus(HttpCallback<LiveAiRobotBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getAnchorAiState()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void setAiRobotStatus(String status, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setAnchorAiState(status)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(null);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void setAiRobotDate(String name, String value, HttpCallback<HttpCallbackModel> callback) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(name, value);
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setAnchorAiState(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(null);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getAiRobotBody(int type, HttpCallback<List<LiveAiRobotBean.Message>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getAiAutomaticSpeech(type + "")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void addAiRobotBody(int type, String content, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.addAiAutomaticSpeech(type + "", content)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void updateAiRobotBody(int type, int id, String content, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.updateAiAutomaticSpeech(type + "", id + "", content)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void delAiRobotBody(int type, int id, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.delAiAutomaticSpeech(type + "", id + "")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 开播设置数据获取
|
||||
*
|
||||
* @param liveUid
|
||||
* @param callback
|
||||
*/
|
||||
public void getLiveStetUpStatus(String liveUid, HttpCallback<LiveStetUpStatusModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveStetUpStatus(liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<LiveStetUpStatusModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<LiveStetUpStatusModel> liveStetUpStatusModelResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(liveStetUpStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
public void cancelLive() {
|
||||
if (userJoinDisposable != null) {
|
||||
userJoinDisposable.dispose();
|
||||
}
|
||||
if (enterRoomDisposable != null) {
|
||||
enterRoomDisposable.dispose();
|
||||
}
|
||||
if (randomPkApi != null) {
|
||||
randomPkApi.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||
import com.yunbao.common.utils.VersionUtil;
|
||||
|
||||
public class APKManager extends BaseCacheManager {
|
||||
private static APKManager manager;
|
||||
private final String APK_VER = "apk_ver";
|
||||
private final String APK_URL = "apk_url";
|
||||
private final String APK_DES = "apk_des";
|
||||
private final String APK_IS_UP = "isup";
|
||||
private final String APK_GOOGLE_IS_UP = "google_isup";
|
||||
|
||||
public APKManager(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单利
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static APKManager get() {
|
||||
if (null == manager) {
|
||||
manager = new APKManager(CommonAppContext.sInstance.getBaseContext());
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setAPKUrl(String apkUrl) {
|
||||
put(APK_URL, apkUrl);
|
||||
}
|
||||
|
||||
public void setAPKDes(String apkDes) {
|
||||
put(APK_DES, apkDes);
|
||||
}
|
||||
|
||||
public String getAPKUrl() {
|
||||
return getString(APK_URL);
|
||||
}
|
||||
|
||||
public String getAPKDes() {
|
||||
return getString(APK_DES);
|
||||
}
|
||||
|
||||
public void setApkVer(String apkVer) {
|
||||
put(APK_VER, apkVer);
|
||||
}
|
||||
|
||||
public boolean getApkVerNew() {
|
||||
|
||||
return VersionUtil.isLatest(getString(APK_VER));
|
||||
}
|
||||
|
||||
public void setAPKIsUp(int apkIsUp) {
|
||||
put(APK_IS_UP, apkIsUp);
|
||||
}
|
||||
|
||||
public void setAPKGoogleIsUp(int apkGoogleIsUp) {
|
||||
put(APK_GOOGLE_IS_UP, apkGoogleIsUp);
|
||||
}
|
||||
|
||||
public int getApkIsUp() {
|
||||
return getInt(APK_IS_UP, 0);
|
||||
}
|
||||
|
||||
public int getAPKGoogleIsUp() {
|
||||
return getInt(APK_GOOGLE_IS_UP, 0);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.DataUserInfoEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
@@ -26,55 +25,20 @@ import org.greenrobot.eventbus.EventBus;
|
||||
* 登录者信息管理
|
||||
*/
|
||||
public class IMLoginManager extends BaseCacheManager {
|
||||
private final String KEY_USER_INFO = "keyUserInfo";
|
||||
private final static String KEY_USER_INFO = "keyUserInfo";
|
||||
private static IMLoginManager manager;
|
||||
private IMLoginModel userInfo;
|
||||
private final String isNewUserGif = "isNewUserGif";
|
||||
private final String isNewUserOne = "isNewUserOne";
|
||||
private final String GiftEffect = "giftEffect";
|
||||
private final String MountEffect = "mountEffect";
|
||||
private final String IS_CHAT = "isChat";
|
||||
private final String IS_SLIDE = "isSlide";
|
||||
private final String IS_FLOAT = "is_float";
|
||||
private final String IS_HINT = "is_hint";
|
||||
private final String IS_HINT2 = "is_hint2";
|
||||
private final String SELECT_CLARITY = "selectClarity";
|
||||
private final String CLARITY = "clarity";
|
||||
private final static String isNewUserGif = "isNewUserGif";
|
||||
private final static String isNewUserOne = "isNewUserOne";
|
||||
private final static String GiftEffect = "giftEffect";
|
||||
private final static String MountEffect = "mountEffect";
|
||||
private final static String IS_CHAT = "isChat";
|
||||
private final static String IS_SLIDE = "isSlide";
|
||||
private final static String IS_FLOAT = "is_float";
|
||||
private final static String IS_HINT = "is_hint";
|
||||
private final static String IS_HINT2 = "is_hint2";
|
||||
|
||||
|
||||
public void setClarity(String clarity) {
|
||||
put(CLARITY, clarity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 1080p开播分辨率:clarity 0关闭 1开启
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean getClarity() {
|
||||
return TextUtils.equals(getString(CLARITY), "1");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置清晰度
|
||||
*
|
||||
* @param selectClarity
|
||||
*/
|
||||
public void setSelectClarity(int selectClarity) {
|
||||
put(SELECT_CLARITY, selectClarity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取清晰度
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getSelectClarity() {
|
||||
|
||||
return getInt(SELECT_CLARITY, 0);
|
||||
|
||||
}
|
||||
|
||||
public boolean isHint() {
|
||||
return 1 == getInt(IS_HINT, 0);
|
||||
}
|
||||
@@ -187,7 +151,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
*/
|
||||
public static IMLoginManager get(Context context) {
|
||||
if (null == manager) {
|
||||
manager = new IMLoginManager(CommonAppContext.sInstance.getBaseContext());
|
||||
manager = new IMLoginManager(context);
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
@@ -305,7 +269,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (info.length > 0 && userInfo != null) {
|
||||
if (info.length > 0) {
|
||||
if ("1".equals(info[0])) {
|
||||
userInfo.setIsAdmin("1");
|
||||
InstructorRemarkManager.get(context).getNetInstructorRemark();
|
||||
|
||||
@@ -1,261 +0,0 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import static cn.rongcloud.rtc.base.RTCErrorCode.JOIN_CHAT_ROOM_TIMEOUT;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import cn.rongcloud.rtc.api.RCRTCRemoteUser;
|
||||
import cn.rongcloud.rtc.api.RCRTCRoom;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCRoomEventsListener;
|
||||
import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
|
||||
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||
|
||||
/**
|
||||
* RTC管理类,负责管理申请、同意、拒绝PK
|
||||
*/
|
||||
public class IMRTCManager {
|
||||
private static IMRTCManager manager;
|
||||
private RCRTCRoom rtcRoom;
|
||||
private List<String> requestUid;
|
||||
|
||||
private IMRTCManager() {
|
||||
requestUid = new ArrayList<>();
|
||||
}
|
||||
|
||||
public static IMRTCManager getInstance() {
|
||||
if (manager == null) {
|
||||
manager = new IMRTCManager();
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setRtcRoom(RCRTCRoom rtcRoom) {
|
||||
this.rtcRoom = rtcRoom;
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应PK请求
|
||||
*
|
||||
* @param liveUid 对方房间号
|
||||
* @param agree 是否同意
|
||||
* @param extra 扩展参数
|
||||
* @param callback 回调
|
||||
*/
|
||||
public void responseJoinOtherRoom(String liveUid, boolean agree, String extra, IRCRTCResultCallback callback) {
|
||||
if (rtcRoom != null) {
|
||||
/*
|
||||
inviterRoomId - 邀请者所在房间 id,
|
||||
inviterUserId - 邀请者用户 id
|
||||
agree - 被邀请者是否同意连麦邀请
|
||||
inviteeAutoMix - 是否将被邀请者音视频资源发送到邀请人房间中合流
|
||||
1:inviteeAutoMix 为true时:
|
||||
1.1:如果邀请方在发送连麦请求之前发布了资源,当被邀请方加入邀请者房间成功后,服务器会把邀请方流资源合并到被邀请方视图(默认仅悬浮布局合流)上。
|
||||
1.2:如果邀请方在发送连麦请求之前没有发布资源,将会在邀请方发布资源成功后,服务器才会把邀请方的资源合并到被邀请方视图(默认仅悬浮布局合流)上。
|
||||
2: 无论为true或false,双方都可以使用RCRTCLiveInfo.setMixConfig(RCRTCMixConfig, IRCRTCResultCallback) 方法主动设置合流布局。一旦主动设置过合流布局,后续音视频直播过程中设置的自动合流参数将失效。
|
||||
extra - 扩展字段,默认为空
|
||||
*/
|
||||
rtcRoom.getLocalUser().responseJoinOtherRoom(liveUid, liveUid, agree, agree, extra, callback);
|
||||
} else {
|
||||
callback.onFailed(RTCErrorCode.RongRTCCodeIMError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请PK
|
||||
*
|
||||
* @param liveUid 对方房间号
|
||||
* @param inviterAutoMix 是否将邀请者音视频资源发送到被邀请人房间中合流
|
||||
* @param extra 扩展参数
|
||||
* @param callback 回调
|
||||
*/
|
||||
public void requestJoinOtherRoom(String liveUid, boolean inviterAutoMix, String extra, IRCRTCResultCallback callback) {
|
||||
if (requestUid.contains(liveUid)) {
|
||||
callback.onFailed(RTCErrorCode.RongRTCCodeJoinRepeatedRoom);
|
||||
return;
|
||||
}
|
||||
if (rtcRoom != null && rtcRoom.getLocalUser() != null) {
|
||||
/*
|
||||
inviteeRoomId - 被邀请者所在房间 id
|
||||
inviteeUserId - 被邀请用户 id
|
||||
inviterAutoMix - 是否将邀请者音视频资源发送到被邀请人房间中合流
|
||||
1: inviterAutoMix为true时:
|
||||
1.1:如果被邀请方在加入邀请方房间之前发布了资源,当被邀请方加入邀请者房间成功后,服务器会把被邀请方流资源合并到邀请方视图 ·(默认仅悬浮布局合流)上。
|
||||
1.2:如果被邀请方在加入邀请方房间之前没有发布过资源,将会在被邀请方发布资源成功后,服务器会把被邀请方流资源合并到邀请方视图(默认仅悬浮布局合流)上。
|
||||
2:无论为true或false,双方都可以使用RCRTCLiveInfo.setMixConfig(RCRTCMixConfig, IRCRTCResultCallback) 方法主动设置合流布局。一旦主动设置过合流布局,后续音视频直播过程中设置的自动合流参数将失效。
|
||||
extra - 扩展字段,默认为空
|
||||
*/
|
||||
rtcRoom.getLocalUser().requestJoinOtherRoom(liveUid, liveUid, inviterAutoMix, extra, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
callback.onSuccess();
|
||||
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||
ToastUtil.show("发起邀请成功");
|
||||
}
|
||||
requestUid.add(liveUid);
|
||||
startRequestTimeoutTask(liveUid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode errorCode) {
|
||||
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||
ToastUtil.show("邀请失败 " + errorCode.getValue());
|
||||
}
|
||||
if (RandomPkManager.getInstance().isRequestPk()) {
|
||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||
}
|
||||
requestUid.remove(liveUid);
|
||||
callback.onFailed(errorCode);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback.onFailed(RTCErrorCode.RongRTCCodeIMError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册监听对方通知类,还没搞清楚具体用法,先搁置
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
public void registerRoomListener(IRCRTCRoomEventsListener listener) {
|
||||
if (rtcRoom != null && rtcRoom.getLocalUser() != null) {
|
||||
rtcRoom.registerRoomListener(new IRCRTCRoomEventsListener() {
|
||||
@Override
|
||||
public void onRemoteUserPublishResource(RCRTCRemoteUser remoteUser, List<RCRTCInputStream> streams) {
|
||||
listener.onRemoteUserPublishResource(remoteUser, streams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUserMuteAudio(RCRTCRemoteUser remoteUser, RCRTCInputStream stream, boolean mute) {
|
||||
listener.onRemoteUserMuteAudio(remoteUser, stream, mute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUserMuteVideo(RCRTCRemoteUser remoteUser, RCRTCInputStream stream, boolean mute) {
|
||||
listener.onRemoteUserMuteVideo(remoteUser, stream, mute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUserUnpublishResource(RCRTCRemoteUser remoteUser, List<RCRTCInputStream> streams) {
|
||||
listener.onRemoteUserUnpublishResource(remoteUser, streams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserJoined(RCRTCRemoteUser remoteUser) {
|
||||
listener.onUserJoined(remoteUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserLeft(RCRTCRemoteUser remoteUser) {
|
||||
listener.onUserLeft(remoteUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserOffline(RCRTCRemoteUser remoteUser) {
|
||||
listener.onUserOffline(remoteUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPublishLiveStreams(List<RCRTCInputStream> streams) {
|
||||
listener.onPublishLiveStreams(streams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnpublishLiveStreams(List<RCRTCInputStream> streams) {
|
||||
listener.onUnpublishLiveStreams(streams);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消邀请
|
||||
*
|
||||
* @param liveUid 房间号
|
||||
* @param extra 扩展参数
|
||||
* @param callback 回调
|
||||
*/
|
||||
public void cancelRequestJoinOtherRoom(String liveUid, String extra, IRCRTCResultCallback callback) {
|
||||
if (rtcRoom != null && rtcRoom.getLocalUser() != null) {
|
||||
rtcRoom.getLocalUser().cancelRequestJoinOtherRoom(liveUid, liveUid, extra, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode errorCode) {
|
||||
callback.onFailed(errorCode);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback.onFailed(RTCErrorCode.RongRTCCodeIMError);
|
||||
}
|
||||
}
|
||||
|
||||
public void callPkSuccess(String liveUid) {
|
||||
requestUid.remove(liveUid);
|
||||
}
|
||||
|
||||
private void startRequestTimeoutTask(String liveUid) {
|
||||
new Timer().schedule(new TimerTask() {
|
||||
int waitTime = 15;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!requestUid.contains(liveUid)) {
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
if (waitTime-- == 0) {
|
||||
//callback.onFailed(JOIN_CHAT_ROOM_TIMEOUT);
|
||||
cancelRequestJoinOtherRoom(liveUid, "extra", new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
requestUid.remove(liveUid);
|
||||
if (RandomPkManager.getInstance().isRandomModel()) {
|
||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode errorCode) {
|
||||
requestUid.remove(liveUid);
|
||||
if (RandomPkManager.getInstance().isRandomModel()) {
|
||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||
}
|
||||
}
|
||||
});
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
}, 1000, 1000);
|
||||
}
|
||||
|
||||
public void leaveOtherRoom(String roomId,
|
||||
boolean notifyFinished,
|
||||
IRCRTCResultCallback callBack) {
|
||||
RCRTCEngine.getInstance().leaveOtherRoom(roomId, notifyFinished, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
callBack.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode rtcErrorCode) {
|
||||
callBack.onFailed(rtcErrorCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新粉丝牌管理
|
||||
*/
|
||||
public class NewLevelManager extends BaseCacheManager {
|
||||
private final String KEY_USER_LEVEL = "keyUserLevel";
|
||||
private final String KEY_ANCHOR_LEVEL = "keyAnchorLevel";
|
||||
private List<NewLevelModel> newLevelModels = new ArrayList<>();
|
||||
private List<NewLevelModel> keyAnchorLevel = new ArrayList<>();
|
||||
|
||||
public NewLevelManager(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存等级图标
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
public void UpDataLevel(String json) {
|
||||
newLevelModels = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
|
||||
}.getType());
|
||||
put(KEY_USER_LEVEL, newLevelModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<NewLevelModel> getNewLevelModels() {
|
||||
return getList(KEY_USER_LEVEL, new TypeToken<List<NewLevelModel>>() {
|
||||
}.getType());
|
||||
}
|
||||
/**
|
||||
* 缓存等级图标
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
public void UpAnchorDataLevel(String json) {
|
||||
newLevelModels = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
|
||||
}.getType());
|
||||
put(KEY_ANCHOR_LEVEL, newLevelModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<NewLevelModel> getNewAnchorLevelModels() {
|
||||
return getList(KEY_ANCHOR_LEVEL, new TypeToken<List<NewLevelModel>>() {
|
||||
}.getType());
|
||||
}
|
||||
}
|
||||
@@ -1,469 +0,0 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.RankPkInfoBean;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* 随机PK管理类
|
||||
*/
|
||||
public class RandomPkManager {
|
||||
public final static int PK_STATUS_DEFAULT = -1;//默认状态,一般为为开始匹配
|
||||
public final static int PK_STATUS_REQUEST = 0;//已发出匹配请求
|
||||
public final static int PK_STATUS_START = 1;//匹配到用户
|
||||
public final static int PK_STATUS_CLOSE = 2;//PK结束
|
||||
public final static int PK_STATUS_REFUSE = 3;//对方拒绝
|
||||
public final static int PK_STATUS_EXIT_ING = 4;//退出匹配中
|
||||
|
||||
private static RandomPkManager manager;
|
||||
private int min = -1;//匹配计时器 分钟
|
||||
private int sec = -1;//匹配计时器 秒钟
|
||||
private int status = PK_STATUS_DEFAULT;
|
||||
private Timer timer;
|
||||
private TimerTask task;
|
||||
private final List<OnRandomPkTimer> randomPkTimer = new ArrayList<>();//监听器集合
|
||||
private String pkUid;//对方房间ID
|
||||
public static String debugUid;
|
||||
private RankPkInfoBean rankPkInfoBean;//排位赛信息
|
||||
private int exitTimer;//退出倒计时
|
||||
private TimerTask exitTask = null;//退出任务
|
||||
Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
private RandomPkManager() {
|
||||
getRankInfo();
|
||||
initTask();
|
||||
}
|
||||
|
||||
public static RandomPkManager getInstance() {
|
||||
if (manager == null) {
|
||||
manager = new RandomPkManager();
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加监听器
|
||||
*/
|
||||
public void addOnRandomPkTimer(OnRandomPkTimer randomPkTimer) {
|
||||
if (randomPkTimer != null) {
|
||||
this.randomPkTimer.add(randomPkTimer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除监听器
|
||||
*/
|
||||
public void unregisterOnRandomPkTimer(OnRandomPkTimer randomPkTimer) {
|
||||
if (randomPkTimer != null) {
|
||||
this.randomPkTimer.remove(randomPkTimer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化参数
|
||||
*/
|
||||
private void initVal() {
|
||||
min = -1;
|
||||
sec = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化任务
|
||||
*/
|
||||
private void initTask() {
|
||||
if (task != null) {
|
||||
return;
|
||||
}
|
||||
task = new TimerTask() {
|
||||
boolean isStartPk = false;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
sec++;
|
||||
if (sec % 60 == 0) {
|
||||
min++;
|
||||
sec = 0;
|
||||
}
|
||||
handler.post(() -> {
|
||||
for (OnRandomPkTimer onRandomPkTimer : randomPkTimer) {
|
||||
onRandomPkTimer.onTimer(String.format(Locale.CHINA, "%02d:%02d", min, sec));
|
||||
}
|
||||
if (!isStartPk) {
|
||||
nextPk();
|
||||
isStartPk = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化匹配时间
|
||||
*/
|
||||
public String getTimer() {
|
||||
return String.format(Locale.CHINA, "%02d:%02d", min, sec);
|
||||
}
|
||||
|
||||
private Runnable pkRunnable = this::next;
|
||||
|
||||
/**
|
||||
* 对方拒绝,开始下一轮匹配
|
||||
*/
|
||||
private void nextPk() {
|
||||
if (status != PK_STATUS_DEFAULT && status != PK_STATUS_REFUSE) {
|
||||
return;
|
||||
}
|
||||
handler.postDelayed(pkRunnable, 5000);
|
||||
}
|
||||
|
||||
private void next() {
|
||||
if (task == null) {
|
||||
return;
|
||||
}
|
||||
status = PK_STATUS_REQUEST;
|
||||
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||
.randomPK(new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
try {
|
||||
Integer.parseInt(data);//检测返回的data是否为数字uid,不是的话开始下一轮
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
status = PK_STATUS_DEFAULT;
|
||||
nextPk();
|
||||
return;
|
||||
}
|
||||
pkUid = data;
|
||||
if (debugUid != null) {
|
||||
pkUid = data = debugUid;
|
||||
}
|
||||
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||
pkTimer.onStartPK(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为排位赛模式
|
||||
*/
|
||||
public boolean isRankModel() {
|
||||
return rankPkInfoBean != null && rankPkInfoBean.isRankPKTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为随机PK模式
|
||||
*/
|
||||
public boolean isRandomModel() {
|
||||
boolean isRandom = status == PK_STATUS_START || status == PK_STATUS_REQUEST || status == PK_STATUS_EXIT_ING;
|
||||
Log.i("随机PK", "isRandomModel: " + isRandom + " status = " + status);
|
||||
return isRandom;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始匹配
|
||||
*/
|
||||
public boolean start() {
|
||||
if (status == PK_STATUS_START) {
|
||||
ToastUtil.show("PK中");
|
||||
return false;
|
||||
}
|
||||
if (status == PK_STATUS_EXIT_ING) {
|
||||
return false;
|
||||
}
|
||||
if (task != null) {
|
||||
task.cancel();
|
||||
}
|
||||
task = null;
|
||||
initTask();
|
||||
initVal();
|
||||
timer = new Timer();
|
||||
timer.schedule(task, 0, 1000);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void getRankInfo() {
|
||||
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||
.getRankPkInfoBean(new HttpCallback<RankPkInfoBean>() {
|
||||
@Override
|
||||
public void onSuccess(RankPkInfoBean data) {
|
||||
rankPkInfoBean = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知所有监听者,开始退出匹配
|
||||
*/
|
||||
private void callEndPkStart() {
|
||||
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||
pkTimer.onPkEndStart();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知所有监听者,退出匹配倒计时
|
||||
*/
|
||||
private void callEndPkTimer(String time) {
|
||||
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||
pkTimer.onPkEndTimer(time);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知所有监听者,退出匹配成功
|
||||
*/
|
||||
private void callEndPkSuccess() {
|
||||
status = PK_STATUS_DEFAULT;
|
||||
rankPkInfoBean = null;
|
||||
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||
pkTimer.onPkEndSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private TimerTask createExitTask() {
|
||||
return new TimerTask() {
|
||||
|
||||
Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
handler.post(() -> {
|
||||
exitTimer--;
|
||||
callEndPkTimer(exitTimer + "");
|
||||
if (exitTimer == 0) {
|
||||
end();
|
||||
callEndPkSuccess();
|
||||
cancel();
|
||||
exitTask = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出匹配
|
||||
*/
|
||||
public void exitPk() {
|
||||
if (status == PK_STATUS_EXIT_ING) {
|
||||
return;
|
||||
}
|
||||
callEndPkStart();
|
||||
status = PK_STATUS_EXIT_ING;
|
||||
exitTimer = 11;
|
||||
exitTask = createExitTask();
|
||||
new Timer().schedule(exitTask, 0, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出连麦
|
||||
*/
|
||||
public void end() {
|
||||
if (task != null) {
|
||||
task.cancel();
|
||||
}
|
||||
task = null;
|
||||
status = PK_STATUS_DEFAULT;
|
||||
pkUid = null;
|
||||
callEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否正在匹配中
|
||||
*/
|
||||
public boolean isRequestPk() {
|
||||
return status == PK_STATUS_REQUEST;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知所有监听者,结束匹配
|
||||
*/
|
||||
private void callEnd() {
|
||||
if (task != null) {
|
||||
task.cancel();
|
||||
task = null;
|
||||
}
|
||||
handler.post(() -> {
|
||||
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||
pkTimer.onPkEnd();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知所有监听者,开始匹配
|
||||
*/
|
||||
private void callStart() {
|
||||
if (task != null) {
|
||||
task.cancel();
|
||||
task = null;
|
||||
}
|
||||
handler.post(() -> {
|
||||
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||
pkTimer.onPking();
|
||||
}
|
||||
});
|
||||
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||
.startRandomPK(pkUid, new HttpCallback<Boolean>() {
|
||||
@Override
|
||||
public void onSuccess(Boolean data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知所有监听者,对方拒绝PK
|
||||
*/
|
||||
private void callRefuse() {
|
||||
handler.post(() -> {
|
||||
for (OnRandomPkTimer pkTimer : randomPkTimer) {
|
||||
pkTimer.onRefuse();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置PK状态
|
||||
*/
|
||||
public void setPkStatus(int status) {
|
||||
if (!isRandomModel()) {
|
||||
return;
|
||||
}
|
||||
if (this.status == PK_STATUS_DEFAULT || this.status == PK_STATUS_EXIT_ING) {//默认状态下不响应随机PK接口
|
||||
return;
|
||||
}
|
||||
this.status = status;
|
||||
switch (status) {
|
||||
case PK_STATUS_START:
|
||||
callStart();
|
||||
break;
|
||||
case PK_STATUS_CLOSE:
|
||||
callEnd();
|
||||
break;
|
||||
case PK_STATUS_REFUSE:
|
||||
//callRefuse();
|
||||
nextPk();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否正在退出匹配中
|
||||
*/
|
||||
public boolean isExiting() {
|
||||
return status == PK_STATUS_EXIT_ING;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退出匹配倒计时
|
||||
*/
|
||||
public String getExitTimer() {
|
||||
return exitTimer + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空状态,下播时调用
|
||||
*/
|
||||
public void release() {
|
||||
status = PK_STATUS_REQUEST;
|
||||
if (task != null) {
|
||||
task.cancel();
|
||||
}
|
||||
if (exitTask != null) {
|
||||
exitTask.cancel();
|
||||
}
|
||||
randomPkTimer.clear();
|
||||
rankPkInfoBean = null;
|
||||
pkUid = null;
|
||||
handler.removeCallbacks(pkRunnable);
|
||||
}
|
||||
|
||||
|
||||
public static abstract class OnRandomPkTimer {
|
||||
/**
|
||||
* 匹配倒计时
|
||||
*/
|
||||
public void onTimer(String time) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配到对方
|
||||
*
|
||||
* @param pkUid 对方uid
|
||||
*/
|
||||
public void onStartPK(String pkUid) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配中
|
||||
*/
|
||||
public void onPking() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 连麦结束
|
||||
*/
|
||||
public void onPkEnd() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 对方拒绝PK
|
||||
*/
|
||||
public void onRefuse() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出匹配倒计时
|
||||
*/
|
||||
public void onPkEndTimer(String time) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始退出匹配
|
||||
*/
|
||||
public void onPkEndStart() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出匹配成功
|
||||
*/
|
||||
public void onPkEndSuccess() {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,6 +271,7 @@ public class ACache {
|
||||
JSONArray obj = new JSONArray(JSONString);
|
||||
return obj;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,9 +98,6 @@ public class MessageIMManager {
|
||||
public void getSystemMessages() {
|
||||
systemNumber = 0;
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
if (userInfo == null) {
|
||||
return;
|
||||
}
|
||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||
.params("uid", userInfo.getId())
|
||||
.params("token", userInfo.getToken())
|
||||
|
||||
@@ -3,8 +3,16 @@ package com.yunbao.common.manager.imrongcloud;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.google.gson.Gson;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -28,12 +36,12 @@ public class PDMessageInterceptor implements MessageInterceptor {
|
||||
TextMessage textMessage = (TextMessage) message.getContent();
|
||||
String context = textMessage.getContent();
|
||||
//符合条件的接受消息不做展示
|
||||
if (context.contains("LivePK")||context.contains("LiveDRPK")||context.contains("LiveRandomPK")) {
|
||||
if (context.contains("LivePK")) {
|
||||
Message[] messages = new Message[]{message};
|
||||
Log.e("PDMessageInterceptor", textMessage.getContent());
|
||||
//删除消息
|
||||
IMCenter.getInstance().deleteRemoteMessages(Conversation.ConversationType.PRIVATE, message.getTargetId(), messages, null);
|
||||
IMCenter.getInstance().clearMessagesUnreadStatus(Conversation.ConversationType.PRIVATE, message.getTargetId(), null);
|
||||
IMCenter.getInstance().clearMessagesUnreadStatus(Conversation.ConversationType.PRIVATE, message.getTargetId(), null);
|
||||
|
||||
// return true;
|
||||
}
|
||||
@@ -45,7 +53,7 @@ public class PDMessageInterceptor implements MessageInterceptor {
|
||||
IMLoginModel userBean = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class);
|
||||
//新手指导员
|
||||
if (!TextUtils.isEmpty(userBean.getIsAdmin()) && TextUtils.equals(userBean.getIsAdmin(), "1")) {
|
||||
//wow
|
||||
//wow
|
||||
|
||||
} else {//非指导员
|
||||
|
||||
@@ -63,7 +71,7 @@ public class PDMessageInterceptor implements MessageInterceptor {
|
||||
*/
|
||||
@Override
|
||||
public void onSuccess(List<Message> messages) {
|
||||
if (messages.size() == 0 || (messages.size() == 1 && ((TextMessage) messages.get(0).getContent()).getContent().contains("LivePK"))) {
|
||||
if (messages.size() == 0||(messages.size()==1&&((TextMessage) messages.get(0).getContent()).getContent().contains("LivePK"))) {
|
||||
IMCenter.getInstance().removeConversation(Conversation.ConversationType.PRIVATE, message.getTargetId(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,21 +295,21 @@ public class PayPresenter {
|
||||
if (mActivity == null || TextUtils.isEmpty(mServiceNameAli)|| TextUtils.isEmpty(mAliCallbackUrl)) {
|
||||
return;
|
||||
}
|
||||
// if (!CommonAppConfig.isAppExist(Constants.PACKAGE_NAME_ALI)) {
|
||||
// ToastUtil.show(R.string.coin_ali_not_install);
|
||||
// return;
|
||||
// }
|
||||
if (!CommonAppConfig.isAppExist(Constants.PACKAGE_NAME_ALI)) {
|
||||
ToastUtil.show(R.string.coin_ali_not_install);
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(mAliPartner) || TextUtils.isEmpty(mAliSellerId) || TextUtils.isEmpty(mAliPrivateKey)) {
|
||||
ToastUtil.show(Constants.PAY_ALI_NOT_ENABLE);
|
||||
return;
|
||||
}
|
||||
// AliPayBuilder builder = new AliPayBuilder(mActivity, mAliPartner, mAliSellerId, mAliPrivateKey);
|
||||
// builder.setMoney(money);
|
||||
// builder.setGoodsName(goodsName);
|
||||
// builder.setCallbackUrl(mAliCallbackUrl);
|
||||
// builder.setOrderParams(StringUtil.contact(mServiceNameAli, orderParams));
|
||||
// builder.setPayCallback(mPayCallback);
|
||||
// builder.pay();
|
||||
AliPayBuilder builder = new AliPayBuilder(mActivity, mAliPartner, mAliSellerId, mAliPrivateKey);
|
||||
builder.setMoney(money);
|
||||
builder.setGoodsName(goodsName);
|
||||
builder.setCallbackUrl(mAliCallbackUrl);
|
||||
builder.setOrderParams(StringUtil.contact(mServiceNameAli, orderParams));
|
||||
builder.setPayCallback(mPayCallback);
|
||||
builder.pay();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,214 +22,213 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/9/21.
|
||||
* 禁用支付宝
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
public class AliPayBuilder {
|
||||
//
|
||||
// private Activity mActivity;
|
||||
// private String mPartner;// 商户ID
|
||||
// private String mSellerId; // 商户收款账号
|
||||
// private String mPrivateKey; // 商户私钥,pkcs8格式
|
||||
// private String mPayInfo;//支付宝订单信息 包括 商品信息,订单签名,签名类型
|
||||
// private String mGoodsName;//商品名称
|
||||
// private String mMoney;//要支付的金额
|
||||
// private String mOrderParams;//订单获取订单需要的参数
|
||||
// private String mCallbackUrl;//支付宝充值回调地址
|
||||
// private PayHandler mPayHandler;
|
||||
//
|
||||
// public AliPayBuilder(Activity activity, String partner, String sellerId, String privateKey) {
|
||||
// mActivity = new WeakReference<>(activity).get();
|
||||
// mPartner = partner;
|
||||
// mSellerId = sellerId;
|
||||
// mPrivateKey = privateKey;
|
||||
// }
|
||||
//
|
||||
// public AliPayBuilder setMoney(String money) {
|
||||
// mMoney = money;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public AliPayBuilder setGoodsName(String goodsName) {
|
||||
// mGoodsName = goodsName;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public AliPayBuilder setOrderParams(String orderParams) {
|
||||
// mOrderParams = orderParams;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public AliPayBuilder setPayCallback(PayCallback callback) {
|
||||
// mPayHandler = new PayHandler(callback);
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public void setCallbackUrl(String callbackUrl) {
|
||||
// mCallbackUrl = callbackUrl;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 从服务器端获取订单号,即下单
|
||||
// */
|
||||
// public void pay() {
|
||||
// if (TextUtils.isEmpty(mOrderParams) || TextUtils.isEmpty(mMoney) || TextUtils.isEmpty(mGoodsName)|| TextUtils.isEmpty(mCallbackUrl)) {
|
||||
// return;
|
||||
// }
|
||||
// CommonHttpUtil.getAliOrder(mOrderParams, new HttpCallback() {
|
||||
|
||||
private Activity mActivity;
|
||||
private String mPartner;// 商户ID
|
||||
private String mSellerId; // 商户收款账号
|
||||
private String mPrivateKey; // 商户私钥,pkcs8格式
|
||||
private String mPayInfo;//支付宝订单信息 包括 商品信息,订单签名,签名类型
|
||||
private String mGoodsName;//商品名称
|
||||
private String mMoney;//要支付的金额
|
||||
private String mOrderParams;//订单获取订单需要的参数
|
||||
private String mCallbackUrl;//支付宝充值回调地址
|
||||
private PayHandler mPayHandler;
|
||||
|
||||
public AliPayBuilder(Activity activity, String partner, String sellerId, String privateKey) {
|
||||
mActivity = new WeakReference<>(activity).get();
|
||||
mPartner = partner;
|
||||
mSellerId = sellerId;
|
||||
mPrivateKey = privateKey;
|
||||
}
|
||||
|
||||
public AliPayBuilder setMoney(String money) {
|
||||
mMoney = money;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AliPayBuilder setGoodsName(String goodsName) {
|
||||
mGoodsName = goodsName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AliPayBuilder setOrderParams(String orderParams) {
|
||||
mOrderParams = orderParams;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public AliPayBuilder setPayCallback(PayCallback callback) {
|
||||
mPayHandler = new PayHandler(callback);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setCallbackUrl(String callbackUrl) {
|
||||
mCallbackUrl = callbackUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从服务器端获取订单号,即下单
|
||||
*/
|
||||
public void pay() {
|
||||
if (TextUtils.isEmpty(mOrderParams) || TextUtils.isEmpty(mMoney) || TextUtils.isEmpty(mGoodsName)|| TextUtils.isEmpty(mCallbackUrl)) {
|
||||
return;
|
||||
}
|
||||
CommonHttpUtil.getAliOrder(mOrderParams, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
String orderInfo = createAliOrder(obj.getString("orderid"));//商品信息
|
||||
String sign = getOrderSign(orderInfo);//订单签名
|
||||
if (TextUtils.isEmpty(sign)) {
|
||||
ToastUtil.show("商户私钥错误,订单签名失败");
|
||||
return;
|
||||
}
|
||||
sign = urlEncode(sign);
|
||||
String signType = "sign_type=\"RSA\"";//签名类型
|
||||
mPayInfo = orderInfo + "&sign=\"" + sign + "\"&" + signType;
|
||||
L.e("支付宝订单信息----->" + mPayInfo);
|
||||
invokeAliPay();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showLoadingDialog() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog createLoadingDialog() {
|
||||
return DialogUitl.loadingDialog(mActivity);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号和商品信息生成支付宝格式的订单信息
|
||||
*
|
||||
* @param orderId 服务器返回的订单号
|
||||
* @return
|
||||
*/
|
||||
private String createAliOrder(String orderId) {
|
||||
// 合作者身份ID
|
||||
String orderInfo = "partner=" + "\"" + mPartner + "\"";
|
||||
|
||||
// 卖家支付宝账号
|
||||
orderInfo += "&seller_id=" + "\"" + mSellerId + "\"";
|
||||
|
||||
// 商户网站唯一订单号
|
||||
orderInfo += "&out_trade_no=" + "\"" + orderId + "\"";
|
||||
|
||||
// 商品名称
|
||||
orderInfo += "&subject=" + "\"" + mGoodsName + "\"";
|
||||
|
||||
// 商品详情
|
||||
orderInfo += "&body=" + "\"" + mGoodsName + "\"";
|
||||
|
||||
// 商品金额
|
||||
orderInfo += "&total_fee=" + "\"" + mMoney + "\"";
|
||||
|
||||
// 服务器异步通知页面路径 //服务器异步通知页面路径 参数 notify_url,如果商户没设定,则不会进行该操作
|
||||
orderInfo += "¬ify_url=" + "\"" + mCallbackUrl + "\"";
|
||||
|
||||
// 接口名称, 固定值
|
||||
orderInfo += "&service=\"mobile.securitypay.pay\"";
|
||||
|
||||
// 支付类型, 固定值
|
||||
orderInfo += "&payment_type=\"1\"";
|
||||
|
||||
// 参数编码, 固定值
|
||||
orderInfo += "&_input_charset=\"utf-8\"";
|
||||
|
||||
// 设置未付款交易的超时时间
|
||||
// 默认30分钟,一旦超时,该笔交易就会自动被关闭。
|
||||
// 取值范围:1m〜15d。
|
||||
// m-分钟,h-小时,d-天,1c-当天(无论交易何时创建,都在0点关闭)。
|
||||
// 该参数数值不接受小数点,如1.5h,可转换为90m。
|
||||
orderInfo += "&it_b_pay=\"30m\"";
|
||||
|
||||
// 支付宝处理完请求后,当前页面跳转到商户指定页面的路径,可空
|
||||
orderInfo += "&return_url=\"m.alipay.com\"";
|
||||
|
||||
// 调用银行卡支付,需配置此参数,参与签名, 固定值
|
||||
// orderInfo += "&paymethod=\"expressGateway\"";
|
||||
|
||||
return orderInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单信息生成订单的签名
|
||||
*
|
||||
* @param orderInfo 订单信息
|
||||
* @return
|
||||
*/
|
||||
private String getOrderSign(String orderInfo) {
|
||||
return SignUtils.sign(orderInfo, mPrivateKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对订单签名进行urlencode转码
|
||||
*
|
||||
* @param sign 签名
|
||||
* @return
|
||||
*/
|
||||
private String urlEncode(String sign) {
|
||||
try {
|
||||
sign = URLEncoder.encode(sign, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sign;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用支付宝sdk
|
||||
*/
|
||||
private void invokeAliPay() {
|
||||
// new Thread(new Runnable() {
|
||||
// @Override
|
||||
// public void onSuccess(int code, String msg, String[] info) {
|
||||
// if (code == 0 && info.length > 0) {
|
||||
// JSONObject obj = JSON.parseObject(info[0]);
|
||||
// String orderInfo = createAliOrder(obj.getString("orderid"));//商品信息
|
||||
// String sign = getOrderSign(orderInfo);//订单签名
|
||||
// if (TextUtils.isEmpty(sign)) {
|
||||
// ToastUtil.show("商户私钥错误,订单签名失败");
|
||||
// return;
|
||||
// }
|
||||
// sign = urlEncode(sign);
|
||||
// String signType = "sign_type=\"RSA\"";//签名类型
|
||||
// mPayInfo = orderInfo + "&sign=\"" + sign + "\"&" + signType;
|
||||
// L.e("支付宝订单信息----->" + mPayInfo);
|
||||
// invokeAliPay();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean showLoadingDialog() {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Dialog createLoadingDialog() {
|
||||
// return DialogUitl.loadingDialog(mActivity);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据订单号和商品信息生成支付宝格式的订单信息
|
||||
// *
|
||||
// * @param orderId 服务器返回的订单号
|
||||
// * @return
|
||||
// */
|
||||
// private String createAliOrder(String orderId) {
|
||||
// // 合作者身份ID
|
||||
// String orderInfo = "partner=" + "\"" + mPartner + "\"";
|
||||
//
|
||||
// // 卖家支付宝账号
|
||||
// orderInfo += "&seller_id=" + "\"" + mSellerId + "\"";
|
||||
//
|
||||
// // 商户网站唯一订单号
|
||||
// orderInfo += "&out_trade_no=" + "\"" + orderId + "\"";
|
||||
//
|
||||
// // 商品名称
|
||||
// orderInfo += "&subject=" + "\"" + mGoodsName + "\"";
|
||||
//
|
||||
// // 商品详情
|
||||
// orderInfo += "&body=" + "\"" + mGoodsName + "\"";
|
||||
//
|
||||
// // 商品金额
|
||||
// orderInfo += "&total_fee=" + "\"" + mMoney + "\"";
|
||||
//
|
||||
// // 服务器异步通知页面路径 //服务器异步通知页面路径 参数 notify_url,如果商户没设定,则不会进行该操作
|
||||
// orderInfo += "¬ify_url=" + "\"" + mCallbackUrl + "\"";
|
||||
//
|
||||
// // 接口名称, 固定值
|
||||
// orderInfo += "&service=\"mobile.securitypay.pay\"";
|
||||
//
|
||||
// // 支付类型, 固定值
|
||||
// orderInfo += "&payment_type=\"1\"";
|
||||
//
|
||||
// // 参数编码, 固定值
|
||||
// orderInfo += "&_input_charset=\"utf-8\"";
|
||||
//
|
||||
// // 设置未付款交易的超时时间
|
||||
// // 默认30分钟,一旦超时,该笔交易就会自动被关闭。
|
||||
// // 取值范围:1m〜15d。
|
||||
// // m-分钟,h-小时,d-天,1c-当天(无论交易何时创建,都在0点关闭)。
|
||||
// // 该参数数值不接受小数点,如1.5h,可转换为90m。
|
||||
// orderInfo += "&it_b_pay=\"30m\"";
|
||||
//
|
||||
// // 支付宝处理完请求后,当前页面跳转到商户指定页面的路径,可空
|
||||
// orderInfo += "&return_url=\"m.alipay.com\"";
|
||||
//
|
||||
// // 调用银行卡支付,需配置此参数,参与签名, 固定值
|
||||
// // orderInfo += "&paymethod=\"expressGateway\"";
|
||||
//
|
||||
// return orderInfo;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据订单信息生成订单的签名
|
||||
// *
|
||||
// * @param orderInfo 订单信息
|
||||
// * @return
|
||||
// */
|
||||
// private String getOrderSign(String orderInfo) {
|
||||
// return SignUtils.sign(orderInfo, mPrivateKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 对订单签名进行urlencode转码
|
||||
// *
|
||||
// * @param sign 签名
|
||||
// * @return
|
||||
// */
|
||||
// private String urlEncode(String sign) {
|
||||
// try {
|
||||
// sign = URLEncoder.encode(sign, "UTF-8");
|
||||
// } catch (UnsupportedEncodingException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return sign;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 调用支付宝sdk
|
||||
// */
|
||||
// private void invokeAliPay() {
|
||||
//// new Thread(new Runnable() {
|
||||
//// @Override
|
||||
//// public void run() {
|
||||
////// PayTask alipay = new PayTask(mActivity);
|
||||
//// //执行支付,这是一个耗时操作,最后返回支付的结果,用handler发送到主线程
|
||||
////// Map<String, String> result = alipay.payV2(mPayInfo, true);
|
||||
////// L.e("支付宝返回结果----->" + result);
|
||||
////// if (mPayHandler != null) {
|
||||
////// Message msg = Message.obtain();
|
||||
////// msg.obj = result;
|
||||
////// mPayHandler.sendMessage(msg);
|
||||
////// }
|
||||
////// }
|
||||
//// }).start();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// private static class PayHandler extends Handler {
|
||||
//
|
||||
// private PayCallback mPayCallback;
|
||||
//
|
||||
// public PayHandler(PayCallback payCallback) {
|
||||
// mPayCallback = new WeakReference<>(payCallback).get();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void handleMessage(Message msg) {
|
||||
// if (mPayCallback != null) {
|
||||
// @SuppressWarnings("unchecked")
|
||||
// Map<String, String> result = (Map<String, String>) msg.obj;
|
||||
// if ("9000".equals(result.get("resultStatus"))) {
|
||||
// mPayCallback.onSuccess();
|
||||
// } else {
|
||||
// mPayCallback.onFailed();
|
||||
// }
|
||||
// }
|
||||
// mPayCallback = null;
|
||||
// }
|
||||
// }
|
||||
// public void run() {
|
||||
//// PayTask alipay = new PayTask(mActivity);
|
||||
// //执行支付,这是一个耗时操作,最后返回支付的结果,用handler发送到主线程
|
||||
//// Map<String, String> result = alipay.payV2(mPayInfo, true);
|
||||
//// L.e("支付宝返回结果----->" + result);
|
||||
//// if (mPayHandler != null) {
|
||||
//// Message msg = Message.obtain();
|
||||
//// msg.obj = result;
|
||||
//// mPayHandler.sendMessage(msg);
|
||||
//// }
|
||||
//// }
|
||||
// }).start();
|
||||
}
|
||||
|
||||
|
||||
private static class PayHandler extends Handler {
|
||||
|
||||
private PayCallback mPayCallback;
|
||||
|
||||
public PayHandler(PayCallback payCallback) {
|
||||
mPayCallback = new WeakReference<>(payCallback).get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
if (mPayCallback != null) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String> result = (Map<String, String>) msg.obj;
|
||||
if ("9000".equals(result.get("resultStatus"))) {
|
||||
mPayCallback.onSuccess();
|
||||
} else {
|
||||
mPayCallback.onFailed();
|
||||
}
|
||||
}
|
||||
mPayCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Display;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class APKDownloadUtil {
|
||||
/**
|
||||
* APK文件下载
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public void downloadAPK(Activity context, String url, OnUpdateListener listener) {
|
||||
Request request = new Request.Builder().url(url)
|
||||
.addHeader("Accept-Encoding", "identity").build();
|
||||
File downloadFile = new File(context.getCacheDir(), "update_app.apk");
|
||||
try {
|
||||
if (!downloadFile.exists()
|
||||
&& !downloadFile.createNewFile()) {
|
||||
return;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
showDialod(context);
|
||||
new OkHttpClient().newCall(request).enqueue(new Callback() {
|
||||
private Handler handler = new Handler();
|
||||
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
// 下载失败
|
||||
handler.post(() -> {
|
||||
listener.updateFailure(-1, e.getMessage());
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) {
|
||||
Looper.prepare();
|
||||
byte[] buf = new byte[2048];
|
||||
int len;
|
||||
try (InputStream inputStream = response.body().byteStream();
|
||||
FileOutputStream outputStream = new FileOutputStream(downloadFile)) {
|
||||
long total = response.body().contentLength();
|
||||
long sum = 0;
|
||||
while ((len = inputStream.read(buf)) != -1) {
|
||||
outputStream.write(buf, 0, len);
|
||||
sum += len;
|
||||
int progress = (int) (sum * 1.0f / total * 100);
|
||||
// 下载中
|
||||
handler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tvProgress.setText(progress + "%");
|
||||
progressBar.setProgress(progress);
|
||||
}
|
||||
});
|
||||
}
|
||||
outputStream.flush();
|
||||
//启动安装app
|
||||
installApk(context, downloadFile, context.getPackageName() + ".fileprovider");
|
||||
handler.post(() -> progressDialog.dismiss());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
new Handler().post(() -> {
|
||||
listener.updateFailure(-1, e.getMessage());
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新监听
|
||||
*/
|
||||
public interface OnUpdateListener {
|
||||
void updateFailure(int code, String error);
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 启动app安装
|
||||
// *
|
||||
// * @param context
|
||||
// * @param filePath
|
||||
// */
|
||||
// private static void startInstall(Context context, File filePath) {
|
||||
//
|
||||
// Intent install = new Intent(Intent.ACTION_VIEW);
|
||||
// install.setDataAndType(Uri.parse("file://" + filePath.getAbsolutePath()),
|
||||
// "application/vnd.android.package-archive");
|
||||
// install.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// context.startActivity(install);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 安装apk
|
||||
*
|
||||
* @param context
|
||||
* @param file
|
||||
*/
|
||||
public void installApk(Context context, File file, String authority) {
|
||||
Intent intent = getInstallIntent(context, file, authority);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取安装Intent
|
||||
*
|
||||
* @param context
|
||||
* @param file
|
||||
* @param authority
|
||||
* @return
|
||||
*/
|
||||
public Intent getInstallIntent(Context context, File file, String authority) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
Uri uriData;
|
||||
String type = "application/vnd.android.package-archive";
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
uriData = FileProvider.getUriForFile(context, authority, file);
|
||||
} else {
|
||||
uriData = Uri.fromFile(file);
|
||||
}
|
||||
intent.setDataAndType(uriData, type);
|
||||
return intent;
|
||||
}
|
||||
|
||||
public TextView tvProgress;
|
||||
public ProgressBar progressBar;
|
||||
public Dialog progressDialog;
|
||||
|
||||
private void showDialod(Activity context) {
|
||||
if (progressDialog == null) {
|
||||
progressDialog = new Dialog(context, R.style.dialog);
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.dialog_progress, null);
|
||||
tvProgress = view.findViewById(R.id.tvProgress);
|
||||
progressBar = view.findViewById(R.id.progressBar);
|
||||
progressDialog.setContentView(view);
|
||||
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
Display display = wm.getDefaultDisplay();
|
||||
int width = display.getWidth();
|
||||
Window window = progressDialog.getWindow();// 这部分是设置dialog宽高的,宽高是我从sharedpreferences里面获取到的。之前程序启动的时候有获取
|
||||
window.getDecorView().setPadding(0, 0, 0, 0);
|
||||
WindowManager.LayoutParams lp = window.getAttributes();
|
||||
lp.width = width / 4 * 3;
|
||||
window.setAttributes(lp);
|
||||
}
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,8 +11,5 @@ public class CommonIconUtil {
|
||||
public static int getSexIcon(int key) {
|
||||
return key == 1 ? R.mipmap.icon_sex_male_1 : R.mipmap.icon_sex_female_1;
|
||||
}
|
||||
public static int getSexIconForUserCard(int key) {
|
||||
return key == 1 ? R.mipmap.user_card_man : R.mipmap.user_card_woman;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Point;
|
||||
import android.net.TrafficStats;
|
||||
import android.text.format.Formatter;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
/**
|
||||
* 设备通用类
|
||||
@@ -43,19 +34,6 @@ public class DeviceUtils {
|
||||
return displayMetrics.heightPixels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取屏幕真实高度
|
||||
*
|
||||
* @param activity activity
|
||||
* @return 屏幕高度
|
||||
*/
|
||||
public static int getScreenRealHeight(Activity activity) {
|
||||
WindowManager service = (WindowManager) activity.getSystemService(Context.WINDOW_SERVICE);
|
||||
Point point = new Point();
|
||||
service.getDefaultDisplay().getRealSize(point);
|
||||
return point.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机的分辨率从 dp 的单位 转成为 px(像素)
|
||||
*
|
||||
@@ -83,7 +61,7 @@ public class DeviceUtils {
|
||||
public static String getVersionName(Context context) {
|
||||
try {
|
||||
PackageManager manager = context.getPackageManager();
|
||||
PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
|
||||
PackageInfo info = manager.getPackageInfo(context.getPackageName(),0);
|
||||
return info.versionName;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -91,51 +69,4 @@ public class DeviceUtils {
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前是否处于低内存状态
|
||||
*/
|
||||
public static boolean isLowMemory(Context context) {
|
||||
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||
am.getMemoryInfo(mi);
|
||||
return mi.lowMemory;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可用内存 格式化
|
||||
*/
|
||||
public static String getMemoryToFormat(Context context) {
|
||||
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||
am.getMemoryInfo(mi);
|
||||
return Formatter.formatFileSize(context, mi.availMem);// 将获取的内存大小规格化
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可用内存
|
||||
*/
|
||||
public static String getMemory(Context context) {
|
||||
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||
am.getMemoryInfo(mi);
|
||||
return mi.availMem + "";
|
||||
}
|
||||
|
||||
private static long lastTotalRxBytes = 0;
|
||||
private static long lastTimeStamp = 0;
|
||||
|
||||
/**
|
||||
* 获取上传网速
|
||||
*/
|
||||
public static long getNetSpeed(Context context) {
|
||||
long nowTotalRxBytes = TrafficStats.getUidTxBytes(context.getApplicationInfo().uid) == TrafficStats.UNSUPPORTED ? 0 : (TrafficStats.getTotalTxBytes() / 1024);
|
||||
long nowTimeStamp = System.currentTimeMillis();
|
||||
long speed = ((nowTotalRxBytes - lastTotalRxBytes) * 1000 / (nowTimeStamp - lastTimeStamp));//毫秒转换
|
||||
lastTimeStamp = nowTimeStamp;
|
||||
lastTotalRxBytes = nowTotalRxBytes;
|
||||
return speed;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,12 +3,8 @@ package com.yunbao.common.utils;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.InputFilter;
|
||||
import android.text.InputType;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateFormat;
|
||||
import android.util.SparseArray;
|
||||
@@ -23,8 +19,6 @@ import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.LayoutRes;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -70,21 +64,6 @@ public class DialogUitl {
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
public static void showToast(Context context,String content,long delayMillis){
|
||||
Dialog dialog = new Dialog(context, R.style.dialog);
|
||||
dialog.setContentView(R.layout.dialog_toast);
|
||||
dialog.setCancelable(false);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
TextView titleView = (TextView) dialog.findViewById(R.id.text);
|
||||
if (titleView != null) {
|
||||
titleView.setGravity(Gravity.CENTER);
|
||||
titleView.setText(content);
|
||||
}
|
||||
}
|
||||
dialog.show();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(dialog::dismiss,delayMillis);
|
||||
}
|
||||
|
||||
|
||||
public static Dialog loadingDialog(Context context) {
|
||||
@@ -341,9 +320,6 @@ public class DialogUitl {
|
||||
private int mLength;
|
||||
private SimpleCallback mClickCallback;
|
||||
private SimpleCallback3 mClickCallback3;
|
||||
private SimpleCallbackView mSimpleCallbackView;
|
||||
private int mView = 0;
|
||||
private CharSequence mSpanned;
|
||||
|
||||
public Builder(Context context) {
|
||||
mContext = context;
|
||||
@@ -356,18 +332,6 @@ public class DialogUitl {
|
||||
|
||||
public Builder setContent(String content) {
|
||||
mContent = content;
|
||||
this.mSpanned = null;//设置文本则不是使用HTML代码
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setHtmlCode(CharSequence mSpanned) {
|
||||
this.mSpanned = mSpanned;
|
||||
this.mContent = null;//设置HTML代码则不使用文本
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSimpleCallbackView(SimpleCallbackView mSimpleCallbackView) {
|
||||
this.mSimpleCallbackView = mSimpleCallbackView;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -421,18 +385,9 @@ public class DialogUitl {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setView(@LayoutRes int layoutRes) {
|
||||
mView = layoutRes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Dialog build() {
|
||||
final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2);
|
||||
if (mView != 0) {
|
||||
dialog.setContentView(mView);
|
||||
} else {
|
||||
dialog.setContentView(mInput ? R.layout.dialog_input : R.layout.dialog_simple);
|
||||
}
|
||||
dialog.setContentView(mInput ? R.layout.dialog_input : R.layout.dialog_simple);
|
||||
dialog.setCancelable(mCancelable);
|
||||
dialog.setCanceledOnTouchOutside(mCancelable);
|
||||
TextView titleView = (TextView) dialog.findViewById(R.id.title);
|
||||
@@ -446,9 +401,6 @@ public class DialogUitl {
|
||||
if (!TextUtils.isEmpty(mContent)) {
|
||||
content.setText(mContent);
|
||||
}
|
||||
if (mSpanned != null) {
|
||||
content.setText(mSpanned);
|
||||
}
|
||||
if (mInputType == INPUT_TYPE_NUMBER) {
|
||||
content.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
} else if (mInputType == INPUT_TYPE_NUMBER_PASSWORD) {
|
||||
@@ -479,52 +431,30 @@ public class DialogUitl {
|
||||
mClickCallback.onConfirmClick(dialog, "");
|
||||
}
|
||||
} else {
|
||||
|
||||
dialog.dismiss();
|
||||
if (mClickCallback3 != null) {
|
||||
mClickCallback3.onConfirmClick(dialog);
|
||||
}
|
||||
if (mSimpleCallbackView != null) {
|
||||
mSimpleCallbackView.onConfirmClick(dialog,titleView, content, btnConfirm, btnCancel);
|
||||
}else{
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
dialog.dismiss();
|
||||
if (mClickCallback3 != null) {
|
||||
mClickCallback3.onCancel();
|
||||
dialog.dismiss();
|
||||
|
||||
} else {
|
||||
|
||||
if (mClickCallback instanceof SimpleCallback2) {
|
||||
((SimpleCallback2) mClickCallback).onCancelClick();
|
||||
}
|
||||
if (mSimpleCallbackView != null) {
|
||||
mSimpleCallbackView.onCancel(dialog,titleView, content, btnConfirm, btnCancel);
|
||||
}else{
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
if(btnConfirm!=null) {
|
||||
btnConfirm.setOnClickListener(listener);
|
||||
}
|
||||
if(btnCancel!=null) {
|
||||
btnCancel.setOnClickListener(listener);
|
||||
}
|
||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
if (mSimpleCallbackView != null) {
|
||||
mSimpleCallbackView.onShow(dialog,titleView, content, btnConfirm, btnCancel);
|
||||
}
|
||||
}
|
||||
});
|
||||
btnConfirm.setOnClickListener(listener);
|
||||
btnCancel.setOnClickListener(listener);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@@ -552,14 +482,6 @@ public class DialogUitl {
|
||||
void onCancel();
|
||||
}
|
||||
|
||||
public interface SimpleCallbackView {
|
||||
void onShow(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn);
|
||||
|
||||
void onConfirmClick(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn);
|
||||
|
||||
void onCancel(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 城市选择
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user