1
This commit is contained in:
71
common/src/main/AndroidManifest.xml
Normal file
71
common/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.yunbao.common">
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||
|
||||
<application android:allowBackup="true">
|
||||
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.ar.core"-->
|
||||
<!-- android:value="optional" />-->
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.WebViewActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.yalantis.ucrop.UCropActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!--Android 7.0 拍照要用这个-->
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.pandoralive.shayu.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
<!--
|
||||
|
||||
支付宝
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5PayActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5AuthActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden"></activity>
|
||||
支付宝 end
|
||||
-->
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.ErrorActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.SelectImageActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.PreviewImageActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.yunbao.common.activity.PreviewVideoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
BIN
common/src/main/assets/chat_message_bg.png
Normal file
BIN
common/src/main/assets/chat_message_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 712 B |
14250
common/src/main/assets/city.json
Normal file
14250
common/src/main/assets/city.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
common/src/main/assets/icon_livemsgbg_chaohuang.svga
Normal file
BIN
common/src/main/assets/icon_livemsgbg_chaohuang.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_livemsgbg_guowang.svga
Normal file
BIN
common/src/main/assets/icon_livemsgbg_guowang.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_livemsgbg_huangdi.svga
Normal file
BIN
common/src/main/assets/icon_livemsgbg_huangdi.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_noble_chaohuang.svga
Normal file
BIN
common/src/main/assets/icon_noble_chaohuang.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_noble_gongjue.svga
Normal file
BIN
common/src/main/assets/icon_noble_gongjue.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_noble_guowang.svga
Normal file
BIN
common/src/main/assets/icon_noble_guowang.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_noble_houjue.svga
Normal file
BIN
common/src/main/assets/icon_noble_houjue.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_noble_huangdi.svga
Normal file
BIN
common/src/main/assets/icon_noble_huangdi.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_noble_nanjue.svga
Normal file
BIN
common/src/main/assets/icon_noble_nanjue.svga
Normal file
Binary file not shown.
BIN
common/src/main/assets/icon_noble_zijue.svga
Normal file
BIN
common/src/main/assets/icon_noble_zijue.svga
Normal file
Binary file not shown.
656
common/src/main/java/com/yunbao/common/CommonAppConfig.java
Normal file
656
common/src/main/java/com/yunbao/common/CommonAppConfig.java
Normal file
@@ -0,0 +1,656 @@
|
||||
package com.yunbao.common;
|
||||
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.FansMedalBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.UserItemBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/4.
|
||||
*/
|
||||
public class CommonAppConfig {
|
||||
//域名
|
||||
public static final String HOST = getMetaDataString("SERVER_HOST");
|
||||
//是否使用谷歌支付
|
||||
public static final int IS_GOOGLE_PLAY = getMetaDataInt("IS_GOOGLE_PLAY");
|
||||
//是否开启上报错误日志功能
|
||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||
//是否为插件包模式
|
||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||
|
||||
//外部sd卡
|
||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||
//内部存储 /data/data/<application package>/files目录
|
||||
public static final String INNER_PATH = CommonAppContext.sInstance.getFilesDir().getAbsolutePath();
|
||||
//文件夹名字
|
||||
private static final String DIR_NAME = "yunbao";
|
||||
//保存视频的时候,在sd卡存储短视频的路径DCIM下
|
||||
public static final String VIDEO_PATH = DCMI_PATH + "/" + DIR_NAME + "/video/";
|
||||
public static final String VIDEO_RECORD_TEMP_PATH = VIDEO_PATH + "recordParts";
|
||||
//下载贴纸的时候保存的路径 /storage/emulated/0/DCIM/yunbao/tieZhi/
|
||||
public static final String VIDEO_TIE_ZHI_PATH = DCMI_PATH + "/" + DIR_NAME + "/tieZhi/";
|
||||
//解压的美颜模型地址
|
||||
public static String VIDEO_TIE_MODEl_PATH = "";
|
||||
//360贴纸名字
|
||||
public static final String TIEZHI_360_NAME = "sticker360";
|
||||
|
||||
//下载音乐的时候保存的路径
|
||||
public static final String MUSIC_PATH = DCMI_PATH + "/" + DIR_NAME + "/music/";
|
||||
//拍照时图片保存路径
|
||||
public static final String CAMERA_IMAGE_PATH = DCMI_PATH + "/" + DIR_NAME + "/camera/";
|
||||
//log保存路径
|
||||
public static final String LOG_PATH = DCMI_PATH + "/" + DIR_NAME + "/log/";
|
||||
public static final String GIF_PATH = INNER_PATH + "/gif/";
|
||||
//QQ登录是否与PC端互通
|
||||
public static final boolean QQ_LOGIN_WITH_PC = true;
|
||||
//是否使用游戏
|
||||
public static final boolean GAME_ENABLE = true;
|
||||
//是否上下滑动切换直播间
|
||||
public static final boolean LIVE_ROOM_SCROLL = false;
|
||||
//直播sdk类型是否由后台控制的
|
||||
public static final boolean LIVE_SDK_CHANGED = true;
|
||||
//使用指定的直播sdk类型
|
||||
public static final int LIVE_SDK_USED = Constants.LIVE_SDK_KSY;
|
||||
private static CommonAppConfig sInstance;
|
||||
|
||||
public static boolean isGetNewWrap = false;//是否获取到新的包裹礼物
|
||||
public static int alert_time = 1;
|
||||
public static int alert_end_time = 1;
|
||||
|
||||
|
||||
private CommonAppConfig() {
|
||||
|
||||
}
|
||||
|
||||
public static CommonAppConfig getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (CommonAppConfig.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new CommonAppConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private String mUid;
|
||||
private String mToken;
|
||||
private ConfigBean mConfig;
|
||||
private double mLng;
|
||||
private double mLat;
|
||||
private String mProvince;//省
|
||||
private String mCity;//市
|
||||
private String mDistrict;//区
|
||||
private UserBean mUserBean;
|
||||
private String mVersion;
|
||||
private boolean mLoginIM;//IM是否登录了
|
||||
private boolean mLaunched;//App是否启动了
|
||||
private String mJPushAppKey;//极光推送的AppKey
|
||||
private List<UserItemBean> mUserItemList;//个人中心功能列表
|
||||
private SparseArray<FansMedalBean> mAnchorFansMedalMap;
|
||||
private String mGiftListJson;
|
||||
private String mWrapListJson;
|
||||
private String mTxMapAppKey;//腾讯定位,地图的AppKey
|
||||
private String mTxMapAppSecret;//腾讯地图的AppSecret
|
||||
private boolean mFrontGround;
|
||||
private int mAppIconRes;
|
||||
private String mAppName;
|
||||
private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜
|
||||
|
||||
public String getUid() {
|
||||
if (TextUtils.isEmpty(mUid)) {
|
||||
String[] uidAndToken = SpUtil.getInstance()
|
||||
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||
if (uidAndToken != null) {
|
||||
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
||||
mUid = uidAndToken[0];
|
||||
mToken = uidAndToken[1];
|
||||
}
|
||||
} else {
|
||||
return "-1";
|
||||
}
|
||||
}
|
||||
return mUid;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return mToken;
|
||||
}
|
||||
|
||||
public String getCoinName() {
|
||||
ConfigBean configBean = getConfig();
|
||||
if (configBean != null) {
|
||||
return configBean.getCoinName();
|
||||
}
|
||||
return Constants.DIAMONDS;
|
||||
}
|
||||
|
||||
public String getGoldCoinName() {
|
||||
ConfigBean configBean = getConfig();
|
||||
if (configBean != null) {
|
||||
return configBean.getGoldCoinName();
|
||||
}
|
||||
return Constants.GOLD_NAME;
|
||||
}
|
||||
|
||||
|
||||
public String getVotesName() {
|
||||
ConfigBean configBean = getConfig();
|
||||
if (configBean != null) {
|
||||
return configBean.getVotesName();
|
||||
}
|
||||
return Constants.VOTES;
|
||||
}
|
||||
|
||||
public ConfigBean getConfig() {
|
||||
if (mConfig == null) {
|
||||
String configString = SpUtil.getInstance().getStringValue(SpUtil.CONFIG);
|
||||
if (!TextUtils.isEmpty(configString)) {
|
||||
mConfig = JSON.parseObject(configString, ConfigBean.class);
|
||||
}
|
||||
}
|
||||
return mConfig;
|
||||
}
|
||||
|
||||
public void getConfig(CommonCallback<ConfigBean> callback) {
|
||||
if (callback == null) {
|
||||
return;
|
||||
}
|
||||
ConfigBean configBean = getConfig();
|
||||
if (configBean != null) {
|
||||
callback.callback(configBean);
|
||||
} else {
|
||||
CommonHttpUtil.getConfig(null, callback);
|
||||
}
|
||||
}
|
||||
|
||||
private String[][] liveType = null;
|
||||
|
||||
public String[][] getLiveType() {
|
||||
return liveType;
|
||||
}
|
||||
|
||||
public void setConfig(ConfigBean config) {
|
||||
mConfig = config;
|
||||
liveType = config.getLiveType();
|
||||
}
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
public double getLng() {
|
||||
if (mLng == 0) {
|
||||
String lng = SpUtil.getInstance().getStringValue(SpUtil.LOCATION_LNG);
|
||||
if (!TextUtils.isEmpty(lng)) {
|
||||
try {
|
||||
mLng = Double.parseDouble(lng);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return mLng;
|
||||
}
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
public double getLat() {
|
||||
if (mLat == 0) {
|
||||
String lat = SpUtil.getInstance().getStringValue(SpUtil.LOCATION_LAT);
|
||||
if (!TextUtils.isEmpty(lat)) {
|
||||
try {
|
||||
mLat = Double.parseDouble(lat);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return mLat;
|
||||
}
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
public String getProvince() {
|
||||
if (TextUtils.isEmpty(mProvince)) {
|
||||
mProvince = SpUtil.getInstance().getStringValue(SpUtil.LOCATION_PROVINCE);
|
||||
}
|
||||
return mProvince == null ? "" : mProvince;
|
||||
}
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
public String getCity() {
|
||||
if (TextUtils.isEmpty(mCity)) {
|
||||
mCity = SpUtil.getInstance().getStringValue(SpUtil.LOCATION_CITY);
|
||||
}
|
||||
return mCity == null ? "" : mCity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
public String getDistrict() {
|
||||
if (TextUtils.isEmpty(mDistrict)) {
|
||||
mDistrict = SpUtil.getInstance().getStringValue(SpUtil.LOCATION_DISTRICT);
|
||||
}
|
||||
return mDistrict == null ? "" : mDistrict;
|
||||
}
|
||||
|
||||
public void setUserBean(UserBean bean) {
|
||||
mUserBean = bean;
|
||||
}
|
||||
|
||||
public UserBean getUserBean() {
|
||||
if (mUserBean == null) {
|
||||
String userBeanJson = SpUtil.getInstance().getStringValue(SpUtil.USER_INFO);
|
||||
if (!TextUtils.isEmpty(userBeanJson)) {
|
||||
mUserBean = JSON.parseObject(userBeanJson, UserBean.class);
|
||||
}
|
||||
}
|
||||
return mUserBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置萌颜是否可用
|
||||
*/
|
||||
public void setTiBeautyEnable(boolean tiBeautyEnable) {
|
||||
mTiBeautyEnable = tiBeautyEnable;
|
||||
SpUtil.getInstance().setBooleanValue(SpUtil.TI_BEAUTY_ENABLE, tiBeautyEnable);
|
||||
}
|
||||
|
||||
public boolean isTiBeautyEnable() {
|
||||
if (mTiBeautyEnable == null) {
|
||||
mTiBeautyEnable = SpUtil.getInstance().getBooleanValue(SpUtil.TI_BEAUTY_ENABLE);
|
||||
}
|
||||
return mTiBeautyEnable;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置登录信息
|
||||
*/
|
||||
public void setLoginInfo(String uid, String token, boolean save) {
|
||||
L.e("登录成功", "uid------>" + uid);
|
||||
L.e("登录成功", "token------>" + token);
|
||||
mUid = uid;
|
||||
mToken = token;
|
||||
if (save) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put(SpUtil.UID, uid);
|
||||
map.put(SpUtil.TOKEN, token);
|
||||
SpUtil.getInstance().setMultiStringValue(map);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除登录信息
|
||||
*/
|
||||
public void clearLoginInfo() {
|
||||
mUid = null;
|
||||
mToken = null;
|
||||
mLoginIM = false;
|
||||
SpUtil.getInstance().removeValue(
|
||||
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置位置信息
|
||||
*
|
||||
* @param lng 经度
|
||||
* @param lat 纬度
|
||||
* @param province 省
|
||||
* @param city 市
|
||||
*/
|
||||
public void setLocationInfo(double lng, double lat, String province, String city, String district) {
|
||||
mLng = lng;
|
||||
mLat = lat;
|
||||
mProvince = province;
|
||||
mCity = city;
|
||||
mDistrict = district;
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put(SpUtil.LOCATION_LNG, String.valueOf(lng));
|
||||
map.put(SpUtil.LOCATION_LAT, String.valueOf(lat));
|
||||
map.put(SpUtil.LOCATION_PROVINCE, province);
|
||||
map.put(SpUtil.LOCATION_CITY, city);
|
||||
map.put(SpUtil.LOCATION_DISTRICT, district);
|
||||
SpUtil.getInstance().setMultiStringValue(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除定位信息
|
||||
*/
|
||||
public void clearLocationInfo() {
|
||||
mLng = 0;
|
||||
mLat = 0;
|
||||
mProvince = null;
|
||||
mCity = null;
|
||||
mDistrict = null;
|
||||
SpUtil.getInstance().removeValue(
|
||||
SpUtil.LOCATION_LNG,
|
||||
SpUtil.LOCATION_LAT,
|
||||
SpUtil.LOCATION_PROVINCE,
|
||||
SpUtil.LOCATION_CITY,
|
||||
SpUtil.LOCATION_DISTRICT);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public boolean isLoginIM() {
|
||||
return mLoginIM;
|
||||
}
|
||||
|
||||
public void setLoginIM(boolean loginIM) {
|
||||
mLoginIM = loginIM;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取版本号
|
||||
*/
|
||||
public String getVersion() {
|
||||
if (TextUtils.isEmpty(mVersion)) {
|
||||
try {
|
||||
PackageManager manager = CommonAppContext.sInstance.getPackageManager();
|
||||
PackageInfo info = manager.getPackageInfo(CommonAppContext.sInstance.getPackageName(), 0);
|
||||
mVersion = info.versionName;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return mVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取App名称
|
||||
*/
|
||||
public String getAppName() {
|
||||
if (TextUtils.isEmpty(mAppName)) {
|
||||
int res = CommonAppContext.sInstance.getResources().getIdentifier("app_name", "string", "myname.pdlive.shayu");
|
||||
mAppName = WordUtil.getString(res);
|
||||
}
|
||||
return mAppName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取App图标的资源id
|
||||
*/
|
||||
public int getAppIconRes() {
|
||||
if (mAppIconRes == 0) {
|
||||
mAppIconRes = CommonAppContext.sInstance.getResources().getIdentifier("ic_launcher", "mipmap", CommonAppContext.sInstance.getPackageName());
|
||||
}
|
||||
return mAppIconRes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取MetaData中的极光AppKey
|
||||
*/
|
||||
public String getJPushAppKey() {
|
||||
if (mJPushAppKey == null) {
|
||||
mJPushAppKey = getMetaDataString("JPUSH_APPKEY");
|
||||
}
|
||||
return mJPushAppKey;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取MetaData中的腾讯定位,地图的AppKey
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getTxMapAppKey() {
|
||||
if (mTxMapAppKey == null) {
|
||||
mTxMapAppKey = getMetaDataString("TencentMapSDK");
|
||||
}
|
||||
return mTxMapAppKey;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取MetaData中的腾讯定位,地图的AppSecret
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getTxMapAppSecret() {
|
||||
if (mTxMapAppSecret == null) {
|
||||
mTxMapAppSecret = getMetaDataString("TencentMapAppSecret");
|
||||
}
|
||||
return mTxMapAppSecret;
|
||||
}
|
||||
|
||||
|
||||
private static String getMetaDataString(String key) {
|
||||
String res = null;
|
||||
try {
|
||||
ApplicationInfo appInfo = CommonAppContext.sInstance.getPackageManager().getApplicationInfo(CommonAppContext.sInstance.getPackageName(), PackageManager.GET_META_DATA);
|
||||
res = appInfo.metaData.getString(key);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("tag", "url:" + res);
|
||||
return res;
|
||||
}
|
||||
|
||||
private static boolean getMetaDataBoolean(String key) {
|
||||
boolean res = false;
|
||||
try {
|
||||
ApplicationInfo appInfo = CommonAppContext.sInstance.getPackageManager().getApplicationInfo(CommonAppContext.sInstance.getPackageName(), PackageManager.GET_META_DATA);
|
||||
res = appInfo.metaData.getBoolean(key);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
private static int getMetaDataInt(String key) {
|
||||
int res = 0;
|
||||
try {
|
||||
ApplicationInfo appInfo = CommonAppContext.sInstance.getPackageManager().getApplicationInfo(CommonAppContext.sInstance.getPackageName(), PackageManager.GET_META_DATA);
|
||||
res = appInfo.metaData.getInt(key);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 个人中心功能列表
|
||||
*/
|
||||
public List<UserItemBean> getUserItemList() {
|
||||
if (mUserItemList == null || mUserItemList.size() == 0) {
|
||||
String userBeanJson = SpUtil.getInstance().getStringValue(SpUtil.USER_INFO);
|
||||
if (!TextUtils.isEmpty(userBeanJson)) {
|
||||
JSONObject obj = JSON.parseObject(userBeanJson);
|
||||
if (obj != null) {
|
||||
setUserItemList(obj.getString("list"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return mUserItemList;
|
||||
}
|
||||
|
||||
|
||||
public void setUserItemList(String listString) {
|
||||
UserItemBean[][] arr = JSON.parseObject(listString, UserItemBean[][].class);
|
||||
if (arr != null && arr.length > 0) {
|
||||
List<UserItemBean> newList = new ArrayList<>();
|
||||
for (int i = 0, length1 = arr.length; i < length1; i++) {
|
||||
for (int j = 0, length2 = arr[i].length; j < length2; j++) {
|
||||
UserItemBean bean = arr[i][j];
|
||||
if (j == length2 - 1) {
|
||||
if (i < length1 - 1) {
|
||||
bean.setGroupLast(true);
|
||||
} else {
|
||||
bean.setAllLast(true);
|
||||
}
|
||||
}
|
||||
newList.add(bean);
|
||||
}
|
||||
}
|
||||
mUserItemList = newList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存主播粉丝徽章信息
|
||||
*/
|
||||
public void setAnchorFansMedal(String anchorMedalJson) {
|
||||
if (TextUtils.isEmpty(anchorMedalJson)) {
|
||||
return;
|
||||
}
|
||||
List<FansMedalBean> list = JSON.parseArray(anchorMedalJson, FansMedalBean.class);
|
||||
if (list == null || list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
if (mAnchorFansMedalMap == null) {
|
||||
mAnchorFansMedalMap = new SparseArray<>();
|
||||
}
|
||||
mAnchorFansMedalMap.clear();
|
||||
for (FansMedalBean bean : list) {
|
||||
mAnchorFansMedalMap.put(bean.getLevel(), bean);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主播粉丝徽章信息
|
||||
*/
|
||||
public FansMedalBean getAnchorFansMedal(int level) {
|
||||
if (mAnchorFansMedalMap == null) {
|
||||
String configString = SpUtil.getInstance().getStringValue(SpUtil.CONFIG);
|
||||
if (!TextUtils.isEmpty(configString)) {
|
||||
JSONObject obj = JSON.parseObject(configString);
|
||||
setAnchorFansMedal(obj.getString("levelfans"));
|
||||
}
|
||||
}
|
||||
if (mAnchorFansMedalMap == null || mAnchorFansMedalMap.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return mAnchorFansMedalMap.get(level);
|
||||
}
|
||||
|
||||
|
||||
public String getGiftListJson() {
|
||||
return mGiftListJson;
|
||||
}
|
||||
|
||||
public void setGiftListJson(String getGiftListJson) {
|
||||
mGiftListJson = getGiftListJson;
|
||||
}
|
||||
|
||||
|
||||
public String getWrapListJson() {
|
||||
return mWrapListJson;
|
||||
}
|
||||
|
||||
public void setWrapListJson(String wrapListJson) {
|
||||
mWrapListJson = wrapListJson;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断某APP是否安装
|
||||
*/
|
||||
public static boolean isAppExist(String packageName) {
|
||||
if (!TextUtils.isEmpty(packageName)) {
|
||||
PackageManager manager = CommonAppContext.sInstance.getPackageManager();
|
||||
List<PackageInfo> list = manager.getInstalledPackages(0);
|
||||
for (PackageInfo info : list) {
|
||||
if (packageName.equalsIgnoreCase(info.packageName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean isLaunched() {
|
||||
return mLaunched;
|
||||
}
|
||||
|
||||
public void setLaunched(boolean launched) {
|
||||
mLaunched = launched;
|
||||
}
|
||||
|
||||
//app是否在前台
|
||||
public boolean isFrontGround() {
|
||||
return mFrontGround;
|
||||
}
|
||||
|
||||
//app是否在前台
|
||||
public void setFrontGround(boolean frontGround) {
|
||||
mFrontGround = frontGround;
|
||||
}
|
||||
|
||||
//设置美颜类型
|
||||
public void setBeautySdkType(String sproutType) {
|
||||
SpUtil.getInstance().setStringValue(SpUtil.BEAUTY_SDK_TYPE, sproutType);
|
||||
}
|
||||
|
||||
public String getBeautySdkType() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.BEAUTY_SDK_TYPE);
|
||||
}
|
||||
|
||||
//设置是否显示转盘功能
|
||||
public void setTurnTableEnable(String enable) {
|
||||
SpUtil.getInstance().setStringValue(SpUtil.TURNTABLE_ENABLE, enable);
|
||||
}
|
||||
|
||||
public String getTurnTableEnable() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.TURNTABLE_ENABLE);
|
||||
}
|
||||
|
||||
//设置360美颜贴纸下载地址
|
||||
public void setBeauty360TieZhiUrl(String tieZhiUrl) {
|
||||
SpUtil.getInstance().setStringValue(SpUtil.BEAUTY_360_TIEZHI_URL, tieZhiUrl);
|
||||
}
|
||||
|
||||
public String getBeauty360TieZhiUrl() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.BEAUTY_360_TIEZHI_URL);
|
||||
}
|
||||
|
||||
//360贴纸已经下载过
|
||||
public void setBeauty360TieZhiExist(boolean isExist) {
|
||||
SpUtil.getInstance().setBooleanValue(SpUtil.BEAUTY_360_TIEZHI_EXIST, isExist);
|
||||
}
|
||||
|
||||
public boolean getBeauty360TieZhiExist() {
|
||||
return SpUtil.getInstance().getBooleanValue(SpUtil.BEAUTY_360_TIEZHI_EXIST);
|
||||
}
|
||||
|
||||
//设置主播pk时间
|
||||
public void setAnchorPkTime(String pkTime) {
|
||||
SpUtil.getInstance().setStringValue(SpUtil.ANCHOR_PK_TIME, pkTime);
|
||||
}
|
||||
|
||||
public String getAnchorPkTime() {
|
||||
return SpUtil.getInstance().getStringValue(SpUtil.ANCHOR_PK_TIME);
|
||||
}
|
||||
|
||||
}
|
||||
153
common/src/main/java/com/yunbao/common/CommonAppContext.java
Normal file
153
common/src/main/java/com/yunbao/common/CommonAppContext.java
Normal file
@@ -0,0 +1,153 @@
|
||||
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 com.facebook.FacebookSdk;
|
||||
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;
|
||||
import io.rong.push.RongPushClient;
|
||||
import io.rong.push.pushconfig.PushConfig;
|
||||
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/3.
|
||||
*/
|
||||
|
||||
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 boolean isReady = false;
|
||||
public static String home_zdy_img_us = "";
|
||||
public static String home_zdy_img_cn = "";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
sInstance = this;
|
||||
//初始化Http
|
||||
CommonHttpUtil.init();
|
||||
// //华为推送
|
||||
// PushConfig config = new PushConfig.Builder()
|
||||
// .enableHWPush(true)
|
||||
// .build();
|
||||
// RongPushClient.setPushConfig(config); //将推送相关配置设置到 SDK
|
||||
//设置新加坡融云服务器 有时候国内收不到推送是因为这个
|
||||
RongIMClient.setServerInfo("navsg01.cn.ronghub.com", null);
|
||||
if (CommonAppConfig.IS_GOOGLE_PLAY != 2) {
|
||||
//谷歌推送
|
||||
PushConfig gconfig = new PushConfig.Builder().enableFCM(true).build();
|
||||
RongPushClient.setPushConfig(gconfig);
|
||||
}
|
||||
//初始化友盟统计
|
||||
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
|
||||
FacebookSdk.sdkInitialize(getApplicationContext());
|
||||
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("zh")) {
|
||||
lang = "chinese";
|
||||
|
||||
} else {
|
||||
lang = "english";
|
||||
|
||||
}
|
||||
Log.i("lang", lang);
|
||||
|
||||
}
|
||||
|
||||
public static Activity getTopActivity() {
|
||||
if (activityWeakReference == null) {
|
||||
return null;
|
||||
}
|
||||
return activityWeakReference.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
MultiDex.install(this);
|
||||
super.attachBaseContext(base);
|
||||
}
|
||||
|
||||
private void registerActivityLifecycleCallbacks() {
|
||||
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
|
||||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
mCount++;
|
||||
activityWeakReference = new WeakReference<>(activity);
|
||||
if (!mFront) {
|
||||
mFront = true;
|
||||
L.e("AppContext------->处于前台");
|
||||
ShortcutBadger.applyCount(activity, 0);
|
||||
jpushMsgNum = 0;
|
||||
CommonAppConfig.getInstance().setFrontGround(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity) {
|
||||
mCount--;
|
||||
if (mCount == 0) {
|
||||
mFront = false;
|
||||
L.e("AppContext------->处于后台");
|
||||
CommonAppConfig.getInstance().setFrontGround(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
310
common/src/main/java/com/yunbao/common/Constants.java
Normal file
310
common/src/main/java/com/yunbao/common/Constants.java
Normal file
@@ -0,0 +1,310 @@
|
||||
package com.yunbao.common;
|
||||
|
||||
import com.yunbao.common.bean.ChatRemarksBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/6/7.
|
||||
*/
|
||||
|
||||
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";
|
||||
public static final String NICK_NAME = "nickname";
|
||||
public static final String REMARKS = "remarks";
|
||||
public static final String AVATAR = "avatar";
|
||||
public static final String SIGN = "sign";
|
||||
public static final String TO_UID = "toUid";
|
||||
public static final String INTOINDEX = "intoIndex";
|
||||
public static final String FROM_LIVE_ROOM = "fromLiveRoom";
|
||||
public static final String TO_NAME = "toName";
|
||||
public static final String STREAM = "stream";
|
||||
public static final String LIMIT = "limit";
|
||||
public static final String UID = "uid";
|
||||
public static final String USER_NAME = "userName";//用户名
|
||||
public static final String USER_ICON = "userIcon";//用户头像
|
||||
|
||||
public static final String TIP = "tip";
|
||||
public static final String SHOW_INVITE = "showInvite";
|
||||
public static final String USER_BEAN = "userBean";
|
||||
public static final String CLASS_ID = "classID";
|
||||
public static final String CLASS_NAME = "className";
|
||||
public static final String CHECKED_ID = "checkedId";
|
||||
public static final String CHECKED_COIN = "checkedCoin";
|
||||
public static final String LIVE_DANMU_PRICE = "danmuPrice";
|
||||
public static final String COIN_NAME = "coinName";
|
||||
public static final String LIVE_BEAN = "liveBean";
|
||||
public static final String LIVE_TYPE = "liveType";
|
||||
public static final String LIVE_KEY = "liveKey";
|
||||
public static final String LIVE_POSITION = "livePosition";
|
||||
public static final String LIVE_TYPE_VAL = "liveTypeVal";
|
||||
public static final String LIVE_UID = "liveUid";
|
||||
public static final String LIVE_STREAM = "liveStream";
|
||||
public static final String LIVE_WISH_GIFTID = "wishGiftId";
|
||||
public static final String LIVE_HOME = "liveHome";
|
||||
public static final String LIVE_FOLLOW = "liveFollow";
|
||||
public static final String LIVE_NEAR = "liveNear";
|
||||
public static final String LIVE_CLASS_PREFIX = "liveClass_";
|
||||
public static final String LIVE_ADMIN_ROOM = "liveAdminRoom";
|
||||
public static final String LIVE_ANCHER_NAME = "ancherName";//主播名
|
||||
public static final String LIVE_ANCHER_ICON = "ancherIcon";//主播头像
|
||||
public static final String HAS_GAME = "hasGame";
|
||||
public static final String OPEN_FLASH = "openFlash";
|
||||
public static final String SHARE_QR_CODE_FILE = "shareQrCodeFile.png";
|
||||
public static final String ANCHOR = "anchor";
|
||||
public static final String FOLLOW = "follow";
|
||||
public static final String DIAMONDS = "钻石";
|
||||
public static final String GOLD_NAME = "金币";
|
||||
public static final String VOTES = "映票";
|
||||
public static final String PAY_ALI_NOT_ENABLE = "支付宝未接入";
|
||||
public static final String PAY_WX_NOT_ENABLE = "微信支付未接入";
|
||||
public static final String PAY_ALL_NOT_ENABLE = "未开启支付";
|
||||
public static final String PAY_TYPE_ALI = "ali";
|
||||
public static final String PAY_TYPE_WX = "wx";
|
||||
public static final String PAY_TYPE_HW = "hw";
|
||||
public static final String PAY_TYPE_HFB = "hfb";
|
||||
public static final String PAY_TYPE_YUNQU = "yunqu";//海外直播支付yunqu
|
||||
public static final String PAY_TYPE_PAYSSION = "payssion";//payssion支付
|
||||
public static final String PAY_TYPE_PAYPAL = "paypal";//paypal支付
|
||||
public static final String PAY_TYPE_GOOGLE = "google";//google支付
|
||||
|
||||
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_WX = "com.tencent.mm";//微信的包名
|
||||
public static final String PACKAGE_NAME_QQ = "com.tencent.mobileqq";//QQ的包名
|
||||
public static final String LAT = "lat";
|
||||
public static final String LNG = "lng";
|
||||
public static final String ADDRESS = "address";
|
||||
public static final String SCALE = "scale";
|
||||
public static final String SELECT_IMAGE_PATH = "selectedImagePath";
|
||||
public static final String COPY_PREFIX = "copy://";
|
||||
public static final int GUARD_TYPE_NONE = 0;
|
||||
public static final int GUARD_TYPE_DAY = 1;
|
||||
public static final int GUARD_TYPE_MONTH = 2;
|
||||
public static final int GUARD_TYPE_YEAR = 3;
|
||||
|
||||
public static final String GIF_GIFT_PREFIX = "gif_gift_";
|
||||
public static final String GIF_CAR_PREFIX = "gif_car_";
|
||||
public static final String DOWNLOAD_MUSIC = "downloadMusic";
|
||||
public static final String LINK = "link";
|
||||
public static final String REPORT = "report";
|
||||
public static final String SAVE = "save";
|
||||
public static final String DELETE = "delete";
|
||||
public static final String SHARE_FROM = "shareFrom";
|
||||
public static final int SHARE_FROM_LIVE = 101;
|
||||
public static final int SHARE_FROM_HOME = 102;
|
||||
public static final int SETTING_MODIFY_PWD = 15;
|
||||
public static final int SETTING_UPDATE_ID = 16;
|
||||
public static final int SETTING_CLEAR_CACHE = 18;
|
||||
public static final int SETTING_ISBLACK = 20;
|
||||
public static final int SEX_MALE = 1;
|
||||
public static final int SEX_FEMALE = 2;
|
||||
public static final int FOLLOW_FROM_FOLLOW = 1002;
|
||||
public static final int FOLLOW_FROM_FANS = 1003;
|
||||
public static final int FOLLOW_FROM_SEARCH = 1004;
|
||||
public static final String IM_FROM_HOME = "imFromHome";
|
||||
//直播房间类型
|
||||
public static final int LIVE_TYPE_NORMAL = 0;//普通房间
|
||||
public static final int LIVE_TYPE_PWD = 1;//密码房间
|
||||
public static final int LIVE_TYPE_PAY = 2;//收费房间
|
||||
public static final int LIVE_TYPE_TIME = 3;//计时房间
|
||||
public static final int LIVE_TYPE_RESTING = 4;//休息中
|
||||
//主播直播间功能
|
||||
public static final int LIVE_FUNC_BEAUTY = 2001;//美颜
|
||||
public static final int LIVE_FUNC_CAMERA = 2002;//切换摄像头
|
||||
public static final int LIVE_FUNC_FLASH = 2003;//闪光灯
|
||||
public static final int LIVE_FUNC_MUSIC = 2004;//伴奏
|
||||
public static final int LIVE_FUNC_SHARE = 2005;//分享
|
||||
public static final int LIVE_FUNC_GAME = 2006;//游戏
|
||||
public static final int LIVE_FUNC_RED_PACK = 2007;//红包
|
||||
public static final int LIVE_FUNC_LINK_MIC = 2008;//连麦
|
||||
public static final int LIVE_FUNC_WISHLIST = 2009;//心愿单
|
||||
public static final int LIVE_FUNC_MIRROR = 2010;//鏡像
|
||||
public static final int LIVE_FUNC_ZG = 2011;//鏡像
|
||||
public static final int LIVE_FUNC_DR = 2012;//多人
|
||||
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";
|
||||
public static final String SOCKET_BROADCAST = "broadcastingListen";
|
||||
public static final String SOCKET_SEND = "broadcast";
|
||||
public static final String SOCKET_STOP_PLAY = "stopplay";//超管关闭直播间
|
||||
public static final String SOCKET_STOP_LIVE = "stopLive";//超管关闭直播间
|
||||
public static final String SOCKET_SEND_MSG = "SendMsg";//发送文字消息,点亮,用户进房间 PS:这种混乱的设计是因为服务器端逻辑就是这样设计的,客户端无法自行修改
|
||||
public static final String SOCKET_LIGHT = "light";//飘心
|
||||
public static final String SOCKET_SEND_GIFT = "SendGift";//送礼物
|
||||
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";//系统消息
|
||||
public static final String UP_USER_LIST = "upuserlist";//更新用戶列表
|
||||
public static final String LIAN_MAI = "LivePKDRLM";//用户连麦
|
||||
public static final String CARD = "card";//活动
|
||||
public static final String SOCKET_KICK = "KickUser";//踢人
|
||||
public static final String SOCKET_SHUT_UP = "ShutUpUser";//禁言
|
||||
public static final String SOCKET_SET_ADMIN = "setAdmin";//设置或取消管理员
|
||||
public static final String SOCKET_CHANGE_LIVE = "changeLive";//切换计时收费类型
|
||||
public static final String SOCKET_UPDATE_VOTES = "updateVotes";//门票或计时收费时候更新主播的映票数
|
||||
public static final String SOCKET_FAKE_FANS = "requestFans";//僵尸粉
|
||||
public static final String SOCKET_LINK_MIC = "ConnectVideo";//连麦
|
||||
public static final String SOCKET_LINK_MIC_ANCHOR = "LiveConnect";//主播连麦
|
||||
public static final String SOCKET_LINK_MIC_PK = "LivePK";//主播PK
|
||||
public static final String SOCKET_BUY_GUARD = "BuyGuard";//购买守护
|
||||
public static final String SOCKET_RED_PACK = "SendRed";//红包
|
||||
public static final String SOCKET_LUCK_WIN = "luckWin";//幸运礼物中奖
|
||||
public static final String SOCKET_PRIZE_POOL_WIN = "jackpotWin";//奖池中奖
|
||||
public static final String SOCKET_PRIZE_POOL_UP = "jackpotUp";//奖池升级
|
||||
public static final String SOCKET_HOUR = "SendHourChart";//小时榜更新
|
||||
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";//全服通知
|
||||
public static final String XYD_COMPLETE = "XydComplete";//心愿单完成通知
|
||||
public static final String WISH_LIST_PROGRESS = "wishListProgress";//心愿单进度通知
|
||||
public static final String LIVE_VOTE_CREATE = "createVote";
|
||||
public static final String LIVE_VOTE_UPDATE = "updateVote";
|
||||
public static final String LIVE_VOTE_END = "endVote";
|
||||
public static final String LIVE_PK_END = "endPK";//结束PK,以这个PK获取到的参数为准
|
||||
public static final String RED_PACKET = "RedPacket";//红包通知
|
||||
public static final String RED_PACKET_SUPER_JACKPOT = "RedPacketSuperJackpot";//超级红包通知
|
||||
public static final String SOCKET_LIVE_MSG_TO_USER = "SendMsgToUser";//七日用户主播提示语
|
||||
|
||||
//游戏socket
|
||||
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
||||
public static final String SOCKET_GAME_HD = "startLodumaniGame";//海盗船长
|
||||
public static final String SOCKET_GAME_NZ = "startCattleGame";//开心牛仔
|
||||
public static final String SOCKET_GAME_ZP = "startRotationGame";//幸运转盘
|
||||
public static final String SOCKET_GAME_EBB = "startShellGame";//二八贝
|
||||
|
||||
public static final String SOCKET_SEND_ACTIVE_MSG = "SendActiveMsg";//活动,聊天显示
|
||||
public static final String SOCKET_PRANKTURNTABLE = "prankTurntable";//整蛊消息
|
||||
public static final String SOCKET_USEHOTCARD = "UseHotCard";//热度卡消息
|
||||
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;
|
||||
public static final int SOCKET_WHAT_BROADCAST = 1;
|
||||
//socket 用户类型
|
||||
public static final int SOCKET_USER_TYPE_NORMAL = 30;//普通用户
|
||||
public static final int SOCKET_USER_TYPE_ADMIN = 40;//房间管理员
|
||||
public static final int SOCKET_USER_TYPE_ANCHOR = 50;//主播
|
||||
public static final int SOCKET_USER_TYPE_SUPER = 60;//超管
|
||||
|
||||
//提现账号类型,1表示支付宝,2表示微信,3表示银行卡
|
||||
public static final int CASH_ACCOUNT_ALI = 1;
|
||||
public static final int CASH_ACCOUNT_WX = 2;
|
||||
public static final int CASH_ACCOUNT_BANK = 3;
|
||||
public static final String CASH_ACCOUNT_ID = "cashAccountID";
|
||||
public static final String CASH_ACCOUNT = "cashAccount";
|
||||
public static final String CASH_ACCOUNT_TYPE = "cashAccountType";
|
||||
|
||||
|
||||
public static final int RED_PACK_TYPE_AVERAGE = 0;//平均红包
|
||||
public static final int RED_PACK_TYPE_SHOU_QI = 1;//拼手气红包
|
||||
public static final int RED_PACK_SEND_TIME_NORMAL = 0;//立即发放
|
||||
public static final int RED_PACK_SEND_TIME_DELAY = 1;//延时发放
|
||||
|
||||
public static final int JPUSH_TYPE_NONE = 0;
|
||||
public static final int JPUSH_TYPE_LIVE = 1;//直播
|
||||
public static final int JPUSH_TYPE_MESSAGE = 2;//消息
|
||||
|
||||
public static final String VIDEO_HOME = "videoHome";
|
||||
public static final String VIDEO_USER = "videoUser_";
|
||||
public static final String VIDEO_KEY = "videoKey";
|
||||
public static final String VIDEO_POSITION = "videoPosition";
|
||||
public static final String VIDEO_SINGLE = "videoSingle";
|
||||
public static final String VIDEO_COMMUNITY = "community";
|
||||
public static final String VIDEO_PAGE = "videoPage";
|
||||
public static final String VIDEO_BEAN = "videoBean";
|
||||
public static final String VIDEO_ID = "videoId";
|
||||
public static final String VIDEO_COMMENT_BEAN = "videoCommnetBean";
|
||||
public static final String VIDEO_FACE_OPEN = "videoOpenFace";
|
||||
public static final String VIDEO_FACE_HEIGHT = "videoFaceHeight";
|
||||
public static final String VIDEO_DURATION = "videoDuration";
|
||||
public static final String VIDEO_PATH = "videoPath";
|
||||
public static final String VIDEO_FROM_RECORD = "videoFromRecord";
|
||||
public static final String VIDEO_MUSIC_BEAN = "videoMusicBean";
|
||||
public static final String VIDEO_MUSIC_ID = "videoMusicId";
|
||||
public static final String VIDEO_HAS_BGM = "videoHasBgm";
|
||||
public static final String VIDEO_MUSIC_NAME_PREFIX = "videoMusicName_";
|
||||
public static final String VIDEO_SAVE_TYPE = "videoSaveType";
|
||||
public static final int VIDEO_SAVE_SAVE_AND_PUB = 1;//保存并发布
|
||||
public static final int VIDEO_SAVE_SAVE = 2;//仅保存
|
||||
public static final int VIDEO_SAVE_PUB = 3;//仅发布
|
||||
|
||||
public static final String MOB_QQ = "qq";
|
||||
public static final String MOB_QZONE = "qzone";
|
||||
public static final String MOB_WX = "wx";
|
||||
public static final String MOB_WX_PYQ = "wchat";
|
||||
public static final String MOB_FACEBOOK = "facebook";
|
||||
public static final String MOB_TWITTER = "twitter";
|
||||
public static final String MOB_PHONE = "phone";
|
||||
|
||||
public static final String LIVE_SDK = "liveSdk";
|
||||
public static final String LIVE_KSY_CONFIG = "liveKsyConfig";
|
||||
|
||||
public static final String LIVE_PK_RANDOM_START="RankingStartRandomPK";
|
||||
public static final int LIVE_SDK_KSY = 0;//金山推流
|
||||
public static final int LIVE_SDK_TX = 1;//腾讯推流
|
||||
|
||||
|
||||
public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦
|
||||
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦
|
||||
|
||||
//视频举报获取位置
|
||||
public static int xIndex = 0;
|
||||
public static int yindex = 0;
|
||||
public static String isBlack;
|
||||
|
||||
public static String nowPostsId = "";
|
||||
|
||||
public static String myAvatar = "";
|
||||
public static String myUid = "";
|
||||
public static String myName = "";
|
||||
|
||||
public static int myIntoIndex = 0;
|
||||
public static String chatActionUrl = "";
|
||||
|
||||
public static String myUrl = "";
|
||||
public static String mStream = "";
|
||||
public static String nowSendUid = "";//获取当前会话新信息用于会话列表显示
|
||||
public static boolean isAnchor = false;
|
||||
public static String myPackageUrl = "";
|
||||
public static boolean isTitle = false;
|
||||
public static int isShowPage = -1;
|
||||
public static boolean LoginKefu = true;//是否是从客服进入
|
||||
public static String nowAnchorName = "";//当前主播昵称
|
||||
public static String isSend = "1";//是否能发言,enterroom接口返回,1 可发言 0 不可发言
|
||||
public static String nowId = "";//当前点击了某个单聊的id
|
||||
public static String remarks = "";//当前点击了某个单聊的备注
|
||||
public static String isAdmin = "0";//当前点击了某个单聊是否是指导员
|
||||
public static List<ChatRemarksBean> remarksListNow = new ArrayList<>();//存储的备注
|
||||
public static int getWeekIntIndex = 0;//是否刷新了周星列表
|
||||
public static boolean isInstructor = false;//是否是管理员
|
||||
public static String isSetRemark = "";//是否有修改备注
|
||||
public static String isSetRemarkText = "";//修改的备注信息
|
||||
public static boolean isShowLiveDialog = false;//是否在直播间打开单聊
|
||||
public static int firstInto = 0;//
|
||||
|
||||
}
|
||||
61
common/src/main/java/com/yunbao/common/HtmlConfig.java
Normal file
61
common/src/main/java/com/yunbao/common/HtmlConfig.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.yunbao.common;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/15.
|
||||
*/
|
||||
|
||||
public class HtmlConfig {
|
||||
|
||||
//登录即代表同意服务和隐私条款
|
||||
public static final String LOGIN_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=68";
|
||||
public static final String LOGIN_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=67";
|
||||
|
||||
//注册用户协议
|
||||
public static final String REG_PRIVCAY1 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=2";
|
||||
public static final String REG_PRIVCAY2 = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=3";
|
||||
|
||||
//直播间贡献榜
|
||||
public static final String LIVE_LIST = CommonAppConfig.HOST + "/index.php?g=Appapi&m=contribute&a=index&uid=";
|
||||
//直播间粉丝排行榜
|
||||
public static final String LIVE_FANS_MEDAL_RANKING = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Fans&a=fansranking&uid=";
|
||||
//个人主页分享链接
|
||||
public static final String SHARE_HOME_PAGE = CommonAppConfig.HOST + "/index.php?g=Appapi&m=home&a=index&touid=";
|
||||
//提现记录
|
||||
public static final String CASH_RECORD = CommonAppConfig.HOST + "/index.php?g=Appapi&m=cash&a=index";
|
||||
//支付宝充值回调地址
|
||||
public static final String ALI_PAY_COIN_URL = CommonAppConfig.HOST + "/Appapi/Pay/notify_ali";
|
||||
//谷歌支付回调地址
|
||||
public static final String GOOGLE_PAY_COIN_URL = CommonAppConfig.HOST + "/Appapi/Pay/";
|
||||
|
||||
//视频分享地址
|
||||
public static final String SHARE_VIDEO = CommonAppConfig.HOST + "/index.php?g=appapi&m=video&a=index&videoid=";
|
||||
//直播间幸运礼物说明
|
||||
public static final String LUCK_GIFT_TIP = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=26";
|
||||
|
||||
//直播间玩家看到的心愿单
|
||||
public static final String WISHLIST_URL = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Wish&a=index";
|
||||
|
||||
//直播间玩家看到的转盘
|
||||
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
||||
|
||||
//在线商城
|
||||
public static final String SHOP = CommonAppConfig.HOST + "/h5/shoppingMall.html";
|
||||
|
||||
//社区
|
||||
public static final String ENCOURAGE = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ";
|
||||
|
||||
//个人信息
|
||||
public static final String PERSONAL = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ/Personal";
|
||||
|
||||
//我的徽章 右上角问号
|
||||
public static final String MEDAL_QUESTION = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Fans&a=rule&isfans=1";
|
||||
|
||||
//我的明细
|
||||
public static final String DETAIL = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Detail&a=index";
|
||||
//充值协议
|
||||
public static final String CHARGE_PRIVCAY = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=6";
|
||||
|
||||
//充值说明
|
||||
public static final String CHARGE_EXPLAIN = CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=41";
|
||||
|
||||
}
|
||||
394
common/src/main/java/com/yunbao/common/activity/AbsActivity.java
Normal file
394
common/src/main/java/com/yunbao/common/activity/AbsActivity.java
Normal file
@@ -0,0 +1,394 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Rect;
|
||||
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;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.LifeCycleListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/3.
|
||||
*/
|
||||
|
||||
public abstract class AbsActivity extends AppCompatActivity {
|
||||
|
||||
protected String mTag;
|
||||
protected Activity mContext;
|
||||
protected List<LifeCycleListener> mLifeCycleListeners;
|
||||
protected boolean isFullWindow;
|
||||
|
||||
@Override
|
||||
public Resources getResources() {
|
||||
Resources res = super.getResources();
|
||||
Configuration config = new Configuration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(this).getLocaleLanguage();
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
create();
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
isFullWindow = getIntent().getBooleanExtra("isFull", false);
|
||||
if (isFullWindow) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
}
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
mTag = this.getClass().getSimpleName();
|
||||
setStatusBar();
|
||||
setContentView(getLayoutId());
|
||||
mContext = this;
|
||||
mLifeCycleListeners = new ArrayList<>();
|
||||
main(savedInstanceState);
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onCreate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
main();
|
||||
}
|
||||
|
||||
protected void main() {
|
||||
|
||||
}
|
||||
protected void create(){
|
||||
|
||||
}
|
||||
|
||||
protected boolean isStatusBarWhite() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void setTitle(String title) {
|
||||
TextView titleView = (TextView) findViewById(R.id.titleView);
|
||||
if (titleView != null) {
|
||||
titleView.setText(title);
|
||||
}
|
||||
}
|
||||
|
||||
public void backClick(View v) {
|
||||
if (v.getId() == R.id.btn_back) {
|
||||
onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean canClick() {
|
||||
return ClickUtil.canClick();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置透明状态栏
|
||||
*/
|
||||
private void setStatusBar() {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
Window window = getWindow();
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
if (isStatusBarWhite()) {
|
||||
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
} else {
|
||||
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||
}
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
window.setStatusBarColor(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onDestroy();
|
||||
}
|
||||
mLifeCycleListeners.clear();
|
||||
mLifeCycleListeners = null;
|
||||
}
|
||||
ImgLoader.clearMemory(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onStart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestart() {
|
||||
super.onRestart();
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onReStart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onResume();
|
||||
}
|
||||
}
|
||||
//友盟统计
|
||||
// MobclickAgent.onResume(this);
|
||||
MobclickAgent.onPageStart(this.mTag);
|
||||
Log.e("MobclickAgent","MobclickAgent:_onResume_"+this.mTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
MobclickAgent.onPageEnd(this.mTag);
|
||||
Log.e("MobclickAgent","MobclickAgent:_onPause_"+this.mTag);
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onPause();
|
||||
}
|
||||
}
|
||||
//友盟统计
|
||||
// MobclickAgent.onPause(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
if (mLifeCycleListeners != null) {
|
||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||
listener.onStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addLifeCycleListener(LifeCycleListener listener) {
|
||||
if (mLifeCycleListeners != null && listener != null) {
|
||||
mLifeCycleListeners.add(listener);
|
||||
}
|
||||
}
|
||||
|
||||
public void addAllLifeCycleListener(List<LifeCycleListener> listeners) {
|
||||
if (mLifeCycleListeners != null && listeners != null) {
|
||||
mLifeCycleListeners.addAll(listeners);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeLifeCycleListener(LifeCycleListener listener) {
|
||||
if (mLifeCycleListeners != null) {
|
||||
mLifeCycleListeners.remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
//键盘遮挡问题
|
||||
private View mChildOfContent;
|
||||
private int usableHeightPrevious;
|
||||
private FrameLayout.LayoutParams frameLayoutParams;
|
||||
|
||||
public void init() {
|
||||
FrameLayout content = (FrameLayout) findViewById(android.R.id.content);
|
||||
mChildOfContent = content.getChildAt(0);
|
||||
mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(
|
||||
new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
public void onGlobalLayout() {
|
||||
possiblyResizeChildOfContent();
|
||||
}
|
||||
});
|
||||
frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent
|
||||
.getLayoutParams();
|
||||
}
|
||||
|
||||
private void possiblyResizeChildOfContent() {
|
||||
int usableHeightNow = computeUsableHeight();
|
||||
if (usableHeightNow != usableHeightPrevious) {
|
||||
int usableHeightSansKeyboard = mChildOfContent.getRootView()
|
||||
.getHeight();
|
||||
int heightDifference = usableHeightSansKeyboard - usableHeightNow;
|
||||
if (heightDifference > (usableHeightSansKeyboard / 4)) {
|
||||
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
|
||||
} else {
|
||||
frameLayoutParams.height = usableHeightSansKeyboard - getNavigationBarHeightIfRoom(mContext);
|
||||
;
|
||||
}
|
||||
mChildOfContent.requestLayout();
|
||||
usableHeightPrevious = usableHeightNow;
|
||||
}
|
||||
}
|
||||
|
||||
private int computeUsableHeight() {
|
||||
Rect r = new Rect();
|
||||
mChildOfContent.getWindowVisibleDisplayFrame(r);
|
||||
return (r.bottom - r.top);
|
||||
}
|
||||
|
||||
|
||||
public boolean checkDeviceHasNavigationBar2(Context context) {
|
||||
//通过判断设备是否有返回键、菜单键(不是虚拟键,是手机屏幕外的按键)来确定是否有navigation bar
|
||||
boolean hasMenuKey = ViewConfiguration.get(context)
|
||||
.hasPermanentMenuKey();
|
||||
boolean hasBackKey = KeyCharacterMap
|
||||
.deviceHasKey(KeyEvent.KEYCODE_BACK);
|
||||
|
||||
if (!hasMenuKey && !hasBackKey) {
|
||||
// 做任何你需要做的,这个设备有一个导航栏
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getNavigationBarHeightIfRoom(Context context) {
|
||||
if (navigationGestureEnabled(context)) {
|
||||
return 0;
|
||||
}
|
||||
return getCurrentNavigationBarHeight(((Activity) context));
|
||||
}
|
||||
|
||||
/**
|
||||
* 全面屏(是否开启全面屏开关 0 关闭 1 开启)
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static boolean navigationGestureEnabled(Context context) {
|
||||
int val = Settings.Global.getInt(context.getContentResolver(), getDeviceInfo(), 0);
|
||||
return val != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备信息(目前支持几大主流的全面屏手机,亲测华为、小米、oppo、魅族、vivo都可以)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getDeviceInfo() {
|
||||
String brand = Build.BRAND;
|
||||
if (TextUtils.isEmpty(brand))
|
||||
return "navigationbar_is_min";
|
||||
if (brand.equalsIgnoreCase("HUAWEI")) {
|
||||
return "navigationbar_is_min";
|
||||
} else if (brand.equalsIgnoreCase("XIAOMI")) {
|
||||
return "force_fsg_nav_bar";
|
||||
} else if (brand.equalsIgnoreCase("VIVO")) {
|
||||
return "navigation_gesture_on";
|
||||
} else if (brand.equalsIgnoreCase("OPPO")) {
|
||||
return "navigation_gesture_on";
|
||||
} else {
|
||||
return "navigationbar_is_min";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 非全面屏下 虚拟键实际高度(隐藏后高度为0)
|
||||
*
|
||||
* @param activity
|
||||
* @return
|
||||
*/
|
||||
public static int getCurrentNavigationBarHeight(Activity activity) {
|
||||
if (isNavigationBarShown(activity)) {
|
||||
return getNavigationBarHeight(activity);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 非全面屏下 虚拟按键是否打开
|
||||
*
|
||||
* @param activity
|
||||
* @return
|
||||
*/
|
||||
public static boolean isNavigationBarShown(Activity activity) {
|
||||
//虚拟键的view,为空或者不可见时是隐藏状态
|
||||
View view = activity.findViewById(android.R.id.navigationBarBackground);
|
||||
if (view == null) {
|
||||
return false;
|
||||
}
|
||||
int visible = view.getVisibility();
|
||||
if (visible == View.GONE || visible == View.INVISIBLE) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 非全面屏下 虚拟键高度(无论是否隐藏)
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static int getNavigationBarHeight(Context context) {
|
||||
int result = 0;
|
||||
int resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = context.getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
public boolean isKefu(String url){
|
||||
if(url.contains("kefu")){
|
||||
return true;
|
||||
}
|
||||
if(url.contains("https://newkf.yaoulive.com/")){
|
||||
return true;
|
||||
}
|
||||
return url.startsWith("https://kefu.yaoulive.com");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/8/29.
|
||||
* 服务器Home.getConfig接口有时候返回的数据无法解析,导致崩溃,
|
||||
* 这个类是用来收集服务器返回的错误的信息的
|
||||
*/
|
||||
|
||||
public class ErrorActivity extends AbsActivity {
|
||||
|
||||
public static void forward(String title, String errorInfo) {
|
||||
Intent intent = new Intent(CommonAppContext.sInstance, ErrorActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra("title", title);
|
||||
intent.putExtra("error", errorInfo);
|
||||
CommonAppContext.sInstance.startActivity(intent);
|
||||
}
|
||||
|
||||
private TextView mTextView;
|
||||
private String mErrorInfo;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_error;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
Intent intent = getIntent();
|
||||
String title = intent.getStringExtra("title");
|
||||
mErrorInfo = intent.getStringExtra("error");
|
||||
setTitle(title);
|
||||
mTextView = (TextView) findViewById(R.id.text);
|
||||
mTextView.setText(mErrorInfo);
|
||||
findViewById(R.id.btn_copy).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
copyError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void copyError() {
|
||||
if (TextUtils.isEmpty(mErrorInfo)) {
|
||||
return;
|
||||
}
|
||||
ClipboardManager clipboardManager = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text", mErrorInfo);
|
||||
clipboardManager.setPrimaryClip(clipData);
|
||||
ToastUtil.show(mContext.getString(R.string.copy_success));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ImageEntity;
|
||||
import com.yunbao.common.utils.PreViewImageView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Haoxuan Chen on 2019/07/14.
|
||||
* Description:查看图片
|
||||
*/
|
||||
public class PreviewImageActivity extends AbsActivity implements ViewPager.OnPageChangeListener {
|
||||
// @BindView(R.id.viewPager)
|
||||
ViewPager mViewPager;
|
||||
// @BindView(R.id.tv_count)
|
||||
TextView mCount;
|
||||
View v_back;
|
||||
private List<ImageEntity> mSelectedImages;
|
||||
|
||||
@Override
|
||||
public void main(Bundle savedInstanceState) {
|
||||
mViewPager = findViewById(R.id.viewPager);
|
||||
mCount = findViewById(R.id.tv_count);
|
||||
v_back = findViewById(R.id.v_back);
|
||||
|
||||
mSelectedImages = getIntent().getParcelableArrayListExtra("preview_images");
|
||||
mViewPager.setAdapter(mViewPagerAdapter);
|
||||
mViewPager.addOnPageChangeListener(this);
|
||||
mCount.setText(String.format("%s/%s", 1, mSelectedImages.size()));
|
||||
|
||||
v_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_preview_image;
|
||||
}
|
||||
|
||||
|
||||
private PagerAdapter mViewPagerAdapter = new PagerAdapter() {
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mSelectedImages.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
|
||||
return view == object;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
||||
PreViewImageView imageView = new PreViewImageView(container.getContext());
|
||||
// ImgLoader.display(imageView.getContext(), mSelectedImages.get(position).getPath(), imageView);
|
||||
Glide.with(imageView.getContext())
|
||||
.load(mSelectedImages.get(position).getPath())
|
||||
.centerCrop()
|
||||
.into(imageView);
|
||||
container.addView(imageView);
|
||||
return imageView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
|
||||
container.removeView((View) object);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
mCount.setText(String.format("%s/%s", (position + 1), mSelectedImages.size()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.PropertyValuesHolder;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.tencent.rtmp.ITXVodPlayListener;
|
||||
import com.tencent.rtmp.TXLiveConstants;
|
||||
import com.tencent.rtmp.TXVodPlayConfig;
|
||||
import com.tencent.rtmp.TXVodPlayer;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ImageEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Haoxuan Chen on 2022/05/4.
|
||||
* Description:查看视频
|
||||
*/
|
||||
public class PreviewVideoActivity extends AbsActivity implements ITXVodPlayListener, View.OnClickListener {
|
||||
|
||||
View v_back;
|
||||
private List<ImageEntity> mSelectedImages;
|
||||
private TXCloudVideoView mTXCloudVideoView;
|
||||
private TXVodPlayer mPlayer;
|
||||
private TXVodPlayConfig mTXVodPlayConfig;
|
||||
private boolean mStartPlay;
|
||||
private String mCachePath;
|
||||
private boolean mPaused;//生命周期暂停
|
||||
private boolean mClickPaused;//点击暂停
|
||||
private ObjectAnimator mPlayBtnAnimator;//暂停按钮的动画
|
||||
private View mPlayBtn;
|
||||
private View mVideoCover;
|
||||
private ActionListener mActionListener;
|
||||
|
||||
@Override
|
||||
public void main(Bundle savedInstanceState) {
|
||||
mSelectedImages = getIntent().getParcelableArrayListExtra("preview_images");
|
||||
v_back = findViewById(R.id.v_back);
|
||||
mTXCloudVideoView = (TXCloudVideoView) findViewById(R.id.video_view);
|
||||
|
||||
v_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
playAdVideo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_preview_video;
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放视频
|
||||
*/
|
||||
private void playAdVideo() {
|
||||
mCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
mTXCloudVideoView = (TXCloudVideoView) findViewById(R.id.video_view);
|
||||
mTXCloudVideoView.setRenderMode(TXLiveConstants.RENDER_MODE_FULL_FILL_SCREEN);
|
||||
mPlayer = new TXVodPlayer(mContext);
|
||||
mTXVodPlayConfig = new TXVodPlayConfig();
|
||||
mTXVodPlayConfig.setMaxCacheItems(15);
|
||||
mTXVodPlayConfig.setProgressInterval(200);
|
||||
mPlayer.setConfig(mTXVodPlayConfig);
|
||||
mPlayer.setAutoPlay(true);
|
||||
mPlayer.setVodListener(this);
|
||||
mPlayer.setPlayerView(mTXCloudVideoView);
|
||||
findViewById(R.id.root).setOnClickListener(this);
|
||||
mVideoCover = findViewById(R.id.video_cover);
|
||||
mPlayBtn = findViewById(R.id.btn_play);
|
||||
//暂停按钮动画
|
||||
mPlayBtnAnimator = ObjectAnimator.ofPropertyValuesHolder(mPlayBtn,
|
||||
PropertyValuesHolder.ofFloat("scaleX", 4f, 0.8f, 1f),
|
||||
PropertyValuesHolder.ofFloat("scaleY", 4f, 0.8f, 1f),
|
||||
PropertyValuesHolder.ofFloat("alpha", 0f, 1f));
|
||||
mPlayBtnAnimator.setDuration(150);
|
||||
mPlayBtnAnimator.setInterpolator(new AccelerateInterpolator());
|
||||
|
||||
startPlay();
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始播放
|
||||
*/
|
||||
public void startPlay() {
|
||||
mStartPlay = false;
|
||||
mClickPaused = false;
|
||||
if (mVideoCover != null && mVideoCover.getVisibility() != View.VISIBLE) {
|
||||
mVideoCover.setVisibility(View.VISIBLE);
|
||||
}
|
||||
hidePlayBtn();
|
||||
|
||||
String url = mSelectedImages.get(0).getPath();
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
return;
|
||||
}
|
||||
if (mTXVodPlayConfig == null) {
|
||||
mTXVodPlayConfig = new TXVodPlayConfig();
|
||||
mTXVodPlayConfig.setMaxCacheItems(15);
|
||||
mTXVodPlayConfig.setProgressInterval(200);
|
||||
}
|
||||
if (url.endsWith(".m3u8")) {
|
||||
mTXVodPlayConfig.setCacheFolderPath(null);
|
||||
} else {
|
||||
mTXVodPlayConfig.setCacheFolderPath(mCachePath);
|
||||
}
|
||||
mPlayer.setConfig(mTXVodPlayConfig);
|
||||
if (mPlayer != null) {
|
||||
mPlayer.startPlay(url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到视频宽高回调
|
||||
*/
|
||||
public void onVideoSizeChanged(float videoWidth, float videoHeight) {
|
||||
if (mTXCloudVideoView != null && videoWidth > 0 && videoHeight > 0) {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mTXCloudVideoView.getLayoutParams();
|
||||
int targetH = 0;
|
||||
if (videoWidth / videoHeight > 0.5625f) {//横屏 9:16=0.5625
|
||||
targetH = (int) (mTXCloudVideoView.getWidth() / videoWidth * videoHeight);
|
||||
} else {
|
||||
targetH = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
}
|
||||
if (targetH != params.height) {
|
||||
params.height = targetH;
|
||||
mTXCloudVideoView.requestLayout();
|
||||
}
|
||||
if (mVideoCover != null && mVideoCover.getVisibility() == View.VISIBLE) {
|
||||
mVideoCover.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止播放
|
||||
*/
|
||||
public void stopPlay() {
|
||||
if (mPlayer != null) {
|
||||
mPlayer.stopPlay(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 循环播放
|
||||
*/
|
||||
private void replay() {
|
||||
if (mPlayer != null) {
|
||||
mPlayer.seek(0);
|
||||
mPlayer.resume();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示开始播放按钮
|
||||
*/
|
||||
private void showPlayBtn() {
|
||||
if (mPlayBtn != null && mPlayBtn.getVisibility() != View.VISIBLE) {
|
||||
mPlayBtn.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏开始播放按钮
|
||||
*/
|
||||
private void hidePlayBtn() {
|
||||
if (mPlayBtn != null && mPlayBtn.getVisibility() == View.VISIBLE) {
|
||||
mPlayBtn.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int i = v.getId();
|
||||
if (i == R.id.root) {
|
||||
clickTogglePlay();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击切换播放和暂停
|
||||
*/
|
||||
private void clickTogglePlay() {
|
||||
if (!mStartPlay) {
|
||||
return;
|
||||
}
|
||||
if (mPlayer != null) {
|
||||
if (mClickPaused) {
|
||||
mPlayer.resume();
|
||||
} else {
|
||||
mPlayer.pause();
|
||||
}
|
||||
}
|
||||
mClickPaused = !mClickPaused;
|
||||
if (mClickPaused) {
|
||||
showPlayBtn();
|
||||
if (mPlayBtnAnimator != null) {
|
||||
mPlayBtnAnimator.start();
|
||||
}
|
||||
} else {
|
||||
hidePlayBtn();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放器事件回调
|
||||
*/
|
||||
@Override
|
||||
public void onPlayEvent(TXVodPlayer txVodPlayer, int e, Bundle bundle) {
|
||||
switch (e) {
|
||||
case TXLiveConstants.PLAY_EVT_PLAY_BEGIN://加载完成,开始播放的回调
|
||||
mStartPlay = true;
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onPlayBegin();
|
||||
}
|
||||
|
||||
break;
|
||||
case TXLiveConstants.PLAY_EVT_PLAY_LOADING: //开始加载的回调
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onPlayLoading();
|
||||
}
|
||||
break;
|
||||
case TXLiveConstants.PLAY_EVT_PLAY_END://获取到视频播放完毕的回调
|
||||
replay();
|
||||
break;
|
||||
case TXLiveConstants.PLAY_EVT_RCV_FIRST_I_FRAME://获取到视频首帧回调
|
||||
if (mActionListener != null) {
|
||||
mActionListener.onFirstFrame();
|
||||
}
|
||||
if (mPaused && mPlayer != null) {
|
||||
mPlayer.pause();
|
||||
}
|
||||
break;
|
||||
case TXLiveConstants.PLAY_EVT_CHANGE_RESOLUTION://获取到视频宽高回调
|
||||
onVideoSizeChanged(bundle.getInt("EVT_PARAM1", 0), bundle.getInt("EVT_PARAM2", 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetStatus(TXVodPlayer txVodPlayer, Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
public void release() {
|
||||
if (mPlayer != null) {
|
||||
mPlayer.stopPlay(false);
|
||||
mPlayer.setPlayListener(null);
|
||||
}
|
||||
mPlayer = null;
|
||||
mActionListener = null;
|
||||
}
|
||||
|
||||
public interface ActionListener {
|
||||
void onPlayBegin();
|
||||
|
||||
void onPlayLoading();
|
||||
|
||||
void onFirstFrame();
|
||||
}
|
||||
|
||||
|
||||
public void setActionListener(ActionListener actionListener) {
|
||||
mActionListener = actionListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生命周期暂停
|
||||
*/
|
||||
public void pausePlay() {
|
||||
mPaused = true;
|
||||
if (!mClickPaused && mPlayer != null) {
|
||||
mPlayer.pause();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生命周期恢复
|
||||
*/
|
||||
public void resumePlay() {
|
||||
if (mPaused) {
|
||||
if (!mClickPaused && mPlayer != null) {
|
||||
mPlayer.resume();
|
||||
}
|
||||
}
|
||||
mPaused = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
release();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,472 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Parcelable;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import androidx.loader.content.CursorLoader;
|
||||
import androidx.loader.content.Loader;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.ImageAdapter;
|
||||
import com.yunbao.common.adapter.ImageFolderAdapter;
|
||||
import com.yunbao.common.adapter.MultiTypeSupport;
|
||||
import com.yunbao.common.adapter.SpaceGridItemDecoration;
|
||||
import com.yunbao.common.bean.ImageEntity;
|
||||
import com.yunbao.common.bean.ImageFolderEntity;
|
||||
import com.yunbao.common.dialog.ImageFolderView;
|
||||
import com.yunbao.common.utils.StatusBarUtil;
|
||||
import com.yunbao.common.utils.TDevice;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Chen Haoxuan on 2022/4/30.
|
||||
* Description:图片选择
|
||||
*/
|
||||
|
||||
public class SelectImageActivity extends AbsActivity implements ImageFolderView.ImageFolderViewListener, ImageAdapter.onCameraClickListener, View.OnClickListener {
|
||||
// 返回选择图片列表的EXTRA_KEY
|
||||
public static final String EXTRA_RESULT = "EXTRA_RESULT";
|
||||
public static int MAX_SIZE = 5;
|
||||
private static final int PERMISSION_REQUEST_CODE = 88;
|
||||
private static final int TAKE_PHOTO = 99;
|
||||
TextView mTvBack;
|
||||
TextView mTvSelectCount;
|
||||
RecyclerView mRvImage;
|
||||
TextView mTvPhoto;
|
||||
TextView mTvPreview;
|
||||
ImageFolderView mImageFolderView;
|
||||
View v_back;
|
||||
|
||||
private boolean mHasCamera = true;
|
||||
//被选中图片的集合
|
||||
private List<ImageEntity> mSelectedImages = new ArrayList<>();
|
||||
private List<ImageEntity> mImages = new ArrayList<>();
|
||||
private List<ImageFolderEntity> mImageFolders = new ArrayList<>();
|
||||
private ImageAdapter mImageAdapter;
|
||||
private ImageFolderAdapter mImageFolderAdapter;
|
||||
private Uri mImageUri;
|
||||
private File takePhotoImageFile;
|
||||
private int intoIndex = 0;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_select_image;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void main(Bundle savedInstanceState) {
|
||||
mTvBack = findViewById(R.id.tv_back);
|
||||
mTvSelectCount = findViewById(R.id.tv_ok);
|
||||
mRvImage = findViewById(R.id.rv);
|
||||
mTvPhoto = findViewById(R.id.tv_photo);
|
||||
mTvPreview = findViewById(R.id.tv_preview);
|
||||
mImageFolderView = findViewById(R.id.image_folder_view);
|
||||
v_back = findViewById(R.id.v_back);
|
||||
|
||||
//设置状态栏的颜色
|
||||
StatusBarUtil.statusBarTintColor(this, ContextCompat.getColor(this, R.color.black2));
|
||||
setupSelectedImages();
|
||||
mRvImage.setLayoutManager(new GridLayoutManager(this, 4, LinearLayoutManager.VERTICAL, false));
|
||||
mRvImage.addItemDecoration(new SpaceGridItemDecoration((int) TDevice.dipToPx(getResources(), 1)));
|
||||
//异步加载图片
|
||||
getSupportLoaderManager().initLoader(0, null, mLoaderCallbacks);
|
||||
mImageFolderView.setListener(this);
|
||||
|
||||
if (intoIndex == 1) {
|
||||
onCameraClick();
|
||||
}
|
||||
|
||||
v_back.setOnClickListener(this);
|
||||
mTvSelectCount.setOnClickListener(this);
|
||||
mTvPhoto.setOnClickListener(this);
|
||||
mTvPreview.setOnClickListener(this);
|
||||
}
|
||||
|
||||
private void setupSelectedImages() {
|
||||
Intent intent = getIntent();
|
||||
ArrayList<ImageEntity> selectImages = intent.getParcelableArrayListExtra("selected_images");
|
||||
intoIndex = intent.getIntExtra("intoIndex", 0);
|
||||
if (selectImages == null) {
|
||||
selectImages = new ArrayList<>();
|
||||
}
|
||||
mSelectedImages.addAll(selectImages);
|
||||
String showLook = getResources().getString(R.string.preview) + "%d/";
|
||||
if (intoIndex == 3) {
|
||||
showLook = showLook + "1";
|
||||
MAX_SIZE = 1;
|
||||
mTvBack.setText(getResources().getString(R.string.video));
|
||||
mTvPhoto.setText(getResources().getString(R.string.video));
|
||||
} else {
|
||||
showLook = showLook + "9";
|
||||
MAX_SIZE = 9;
|
||||
mTvBack.setText(getResources().getString(R.string.im_input_img));
|
||||
mTvPhoto.setText(getResources().getString(R.string.im_input_img));
|
||||
}
|
||||
if (mSelectedImages.size() > 0 && mSelectedImages.size() <= MAX_SIZE) {
|
||||
mTvPreview.setClickable(true);
|
||||
|
||||
mTvPreview.setText(String.format(showLook, mSelectedImages.size()));
|
||||
mTvPreview.setTextColor(ContextCompat.getColor(SelectImageActivity.this, R.color.pk_red));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
if (id == R.id.v_back) {
|
||||
finish();
|
||||
} else if (id == R.id.tv_ok) {
|
||||
Intent intent = new Intent();
|
||||
intent.putParcelableArrayListExtra(EXTRA_RESULT, (ArrayList<? extends Parcelable>) mSelectedImages);
|
||||
setResult(RESULT_OK, intent);
|
||||
finish();
|
||||
} else if (id == R.id.tv_photo) {
|
||||
if (mImageFolderView.isShowing()) {
|
||||
mImageFolderView.hide();
|
||||
} else {
|
||||
mImageFolderView.show();
|
||||
}
|
||||
} else if (id == R.id.tv_preview) {
|
||||
if (mSelectedImages.size() > 0) {
|
||||
if (intoIndex != 3) {
|
||||
Intent previewIntent = new Intent(this, PreviewImageActivity.class);
|
||||
previewIntent.putParcelableArrayListExtra("preview_images", (ArrayList<? extends Parcelable>) mSelectedImages);
|
||||
startActivity(previewIntent);
|
||||
} else {
|
||||
Intent previewIntent = new Intent(this, PreviewVideoActivity.class);
|
||||
previewIntent.putParcelableArrayListExtra("preview_images", (ArrayList<? extends Parcelable>) mSelectedImages);
|
||||
startActivity(previewIntent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addImageFoldersToAdapter() {
|
||||
if (mImageFolderAdapter == null) {
|
||||
mImageFolderAdapter = new ImageFolderAdapter(this, mImageFolders, R.layout.item_list_folder);
|
||||
mImageFolderView.setAdapter(mImageFolderAdapter);
|
||||
} else {
|
||||
mImageFolderAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void addImagesToAdapter(ArrayList<ImageEntity> images) {
|
||||
mImages.clear();
|
||||
mImages.addAll(images);
|
||||
if (mImageAdapter == null) {
|
||||
mImageAdapter = new ImageAdapter(this, mImages, mSelectedImages, mMultiTypeSupport);
|
||||
mRvImage.setAdapter(mImageAdapter);
|
||||
} else {
|
||||
mImageAdapter.notifyDataSetChanged();
|
||||
}
|
||||
mImageAdapter.setSelectImageCountListener(mOnSelectImageCountListener);
|
||||
mImageAdapter.setOnCameraClickListener(this);
|
||||
}
|
||||
|
||||
private MultiTypeSupport<ImageEntity> mMultiTypeSupport = new MultiTypeSupport<ImageEntity>() {
|
||||
@Override
|
||||
public int getLayoutId(ImageEntity image) {
|
||||
if (TextUtils.isEmpty(image.getPath())) {
|
||||
return R.layout.item_list_camera;
|
||||
}
|
||||
return R.layout.item_list_image;
|
||||
}
|
||||
};
|
||||
/*************************************已选择的图片回调的方法************************************************/
|
||||
|
||||
private ImageAdapter.onSelectImageCountListener mOnSelectImageCountListener = new ImageAdapter.onSelectImageCountListener() {
|
||||
@Override
|
||||
public void onSelectImageCount(int count) {
|
||||
String showLook = getResources().getString(R.string.preview);
|
||||
if (intoIndex == 3) {
|
||||
showLook = showLook + "%d/1";
|
||||
MAX_SIZE = 1;
|
||||
} else {
|
||||
showLook = showLook + "%d/9";
|
||||
MAX_SIZE = 9;
|
||||
}
|
||||
if (count == 0) {
|
||||
showLook = getResources().getString(R.string.preview);
|
||||
mTvPreview.setClickable(false);
|
||||
mTvPreview.setText(showLook);
|
||||
mTvPreview.setTextColor(ContextCompat.getColor(SelectImageActivity.this, R.color.color_b14066));
|
||||
} else if (count > 0 && count <= MAX_SIZE) {
|
||||
mTvPreview.setClickable(true);
|
||||
mTvPreview.setText(String.format(showLook, count));
|
||||
mTvPreview.setTextColor(ContextCompat.getColor(SelectImageActivity.this, R.color.pk_red));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelectImageList(List<ImageEntity> images) {
|
||||
mSelectedImages = images;
|
||||
}
|
||||
};
|
||||
|
||||
/*************************************异步加载相册图片************************************************/
|
||||
|
||||
private LoaderManager.LoaderCallbacks<Cursor> mLoaderCallbacks = new LoaderManager.LoaderCallbacks<Cursor>() {
|
||||
private final String[] IMAGE_PROJECTION = {
|
||||
MediaStore.Images.Media.DATA,
|
||||
MediaStore.Images.Media.DISPLAY_NAME,
|
||||
MediaStore.Images.Media.DATE_ADDED,
|
||||
MediaStore.Images.Media._ID,
|
||||
MediaStore.Images.Media.MINI_THUMB_MAGIC,
|
||||
MediaStore.Images.Media.BUCKET_DISPLAY_NAME};
|
||||
|
||||
//创建一个CursorLoader,去异步加载相册的图片
|
||||
@NonNull
|
||||
@Override
|
||||
public Loader<Cursor> onCreateLoader(int id, @Nullable Bundle args) {
|
||||
if (intoIndex == 3) {
|
||||
return new CursorLoader(SelectImageActivity.this,
|
||||
MediaStore.Video.Media.EXTERNAL_CONTENT_URI, IMAGE_PROJECTION,
|
||||
null, null, IMAGE_PROJECTION[2] + " DESC");
|
||||
} else {
|
||||
return new CursorLoader(SelectImageActivity.this,
|
||||
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, IMAGE_PROJECTION,
|
||||
null, null, IMAGE_PROJECTION[2] + " DESC");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(@NonNull Loader<Cursor> loader, Cursor data) {
|
||||
if (data != null) {
|
||||
ArrayList<ImageEntity> images = new ArrayList<>();
|
||||
//是否显示照相图片
|
||||
if (mHasCamera) {
|
||||
//添加到第一个的位置(默认)
|
||||
if (intoIndex != 3) {
|
||||
images.add(new ImageEntity());
|
||||
}
|
||||
}
|
||||
ImageFolderEntity defaultFolder = new ImageFolderEntity();
|
||||
defaultFolder.setName("全部照片");
|
||||
defaultFolder.setPath("");
|
||||
mImageFolders.add(defaultFolder);
|
||||
|
||||
int count = data.getCount();
|
||||
if (count > 0) {
|
||||
data.moveToFirst();
|
||||
do {
|
||||
String path = data.getString(data.getColumnIndexOrThrow(IMAGE_PROJECTION[0]));
|
||||
String name = data.getString(data.getColumnIndexOrThrow(IMAGE_PROJECTION[1]));
|
||||
long dateTime = data.getLong(data.getColumnIndexOrThrow(IMAGE_PROJECTION[2]));
|
||||
int id = data.getInt(data.getColumnIndexOrThrow(IMAGE_PROJECTION[3]));
|
||||
String thumbPath = data.getString(data.getColumnIndexOrThrow(IMAGE_PROJECTION[4]));
|
||||
String bucket = data.getString(data.getColumnIndexOrThrow(IMAGE_PROJECTION[5]));
|
||||
|
||||
ImageEntity image = new ImageEntity();
|
||||
image.setPath(path);
|
||||
image.setName(name);
|
||||
image.setDate(dateTime);
|
||||
image.setId(id);
|
||||
image.setThumbPath(thumbPath);
|
||||
image.setFolderName(bucket);
|
||||
image.setFolderName(bucket);
|
||||
images.add(image);
|
||||
//如果是被选中的图片
|
||||
if (mSelectedImages.size() > 0) {
|
||||
for (ImageEntity i : mSelectedImages) {
|
||||
if (i.getPath().equals(image.getPath())) {
|
||||
image.setSelect(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置图片分类的文件夹
|
||||
File imageFile = new File(path);
|
||||
File folderFile = imageFile.getParentFile();
|
||||
ImageFolderEntity folder = new ImageFolderEntity();
|
||||
folder.setName(folderFile.getName());
|
||||
folder.setPath(folderFile.getAbsolutePath());
|
||||
//ImageFolder复写了equal方法,equal方法比较的是文件夹的路径
|
||||
if (!mImageFolders.contains(folder)) {
|
||||
folder.getImages().add(image);
|
||||
//默认相册封面
|
||||
folder.setAlbumPath(image.getPath());
|
||||
mImageFolders.add(folder);
|
||||
} else {
|
||||
ImageFolderEntity imageFolder = mImageFolders.get(mImageFolders.indexOf(folder));
|
||||
imageFolder.getImages().add(image);
|
||||
}
|
||||
} while (data.moveToNext());
|
||||
}
|
||||
addImagesToAdapter(images);
|
||||
//全部照片
|
||||
defaultFolder.getImages().addAll(images);
|
||||
if (mHasCamera) {
|
||||
defaultFolder.setAlbumPath(images.size() > 1 ? images.get(1).getPath() : null);
|
||||
} else {
|
||||
defaultFolder.setAlbumPath(images.size() > 0 ? images.get(0).getPath() : null);
|
||||
}
|
||||
//删除掉不存在的,在于用户选择了相片,又去相册删除
|
||||
if (mSelectedImages.size() > 0) {
|
||||
List<ImageEntity> rs = new ArrayList<>();
|
||||
for (ImageEntity i : mSelectedImages) {
|
||||
File f = new File(i.getPath());
|
||||
if (!f.exists()) {
|
||||
rs.add(i);
|
||||
}
|
||||
}
|
||||
mSelectedImages.removeAll(rs);
|
||||
}
|
||||
}
|
||||
mImageFolderView.setImageFolders(mImageFolders);
|
||||
addImageFoldersToAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(@NonNull Loader<Cursor> loader) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public void onSelectFolder(ImageFolderView imageFolderView, ImageFolderEntity imageFolder) {
|
||||
addImagesToAdapter(imageFolder.getImages());
|
||||
mRvImage.scrollToPosition(0);
|
||||
mTvPhoto.setText(imageFolder.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow() {
|
||||
|
||||
}
|
||||
|
||||
/*************************************相机拍照************************************************/
|
||||
|
||||
@Override
|
||||
public void onCameraClick() {
|
||||
//首先申请下相机权限
|
||||
int isPermission = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
|
||||
if (isPermission == PackageManager.PERMISSION_GRANTED) {
|
||||
takePhoto();
|
||||
} else {
|
||||
//申请权限
|
||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, PERMISSION_REQUEST_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == PERMISSION_REQUEST_CODE) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
takePhoto();
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, PERMISSION_REQUEST_CODE);
|
||||
Toast.makeText(this, "需要您的相机权限!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void takePhoto() {
|
||||
//用来打开相机的Intent
|
||||
Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
//这句作用是如果没有相机则该应用不会闪退,要是不加这句则当系统没有相机应用的时候该应用会闪退
|
||||
if (takePhotoIntent.resolveActivity(getPackageManager()) != null) {
|
||||
takePhotoImageFile = createImageFile();
|
||||
if (takePhotoImageFile != null) {
|
||||
Log.i("take photo", "ImageFilePath=" + takePhotoImageFile.getAbsolutePath());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
///7.0以上要通过FileProvider将File转化为Uri
|
||||
mImageUri = FileProvider.getUriForFile(this, this.getPackageName() + ".fileprovider", takePhotoImageFile);
|
||||
} else {
|
||||
//7.0以下则直接使用Uri的fromFile方法将File转化为Uri
|
||||
mImageUri = Uri.fromFile(takePhotoImageFile);
|
||||
}
|
||||
//将用于输出的文件Uri传递给相机
|
||||
takePhotoIntent.putExtra(MediaStore.EXTRA_OUTPUT, mImageUri);
|
||||
//启动相机
|
||||
startActivityForResult(takePhotoIntent, TAKE_PHOTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && requestCode == TAKE_PHOTO) {
|
||||
galleryAddPictures();
|
||||
try {
|
||||
Bitmap bitmap = BitmapFactory.decodeStream(this.getContentResolver().openInputStream(mImageUri));
|
||||
Log.i("take photo", bitmap + "");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private File createImageFile() {
|
||||
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.CHINA).format(new Date());
|
||||
String imageFileName = "BEMS_APP_IMG_" + timeStamp + "_";
|
||||
File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
|
||||
File imageFile = null;
|
||||
try {
|
||||
imageFile = File.createTempFile(imageFileName, ".jpg", storageDir);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return imageFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将拍的照片添加到相册
|
||||
*/
|
||||
private void galleryAddPictures() {
|
||||
//把文件插入到系统图库
|
||||
try {
|
||||
MediaStore.Images.Media.insertImage(this.getContentResolver(),
|
||||
takePhotoImageFile.getAbsolutePath(), takePhotoImageFile.getName(), null);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//通知图库更新
|
||||
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(takePhotoImageFile));
|
||||
sendBroadcast(mediaScanIntent);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,468 @@
|
||||
package com.yunbao.common.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
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.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.HintCustomPopup;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/25.
|
||||
*/
|
||||
|
||||
public class WebViewActivity extends AbsActivity {
|
||||
|
||||
private FrameLayout ft_title;
|
||||
private ImageView btnEdit;
|
||||
private ProgressBar mProgressBar;
|
||||
private WebView mWebView;
|
||||
private final int CHOOSE = 100;//Android 5.0以下的
|
||||
private final int CHOOSE_ANDROID_5 = 200;//Android 5.0以上的
|
||||
private ValueCallback<Uri> mValueCallback;
|
||||
private ValueCallback<Uri[]> mValueCallback2;
|
||||
private int indexInto = 0;
|
||||
private View v_spacing;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_webview;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
String url = getIntent().getStringExtra(Constants.URL);
|
||||
if(StringUtil.isEmpty(url)){
|
||||
url="";
|
||||
}
|
||||
L.e("H5--->" + url);
|
||||
if(isKefu(url)){
|
||||
RouteUtil.forwardCustomerService(url);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
Bus.getOn(this);
|
||||
LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
|
||||
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
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);
|
||||
|
||||
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.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
L.e("H5-------->" + url);
|
||||
if(isKefu(url)){
|
||||
RouteUtil.forwardCustomerService(url);
|
||||
return true;
|
||||
}
|
||||
if (url.startsWith(Constants.COPY_PREFIX)) {
|
||||
String content = url.substring(Constants.COPY_PREFIX.length());
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
copy(content);
|
||||
}
|
||||
} else {
|
||||
view.loadUrl(url);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setTitle(view.getTitle());
|
||||
}
|
||||
}, 500);
|
||||
|
||||
if (url.contains("for")) {
|
||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||
}
|
||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||
if (!navigationGestureEnabled(mContext)) {
|
||||
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
mWebView.setWebChromeClient(new WebChromeClient() {
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
if (newProgress == 100) {
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
} else {
|
||||
mProgressBar.setProgress(newProgress);
|
||||
}
|
||||
}
|
||||
|
||||
//以下是在各个Android版本中 WebView调用文件选择器的方法
|
||||
// For Android < 3.0
|
||||
public void openFileChooser(ValueCallback<Uri> valueCallback) {
|
||||
openImageChooserActivity(valueCallback);
|
||||
}
|
||||
|
||||
// For Android >= 3.0
|
||||
public void openFileChooser(ValueCallback valueCallback, String acceptType) {
|
||||
openImageChooserActivity(valueCallback);
|
||||
}
|
||||
|
||||
//For Android >= 4.1
|
||||
public void openFileChooser(ValueCallback<Uri> valueCallback,
|
||||
String acceptType, String capture) {
|
||||
openImageChooserActivity(valueCallback);
|
||||
}
|
||||
|
||||
// For Android >= 5.0
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView,
|
||||
ValueCallback<Uri[]> filePathCallback,
|
||||
FileChooserParams fileChooserParams) {
|
||||
mValueCallback2 = filePathCallback;
|
||||
Intent intent = fileChooserParams.createIntent();
|
||||
startActivityForResult(intent, CHOOSE_ANDROID_5);
|
||||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(mContext, mWebView).setPageClose(true).setLiveZhuangBana(false), "androidObject");
|
||||
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||
mWebView.getSettings().setAllowFileAccess(true);
|
||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
mWebView.loadUrl(url);
|
||||
AndroidBug5497Workaround.assistActivity(mWebView);
|
||||
|
||||
if (Constants.myIntoIndex == 2) {
|
||||
ft_title.setVisibility(View.GONE);
|
||||
btnEdit.setVisibility(View.GONE);
|
||||
v_spacing.setVisibility(View.VISIBLE);
|
||||
|
||||
} else if (Constants.myIntoIndex == 1) {
|
||||
v_spacing.setVisibility(View.GONE);
|
||||
} else {
|
||||
btnEdit.setVisibility(View.GONE);
|
||||
ft_title.setVisibility(View.VISIBLE);
|
||||
v_spacing.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void openImageChooserActivity(ValueCallback<Uri> valueCallback) {
|
||||
mValueCallback = valueCallback;
|
||||
Intent intent = new Intent();
|
||||
if (Build.VERSION.SDK_INT < 19) {
|
||||
intent.setAction(Intent.ACTION_GET_CONTENT);
|
||||
} else {
|
||||
intent.setAction(Intent.ACTION_PICK);
|
||||
intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
}
|
||||
intent.setType("image/*");
|
||||
startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||
super.onActivityResult(requestCode, resultCode, intent);
|
||||
switch (requestCode) {
|
||||
case CHOOSE://5.0以下选择图片后的回调
|
||||
processResult(resultCode, intent);
|
||||
break;
|
||||
case CHOOSE_ANDROID_5://5.0以上选择图片后的回调
|
||||
processResultAndroid5(resultCode, intent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void processResult(int resultCode, Intent intent) {
|
||||
if (mValueCallback == null) {
|
||||
return;
|
||||
}
|
||||
if (resultCode == RESULT_OK && intent != null) {
|
||||
Uri result = intent.getData();
|
||||
mValueCallback.onReceiveValue(result);
|
||||
} else {
|
||||
mValueCallback.onReceiveValue(null);
|
||||
}
|
||||
mValueCallback = null;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private void processResultAndroid5(int resultCode, Intent intent) {
|
||||
if (mValueCallback2 == null) {
|
||||
return;
|
||||
}
|
||||
if (resultCode == RESULT_OK && intent != null) {
|
||||
mValueCallback2.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
|
||||
} else {
|
||||
mValueCallback2.onReceiveValue(null);
|
||||
}
|
||||
mValueCallback2 = null;
|
||||
}
|
||||
|
||||
private static boolean mIsLive = false;
|
||||
|
||||
public static void forward(Context context, String url, boolean addArgs, boolean isLive) {
|
||||
mIsLive = isLive;
|
||||
if (Constants.LoginKefu) {
|
||||
if (addArgs) {
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
}
|
||||
Intent intent = new Intent(context, WebViewActivity.class);
|
||||
intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void forward(Context context, String url, boolean isLive) {
|
||||
forward(context, url, true, isLive);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mWebView != null) {
|
||||
ViewGroup parent = (ViewGroup) mWebView.getParent();
|
||||
if (parent != null) {
|
||||
parent.removeView(mWebView);
|
||||
}
|
||||
mWebView.destroy();
|
||||
}
|
||||
Constants.myIntoIndex = 0;
|
||||
indexInto = 0;
|
||||
Constants.LoginKefu = true;
|
||||
Bus.getOff(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制到剪贴板
|
||||
*/
|
||||
private void copy(String content) {
|
||||
ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text", content);
|
||||
cm.setPrimaryClip(clipData);
|
||||
ToastUtil.show(getString(R.string.copy_success));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (Constants.myIntoIndex == 2 && mWebView != null && indexInto == 1) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
mWebView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String method = "reload()";//拼接参数,就可以把数据传递给js
|
||||
mWebView.evaluateJavascript(method, new ValueCallback<String>() {
|
||||
@Override
|
||||
public void onReceiveValue(String value) {
|
||||
// Log.i("qcl0228", "js返回的数据" + value);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mWebView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
mWebView.loadUrl("javascript:reload()");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
indexInto = 0;
|
||||
}
|
||||
if (Constants.isShowPage != -1) {
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
|
||||
indexInto = event.getIndexInto();
|
||||
if (event.getMethod().equals("androidInviteShare")) {
|
||||
try {
|
||||
Class<?> clz = mContext.getClassLoader().loadClass("com.yunbao.share.ui.InvitePopDialog");
|
||||
Object invite = clz.getConstructor(Context.class).newInstance(mContext);
|
||||
invite = invite.getClass().getMethod("setUrl", String.class).invoke(invite, event.getData());
|
||||
assert invite != null;
|
||||
invite.getClass().getMethod("showDialog").invoke(invite);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else if (TextUtils.equals(event.getMethod(), "clickLogOffAccount")) {
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new HintCustomPopup(mContext,
|
||||
mContext.getString(R.string.delete_account1),
|
||||
mContext.getString(R.string.delete_account2))
|
||||
.setLiveOpenOk(mContext.getString(R.string.delete_account3))
|
||||
.setLiveOpenCancel(mContext.getString(R.string.cancel))
|
||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||
@Override
|
||||
public void onSure() {
|
||||
LiveNetManager.get(mContext).
|
||||
setLogOff(new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
Stack<Activity> allActivityStacks = AppManager.getInstance().getAllActivityStacks();
|
||||
for (int i = 0; i < allActivityStacks.size(); i++) {
|
||||
if (!(allActivityStacks.get(i) instanceof WebViewActivity)) {
|
||||
allActivityStacks.get(i).finish();
|
||||
}
|
||||
}
|
||||
IMLoginManager.get(mContext).logout(mContext);
|
||||
CommonAppConfig.getInstance().clearLoginInfo();
|
||||
mContext.finish();
|
||||
RouteUtil.forwardLoginActivity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
}))
|
||||
.show();
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
||||
//看直播
|
||||
gotoLive(event.getLiveId());
|
||||
}else if (TextUtils.equals(event.getMethod(), "androidtoCommunityVideo")) {
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
}
|
||||
}
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
|
||||
LiveHttpUtil.getLiveInfo(live_id, new com.yunbao.common.http.HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
if (mIsLive) {
|
||||
finish();
|
||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, live_id, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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.UserMedalModel;
|
||||
import com.yunbao.common.views.AchievementDetailsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AchievementDetailsAdapter extends RecyclerView.Adapter {
|
||||
private List<UserMedalModel> dressInfo = new ArrayList<>();
|
||||
|
||||
public AchievementDetailsAdapter(List<UserMedalModel> dressInfo) {
|
||||
this.dressInfo = dressInfo;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_achievement_details, parent, false);
|
||||
return new AchievementDetailsViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
AchievementDetailsViewHolder achievementDetailsViewHolder = (AchievementDetailsViewHolder) holder;
|
||||
achievementDetailsViewHolder.showData(dressInfo.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dressInfo.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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.playerObject;
|
||||
import com.yunbao.common.views.AvatarListViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AvatarListAdapter extends RecyclerView.Adapter {
|
||||
private List<playerObject> playerObjects = new ArrayList<>();
|
||||
|
||||
public AvatarListAdapter(List<playerObject> playerObjects) {
|
||||
this.playerObjects = playerObjects;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_avatar_list_view, parent, false);
|
||||
return new AvatarListViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
AvatarListViewHolder avatarListViewHolder = (AvatarListViewHolder) holder;
|
||||
avatarListViewHolder.setData(playerObjects.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return playerObjects.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.CoinBean;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/22.
|
||||
*/
|
||||
|
||||
public class ChatChargeCoinAdapter extends RecyclerView.Adapter<ChatChargeCoinAdapter.Vh> {
|
||||
|
||||
private List<CoinBean> mList;
|
||||
private LayoutInflater mInflater;
|
||||
private String mCoinName;
|
||||
private String mGoldCoinName;
|
||||
private String mGiveString;
|
||||
private Drawable mCheckedDrawable;
|
||||
private Drawable mUnCheckedDrawable;
|
||||
private int mCheckedPosition;
|
||||
private View.OnClickListener mOnClickListener;
|
||||
private OnItemClickListener<CoinBean> mOnItemClickListener;
|
||||
|
||||
public ChatChargeCoinAdapter(Context context, List<CoinBean> list) {
|
||||
mInflater = LayoutInflater.from(context);
|
||||
mList = list;
|
||||
mCoinName = CommonAppConfig.getInstance().getCoinName();
|
||||
mGoldCoinName = CommonAppConfig.getInstance().getGoldCoinName();
|
||||
mGiveString = context.getString(R.string.coin_give);
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Object tag = v.getTag();
|
||||
if (tag == null) {
|
||||
return;
|
||||
}
|
||||
int positon = (int) tag;
|
||||
CoinBean bean = mList.get(positon);
|
||||
if (mCheckedPosition != positon) {
|
||||
if (mCheckedPosition >= 0 && mCheckedPosition < mList.size()) {
|
||||
mList.get(mCheckedPosition).setChecked(false);
|
||||
notifyItemChanged(mCheckedPosition, Constants.PAYLOAD);
|
||||
}
|
||||
bean.setChecked(true);
|
||||
notifyItemChanged(positon, Constants.PAYLOAD);
|
||||
mCheckedPosition = positon;
|
||||
}
|
||||
if (mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(bean, positon);
|
||||
}
|
||||
}
|
||||
};
|
||||
mCheckedDrawable = ContextCompat.getDrawable(context, R.drawable.bg_coin_item_1);
|
||||
mUnCheckedDrawable = ContextCompat.getDrawable(context, R.drawable.bg_coin_item_0);
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_coin, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Vh holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Vh vh, int position, @NonNull List<Object> payloads) {
|
||||
Object payload = payloads.size() > 0 ? payloads.get(0) : null;
|
||||
vh.setData(mList.get(position), position, payload);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView mCoin;
|
||||
TextView mMoney;
|
||||
TextView mGive;
|
||||
View mGiveGroup;
|
||||
View mBg;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
mCoin = itemView.findViewById(R.id.coin);
|
||||
mMoney = itemView.findViewById(R.id.money);
|
||||
mGive = itemView.findViewById(R.id.give);
|
||||
mGiveGroup = itemView.findViewById(R.id.give_group);
|
||||
mBg = itemView.findViewById(R.id.bg);
|
||||
itemView.setOnClickListener(mOnClickListener);
|
||||
}
|
||||
|
||||
void setData(CoinBean bean, int position, Object payload) {
|
||||
if (payload == null) {
|
||||
itemView.setTag(position);
|
||||
mCoin.setText(bean.getCoin());
|
||||
mMoney.setText("¥" + bean.getMoney());
|
||||
if (!"0".equals(bean.getGive())) {
|
||||
if (mGiveGroup.getVisibility() != View.VISIBLE) {
|
||||
mGiveGroup.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mGive.setText(mGiveString + bean.getGive() + mGoldCoinName);
|
||||
} else {
|
||||
if (mGiveGroup.getVisibility() == View.VISIBLE) {
|
||||
mGiveGroup.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
mBg.setBackground(bean.isChecked() ? mCheckedDrawable : mUnCheckedDrawable);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<CoinBean> onItemClickListener) {
|
||||
mOnItemClickListener = onItemClickListener;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.CoinPayBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/22.
|
||||
*/
|
||||
|
||||
public class ChatChargePayAdapter extends RecyclerView.Adapter<ChatChargePayAdapter.Vh> {
|
||||
|
||||
private Context mContext;
|
||||
private List<CoinPayBean> mList;
|
||||
private LayoutInflater mInflater;
|
||||
private Drawable mCheckedDrawable;
|
||||
private int mCheckedPosition;
|
||||
private View.OnClickListener mOnClickListener;
|
||||
|
||||
public ChatChargePayAdapter(Context context, List<CoinPayBean> list) {
|
||||
mContext = context;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
mList = list;
|
||||
mCheckedPosition = 0;
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Object tag = v.getTag();
|
||||
if (tag == null) {
|
||||
return;
|
||||
}
|
||||
int positon = (int) tag;
|
||||
CoinPayBean bean = mList.get(positon);
|
||||
if (mCheckedPosition != positon) {
|
||||
if (mCheckedPosition >= 0 && mCheckedPosition < mList.size()) {
|
||||
mList.get(mCheckedPosition).setChecked(false);
|
||||
notifyItemChanged(mCheckedPosition, Constants.PAYLOAD);
|
||||
}
|
||||
bean.setChecked(true);
|
||||
notifyItemChanged(positon, Constants.PAYLOAD);
|
||||
mCheckedPosition = positon;
|
||||
}
|
||||
}
|
||||
};
|
||||
// mCheckedDrawable = ContextCompat.getDrawable(context, R.drawable.icon_chat_charge_pay_1);
|
||||
mCheckedDrawable = ContextCompat.getDrawable(context, R.mipmap.icon_coin_wrap);
|
||||
}
|
||||
|
||||
public CoinPayBean getCheckedPayBean() {
|
||||
if (mList != null && mCheckedPosition >= 0 && mCheckedPosition < mList.size()) {
|
||||
return mList.get(mCheckedPosition);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_chat_charge_pay2, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Vh holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Vh vh, int position, @NonNull List<Object> payloads) {
|
||||
Object payload = payloads.size() > 0 ? payloads.get(0) : null;
|
||||
vh.setData(mList.get(position), position, payload);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView mThumb;
|
||||
TextView mName;
|
||||
ImageView mImg;
|
||||
TextView mGive;
|
||||
View mGiveGroup;
|
||||
ImageView mWrap;
|
||||
View viewLine;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
mThumb = itemView.findViewById(R.id.thumb);
|
||||
mName = itemView.findViewById(R.id.name);
|
||||
mImg = itemView.findViewById(R.id.img);
|
||||
mGive = itemView.findViewById(R.id.give);
|
||||
mGiveGroup = itemView.findViewById(R.id.give_group);
|
||||
mWrap = itemView.findViewById(R.id.wrap);
|
||||
viewLine = itemView.findViewById(R.id.viewLine);
|
||||
itemView.setOnClickListener(mOnClickListener);
|
||||
}
|
||||
|
||||
void setData(CoinPayBean bean, int position, Object payload) {
|
||||
if (payload == null) {
|
||||
itemView.setTag(position);
|
||||
ImgLoader.display(mContext, bean.getThumb(), mThumb);
|
||||
|
||||
//大额
|
||||
if (bean.getPayDesc()!=null && !bean.getPayDesc().isEmpty()){
|
||||
mGiveGroup.setVisibility(View.VISIBLE);
|
||||
mGive.setText(bean.getPayDesc());
|
||||
}else {
|
||||
mGiveGroup.setVisibility(View.GONE);
|
||||
mGive.setText("");
|
||||
}
|
||||
|
||||
if (bean.getId().equals(Constants.PAY_TYPE_PAYSSION)){
|
||||
mName.setText(bean.getName());
|
||||
mName.setTextColor(Color.parseColor("#323232"));
|
||||
// mName.setText(bean.getName()+" (推荐)");
|
||||
// mName.setTextColor(Color.parseColor("#ff6131"));
|
||||
}
|
||||
else {
|
||||
mName.setText(bean.getName());
|
||||
mName.setTextColor(Color.parseColor("#323232"));
|
||||
}
|
||||
}
|
||||
|
||||
if (bean.isChecked()) {
|
||||
if (mWrap.getVisibility() != View.VISIBLE) {
|
||||
mWrap.setVisibility(View.VISIBLE);
|
||||
}
|
||||
viewLine.setVisibility(View.GONE);
|
||||
} else {
|
||||
if (mWrap.getVisibility() == View.VISIBLE) {
|
||||
mWrap.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
viewLine.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// mImg.setImageDrawable(bean.isChecked() ? mCheckedDrawable : null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Chen Haoxuan on 2022/4/30.
|
||||
*/
|
||||
|
||||
public abstract class CommonRecycleAdapter<T> extends RecyclerView.Adapter<CommonViewHolder> {
|
||||
private int mLayoutId;
|
||||
private List<T> mData;
|
||||
private LayoutInflater mInflater;
|
||||
private OnItemClickListener mItemClickListener;
|
||||
private MultiTypeSupport mTypeSupport;
|
||||
|
||||
|
||||
public CommonRecycleAdapter(Context context, List<T> mData, int layoutId) {
|
||||
this.mData = mData;
|
||||
this.mLayoutId = layoutId;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
public CommonRecycleAdapter(Context context, List<T> mData, MultiTypeSupport typeSupport) {
|
||||
this(context, mData, -1);
|
||||
this.mTypeSupport = typeSupport;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public CommonViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (mTypeSupport != null) {
|
||||
//多布局
|
||||
mLayoutId = viewType;
|
||||
}
|
||||
View itemView = mInflater.inflate(mLayoutId, parent, false);
|
||||
return new CommonViewHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull CommonViewHolder holder, final int position) {
|
||||
convert(holder, mData.get(position), position);
|
||||
if (mItemClickListener != null) {
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mItemClickListener.onItemClick(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mData.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
//多布局
|
||||
if (mTypeSupport != null) {
|
||||
return mTypeSupport.getLayoutId(mData.get(position));
|
||||
}
|
||||
return super.getItemViewType(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
//点击事件
|
||||
public void setItemClickListener(OnItemClickListener itemClickListener) {
|
||||
this.mItemClickListener = itemClickListener;
|
||||
}
|
||||
|
||||
protected abstract void convert(CommonViewHolder holder, T t, int position);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
* Created by zhiwenyan on 5/25/17.
|
||||
* <p>
|
||||
* 通用的ViewHolder
|
||||
*/
|
||||
|
||||
public class CommonViewHolder extends RecyclerView.ViewHolder {
|
||||
//用于缓存View
|
||||
private SparseArray<View> mView;
|
||||
|
||||
public CommonViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
mView = new SparseArray<>();
|
||||
}
|
||||
|
||||
|
||||
public <T extends View> T getView(int viewId) {
|
||||
View view = mView.get(viewId);
|
||||
if (view == null) {
|
||||
view = itemView.findViewById(viewId);
|
||||
mView.put(viewId, view);
|
||||
}
|
||||
return (T) view;
|
||||
}
|
||||
|
||||
|
||||
//通用的setText进行封装
|
||||
|
||||
/**
|
||||
* @param viewId
|
||||
* @param text
|
||||
* @return
|
||||
*/
|
||||
public CommonViewHolder setText(int viewId, CharSequence text) {
|
||||
TextView tv = getView(viewId);
|
||||
tv.setText(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 本地图片
|
||||
*
|
||||
* @param viewId
|
||||
* @param resourceId
|
||||
* @return
|
||||
*/
|
||||
public CommonViewHolder setImageResoucrce(int viewId, int resourceId) {
|
||||
ImageView iv = getView(viewId);
|
||||
iv.setImageResource(resourceId);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 网络图片处理
|
||||
*
|
||||
* @param viewId
|
||||
* @param imageLoader
|
||||
* @return
|
||||
*/
|
||||
public CommonViewHolder setImagePath(int viewId, HolderImageLoader imageLoader) {
|
||||
ImageView iv = getView(viewId);
|
||||
imageLoader.loadImage(iv, imageLoader.getPath());
|
||||
return this;
|
||||
}
|
||||
|
||||
abstract static class HolderImageLoader {
|
||||
private String path;
|
||||
|
||||
public HolderImageLoader(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载图片
|
||||
*
|
||||
* @param imageView
|
||||
* @param path
|
||||
*/
|
||||
abstract void loadImage(ImageView imageView, String path);
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
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.utils.ToastUtil;
|
||||
import com.yunbao.common.views.DrawerRecommendViewHolder;
|
||||
import com.yunbao.common.views.DrawerTaskViewHolder;
|
||||
import com.yunbao.common.views.FunGamesViewHolder;
|
||||
import com.yunbao.common.views.InteractionGamesViewHolder;
|
||||
import com.yunbao.common.views.RecommendViewHolder;
|
||||
import com.yunbao.common.views.RigtsInterestsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 新侧边栏适配器
|
||||
*/
|
||||
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);
|
||||
case RECOMMEND:
|
||||
View recommendView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_recommend, parent, false);
|
||||
return new RecommendViewHolder(recommendView);
|
||||
default:
|
||||
View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_interaction_games_view, parent, false);
|
||||
return new InteractionGamesViewHolder(gamesView);
|
||||
}
|
||||
}
|
||||
|
||||
@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 InteractionGamesViewHolder) {
|
||||
InteractionGamesViewHolder interactionGamesViewHolder = (InteractionGamesViewHolder) holder;
|
||||
interactionGamesViewHolder.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() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("num", "9");
|
||||
map.put("live_recommend", "sidebar");
|
||||
map.put("refresh", "1");
|
||||
//推荐位
|
||||
MainNetManager.get((Activity) mContext)
|
||||
.anchorRecommend(map, 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) {
|
||||
ToastUtil.show(mContext.getString(R.string.net_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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
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.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() {
|
||||
if (child.size()>3){
|
||||
return 3;
|
||||
}else {
|
||||
return child.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||
child.clear();
|
||||
child.addAll(mChild);
|
||||
// for (CustomSidebarChildModel childModel : mChild) {
|
||||
// if (TextUtils.equals("1", childModel.getIsShow())) {
|
||||
// child.add(childModel);
|
||||
// }
|
||||
// }
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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.GiftWallModel;
|
||||
import com.yunbao.common.views.GiftAlreadyWallViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftAlreadyWallAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
private boolean sbWy;//是否正在直播
|
||||
|
||||
public GiftAlreadyWallAdapter(boolean sbWy) {
|
||||
this.sbWy = sbWy;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_already_wall, parent, false);
|
||||
return new GiftAlreadyWallViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftAlreadyWallViewHolder withoutWallViewHolder = (GiftAlreadyWallViewHolder) holder;
|
||||
withoutWallViewHolder.showData(giftWall.get(position), sbWy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
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.GiftQuantityModel;
|
||||
import com.yunbao.common.views.GiftNumber;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftNumberAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftQuantityModel> giftQuantityModels;
|
||||
|
||||
public GiftNumberAdapter(List<GiftQuantityModel> giftQuantityModels) {
|
||||
this.giftQuantityModels = giftQuantityModels;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotSayHelloView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_gift_number, parent, false);
|
||||
return new GiftNumber(robotSayHelloView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftNumber giftNumber = (GiftNumber) holder;
|
||||
giftNumber.showData(giftQuantityModels.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftQuantityModels.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
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.GiftWallModel;
|
||||
import com.yunbao.common.views.GiftWithoutWallViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftWithoutWallAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_without_wall, parent, false);
|
||||
return new GiftWithoutWallViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftWithoutWallViewHolder withoutWallViewHolder = (GiftWithoutWallViewHolder) holder;
|
||||
withoutWallViewHolder.showData(giftWall.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.yunbao.common.utils.FaceUtil;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.interfaces.OnFaceClickListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/7/11.
|
||||
* 聊天表情的RecyclerView Adapter
|
||||
*/
|
||||
|
||||
public class ImChatFaceAdapter extends RecyclerView.Adapter<ImChatFaceAdapter.Vh> {
|
||||
|
||||
private List<String> mList;
|
||||
private LayoutInflater mInflater;
|
||||
private View.OnClickListener mOnClickListener;
|
||||
|
||||
public ImChatFaceAdapter(List<String> list, LayoutInflater inflater, final OnFaceClickListener onFaceClickListener) {
|
||||
mList = list;
|
||||
mInflater = inflater;
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Object tag = v.getTag();
|
||||
if (tag != null && onFaceClickListener != null) {
|
||||
String str = (String) v.getTag();
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
if ("<".equals(str)) {
|
||||
onFaceClickListener.onFaceDeleteClick();
|
||||
} else {
|
||||
onFaceClickListener.onFaceClick(str, v.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vh onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_list_face, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(Vh vh, int position) {
|
||||
vh.setData(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView mImageView;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
mImageView = (ImageView) itemView;
|
||||
mImageView.setOnClickListener(mOnClickListener);
|
||||
}
|
||||
|
||||
void setData(String str) {
|
||||
mImageView.setTag(str);
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
if ("<".equals(str)) {
|
||||
mImageView.setImageResource(R.mipmap.icon_face_delete);
|
||||
} else {
|
||||
int imgRes = FaceUtil.getFaceImageRes(str);
|
||||
mImageView.setId(imgRes);
|
||||
mImageView.setImageResource(imgRes);
|
||||
}
|
||||
}else{
|
||||
mImageView.setClickable(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.yunbao.common.utils.FaceUtil;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.interfaces.OnFaceClickListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/7/11.
|
||||
* 聊天表情的ViewPager Adapter
|
||||
*/
|
||||
|
||||
public class ImChatFacePagerAdapter extends PagerAdapter {
|
||||
|
||||
private List<View> mViewList;
|
||||
private static final int FACE_COUNT = 20;//每页20个表情
|
||||
|
||||
public ImChatFacePagerAdapter(Context context, OnFaceClickListener onFaceClickListener) {
|
||||
LayoutInflater inflater = LayoutInflater.from(context);
|
||||
mViewList = new ArrayList<>();
|
||||
List<String> faceList = FaceUtil.getFaceList();
|
||||
int fromIndex = 0;
|
||||
int size = faceList.size();
|
||||
int pageCount = size / FACE_COUNT;
|
||||
if (size % FACE_COUNT > 0) {
|
||||
pageCount++;
|
||||
for (int i = 0, count = pageCount * FACE_COUNT - size; i < count; i++) {
|
||||
faceList.add("");
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < pageCount; i++) {
|
||||
RecyclerView recyclerView = (RecyclerView) inflater.inflate(R.layout.view_chat_face_page, null, false);
|
||||
recyclerView.setHasFixedSize(true);
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(context, 7, GridLayoutManager.VERTICAL, false));
|
||||
int endIndex = fromIndex + FACE_COUNT;
|
||||
List<String> list = new ArrayList<>();
|
||||
for (int j = fromIndex; j < endIndex; j++) {
|
||||
list.add(faceList.get(j));
|
||||
}
|
||||
list.add("<");
|
||||
recyclerView.setAdapter(new ImChatFaceAdapter(list, inflater, onFaceClickListener));
|
||||
mViewList.add(recyclerView);
|
||||
fromIndex = endIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mViewList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(@Nullable View view, @Nullable Object object) {
|
||||
return view == object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object instantiateItem(@Nullable ViewGroup container, int position) {
|
||||
View view = mViewList.get(position);
|
||||
container.addView(view);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroyItem(@Nullable ViewGroup container, int position, @Nullable Object object) {
|
||||
container.removeView(mViewList.get(position));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.SelectImageActivity;
|
||||
import com.yunbao.common.bean.ImageEntity;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Chen Haoxuan on 2022/4/30.
|
||||
* Description:
|
||||
*/
|
||||
public class ImageAdapter extends CommonRecycleAdapter<ImageEntity> {
|
||||
private Context mContext;
|
||||
private onSelectImageCountListener mSelectImageCountListener;
|
||||
private List<ImageEntity> mSelectImages;
|
||||
|
||||
public ImageAdapter(Context context, List<ImageEntity> images, List<ImageEntity> selectedImages, MultiTypeSupport typeSupport) {
|
||||
super(context, images, typeSupport);
|
||||
this.mContext = context;
|
||||
this.mSelectImages = selectedImages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(CommonViewHolder holder, final ImageEntity image, int position) {
|
||||
if (!TextUtils.isEmpty(image.getPath())) {
|
||||
final ImageView chb_selected = holder.getView(R.id.iv_selected);
|
||||
final View maskView = holder.getView(R.id.mask);
|
||||
ImageView iv_image = holder.getView(R.id.iv_image);
|
||||
// GlideApp.with(mContext).load(image.getPath()).into(iv_image);
|
||||
ImgLoader.display(mContext, image.getPath(), iv_image);
|
||||
|
||||
chb_selected.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (image.isSelect()) {
|
||||
image.setSelect(false);
|
||||
mSelectImages.remove(image);
|
||||
chb_selected.setSelected(false);
|
||||
} else if (mSelectImages.size() < SelectImageActivity.MAX_SIZE) {
|
||||
image.setSelect(true);
|
||||
mSelectImages.add(image);
|
||||
chb_selected.setSelected(true);
|
||||
// maskView.setVisibility(image.isSelect() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
if (mSelectImageCountListener != null) {
|
||||
mSelectImageCountListener.onSelectImageCount(mSelectImages.size());
|
||||
mSelectImageCountListener.onSelectImageList(mSelectImages);
|
||||
}
|
||||
}
|
||||
});
|
||||
chb_selected.setSelected(image.isSelect());
|
||||
// maskView.setVisibility(image.isSelect() ? View.VISIBLE : View.GONE);
|
||||
} else {
|
||||
holder.getView(R.id.iv_camera).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnCameraClickListener != null) {
|
||||
mOnCameraClickListener.onCameraClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setSelectImageCountListener(onSelectImageCountListener selectImageCountListener) {
|
||||
mSelectImageCountListener = selectImageCountListener;
|
||||
}
|
||||
|
||||
public interface onSelectImageCountListener {
|
||||
void onSelectImageCount(int count);
|
||||
|
||||
void onSelectImageList(List<ImageEntity> images);
|
||||
}
|
||||
|
||||
private onCameraClickListener mOnCameraClickListener;
|
||||
|
||||
public void setOnCameraClickListener(onCameraClickListener onCameraClickListener) {
|
||||
this.mOnCameraClickListener = onCameraClickListener;
|
||||
}
|
||||
|
||||
public interface onCameraClickListener {
|
||||
void onCameraClick();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ImageFolderEntity;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Chen Haoxuan on 2022/4/30.
|
||||
*/
|
||||
public class ImageFolderAdapter extends CommonRecycleAdapter<ImageFolderEntity> {
|
||||
private Context mContext;
|
||||
|
||||
public ImageFolderAdapter(Context context, List<ImageFolderEntity> imageFolders, int layoutId) {
|
||||
super(context, imageFolders, layoutId);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(CommonViewHolder holder, ImageFolderEntity imageFolder, int potion) {
|
||||
holder.setText(R.id.tv_folder_name, imageFolder.getName())
|
||||
.setText(R.id.tv_size, imageFolder.getImages().size() + "张");
|
||||
ImageView iv_folder = holder.getView(R.id.iv_folder);
|
||||
ImgLoader.display(mContext, imageFolder.getAlbumPath(), iv_folder);
|
||||
// GlideApp.with(mContext)
|
||||
// .load(imageFolder.getAlbumPath())
|
||||
// .into(iv_folder);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
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.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public InteractionGamesAdapter(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_live_new_role_fun_games_child_view3, parent, false);
|
||||
return new InteractionGamesChildViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
|
||||
@Override
|
||||
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
|
||||
|
||||
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
||||
if (activityID != 0) {
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(child));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
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 com.yunbao.common.views.NewRoleFunGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
private boolean showRed = false;
|
||||
public LiveNewRoleFunGamesAdapter(Context mContext, boolean rigts,boolean showRed) {
|
||||
this.mContext = mContext;
|
||||
this.rigts = rigts;
|
||||
this.showRed = showRed;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view, parent, false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,showRed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) 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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
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.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.event.LiveNewRoleEvent;
|
||||
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private boolean rigts;
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
|
||||
public LiveNewRoleInteractionGamesAdapter(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_live_new_role_fun_games_child_view3, parent, false);
|
||||
return new InteractionGamesChildViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
InteractionGamesChildViewHolder childViewHolder = (InteractionGamesChildViewHolder) holder;
|
||||
childViewHolder.setData(child.get(position), rigts);
|
||||
childViewHolder.setItemViewClicks(new InteractionGamesChildViewHolder.InteractionGamesCallBack() {
|
||||
@Override
|
||||
public void onItemViewClicks(CustomSidebarChildModel model, boolean rigts) {
|
||||
|
||||
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
||||
if (activityID != 0) {
|
||||
Bus.get().post(new NewRoleCustomDrawerPopupEvent()
|
||||
.setDisMiss(true)
|
||||
.setInteractionID(activityID)
|
||||
.setChild(child)
|
||||
.setInteraction(true));
|
||||
}
|
||||
|
||||
|
||||
Bus.get().post(new LiveNewRoleEvent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
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.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.views.LiveNewRoleFunGamesViewHolder;
|
||||
import com.yunbao.common.views.LiveNewRoleInteractionGamesViewHolder;
|
||||
import com.yunbao.common.views.LiveNewRoleRigtsInterestsViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class LiveNewRolerPopupAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
// "type": 1,//模块类型 1 充值送好礼类型2 任务中心类型 3趣味游戏类4 权益 ,5为你推荐
|
||||
private final int FUN_GAMES = 3;
|
||||
private final int RIGHTS_INTERESTS = 4;
|
||||
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
|
||||
private boolean showRed = false;
|
||||
public LiveNewRolerPopupAdapter(Context mContext,boolean showRed) {
|
||||
this.mContext = mContext;
|
||||
this.showRed = showRed;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
switch (viewType) {
|
||||
case FUN_GAMES:
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_new_roler_fun_games_view, parent, false);
|
||||
return new LiveNewRoleFunGamesViewHolder(runGamesView);
|
||||
case RIGHTS_INTERESTS:
|
||||
View rightsInterestsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_roler_ights_interests, parent, false);
|
||||
return new LiveNewRoleRigtsInterestsViewHolder(rightsInterestsView,showRed);
|
||||
default:
|
||||
View gamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_interaction_games_view, parent, false);
|
||||
return new LiveNewRoleInteractionGamesViewHolder(gamesView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder instanceof LiveNewRoleFunGamesViewHolder) {
|
||||
LiveNewRoleFunGamesViewHolder funGamesViewHolder = (LiveNewRoleFunGamesViewHolder) holder;
|
||||
funGamesViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof LiveNewRoleRigtsInterestsViewHolder) {
|
||||
LiveNewRoleRigtsInterestsViewHolder rigtsInterestsViewHolder = (LiveNewRoleRigtsInterestsViewHolder) holder;
|
||||
rigtsInterestsViewHolder.setData(infoModels.get(position));
|
||||
} else if (holder instanceof LiveNewRoleInteractionGamesViewHolder) {
|
||||
LiveNewRoleInteractionGamesViewHolder interactionGamesViewHolder = (LiveNewRoleInteractionGamesViewHolder) holder;
|
||||
interactionGamesViewHolder.setData(infoModels.get(position));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return infoModels.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
CustomSidebarInfoModel model = infoModels.get(position);
|
||||
switch (model.getType()) {
|
||||
|
||||
case "3":
|
||||
return FUN_GAMES;
|
||||
case "4":
|
||||
return RIGHTS_INTERESTS;
|
||||
|
||||
}
|
||||
return super.getItemViewType(position);
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<CustomSidebarInfoModel> mInfoModels) {
|
||||
infoModels.clear();
|
||||
infoModels.addAll(mInfoModels);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private CustomDrawerListener listener;
|
||||
|
||||
public LiveNewRolerPopupAdapter setListener(CustomDrawerListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface CustomDrawerListener {
|
||||
void goToLive(AnchorRecommendItemModel model);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
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.WishModel;
|
||||
import com.yunbao.common.event.LiveNewWishListCloseEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.DayWishItemViewHolder;
|
||||
import com.yunbao.common.views.LunarWishItemViewHolder;
|
||||
import com.yunbao.common.views.SeasonalWishItemViewHolder;
|
||||
import com.yunbao.common.views.WeekWishItemViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishAdapter extends RecyclerView.Adapter {
|
||||
private int type = 0;
|
||||
private List<WishModel> wishList = new ArrayList<>();
|
||||
|
||||
public void addData(List<WishModel> wishModelList, int type) {
|
||||
this.type = type;
|
||||
wishList.clear();
|
||||
wishList.addAll(wishModelList);
|
||||
wishList.add(null);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addGiftListModel(WishModel model) {
|
||||
switch (type) {
|
||||
case 1:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
break;
|
||||
case 2:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
break;
|
||||
case 3:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
break;
|
||||
case 4:
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
break;
|
||||
}
|
||||
boolean isAdd = false;
|
||||
for (int i = 0; i < wishList.size(); i++) {
|
||||
if (wishList.get(i)!=null){
|
||||
if (!TextUtils.isEmpty(wishList.get(i).getLid()) && !TextUtils.isEmpty(model.getLid())
|
||||
&& TextUtils.equals(wishList.get(i).getLid(), model.getLid())) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"重複添加禮物":"Too many gifts");
|
||||
isAdd = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!isAdd) {
|
||||
wishList.add(0, model);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<WishModel> getWishList() {
|
||||
|
||||
return wishList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (type == 1) {
|
||||
View dayWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_day_wish, parent, false);
|
||||
return new DayWishItemViewHolder(dayWish);
|
||||
} else if (type == 2) {
|
||||
View weekWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_week_wish, parent, false);
|
||||
return new WeekWishItemViewHolder(weekWish);
|
||||
} else if (type == 3) {
|
||||
View lunarWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_lunar_wish, parent, false);
|
||||
return new LunarWishItemViewHolder(lunarWish);
|
||||
} else {
|
||||
View seasonalWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_seasonal_wish, parent, false);
|
||||
return new SeasonalWishItemViewHolder(seasonalWish);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (position == wishList.size()) return;
|
||||
if (holder instanceof DayWishItemViewHolder) {
|
||||
DayWishItemViewHolder dayWishItemViewHolder = (DayWishItemViewHolder) holder;
|
||||
dayWishItemViewHolder.steDayWishData(wishList.get(position), position, new DayWishItemViewHolder.DayWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof WeekWishItemViewHolder) {
|
||||
WeekWishItemViewHolder weekWishItemViewHolder = (WeekWishItemViewHolder) holder;
|
||||
weekWishItemViewHolder.steWeekWishData(wishList.get(position), position, new WeekWishItemViewHolder.WeekWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof LunarWishItemViewHolder) {
|
||||
LunarWishItemViewHolder lunarWishItemViewHolder = (LunarWishItemViewHolder) holder;
|
||||
lunarWishItemViewHolder.steLunarWishData(wishList.get(position), position, new LunarWishItemViewHolder.LunarWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
} else if (holder instanceof SeasonalWishItemViewHolder) {
|
||||
SeasonalWishItemViewHolder seasonalWishItemViewHolder = (SeasonalWishItemViewHolder) holder;
|
||||
seasonalWishItemViewHolder.steSeasonalWish(wishList.get(position), position, new SeasonalWishItemViewHolder.SeasonalWishItemListener() {
|
||||
@Override
|
||||
public void onDelete(int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
wishList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(WishModel model, int index) {
|
||||
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
|
||||
wishList.remove(index);
|
||||
wishList.add(index, model);
|
||||
notifyItemChanged(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return wishList.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
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.GiftListModel;
|
||||
import com.yunbao.common.event.LiveNewWishGiftEvent;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.LiveNewWishGiftViewHolder;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishGiftAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftListModel> giftListModels = new ArrayList<>();
|
||||
|
||||
public LiveNewWishGiftAdapter(List<GiftListModel> giftListModels) {
|
||||
this.giftListModels = giftListModels;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View dayWish = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gitf_wish, parent, false);
|
||||
return new LiveNewWishGiftViewHolder(dayWish);
|
||||
}
|
||||
|
||||
private int index = -1;
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
LiveNewWishGiftViewHolder wishGiftViewHolder = (LiveNewWishGiftViewHolder) holder;
|
||||
wishGiftViewHolder.setData(giftListModels.get(position), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
index = position;
|
||||
notifyDataSetChanged();
|
||||
Bus.get().post(new LiveNewWishGiftEvent().setModel(giftListModels.get(position)));
|
||||
}
|
||||
});
|
||||
wishGiftViewHolder.onSelect(index == position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftListModels.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveNewWishListAdapter extends FragmentStateAdapter {
|
||||
private List<Fragment> list = new ArrayList<>();
|
||||
|
||||
public LiveNewWishListAdapter(@NonNull FragmentActivity fragmentActivity, List<Fragment> list) {
|
||||
super(fragmentActivity);
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return list.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GameRecordModel;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryViewHolder;
|
||||
|
||||
public class LiveSudGameHistoryAdapter extends RefreshAdapter<GameRecordModel> {
|
||||
|
||||
public LiveSudGameHistoryAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new LiveSudGameHistoryViewHolder(mInflater.inflate(R.layout.item_live_sud_game_history, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
LiveSudGameHistoryViewHolder sudGameListViewHolder = (LiveSudGameHistoryViewHolder) holder;
|
||||
sudGameListViewHolder.setData(mList.get(position));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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.ListInfoMessageModel;
|
||||
import com.yunbao.common.views.LiveSystemMessageViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 主播消息中心适配器
|
||||
*/
|
||||
public class LiveSystemMessageAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private LayoutInflater mInflater;
|
||||
private List<ListInfoMessageModel> listInfoMessageModels = new ArrayList<>();
|
||||
|
||||
public LiveSystemMessageAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
mInflater = LayoutInflater.from(mContext);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new LiveSystemMessageViewHolder(mInflater.inflate(R.layout.view_live_system_message, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
LiveSystemMessageViewHolder messageViewHolder = (LiveSystemMessageViewHolder) holder;
|
||||
messageViewHolder.setViewData(listInfoMessageModels.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listInfoMessageModels.size();
|
||||
}
|
||||
|
||||
public void addData(List<ListInfoMessageModel> list) {
|
||||
listInfoMessageModels.addAll(list);
|
||||
notifyDataSetChanged();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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.UserMedalListModel;
|
||||
import com.yunbao.common.views.MedalAchievementViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MedalAchievementAdapter extends RecyclerView.Adapter {
|
||||
private List<UserMedalListModel> medalData = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_medal_achievement, parent, false);
|
||||
return new MedalAchievementViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
MedalAchievementViewHolder achievementViewHolder = (MedalAchievementViewHolder) holder;
|
||||
achievementViewHolder.showData(medalData.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return medalData.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<UserMedalListModel> mGiftWall) {
|
||||
|
||||
medalData.clear();
|
||||
medalData.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
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.GiftWallModel;
|
||||
import com.yunbao.common.views.MonthGiftNamingViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MonthGiftNamingAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftWall = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_month_gift_naming, parent, false);
|
||||
return new MonthGiftNamingViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
MonthGiftNamingViewHolder monthGiftNamingViewHolder = (MonthGiftNamingViewHolder) holder;
|
||||
monthGiftNamingViewHolder.showData(giftWall.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftWall.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftWall.clear();
|
||||
giftWall.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
/**
|
||||
* Created by Chen Haoxuan on 2022/4/30.
|
||||
* 多布局的支持
|
||||
*/
|
||||
|
||||
public interface MultiTypeSupport<T> {
|
||||
int getLayoutId(T item);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
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.NewRoleFunGamesChildViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NewRoleFunGamesAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
|
||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||
private boolean rigts;
|
||||
|
||||
public NewRoleFunGamesAdapter(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_live_new_role_fun_games_child_view2, parent, false);
|
||||
return new NewRoleFunGamesChildViewHolder(runGamesView,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
NewRoleFunGamesChildViewHolder childViewHolder = (NewRoleFunGamesChildViewHolder) 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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
/**
|
||||
* Created by zhiwenyan on 5/25/17.
|
||||
* <p>
|
||||
* 条目的点击事件
|
||||
*/
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(int position);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.interfaces.OnItemLongClickListener;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/6/7.
|
||||
*/
|
||||
|
||||
public abstract class RefreshAdapter<T> extends RecyclerView.Adapter {
|
||||
|
||||
protected Context mContext;
|
||||
protected List<T> mList;
|
||||
protected LayoutInflater mInflater;
|
||||
protected RecyclerView mRecyclerView;
|
||||
protected OnItemClickListener<T> mOnItemClickListener;
|
||||
protected OnItemLongClickListener<T> mOnItemLongClickListener;
|
||||
|
||||
public RefreshAdapter(Context context) {
|
||||
this(context, new ArrayList<T>());
|
||||
}
|
||||
|
||||
public RefreshAdapter(Context context, List<T> list) {
|
||||
mList = list;
|
||||
mContext = context;
|
||||
mInflater = LayoutInflater.from(mContext);
|
||||
setHasStableIds(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
if (mList != null) {
|
||||
return mList.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<T> onItemClickListener) {
|
||||
mOnItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
public void setOnItemLongClickListener(OnItemLongClickListener<T> onItemLongClickListener) {
|
||||
mOnItemLongClickListener = onItemLongClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
||||
mRecyclerView = recyclerView;
|
||||
}
|
||||
|
||||
public RecyclerView getRecyclerView() {
|
||||
return mRecyclerView;
|
||||
}
|
||||
|
||||
public void setList(List<T> list) {
|
||||
if (mList != null) {
|
||||
mList.clear();
|
||||
mList.addAll(list);
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshDel(){
|
||||
if (mRecyclerView != null) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void refreshData(List<T> list) {
|
||||
if (mRecyclerView != null && list != null) {
|
||||
mList.clear();
|
||||
mList.addAll(list);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void insertList(List<T> list) {
|
||||
if (mRecyclerView != null && mList != null && list != null && list.size() > 0) {
|
||||
int p = mList.size();
|
||||
mList.addAll(list);
|
||||
notifyItemRangeInserted(p, list.size());
|
||||
}
|
||||
}
|
||||
|
||||
public void clearData() {
|
||||
if (mRecyclerView != null && mList != null) {
|
||||
mList.clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
protected static boolean canClick() {
|
||||
return ClickUtil.canClick();
|
||||
}
|
||||
|
||||
public List<T> getList() {
|
||||
return mList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* Created by Chen Haoxuan on 2022/4/30
|
||||
* Description:
|
||||
*/
|
||||
public class SpaceGridItemDecoration extends RecyclerView.ItemDecoration {
|
||||
private int space;
|
||||
|
||||
public SpaceGridItemDecoration(int space) {
|
||||
this.space = space;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
outRect.left = space;
|
||||
outRect.top = space;
|
||||
outRect.right = space;
|
||||
outRect.bottom = space;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
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.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudGameChatImModel;
|
||||
import com.yunbao.common.views.SudGameChatViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameChatAdapter extends RecyclerView.Adapter {
|
||||
private boolean isBottom = false;
|
||||
List<SudGameChatImModel> sudGameChatImModels = new ArrayList<>();
|
||||
private RecyclerView mRecyclerView;
|
||||
private LinearLayoutManager mLayoutManager;
|
||||
private int mRecyclerViewScrolledDy;
|
||||
private Context mContext;
|
||||
|
||||
public SudGameChatAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_game_chat_item_holder, parent, false);
|
||||
return new SudGameChatViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder instanceof SudGameChatViewHolder) {
|
||||
SudGameChatViewHolder itemViewHolder = (SudGameChatViewHolder) holder;
|
||||
itemViewHolder.sudGameChat(sudGameChatImModels.get(position));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return sudGameChatImModels.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
|
||||
mRecyclerView = recyclerView;
|
||||
mLayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
|
||||
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
super.onScrolled(recyclerView, dx, dy);
|
||||
if (isBottom && dy >= 0) return;
|
||||
mRecyclerViewScrolledDy = dy;
|
||||
isBottom = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
|
||||
super.onScrollStateChanged(recyclerView, newState);
|
||||
if (newState == 0 && isSlideToBottom(recyclerView)) {
|
||||
mRecyclerViewScrolledDy = 0;
|
||||
scrollToBottom();
|
||||
isBottom = true;
|
||||
} else if (newState == 0) {
|
||||
isBottom = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public synchronized void insertItem(SudGameChatImModel bean) {
|
||||
if (bean == null) {
|
||||
return;
|
||||
}
|
||||
int size = sudGameChatImModels.size();
|
||||
//设置最大展示99条消息
|
||||
if (size >= 100 && (isBottom || mRecyclerViewScrolledDy == 0)) {
|
||||
|
||||
sudGameChatImModels.subList(0, 50).clear();
|
||||
notifyItemRangeRemoved(0, 50);
|
||||
}
|
||||
sudGameChatImModels.add(bean);
|
||||
if (getItemCount() == 1) {
|
||||
notifyDataSetChanged();
|
||||
} else {
|
||||
notifyItemInserted(getItemCount());
|
||||
}
|
||||
if (isBottom || mRecyclerViewScrolledDy == 0) {
|
||||
scrollToBottom();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否滚到底部
|
||||
*
|
||||
* @param recyclerView
|
||||
* @return
|
||||
*/
|
||||
public boolean isSlideToBottom(RecyclerView recyclerView) {
|
||||
if (recyclerView == null) return false;
|
||||
if (recyclerView.computeVerticalScrollExtent() + recyclerView.computeVerticalScrollOffset() >= recyclerView.computeVerticalScrollRange())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void scrollToBottom() {
|
||||
if (sudGameChatImModels.size() > 0) {
|
||||
mRecyclerView.smoothScrollToPosition(getItemCount());
|
||||
}
|
||||
mRecyclerViewScrolledDy = 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.views.SudGameListViewHolder;
|
||||
|
||||
public class SudGameListAdapter extends RefreshAdapter<SudRoomListModel> {
|
||||
private boolean isHome = false;
|
||||
|
||||
public SudGameListAdapter(Context context, boolean isHome) {
|
||||
super(context);
|
||||
this.isHome = isHome;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isHome){
|
||||
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_home_sud_game_list, parent, false));
|
||||
}else {
|
||||
return new SudGameListViewHolder(mInflater.inflate(R.layout.item_sud_game_list, parent, false));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
SudGameListViewHolder sudGameListViewHolder = (SudGameListViewHolder) holder;
|
||||
sudGameListViewHolder.setData(mList.get(position),isHome);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameSearchHistoryListAdapter extends RecyclerView.Adapter<SudGameSearchHistoryListAdapter.ViewHolder> {
|
||||
private List<String> mList;
|
||||
private Context mContext;
|
||||
private OnItemClickListener<String> onItemClickListener;
|
||||
private boolean isHome = false;
|
||||
|
||||
public SudGameSearchHistoryListAdapter(Context mContext, boolean isHome) {
|
||||
this.isHome = isHome;
|
||||
this.mContext = mContext;
|
||||
mList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setList(List<String> list) {
|
||||
this.mList = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<String> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isHome) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_search_history, parent, false));
|
||||
} else {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_home_search_history, parent, false));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.setData(mList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return Math.min(mList.size(), 5);
|
||||
}
|
||||
|
||||
public List<String> getList() {
|
||||
return mList;
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView nameView;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
nameView = itemView.findViewById(R.id.history);
|
||||
|
||||
}
|
||||
|
||||
public void setData(String name) {
|
||||
nameView.setText(name);
|
||||
nameView.setOnClickListener(v -> {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(name, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class SudGameSearchRoomListAdapter extends RecyclerView.Adapter<SudGameSearchRoomListAdapter.ViewHolder> {
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
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.SudGameUserModel;
|
||||
import com.yunbao.common.views.SudGameUserListViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudGameUserListAdapter extends RecyclerView.Adapter {
|
||||
private List<SudGameUserModel> gameUserModels = new ArrayList<>();
|
||||
private boolean micMax = false;
|
||||
|
||||
public SudGameUserListAdapter(List<SudGameUserModel> gameUserModels) {
|
||||
|
||||
if (gameUserModels.size() < 7) {
|
||||
this.gameUserModels.addAll(gameUserModels);
|
||||
for (int i = 0; i < this.gameUserModels.size(); i++) {
|
||||
this.gameUserModels.get(i).setNullUser(false);
|
||||
}
|
||||
int size = 7 - gameUserModels.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.gameUserModels.add(new SudGameUserModel().setNullUser(true));
|
||||
}
|
||||
} else if (gameUserModels.size() == 7) {
|
||||
this.gameUserModels.addAll(gameUserModels);
|
||||
for (int i = 0; i < this.gameUserModels.size(); i++) {
|
||||
this.gameUserModels.get(i).setNullUser(false);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < 7; i++) {
|
||||
this.gameUserModels.add(gameUserModels.get(i).setNullUser(false));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void refreshSudGameUserList(List<SudGameUserModel> gameUserModels, List<String> muteUser) {
|
||||
this.gameUserModels.clear();
|
||||
if (gameUserModels.size() < 7) {
|
||||
micMax = false;
|
||||
this.gameUserModels.addAll(gameUserModels);
|
||||
for (int i = 0; i < this.gameUserModels.size(); i++) {
|
||||
for (String userID : muteUser) {
|
||||
if (TextUtils.equals(userID, String.valueOf(this.gameUserModels.get(i).getId()))) {
|
||||
this.gameUserModels.get(i).setMute(true);
|
||||
}
|
||||
|
||||
}
|
||||
this.gameUserModels.get(i).setNullUser(false);
|
||||
}
|
||||
int size = 7 - gameUserModels.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.gameUserModels.add(new SudGameUserModel().setNullUser(true));
|
||||
}
|
||||
} else if (gameUserModels.size() == 7) {
|
||||
micMax = true;
|
||||
this.gameUserModels.addAll(gameUserModels);
|
||||
for (int i = 0; i < this.gameUserModels.size(); i++) {
|
||||
this.gameUserModels.get(i).setNullUser(false);
|
||||
}
|
||||
} else {
|
||||
micMax = true;
|
||||
|
||||
for (int i = 0; i < 7; i++) {
|
||||
for (String userID : muteUser) {
|
||||
if (TextUtils.equals(userID, String.valueOf(this.gameUserModels.get(i).getId()))) {
|
||||
this.gameUserModels.get(i).setMute(true);
|
||||
}
|
||||
|
||||
}
|
||||
this.gameUserModels.add(gameUserModels.get(i).setNullUser(false));
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_game_user_list_holder, parent, false);
|
||||
return new SudGameUserListViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
SudGameUserListViewHolder sudGameUserListViewHolder = (SudGameUserListViewHolder) holder;
|
||||
sudGameUserListViewHolder.upData(gameUserModels.get(position), sudGameSmallCallBack, position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return gameUserModels.size();
|
||||
}
|
||||
|
||||
public boolean isMicMax() {
|
||||
return micMax;
|
||||
}
|
||||
|
||||
public void muteUser(String userID, boolean mute, int position) {
|
||||
for (int i = 0; i < gameUserModels.size(); i++) {
|
||||
SudGameUserModel sudGameUserModel = gameUserModels.get(i);
|
||||
if (!sudGameUserModel.isNullUser()) {
|
||||
if (TextUtils.equals(userID, String.valueOf(sudGameUserModel.getId()))) {
|
||||
gameUserModels.get(i).setMute(mute);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
notifyItemChanged(position);
|
||||
}
|
||||
|
||||
private SudGameSmallCallBack sudGameSmallCallBack;
|
||||
|
||||
public SudGameUserListAdapter setSudGameSmallCallBack(SudGameSmallCallBack sudGameSmallCallBack) {
|
||||
this.sudGameSmallCallBack = sudGameSmallCallBack;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface SudGameSmallCallBack {
|
||||
void unMute(String userID, int position);
|
||||
|
||||
void mute(String userID, int position);
|
||||
|
||||
void viewInformation(SudGameUserModel sudGameUserModel);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
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.SudRoomListModel;
|
||||
import com.yunbao.common.views.SudGameListViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudHomeGameListAdapter extends RecyclerView.Adapter<SudGameListViewHolder> {
|
||||
private Context mContext;
|
||||
private List<SudRoomListModel> mList;
|
||||
private boolean isHome = false;
|
||||
|
||||
public SudHomeGameListAdapter(Context mContext, boolean isHome) {
|
||||
this.mContext = mContext;
|
||||
this.isHome = isHome;
|
||||
mList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setList(List<SudRoomListModel> mList) {
|
||||
this.mList = mList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SudGameListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (isHome) {
|
||||
return new SudGameListViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_home_sud_game_list, parent, false));
|
||||
} else {
|
||||
return new SudGameListViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_sud_game_list, parent, false));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull SudGameListViewHolder holder, int position) {
|
||||
holder.setData(mList.get(position),isHome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
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.views.SudTitleSelectViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SudTitleSelectAdapter extends RecyclerView.Adapter {
|
||||
|
||||
private List<String> selectString = new ArrayList<>();
|
||||
|
||||
private int mIndex;
|
||||
private int mType;
|
||||
|
||||
public SudTitleSelectAdapter(List<String> selectString, int index, int type) {
|
||||
this.selectString = selectString;
|
||||
mIndex = index;
|
||||
mType = type;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_sud_title_select_view, parent, false);
|
||||
return new SudTitleSelectViewHolder(runGamesView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
SudTitleSelectViewHolder childViewHolder = (SudTitleSelectViewHolder) holder;
|
||||
childViewHolder.setData(selectString.get(position), mIndex == position, position, new SudTitleSelectViewHolder.SudTitleSelectListener() {
|
||||
@Override
|
||||
public void onSudTitleSelectCallBack(int index) {
|
||||
if (sudTitleSelectCallBack != null) {
|
||||
sudTitleSelectCallBack.onSudTitleSelectCallBack(index);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return selectString.size();
|
||||
}
|
||||
|
||||
private SudTitleSelectCallBack sudTitleSelectCallBack;
|
||||
|
||||
public void setSudTitleSelectCallBack(SudTitleSelectCallBack sudTitleSelectCallBack) {
|
||||
this.sudTitleSelectCallBack = sudTitleSelectCallBack;
|
||||
}
|
||||
|
||||
public interface SudTitleSelectCallBack {
|
||||
void onSudTitleSelectCallBack(int index);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/22.
|
||||
*/
|
||||
|
||||
public class ViewPagerAdapter extends PagerAdapter {
|
||||
|
||||
private List<? extends View> mViewList;
|
||||
|
||||
public ViewPagerAdapter(List<? extends View> list) {
|
||||
mViewList = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mViewList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
|
||||
return view == object;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
||||
View view = mViewList.get(position);
|
||||
container.addView(view);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
|
||||
container.removeView(mViewList.get(position));
|
||||
}
|
||||
|
||||
}
|
||||
112
common/src/main/java/com/yunbao/common/bean/ActiveModel.java
Normal file
112
common/src/main/java/com/yunbao/common/bean/ActiveModel.java
Normal file
@@ -0,0 +1,112 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
/**
|
||||
* 活动
|
||||
*/
|
||||
public class ActiveModel extends BaseModel {
|
||||
/**
|
||||
* active_id : 3
|
||||
* active_name : 闖關熱戀
|
||||
* active_img : https://qny.shayucm.com/chuangguan.png
|
||||
* active_src : h5/activity/PassionateLove/index.html
|
||||
* show_type : 0
|
||||
*/
|
||||
|
||||
@SerializedName("active_id")
|
||||
private String activeId = "";
|
||||
@SerializedName("active_name")
|
||||
private String activeName = "";
|
||||
@SerializedName("active_img")
|
||||
private String activeImg = "";
|
||||
@SerializedName("active_src")
|
||||
private String activeSrc = "";
|
||||
@SerializedName("show_type")
|
||||
private String showType = "";
|
||||
@SerializedName("textColor")
|
||||
private String textColor;
|
||||
@SerializedName("bgColor")
|
||||
private String bgColor;
|
||||
|
||||
public String getActiveId() {
|
||||
return activeId;
|
||||
}
|
||||
|
||||
public ActiveModel setActiveId(String activeId) {
|
||||
this.activeId = activeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getActiveName() {
|
||||
return activeName;
|
||||
}
|
||||
|
||||
public ActiveModel setActiveName(String activeName) {
|
||||
this.activeName = activeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getActiveImg() {
|
||||
return activeImg;
|
||||
}
|
||||
|
||||
public ActiveModel setActiveImg(String activeImg) {
|
||||
this.activeImg = activeImg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getActiveSrc() {
|
||||
return activeSrc;
|
||||
}
|
||||
|
||||
public ActiveModel setActiveSrc(String activeSrc) {
|
||||
this.activeSrc = activeSrc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShowType() {
|
||||
return showType;
|
||||
}
|
||||
|
||||
public ActiveModel setShowType(String showType) {
|
||||
this.showType = showType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTextColor() {
|
||||
return textColor;
|
||||
}
|
||||
|
||||
public void setTextColor(String textColor) {
|
||||
this.textColor = textColor;
|
||||
}
|
||||
|
||||
public String getBgColor() {
|
||||
return bgColor;
|
||||
}
|
||||
|
||||
public void setBgColor(String bgColor) {
|
||||
this.bgColor = bgColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取跳转网页地址
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String activityUrl(Context context, String liveUid) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||
String url = CommonAppConfig.HOST + "/" + activeSrc +
|
||||
"?uid=" + userInfo.getId() +
|
||||
"&token=" + userInfo.getToken()
|
||||
+ "&anchorUid=" + liveUid
|
||||
+ "&active_id=" + activeId+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||
return url;
|
||||
}
|
||||
}
|
||||
38
common/src/main/java/com/yunbao/common/bean/AdBean.java
Normal file
38
common/src/main/java/com/yunbao/common/bean/AdBean.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/28.
|
||||
*/
|
||||
|
||||
public class AdBean {
|
||||
private String mUrl;
|
||||
private String mLink;
|
||||
private int animation;//是否使用过度动画
|
||||
|
||||
@JSONField(name = "thumb")
|
||||
public String getUrl() {
|
||||
return mUrl;
|
||||
}
|
||||
@JSONField(name = "thumb")
|
||||
public void setUrl(String url) {
|
||||
mUrl = url;
|
||||
}
|
||||
@JSONField(name = "href")
|
||||
public String getLink() {
|
||||
return mLink;
|
||||
}
|
||||
@JSONField(name = "href")
|
||||
public void setLink(String link) {
|
||||
mLink = link;
|
||||
}
|
||||
@JSONField(name = "animation")
|
||||
public int getAnimation() {
|
||||
return animation;
|
||||
}
|
||||
@JSONField(name = "animation")
|
||||
public void setAnimation(int animation) {
|
||||
this.animation = animation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 机器人助手IM消息
|
||||
*/
|
||||
public class AiAutomaticSpeechModel extends BaseModel {
|
||||
//助手名字颜色
|
||||
@SerializedName("name_color")
|
||||
private String nameColor;
|
||||
//助手名字
|
||||
@SerializedName("ai_name")
|
||||
private String aiName;
|
||||
//说话内容
|
||||
@SerializedName("content")
|
||||
private String content;
|
||||
//被@用户名字
|
||||
@SerializedName("user_name")
|
||||
private String userName;
|
||||
//标签图片
|
||||
@SerializedName("icon")
|
||||
private String icon;
|
||||
//气泡背景
|
||||
@SerializedName("system_bubble")
|
||||
private String systemBubble;
|
||||
|
||||
public String getNameColor() {
|
||||
return nameColor;
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setNameColor(String nameColor) {
|
||||
this.nameColor = nameColor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAiName() {
|
||||
return aiName+":";
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setAiName(String aiName) {
|
||||
this.aiName = aiName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setContent(String content) {
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSystemBubble() {
|
||||
return systemBubble;
|
||||
}
|
||||
|
||||
public AiAutomaticSpeechModel setSystemBubble(String systemBubble) {
|
||||
this.systemBubble = systemBubble;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 猜你喜欢数据类(具体主播数据)
|
||||
*/
|
||||
public class AnchorRecommendItemModel extends BaseModel {
|
||||
/**
|
||||
* islive : 1
|
||||
* uid : 97616
|
||||
* title : 12
|
||||
* stream : 97616_1649830285
|
||||
* pull : http://pullry.yaoulive.com/uwd1c0sxu1p71/97616_1649830285.flv
|
||||
* thumb : https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600
|
||||
* isvideo : 0
|
||||
* type : 0
|
||||
* type_val :
|
||||
* anyway : 1
|
||||
* landscape : 1
|
||||
* liveclassid : 1
|
||||
* is_rong : 1
|
||||
* hot_num : 30579
|
||||
* content_pic_size_one :
|
||||
* content_pic_size_two :
|
||||
* content_pic_size_three :
|
||||
* nums : 1
|
||||
* avatar : https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600
|
||||
* avatar_thumb : https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600
|
||||
* avatar2 :
|
||||
* user_nicename : RongCloudcs20
|
||||
* level : 32
|
||||
* level_anchor : 58
|
||||
*/
|
||||
|
||||
@SerializedName("islive")
|
||||
private String islive ="";
|
||||
@SerializedName("uid")
|
||||
private String uid ="";
|
||||
@SerializedName("title")
|
||||
private String title = "";
|
||||
@SerializedName("stream")
|
||||
private String stream = "";
|
||||
@SerializedName("pull")
|
||||
private String pull = "";
|
||||
@SerializedName("thumb")
|
||||
private String thumb = "";
|
||||
@SerializedName("isvideo")
|
||||
private String isvideo ="";
|
||||
@SerializedName("type")
|
||||
private String type ="";
|
||||
@SerializedName("type_val")
|
||||
private String typeVal = "";
|
||||
@SerializedName("anyway")
|
||||
private String anyway ="";
|
||||
@SerializedName("landscape")
|
||||
private String landscape ="";
|
||||
@SerializedName("liveclassid")
|
||||
private String liveclassid ="";
|
||||
@SerializedName("is_rong")
|
||||
private String isRong ="";
|
||||
@SerializedName("hot_num")
|
||||
private String hotNum ="";
|
||||
@SerializedName("content_pic_size_one")
|
||||
private String contentPicSizeOne = "";
|
||||
@SerializedName("content_pic_size_two")
|
||||
private String contentPicSizeTwo = "";
|
||||
@SerializedName("content_pic_size_three")
|
||||
private String contentPicSizeThree;
|
||||
@SerializedName("nums")
|
||||
private String nums = "";
|
||||
@SerializedName("avatar")
|
||||
private String avatar = "";
|
||||
@SerializedName("avatar_thumb")
|
||||
private String avatarThumb = "";
|
||||
@SerializedName("avatar2")
|
||||
private String avatar2 = "";
|
||||
@SerializedName(value = "user_nicename", alternate = "userNiceName")
|
||||
private String userNicename = "";
|
||||
@SerializedName("level")
|
||||
private String level = "";
|
||||
@SerializedName("level_anchor")
|
||||
private String levelAnchor = "";
|
||||
//是否是pk状态
|
||||
@SerializedName("drpk_status")
|
||||
private String drpkStatus;
|
||||
//pk对方的头像
|
||||
@SerializedName("pk_avatar_thumb")
|
||||
private String pkAvatarThumb;
|
||||
|
||||
public String getPkAvatarThumb() {
|
||||
return pkAvatarThumb;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setPkAvatarThumb(String pkAvatarThumb) {
|
||||
this.pkAvatarThumb = pkAvatarThumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDrpkStatus() {
|
||||
return drpkStatus;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setDrpkStatus(String drpkStatus) {
|
||||
this.drpkStatus = drpkStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIslive() {
|
||||
return islive;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setIslive(String islive) {
|
||||
this.islive = islive;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setStream(String stream) {
|
||||
this.stream = stream;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPull() {
|
||||
return pull;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setPull(String pull) {
|
||||
this.pull = pull;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setThumb(String thumb) {
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsvideo() {
|
||||
return isvideo;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setIsvideo(String isvideo) {
|
||||
this.isvideo = isvideo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTypeVal() {
|
||||
return typeVal;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setTypeVal(String typeVal) {
|
||||
this.typeVal = typeVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnyway() {
|
||||
return anyway;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setAnyway(String anyway) {
|
||||
this.anyway = anyway;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLandscape() {
|
||||
return landscape;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setLandscape(String landscape) {
|
||||
this.landscape = landscape;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLiveclassid() {
|
||||
return liveclassid;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setLiveclassid(String liveclassid) {
|
||||
this.liveclassid = liveclassid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsRong() {
|
||||
return isRong;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setIsRong(String isRong) {
|
||||
this.isRong = isRong;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getHotNum() {
|
||||
return hotNum;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setHotNum(String hotNum) {
|
||||
this.hotNum = hotNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContentPicSizeOne() {
|
||||
return contentPicSizeOne;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setContentPicSizeOne(String contentPicSizeOne) {
|
||||
this.contentPicSizeOne = contentPicSizeOne;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContentPicSizeTwo() {
|
||||
return contentPicSizeTwo;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setContentPicSizeTwo(String contentPicSizeTwo) {
|
||||
this.contentPicSizeTwo = contentPicSizeTwo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContentPicSizeThree() {
|
||||
return contentPicSizeThree;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setContentPicSizeThree(String contentPicSizeThree) {
|
||||
this.contentPicSizeThree = contentPicSizeThree;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNums() {
|
||||
return nums;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setNums(String nums) {
|
||||
this.nums = nums;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatarThumb() {
|
||||
return avatarThumb;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setAvatarThumb(String avatarThumb) {
|
||||
this.avatarThumb = avatarThumb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatar2() {
|
||||
return avatar2;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setAvatar2(String avatar2) {
|
||||
this.avatar2 = avatar2;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserNicename() {
|
||||
return userNicename;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setUserNicename(String userNicename) {
|
||||
this.userNicename = userNicename;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setLevel(String level) {
|
||||
this.level = level;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevelAnchor() {
|
||||
return levelAnchor;
|
||||
}
|
||||
|
||||
public AnchorRecommendItemModel setLevelAnchor(String levelAnchor) {
|
||||
this.levelAnchor = levelAnchor;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 猜你喜欢
|
||||
*/
|
||||
public class AnchorRecommendModel extends BaseModel {
|
||||
/**
|
||||
* list_show : 1 //1,展示 0,不展示
|
||||
* up_show : 1 //1,刷新按钮展示 0不展示
|
||||
* list : [{"islive":1,"uid":97616,"title":"12","stream":"97616_1649830285","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/97616_1649830285.flv","thumb":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"hot_num":30579,"content_pic_size_one":"","content_pic_size_two":"","content_pic_size_three":"","nums":"1","avatar":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","avatar2":"","user_nicename":"RongCloudcs20","level":"32","level_anchor":"58"},{"islive":1,"uid":97617,"title":"23","stream":"97617_1649830293","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/97617_1649830293.flv","thumb":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"hot_num":5356,"content_pic_size_one":"","content_pic_size_two":"","content_pic_size_three":"","nums":"1","avatar":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","avatar2":"","user_nicename":"RongCloudcs21","level":"32","level_anchor":"12"},{"islive":1,"uid":97619,"title":"45","stream":"97619_1649830309","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/97619_1649830309.flv","thumb":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"hot_num":41061,"content_pic_size_one":"","content_pic_size_two":"","content_pic_size_three":"","nums":"4","avatar":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","avatar2":"","user_nicename":"RongCloudcs23","level":"32","level_anchor":"21"},{"islive":1,"uid":97620,"title":"56","stream":"97620_1649830320","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/97620_1649830320.flv","thumb":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"hot_num":29610,"content_pic_size_one":"","content_pic_size_two":"","content_pic_size_three":"","nums":"4","avatar":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20210805013115_aaf2203dd76321d068943bb6868c3461?imageView2/2/w/600/h/600","avatar2":"","user_nicename":"RongCloudcs24","level":"32","level_anchor":"34"},{"islive":1,"uid":97712,"title":"宽哥太牛辣","stream":"97712_1658912067","pull":"http://pullry.yaoulive.com/uwd1c0sxu1p71/97712_2022.flv","thumb":"https://qny.shayucm.com/20220329113227_c661f791c5fc878c2ef357ee022f9fbc?imageView2/2/w/600/h/600","isvideo":0,"type":0,"type_val":"","anyway":1,"landscape":1,"liveclassid":1,"is_rong":1,"hot_num":41498,"content_pic_size_one":"","content_pic_size_two":"","content_pic_size_three":"","nums":"3","avatar":"https://qny.shayucm.com/20220329113227_c661f791c5fc878c2ef357ee022f9fbc?imageView2/2/w/600/h/600","avatar_thumb":"https://qny.shayucm.com/20220329113227_c661f791c5fc878c2ef357ee022f9fbc?imageView2/2/w/200/h/200","avatar2":"","user_nicename":"rongyun002","level":"71","level_anchor":"14"}]
|
||||
*/
|
||||
//是否展示0=不展示1=展示
|
||||
@SerializedName("list_show")
|
||||
private int listShow = 0;
|
||||
@SerializedName("red_packet_show")
|
||||
private int showRedPacket = 0;//是否显示首页红包浮窗
|
||||
//是否支持换一批0=不支持 1=支持
|
||||
|
||||
|
||||
@SerializedName("live_battle_pass_show_status")
|
||||
private int showWarOrder = 0;//是否显示首页戰令
|
||||
//是否支持换一批0=不支持 1=支持
|
||||
|
||||
@SerializedName("up_show")
|
||||
private int upShow = 0;
|
||||
@SerializedName("list")
|
||||
private List<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
@SerializedName("slide")
|
||||
private List<SlideInfoModel> slide = new ArrayList<>();
|
||||
@SerializedName("red_packet_total")
|
||||
private int redPacketTotal = 100;
|
||||
@SerializedName("red_packet_day_create_num")
|
||||
private int redPacketNum = 0;
|
||||
|
||||
public List<SlideInfoModel> getSlide() {
|
||||
return slide;
|
||||
}
|
||||
|
||||
public AnchorRecommendModel setSlide(List<SlideInfoModel> slide) {
|
||||
this.slide = slide;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getShowWarOrder() {
|
||||
return showWarOrder;
|
||||
}
|
||||
|
||||
public void setShowWarOrder(int showWarOrder) {
|
||||
this.showWarOrder = showWarOrder;
|
||||
}
|
||||
|
||||
public int getListShow() {
|
||||
return listShow;
|
||||
}
|
||||
|
||||
public AnchorRecommendModel setListShow(int listShow) {
|
||||
this.listShow = listShow;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getUpShow() {
|
||||
return upShow;
|
||||
}
|
||||
|
||||
public AnchorRecommendModel setUpShow(int upShow) {
|
||||
this.upShow = upShow;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getShowRedPacket() {
|
||||
return showRedPacket;
|
||||
}
|
||||
|
||||
public void setShowRedPacket(int showRedPacket) {
|
||||
this.showRedPacket = showRedPacket;
|
||||
}
|
||||
|
||||
public int getRedPacketTotal() {
|
||||
return redPacketTotal;
|
||||
}
|
||||
|
||||
public void setRedPacketTotal(int redPacketTotal) {
|
||||
this.redPacketTotal = redPacketTotal;
|
||||
}
|
||||
|
||||
public int getRedPacketNum() {
|
||||
return redPacketNum;
|
||||
}
|
||||
|
||||
public void setRedPacketNum(int redPacketNum) {
|
||||
this.redPacketNum = redPacketNum;
|
||||
}
|
||||
|
||||
public List<AnchorRecommendItemModel> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public AnchorRecommendModel setList(List<AnchorRecommendItemModel> list) {
|
||||
this.list = list;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class AnchorStartLiveBean extends BaseModel{
|
||||
private String anchorName;
|
||||
private String avatar;
|
||||
private String roomId;
|
||||
|
||||
public String getAnchorName() {
|
||||
return anchorName;
|
||||
}
|
||||
|
||||
public void setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getRoomId() {
|
||||
return roomId;
|
||||
}
|
||||
|
||||
public void setRoomId(String roomId) {
|
||||
this.roomId = roomId;
|
||||
}
|
||||
}
|
||||
221
common/src/main/java/com/yunbao/common/bean/BannerBean.java
Normal file
221
common/src/main/java/com/yunbao/common/bean/BannerBean.java
Normal file
@@ -0,0 +1,221 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/3/30.
|
||||
*/
|
||||
|
||||
public class BannerBean {
|
||||
//是否是星标
|
||||
private boolean isStart = false;
|
||||
private String mImageUrl;
|
||||
private String mLink;
|
||||
private String show_type;
|
||||
private String mIntoUrl;
|
||||
private int type;
|
||||
private String name;
|
||||
private int activityId = 0;
|
||||
private int mIconRes;
|
||||
//心愿单展示数据
|
||||
@SerializedName("wishlist_icon")
|
||||
private String wishlistIcon;
|
||||
@SerializedName("wishlist_num")
|
||||
private String wishlistNum;
|
||||
@SerializedName("wishlist_progress")
|
||||
private String wishlistProgress;
|
||||
@SerializedName("wishlist_name")
|
||||
private String wishlistName;
|
||||
private Object data;//用来存储任意bean
|
||||
|
||||
public String getmImageUrl() {
|
||||
return mImageUrl;
|
||||
}
|
||||
|
||||
public BannerBean setmImageUrl(String mImageUrl) {
|
||||
this.mImageUrl = mImageUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getmLink() {
|
||||
return mLink;
|
||||
}
|
||||
|
||||
public BannerBean setmLink(String mLink) {
|
||||
this.mLink = mLink;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getmIconRes() {
|
||||
return mIconRes;
|
||||
}
|
||||
|
||||
public BannerBean setmIconRes(int mIconRes) {
|
||||
this.mIconRes = mIconRes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWishlistIcon() {
|
||||
return wishlistIcon;
|
||||
}
|
||||
|
||||
public BannerBean setWishlistIcon(String wishlistIcon) {
|
||||
this.wishlistIcon = wishlistIcon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWishlistNum() {
|
||||
return wishlistNum;
|
||||
}
|
||||
|
||||
public BannerBean setWishlistNum(String wishlistNum) {
|
||||
this.wishlistNum = wishlistNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWishlistProgress() {
|
||||
return wishlistProgress;
|
||||
}
|
||||
|
||||
public BannerBean setWishlistProgress(String wishlistProgress) {
|
||||
this.wishlistProgress = wishlistProgress;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWishlistName() {
|
||||
return wishlistName;
|
||||
}
|
||||
|
||||
public BannerBean setWishlistName(String wishlistName) {
|
||||
this.wishlistName = wishlistName;
|
||||
return this;
|
||||
}
|
||||
|
||||
private StarChallengeStatusModel model;
|
||||
|
||||
public boolean isStart() {
|
||||
return isStart;
|
||||
}
|
||||
|
||||
public BannerBean setStart(boolean start) {
|
||||
isStart = start;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StarChallengeStatusModel getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public BannerBean setModel(StarChallengeStatusModel model) {
|
||||
this.model = model;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShow_type() {
|
||||
return show_type;
|
||||
}
|
||||
|
||||
public void setShow_type(String show_type) {
|
||||
this.show_type = show_type;
|
||||
}
|
||||
|
||||
@JSONField(name = "slide_pic")
|
||||
public String getImageUrl() {
|
||||
return mImageUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "slide_pic")
|
||||
public void setImageUrl(String imageUrl) {
|
||||
mImageUrl = imageUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "slide_url")
|
||||
public String getLink() {
|
||||
return mLink;
|
||||
}
|
||||
|
||||
@JSONField(name = "slide_url")
|
||||
public void setLink(String link) {
|
||||
mLink = link;
|
||||
}
|
||||
|
||||
@JSONField(name = "href")
|
||||
public String getmIntoUrl() {
|
||||
return mIntoUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "href")
|
||||
public void setmIntoUrl(String intoUrl) {
|
||||
mIntoUrl = intoUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "type")
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@JSONField(name = "type")
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@JSONField(name = "name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@JSONField(name = "name")
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@JSONField(name = "active_id")
|
||||
public int getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
@JSONField(name = "active_id")
|
||||
public void setActivityId(int activityId) {
|
||||
this.activityId = activityId;
|
||||
}
|
||||
|
||||
public int getIconRes() {
|
||||
return mIconRes;
|
||||
}
|
||||
|
||||
public void setIconRes(int mIconRes) {
|
||||
this.mIconRes = mIconRes;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BannerBean{" +
|
||||
"isStart=" + isStart +
|
||||
", mImageUrl='" + mImageUrl + '\'' +
|
||||
", mLink='" + mLink + '\'' +
|
||||
", show_type='" + show_type + '\'' +
|
||||
", mIntoUrl='" + mIntoUrl + '\'' +
|
||||
", type=" + type +
|
||||
", name='" + name + '\'' +
|
||||
", activityId=" + activityId +
|
||||
", mIconRes=" + mIconRes +
|
||||
", wishlistIcon='" + wishlistIcon + '\'' +
|
||||
", wishlistNum='" + wishlistNum + '\'' +
|
||||
", wishlistProgress='" + wishlistProgress + '\'' +
|
||||
", wishlistName='" + wishlistName + '\'' +
|
||||
", model=" + model +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据类基类实现序列化
|
||||
*/
|
||||
public class BaseModel implements Serializable {
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class BattlePassPoints extends BaseModel{
|
||||
private int id;
|
||||
private int type;
|
||||
@SerializedName("rewards_name")
|
||||
private String rewardsName;
|
||||
@SerializedName("rewards_id")
|
||||
private int rewardsId;
|
||||
@SerializedName("image_url")
|
||||
private String imageUrl;
|
||||
@SerializedName("points_threshold")
|
||||
private String pointsThreshold;
|
||||
@SerializedName("points_threshold_text")
|
||||
private String pointsThresholdText;
|
||||
@SerializedName("rewards_value")
|
||||
private String rewardsValue;
|
||||
@SerializedName("battle_pass_level")
|
||||
private int battlePassLevel;
|
||||
@SerializedName("exchange_quantity")
|
||||
private int exchangeQuantity;
|
||||
@SerializedName("live_battle_pass_type_id")
|
||||
private int liveBattlePassTypeId;
|
||||
private String description;
|
||||
@SerializedName("restrict_time")
|
||||
private int restrictTime;
|
||||
private int sort;
|
||||
@SerializedName("exchange_status")
|
||||
private int exchangeStatus;
|
||||
@SerializedName("user_quinty_count")
|
||||
private int userQuintyCount;
|
||||
@SerializedName("exchange_status_remark")
|
||||
private String exchangeMark;
|
||||
|
||||
@SerializedName("send_reward_type")
|
||||
private int sendRewardType;
|
||||
@SerializedName("send_gift_type")
|
||||
private int sendGiftType;
|
||||
@SerializedName("send_gift_needcoin")
|
||||
private String sendGiftNeedcoin;
|
||||
|
||||
public BattlePassPoints() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getRewardsName() {
|
||||
return rewardsName;
|
||||
}
|
||||
|
||||
public void setRewardsName(String rewardsName) {
|
||||
this.rewardsName = rewardsName;
|
||||
}
|
||||
|
||||
public int getRewardsId() {
|
||||
return rewardsId;
|
||||
}
|
||||
|
||||
public void setRewardsId(int rewardsId) {
|
||||
this.rewardsId = rewardsId;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getPointsThreshold() {
|
||||
return pointsThreshold;
|
||||
}
|
||||
|
||||
public void setPointsThreshold(String pointsThreshold) {
|
||||
this.pointsThreshold = pointsThreshold;
|
||||
}
|
||||
|
||||
public String getRewardsValue() {
|
||||
return rewardsValue;
|
||||
}
|
||||
|
||||
public void setRewardsValue(String rewardsValue) {
|
||||
this.rewardsValue = rewardsValue;
|
||||
}
|
||||
|
||||
public int getBattlePassLevel() {
|
||||
return battlePassLevel;
|
||||
}
|
||||
|
||||
public void setBattlePassLevel(int battlePassLevel) {
|
||||
this.battlePassLevel = battlePassLevel;
|
||||
}
|
||||
|
||||
public int getExchangeQuantity() {
|
||||
return exchangeQuantity;
|
||||
}
|
||||
|
||||
public void setExchangeQuantity(int exchangeQuantity) {
|
||||
this.exchangeQuantity = exchangeQuantity;
|
||||
}
|
||||
|
||||
public int getLiveBattlePassTypeId() {
|
||||
return liveBattlePassTypeId;
|
||||
}
|
||||
|
||||
public void setLiveBattlePassTypeId(int liveBattlePassTypeId) {
|
||||
this.liveBattlePassTypeId = liveBattlePassTypeId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getRestrictTime() {
|
||||
return restrictTime;
|
||||
}
|
||||
|
||||
public void setRestrictTime(int restrictTime) {
|
||||
this.restrictTime = restrictTime;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public int getExchangeStatus() {
|
||||
return exchangeStatus;
|
||||
}
|
||||
|
||||
public void setExchangeStatus(int exchangeStatus) {
|
||||
this.exchangeStatus = exchangeStatus;
|
||||
}
|
||||
|
||||
public int getUserQuintyCount() {
|
||||
return userQuintyCount;
|
||||
}
|
||||
|
||||
public void setUserQuintyCount(int userQuintyCount) {
|
||||
this.userQuintyCount = userQuintyCount;
|
||||
}
|
||||
|
||||
public String getExchangeMark() {
|
||||
return exchangeMark;
|
||||
}
|
||||
|
||||
public void setExchangeMark(String exchangeMark) {
|
||||
this.exchangeMark = exchangeMark;
|
||||
}
|
||||
|
||||
public String getPointsThresholdText() {
|
||||
return pointsThresholdText;
|
||||
}
|
||||
|
||||
public void setPointsThresholdText(String pointsThresholdText) {
|
||||
this.pointsThresholdText = pointsThresholdText;
|
||||
}
|
||||
|
||||
public int getSendRewardType() {
|
||||
return sendRewardType;
|
||||
}
|
||||
|
||||
public void setSendRewardType(int sendRewardType) {
|
||||
this.sendRewardType = sendRewardType;
|
||||
}
|
||||
|
||||
public int getSendGiftType() {
|
||||
return sendGiftType;
|
||||
}
|
||||
|
||||
public void setSendGiftType(int sendGiftType) {
|
||||
this.sendGiftType = sendGiftType;
|
||||
}
|
||||
|
||||
public String getSendGiftNeedcoin() {
|
||||
return sendGiftNeedcoin;
|
||||
}
|
||||
|
||||
public void setSendGiftNeedcoin(String sendGiftNeedcoin) {
|
||||
this.sendGiftNeedcoin = sendGiftNeedcoin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BattlePassPoints{" +
|
||||
"id=" + id +
|
||||
", type=" + type +
|
||||
", rewardsName='" + rewardsName + '\'' +
|
||||
", rewardsId=" + rewardsId +
|
||||
", imageUrl='" + imageUrl + '\'' +
|
||||
", pointsThreshold='" + pointsThreshold + '\'' +
|
||||
", pointsThresholdText='" + pointsThresholdText + '\'' +
|
||||
", rewardsValue='" + rewardsValue + '\'' +
|
||||
", battlePassLevel=" + battlePassLevel +
|
||||
", exchangeQuantity=" + exchangeQuantity +
|
||||
", liveBattlePassTypeId=" + liveBattlePassTypeId +
|
||||
", description='" + description + '\'' +
|
||||
", restrictTime=" + restrictTime +
|
||||
", sort=" + sort +
|
||||
", exchangeStatus=" + exchangeStatus +
|
||||
", userQuintyCount=" + userQuintyCount +
|
||||
", exchangeMark='" + exchangeMark + '\'' +
|
||||
", sendRewardType=" + sendRewardType +
|
||||
", sendGiftType=" + sendGiftType +
|
||||
", sendRewardNeedcoin='" + sendGiftNeedcoin + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
157
common/src/main/java/com/yunbao/common/bean/BattlePassTask.java
Normal file
157
common/src/main/java/com/yunbao/common/bean/BattlePassTask.java
Normal file
@@ -0,0 +1,157 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassTask extends BaseModel {
|
||||
private List<Task> daily;// 每日任务
|
||||
private List<Task> season;// 每期任务
|
||||
|
||||
public BattlePassTask() {
|
||||
}
|
||||
|
||||
public List<Task> getDaily() {
|
||||
return daily;
|
||||
}
|
||||
|
||||
public void setDaily(List<Task> daily) {
|
||||
this.daily = daily;
|
||||
}
|
||||
|
||||
public List<Task> getSeason() {
|
||||
return season;
|
||||
}
|
||||
|
||||
public void setSeason(List<Task> season) {
|
||||
this.season = season;
|
||||
}
|
||||
|
||||
public static class Task {
|
||||
private int id;// 任务ID
|
||||
private String type;// 任务类型
|
||||
@SerializedName("task_success")
|
||||
private int taskSuccess;// 任务可以重复的次数
|
||||
@SerializedName("name_en")
|
||||
private String nameEn;// 任务名称英文
|
||||
@SerializedName("remark_en")
|
||||
private String remarkEn;// 任务备注英文
|
||||
private String name;// 任务名称中文
|
||||
private String remark; // 任务备注中文
|
||||
@SerializedName("image_path")
|
||||
private String imagePath;// 图标path
|
||||
@SerializedName("user_task_success")
|
||||
private int userTaskSuccess;// 用户完成的任务次数
|
||||
@SerializedName("received_task")
|
||||
private int receivedTask;// 用户已经领取的任务数量
|
||||
@SerializedName("not_received_task")
|
||||
private int notReceivedTask; // 用户未领取的任务数量
|
||||
public boolean isBuy(){
|
||||
return taskSuccess==0;
|
||||
}
|
||||
public String getNameText(){
|
||||
return WordUtil.isNewZh()?name:nameEn;
|
||||
}
|
||||
public String getRemarkText(){
|
||||
return WordUtil.isNewZh()?remark:remarkEn;
|
||||
}
|
||||
|
||||
public Task() {
|
||||
}
|
||||
|
||||
public Task(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getTaskSuccess() {
|
||||
return taskSuccess;
|
||||
}
|
||||
|
||||
public void setTaskSuccess(int taskSuccess) {
|
||||
this.taskSuccess = taskSuccess;
|
||||
}
|
||||
|
||||
public String getNameEn() {
|
||||
return nameEn;
|
||||
}
|
||||
|
||||
public void setNameEn(String nameEn) {
|
||||
this.nameEn = nameEn;
|
||||
}
|
||||
|
||||
public String getRemarkEn() {
|
||||
return remarkEn;
|
||||
}
|
||||
|
||||
public void setRemarkEn(String remarkEn) {
|
||||
this.remarkEn = remarkEn;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getImagePath() {
|
||||
return imagePath;
|
||||
}
|
||||
|
||||
public void setImagePath(String imagePath) {
|
||||
this.imagePath = imagePath;
|
||||
}
|
||||
|
||||
public int getUserTaskSuccess() {
|
||||
return userTaskSuccess;
|
||||
}
|
||||
|
||||
public void setUserTaskSuccess(int userTaskSuccess) {
|
||||
this.userTaskSuccess = userTaskSuccess;
|
||||
}
|
||||
|
||||
public int getReceivedTask() {
|
||||
return receivedTask;
|
||||
}
|
||||
|
||||
public void setReceivedTask(int receivedTask) {
|
||||
this.receivedTask = receivedTask;
|
||||
}
|
||||
|
||||
public int getNotReceivedTask() {
|
||||
return notReceivedTask;
|
||||
}
|
||||
|
||||
public void setNotReceivedTask(int notReceivedTask) {
|
||||
this.notReceivedTask = notReceivedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePassUserInfoBean extends BaseModel{
|
||||
private String uid;
|
||||
private int points;
|
||||
@SerializedName("battle_pass_exp")
|
||||
private int battlePassExp;
|
||||
@SerializedName("battle_pass_user_records_1")
|
||||
private int battlePassUserRecords1;
|
||||
@SerializedName("battle_pass_user_records_2")
|
||||
private int battlePassUserRecords2;
|
||||
@SerializedName("battle_pass_user_records_3")
|
||||
private int battlePassUserRecords3;
|
||||
private int level;
|
||||
@SerializedName("last_level_exp")
|
||||
private int lastLevelExp;
|
||||
@SerializedName("next_level_exp")
|
||||
private int nextLevelExp;
|
||||
private String id;
|
||||
@SerializedName("battle_pass_name")
|
||||
private String battlePassName;
|
||||
@SerializedName("start_time")
|
||||
private String startTime;
|
||||
@SerializedName("end_time")
|
||||
private String endTime;
|
||||
@SerializedName("battle_pass_status")
|
||||
private boolean battlePassStatus;
|
||||
@SerializedName("max_level_exp")
|
||||
private long maxLevelExp;
|
||||
@SerializedName("max_level")
|
||||
private int maxLevel;
|
||||
|
||||
private List<LiveBattlePassRewardsBean.BattlePassType> live_battle_pass_type;
|
||||
|
||||
public BattlePassUserInfoBean() {
|
||||
}
|
||||
public List<LiveBattlePassRewardsBean.BattlePassType> getLive_battle_pass_type() {
|
||||
return live_battle_pass_type;
|
||||
}
|
||||
|
||||
public void setLive_battle_pass_type(List<LiveBattlePassRewardsBean.BattlePassType> live_battle_pass_type) {
|
||||
this.live_battle_pass_type = live_battle_pass_type;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(int points) {
|
||||
this.points = points;
|
||||
}
|
||||
|
||||
public int getBattlePassExp() {
|
||||
return battlePassExp;
|
||||
}
|
||||
|
||||
public void setBattlePassExp(int battlePassExp) {
|
||||
this.battlePassExp = battlePassExp;
|
||||
}
|
||||
|
||||
public int getBattlePassUserRecords1() {
|
||||
return battlePassUserRecords1;
|
||||
}
|
||||
|
||||
public void setBattlePassUserRecords1(int battlePassUserRecords1) {
|
||||
this.battlePassUserRecords1 = battlePassUserRecords1;
|
||||
}
|
||||
|
||||
public int getBattlePassUserRecords2() {
|
||||
return battlePassUserRecords2;
|
||||
}
|
||||
|
||||
public void setBattlePassUserRecords2(int battlePassUserRecords2) {
|
||||
this.battlePassUserRecords2 = battlePassUserRecords2;
|
||||
}
|
||||
|
||||
public int getBattlePassUserRecords3() {
|
||||
return battlePassUserRecords3;
|
||||
}
|
||||
|
||||
public void setBattlePassUserRecords3(int battlePassUserRecords3) {
|
||||
this.battlePassUserRecords3 = battlePassUserRecords3;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getLastLevelExp() {
|
||||
return lastLevelExp;
|
||||
}
|
||||
|
||||
public void setLastLevelExp(int lastLevelExp) {
|
||||
this.lastLevelExp = lastLevelExp;
|
||||
}
|
||||
|
||||
public int getNextLevelExp() {
|
||||
return nextLevelExp;
|
||||
}
|
||||
|
||||
public void setNextLevelExp(int nextLevelExp) {
|
||||
this.nextLevelExp = nextLevelExp;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBattlePassName() {
|
||||
return battlePassName;
|
||||
}
|
||||
|
||||
public void setBattlePassName(String battlePassName) {
|
||||
this.battlePassName = battlePassName;
|
||||
}
|
||||
|
||||
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 boolean isBattlePassStatus() {
|
||||
return battlePassStatus;
|
||||
}
|
||||
|
||||
public void setBattlePassStatus(boolean battlePassStatus) {
|
||||
this.battlePassStatus = battlePassStatus;
|
||||
}
|
||||
|
||||
public long getMaxLevelExp() {
|
||||
return maxLevelExp;
|
||||
}
|
||||
|
||||
public void setMaxLevelExp(long maxLevelExp) {
|
||||
this.maxLevelExp = maxLevelExp;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return maxLevel;
|
||||
}
|
||||
|
||||
public void setMaxLevel(int maxLevel) {
|
||||
this.maxLevel = maxLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BattlePassUserInfoBean{" +
|
||||
"uid='" + uid + '\'' +
|
||||
", points=" + points +
|
||||
", battlePassExp=" + battlePassExp +
|
||||
", battlePassUserRecords1=" + battlePassUserRecords1 +
|
||||
", battlePassUserRecords2=" + battlePassUserRecords2 +
|
||||
", battlePassUserRecords3=" + battlePassUserRecords3 +
|
||||
", level=" + level +
|
||||
", lastLevelExp=" + lastLevelExp +
|
||||
", nextLevelExp=" + nextLevelExp +
|
||||
", id='" + id + '\'' +
|
||||
", battlePassName='" + battlePassName + '\'' +
|
||||
", startTime='" + startTime + '\'' +
|
||||
", endTime='" + endTime + '\'' +
|
||||
", battlePassStatus=" + battlePassStatus +
|
||||
", maxLevelExp=" + maxLevelExp +
|
||||
", maxLevel=" + maxLevel +
|
||||
", live_battle_pass_type=" + live_battle_pass_type +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlindBoxInfoModel extends BaseModel {
|
||||
/**
|
||||
* "info":[{"item_name":["麒麟勛章饰品","麒麟頭像框饰品","麒麟坐騎饰品","水晶项链礼物","夢幻水晶球礼物","心動泡泡礼物","蝴蝶少女礼物","金色唱片礼物","鑽石禮盒礼物","紙花船礼物"],"threshold_value":268,"threshold_dress_name":"麒麟坐騎","dress_threshold_value":0,"blind_box_type":1,"blind_box_id":1636},{"item_name":["金鳳勛章饰品","金鳳頭像框饰品","金鳳坐騎饰品","浪漫氣球礼物","捕夢網礼物","仙女棒礼物","藍寶石鈴鐺礼物","榮耀星礼物","童話屋礼物","夢幻許願池礼物"],"threshold_value":198,"threshold_dress_name":"金鳳坐騎","dress_threshold_value":0,"blind_box_type":2,"blind_box_id":1637},{"item_name":["神龍勛章饰品","神龍頭像框饰品","神龍坐騎饰品","水晶玫瑰礼物","sweet香水礼物","甜蜜熱氣球礼物","風鈴舞動礼物","音樂噴泉礼物","星空列車礼物","漂洋過海來看你礼物"],"threshold_value":128,"threshold_dress_name":"神龍坐騎","dress_threshold_value":0,"blind_box_type":3,"blind_box_id":1638}]
|
||||
*/
|
||||
@SerializedName("item_name")
|
||||
private List<String> itemName;
|
||||
@SerializedName("threshold_value")
|
||||
private String thresholdValue = "0";
|
||||
@SerializedName("threshold_dress_name")
|
||||
private String thresholdDressName;
|
||||
@SerializedName("dress_threshold_value")
|
||||
private String dressThresholdValue;
|
||||
@SerializedName("blind_box_type")
|
||||
private String blindBoxType;
|
||||
@SerializedName("blind_box_id")
|
||||
private String blindBoxId;
|
||||
@SerializedName("blind_box_swf")
|
||||
private String blindBoxSwf;
|
||||
@SerializedName("threshold_effect_src")
|
||||
private String thresholdEffectSrc;
|
||||
|
||||
public String getThresholdEffectSrc() {
|
||||
return thresholdEffectSrc;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setThresholdEffectSrc(String thresholdEffectSrc) {
|
||||
this.thresholdEffectSrc = thresholdEffectSrc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxSwf() {
|
||||
return blindBoxSwf;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setBlindBoxSwf(String blindBoxSwf) {
|
||||
this.blindBoxSwf = blindBoxSwf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setItemName(List<String> itemName) {
|
||||
this.itemName = itemName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThresholdValue() {
|
||||
return thresholdValue;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setThresholdValue(String thresholdValue) {
|
||||
this.thresholdValue = thresholdValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThresholdDressName() {
|
||||
return thresholdDressName;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setThresholdDressName(String thresholdDressName) {
|
||||
this.thresholdDressName = thresholdDressName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressThresholdValue() {
|
||||
return dressThresholdValue;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setDressThresholdValue(String dressThresholdValue) {
|
||||
this.dressThresholdValue = dressThresholdValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxType() {
|
||||
return blindBoxType;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setBlindBoxType(String blindBoxType) {
|
||||
this.blindBoxType = blindBoxType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxId() {
|
||||
return blindBoxId;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setBlindBoxId(String blindBoxId) {
|
||||
this.blindBoxId = blindBoxId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
/**
|
||||
* 聊天备注信息
|
||||
*/
|
||||
public class ChatRemarkModel extends BaseModel {
|
||||
private String userId;
|
||||
private String remarks;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class ChatRemarksBean {
|
||||
String userId;
|
||||
String remarks;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public ChatRemarksBean() {
|
||||
}
|
||||
|
||||
public ChatRemarksBean(String userId, String remarks) {
|
||||
this.userId = userId;
|
||||
this.remarks = remarks;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CheckRemainingBalance extends BaseModel {
|
||||
|
||||
@SerializedName("golden_bean_remaining_balance")
|
||||
private int goldenBeanRemainingBalance;
|
||||
@SerializedName("status")
|
||||
private int status;
|
||||
@SerializedName("deduct_money_key")
|
||||
private String deductMoneyKey;
|
||||
|
||||
public String getDeductMoneyKey() {
|
||||
return deductMoneyKey;
|
||||
}
|
||||
|
||||
public CheckRemainingBalance setDeductMoneyKey(String deductMoneyKey) {
|
||||
this.deductMoneyKey = deductMoneyKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public CheckRemainingBalance setStatus(int status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getGoldenBeanRemainingBalance() {
|
||||
return goldenBeanRemainingBalance;
|
||||
}
|
||||
|
||||
public void setGoldenBeanRemainingBalance(int goldenBeanRemainingBalance) {
|
||||
this.goldenBeanRemainingBalance = goldenBeanRemainingBalance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CheckRemainingBalance{" +
|
||||
"goldenBeanRemainingBalance=" + goldenBeanRemainingBalance +
|
||||
", status=" + status +
|
||||
", deductMoneyKey='" + deductMoneyKey + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
108
common/src/main/java/com/yunbao/common/bean/CoinBean.java
Normal file
108
common/src/main/java/com/yunbao/common/bean/CoinBean.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/9/21.
|
||||
*/
|
||||
|
||||
public class CoinBean implements Parcelable{
|
||||
|
||||
private String id;
|
||||
private String coin;
|
||||
private String money;
|
||||
private String give;
|
||||
private String money_usd;
|
||||
private boolean checked;
|
||||
|
||||
public CoinBean(){
|
||||
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCoin() {
|
||||
return coin;
|
||||
}
|
||||
|
||||
public void setCoin(String coin) {
|
||||
this.coin = coin;
|
||||
}
|
||||
|
||||
public String getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(String money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public String getGive() {
|
||||
return give;
|
||||
}
|
||||
|
||||
public void setGive(String give) {
|
||||
this.give = give;
|
||||
}
|
||||
|
||||
public boolean isChecked() {
|
||||
return checked;
|
||||
}
|
||||
|
||||
public void setChecked(boolean checked) {
|
||||
this.checked = checked;
|
||||
}
|
||||
|
||||
|
||||
public String getMoney_usd() {
|
||||
return money_usd;
|
||||
}
|
||||
|
||||
public void setMoney_usd(String money_usd) {
|
||||
this.money_usd = money_usd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public CoinBean(Parcel in) {
|
||||
id = in.readString();
|
||||
coin = in.readString();
|
||||
money = in.readString();
|
||||
give = in.readString();
|
||||
money_usd= in.readString();
|
||||
checked = in.readByte() != 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(id);
|
||||
dest.writeString(coin);
|
||||
dest.writeString(money);
|
||||
dest.writeString(give);
|
||||
dest.writeString(money_usd);
|
||||
dest.writeByte((byte) (checked ? 1 : 0));
|
||||
}
|
||||
|
||||
public static final Creator<CoinBean> CREATOR = new Creator<CoinBean>() {
|
||||
@Override
|
||||
public CoinBean createFromParcel(Parcel in) {
|
||||
return new CoinBean(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CoinBean[] newArray(int size) {
|
||||
return new CoinBean[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
92
common/src/main/java/com/yunbao/common/bean/CoinPayBean.java
Normal file
92
common/src/main/java/com/yunbao/common/bean/CoinPayBean.java
Normal file
@@ -0,0 +1,92 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2019/4/11.
|
||||
*/
|
||||
|
||||
public class CoinPayBean {
|
||||
private String mId;
|
||||
private String mName;
|
||||
private String mThumb;
|
||||
private String mHref;
|
||||
private boolean mChecked;
|
||||
private String mPayDesc;//支付描述,如推荐大额
|
||||
private String mPriceNum;//显示价格的数量
|
||||
|
||||
@JSONField(name = "id")
|
||||
public String getId() {
|
||||
return mId;
|
||||
}
|
||||
|
||||
@JSONField(name = "id")
|
||||
public void setId(String id) {
|
||||
mId = id;
|
||||
}
|
||||
|
||||
@JSONField(name = "name")
|
||||
public String getName() {
|
||||
return mName;
|
||||
}
|
||||
|
||||
@JSONField(name = "name")
|
||||
public void setName(String name) {
|
||||
mName = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@JSONField(name = "payDesc")
|
||||
public String getPayDesc() {
|
||||
return mPayDesc;
|
||||
}
|
||||
|
||||
@JSONField(name = "payDesc")
|
||||
public void setPayDesc(String payDesc) {
|
||||
mPayDesc = payDesc;
|
||||
}
|
||||
|
||||
|
||||
@JSONField(name = "priceNum")
|
||||
public String getPriceNum() {
|
||||
return mPriceNum;
|
||||
}
|
||||
|
||||
@JSONField(name = "priceNum")
|
||||
public void setPriceNum(String priceNum) {
|
||||
mPriceNum = priceNum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@JSONField(name = "thumb")
|
||||
public String getThumb() {
|
||||
return mThumb;
|
||||
}
|
||||
|
||||
@JSONField(name = "thumb")
|
||||
public void setThumb(String thumb) {
|
||||
mThumb = thumb;
|
||||
}
|
||||
|
||||
@JSONField(name = "href")
|
||||
public String getHref() {
|
||||
return mHref;
|
||||
}
|
||||
|
||||
@JSONField(name = "href")
|
||||
public void setHref(String href) {
|
||||
mHref = href;
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
public boolean isChecked() {
|
||||
return mChecked;
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
public void setChecked(boolean checked) {
|
||||
mChecked = checked;
|
||||
}
|
||||
}
|
||||
641
common/src/main/java/com/yunbao/common/bean/ConfigBean.java
Normal file
641
common/src/main/java/com/yunbao/common/bean/ConfigBean.java
Normal file
@@ -0,0 +1,641 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/5.
|
||||
*/
|
||||
|
||||
public class ConfigBean extends BaseModel {
|
||||
private String version;//Android apk安装包 版本号
|
||||
private String downloadApkUrl;//Android apk安装包 下载地址
|
||||
private String updateDes;//版本更新描述
|
||||
private String liveWxShareUrl;//直播间微信分享地址
|
||||
private String liveShareTitle;//直播间分享标题
|
||||
private String liveShareDes;//直播间分享描述
|
||||
private String videoShareTitle;//短视频分享标题
|
||||
private String videoShareDes;//短视频分享描述
|
||||
private int videoAuditSwitch;//短视频审核是否开启
|
||||
private int videoCloudType;//短视频云储存类型 1七牛云 2腾讯云
|
||||
private String videoQiNiuHost;//短视频七牛云域名
|
||||
private String txCosAppId;//腾讯云存储appId
|
||||
private String txCosRegion;//腾讯云存储区域
|
||||
private String txCosBucketName;//腾讯云存储桶名字
|
||||
private String txCosVideoPath;//腾讯云存储视频文件夹
|
||||
private String txCosImagePath;//腾讯云存储图片文件夹
|
||||
private String coinName;//钻石名称
|
||||
private String goldCoinName;//金币名称
|
||||
private String votesName;//映票名称
|
||||
private String[] liveTimeCoin;//直播间计时收费规则
|
||||
private String[] loginType;//三方登录类型
|
||||
private String[][] liveType;//直播间开播类型
|
||||
private String[] shareType;//分享类型
|
||||
private List<LiveClassBean> liveClass;//直播分类
|
||||
private int maintainSwitch;//维护开关
|
||||
private String maintainTips;//维护提示
|
||||
private String beautyKey;//萌颜鉴权码
|
||||
private int beautyMeiBai;//萌颜美白数值
|
||||
private int beautyMoPi;//萌颜磨皮数值
|
||||
private int beautyBaoHe;//萌颜饱和数值
|
||||
private int beautyFenNen;//萌颜粉嫩数值
|
||||
private int beautyBigEye;//萌颜大眼数值
|
||||
private int beautyFace;//萌颜瘦脸数值
|
||||
private int faceNarrowing;//窄脸
|
||||
private String mAdInfo;//引导页 广告信息
|
||||
private int priMsgSwitch;//私信开关
|
||||
private int forceUpdate;//强制更新
|
||||
private String sproutType;//美颜类型,1-基础美颜,2-萌颜,3-360美颜
|
||||
|
||||
private String paster360Url;//360贴纸下载地址
|
||||
private String pkTime;//主播pk时间
|
||||
private String serverUrl;//客服地址
|
||||
private String AllServerGiftIcon;//全服通知横幅icon
|
||||
private String turntableEnable;//转盘使能
|
||||
private String txVideoUgcLicenceUrl;//腾讯直播视频鉴权
|
||||
private String txPlayUgcLicenceUrl;//腾讯短视频鉴权
|
||||
private String txVideoUgcKey;
|
||||
private String google_isup;
|
||||
@SerializedName("is_return_user")//是否需要弹窗(0否,1是)
|
||||
private String isReturnUser="";
|
||||
@SerializedName("popup_img_url")//弹窗图片地址
|
||||
private String popupImgUrl="";
|
||||
@SerializedName("popup_img_en_url")//弹窗图片地址
|
||||
private String popupImgEnUrl="";
|
||||
@SerializedName("jump_h5_url")//点击跳转H5页面地址
|
||||
private String jumpH5Url="";
|
||||
|
||||
@JSONField(name = "is_return_user")
|
||||
public String getIsReturnUser() {
|
||||
return isReturnUser;
|
||||
}
|
||||
|
||||
@JSONField(name = "is_return_user")
|
||||
public ConfigBean setIsReturnUser(String isReturnUser) {
|
||||
this.isReturnUser = isReturnUser;
|
||||
return this;
|
||||
}
|
||||
@JSONField(name = "popup_img_url")
|
||||
public String getPopupImgUrl() {
|
||||
return popupImgUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "popup_img_url")
|
||||
public ConfigBean setPopupImgUrl(String popupImgUrl) {
|
||||
this.popupImgUrl = popupImgUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
@JSONField(name = "popup_img_en_url")
|
||||
public String getPopupImgEnUrl() {
|
||||
return popupImgEnUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "popup_img_en_url")
|
||||
public ConfigBean setPopupImgEnUrl(String popupImgEnUrl) {
|
||||
this.popupImgEnUrl = popupImgEnUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
@JSONField(name = "jump_h5_url")
|
||||
public String getJumpH5Url() {
|
||||
return jumpH5Url;
|
||||
}
|
||||
|
||||
@JSONField(name = "jump_h5_url")
|
||||
public ConfigBean setJumpH5Url(String jumpH5Url) {
|
||||
this.jumpH5Url = jumpH5Url;
|
||||
return this;
|
||||
}
|
||||
|
||||
@JSONField(name = "google_isup")
|
||||
public String getGoogle_isup() {
|
||||
return google_isup;
|
||||
}
|
||||
|
||||
@JSONField(name = "google_isup")
|
||||
public void setGoogle_isup(String google_isup) {
|
||||
this.google_isup = google_isup;
|
||||
}
|
||||
|
||||
@JSONField(name = "tx_play_ugc_licence_url")
|
||||
public String getTxPlayUgcLicenceUrl() {
|
||||
return txPlayUgcLicenceUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "tx_play_ugc_licence_url")
|
||||
public void setTxPlayUgcLicenceUrl(String txPlayUgcLicenceUrl) {
|
||||
this.txPlayUgcLicenceUrl = txPlayUgcLicenceUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ConfigBean{" +
|
||||
"version='" + version + '\'' +
|
||||
", downloadApkUrl='" + downloadApkUrl + '\'' +
|
||||
", updateDes='" + updateDes + '\'' +
|
||||
", liveWxShareUrl='" + liveWxShareUrl + '\'' +
|
||||
", liveShareTitle='" + liveShareTitle + '\'' +
|
||||
", liveShareDes='" + liveShareDes + '\'' +
|
||||
", videoShareTitle='" + videoShareTitle + '\'' +
|
||||
", videoShareDes='" + videoShareDes + '\'' +
|
||||
", videoAuditSwitch=" + videoAuditSwitch +
|
||||
", videoCloudType=" + videoCloudType +
|
||||
", videoQiNiuHost='" + videoQiNiuHost + '\'' +
|
||||
", txCosAppId='" + txCosAppId + '\'' +
|
||||
", txCosRegion='" + txCosRegion + '\'' +
|
||||
", txCosBucketName='" + txCosBucketName + '\'' +
|
||||
", txCosVideoPath='" + txCosVideoPath + '\'' +
|
||||
", txCosImagePath='" + txCosImagePath + '\'' +
|
||||
", coinName='" + coinName + '\'' +
|
||||
", goldCoinName='" + goldCoinName + '\'' +
|
||||
", votesName='" + votesName + '\'' +
|
||||
", liveTimeCoin=" + Arrays.toString(liveTimeCoin) +
|
||||
", loginType=" + Arrays.toString(loginType) +
|
||||
", liveType=" + Arrays.toString(liveType) +
|
||||
", shareType=" + Arrays.toString(shareType) +
|
||||
", liveClass=" + liveClass +
|
||||
", maintainSwitch=" + maintainSwitch +
|
||||
", maintainTips='" + maintainTips + '\'' +
|
||||
", beautyKey='" + beautyKey + '\'' +
|
||||
", beautyMeiBai=" + beautyMeiBai +
|
||||
", beautyMoPi=" + beautyMoPi +
|
||||
", beautyBaoHe=" + beautyBaoHe +
|
||||
", beautyFenNen=" + beautyFenNen +
|
||||
", beautyBigEye=" + beautyBigEye +
|
||||
", beautyFace=" + beautyFace +
|
||||
", faceNarrowing=" + faceNarrowing +
|
||||
", mAdInfo='" + mAdInfo + '\'' +
|
||||
", priMsgSwitch=" + priMsgSwitch +
|
||||
", forceUpdate=" + forceUpdate +
|
||||
", sproutType='" + sproutType + '\'' +
|
||||
", paster360Url='" + paster360Url + '\'' +
|
||||
", pkTime='" + pkTime + '\'' +
|
||||
", serverUrl='" + serverUrl + '\'' +
|
||||
", AllServerGiftIcon='" + AllServerGiftIcon + '\'' +
|
||||
", turntableEnable='" + turntableEnable + '\'' +
|
||||
", txVideoUgcLicenceUrl='" + txVideoUgcLicenceUrl + '\'' +
|
||||
", txVideoUgcKey='" + txVideoUgcKey + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_ver")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_ver")
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_url")
|
||||
public String getDownloadApkUrl() {
|
||||
return downloadApkUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_url")
|
||||
public void setDownloadApkUrl(String downloadApkUrl) {
|
||||
this.downloadApkUrl = downloadApkUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_des")
|
||||
public String getUpdateDes() {
|
||||
return updateDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_des")
|
||||
public void setUpdateDes(String updateDes) {
|
||||
this.updateDes = updateDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "wx_siteurl")
|
||||
public void setLiveWxShareUrl(String liveWxShareUrl) {
|
||||
this.liveWxShareUrl = liveWxShareUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "wx_siteurl")
|
||||
public String getLiveWxShareUrl() {
|
||||
return liveWxShareUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_title")
|
||||
public String getLiveShareTitle() {
|
||||
return liveShareTitle;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_title")
|
||||
public void setLiveShareTitle(String liveShareTitle) {
|
||||
this.liveShareTitle = liveShareTitle;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_des")
|
||||
public String getLiveShareDes() {
|
||||
return liveShareDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_des")
|
||||
public void setLiveShareDes(String liveShareDes) {
|
||||
this.liveShareDes = liveShareDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_coin")
|
||||
public String getCoinName() {
|
||||
return coinName;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_coin")
|
||||
public void setCoinName(String coinName) {
|
||||
this.coinName = coinName;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_votes")
|
||||
public String getVotesName() {
|
||||
return votesName;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_votes")
|
||||
public void setVotesName(String votesName) {
|
||||
this.votesName = votesName;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_time_coin")
|
||||
public String[] getLiveTimeCoin() {
|
||||
return liveTimeCoin;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_time_coin")
|
||||
public void setLiveTimeCoin(String[] liveTimeCoin) {
|
||||
this.liveTimeCoin = liveTimeCoin;
|
||||
}
|
||||
|
||||
@JSONField(name = "login_type")
|
||||
public String[] getLoginType() {
|
||||
return loginType;
|
||||
}
|
||||
|
||||
|
||||
@JSONField(name = "login_type")
|
||||
public void setLoginType(String[] loginType) {
|
||||
this.loginType = loginType;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_type")
|
||||
public String[][] getLiveType() {
|
||||
return liveType;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_type")
|
||||
public void setLiveType(String[][] liveType) {
|
||||
this.liveType = liveType;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_type")
|
||||
public String[] getShareType() {
|
||||
return shareType;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_type")
|
||||
public void setShareType(String[] shareType) {
|
||||
this.shareType = shareType;
|
||||
}
|
||||
|
||||
@JSONField(name = "liveclass")
|
||||
public List<LiveClassBean> getLiveClass() {
|
||||
return liveClass;
|
||||
}
|
||||
|
||||
@JSONField(name = "liveclass")
|
||||
public void setLiveClass(List<LiveClassBean> liveClass) {
|
||||
this.liveClass = liveClass;
|
||||
}
|
||||
|
||||
@JSONField(name = "maintain_switch")
|
||||
public int getMaintainSwitch() {
|
||||
return maintainSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "maintain_switch")
|
||||
public void setMaintainSwitch(int maintainSwitch) {
|
||||
this.maintainSwitch = maintainSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "maintain_tips")
|
||||
public String getMaintainTips() {
|
||||
return maintainTips;
|
||||
}
|
||||
|
||||
@JSONField(name = "maintain_tips")
|
||||
public void setMaintainTips(String maintainTips) {
|
||||
this.maintainTips = maintainTips;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_key")
|
||||
public String getBeautyKey() {
|
||||
return beautyKey;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_key")
|
||||
public void setBeautyKey(String beautyKey) {
|
||||
this.beautyKey = beautyKey;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_white")
|
||||
public int getBeautyMeiBai() {
|
||||
return beautyMeiBai;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_white")
|
||||
public void setBeautyMeiBai(int beautyMeiBai) {
|
||||
this.beautyMeiBai = beautyMeiBai;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_skin")
|
||||
public int getBeautyMoPi() {
|
||||
return beautyMoPi;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_skin")
|
||||
public void setBeautyMoPi(int beautyMoPi) {
|
||||
this.beautyMoPi = beautyMoPi;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_saturated")
|
||||
public int getBeautyBaoHe() {
|
||||
return beautyBaoHe;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_saturated")
|
||||
public void setBeautyBaoHe(int beautyBaoHe) {
|
||||
this.beautyBaoHe = beautyBaoHe;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_pink")
|
||||
public int getBeautyFenNen() {
|
||||
return beautyFenNen;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_pink")
|
||||
public void setBeautyFenNen(int beautyFenNen) {
|
||||
this.beautyFenNen = beautyFenNen;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_eye")
|
||||
public int getBeautyBigEye() {
|
||||
return beautyBigEye;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_eye")
|
||||
public void setBeautyBigEye(int beautyBigEye) {
|
||||
this.beautyBigEye = beautyBigEye;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_face")
|
||||
public int getBeautyFace() {
|
||||
return beautyFace;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_face")
|
||||
public void setBeautyFace(int beautyFace) {
|
||||
this.beautyFace = beautyFace;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_face_narrowing")
|
||||
public int getBeautyFaceNarrowing() {
|
||||
return faceNarrowing;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_face_narrowing")
|
||||
public void setBeautyFaceNarrowing(int faceNarrowing) {
|
||||
this.faceNarrowing = faceNarrowing;
|
||||
}
|
||||
|
||||
public String[] getVideoShareTypes() {
|
||||
return shareType;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_share_title")
|
||||
public String getVideoShareTitle() {
|
||||
return videoShareTitle;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_share_title")
|
||||
public void setVideoShareTitle(String videoShareTitle) {
|
||||
this.videoShareTitle = videoShareTitle;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_share_des")
|
||||
public String getVideoShareDes() {
|
||||
return videoShareDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_share_des")
|
||||
public void setVideoShareDes(String videoShareDes) {
|
||||
this.videoShareDes = videoShareDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_audit_switch")
|
||||
public int getVideoAuditSwitch() {
|
||||
return videoAuditSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_audit_switch")
|
||||
public void setVideoAuditSwitch(int videoAuditSwitch) {
|
||||
this.videoAuditSwitch = videoAuditSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "cloudtype")
|
||||
public int getVideoCloudType() {
|
||||
return videoCloudType;
|
||||
}
|
||||
|
||||
@JSONField(name = "cloudtype")
|
||||
public void setVideoCloudType(int videoCloudType) {
|
||||
this.videoCloudType = videoCloudType;
|
||||
}
|
||||
|
||||
@JSONField(name = "qiniu_domain")
|
||||
public String getVideoQiNiuHost() {
|
||||
return videoQiNiuHost;
|
||||
}
|
||||
|
||||
@JSONField(name = "qiniu_domain")
|
||||
public void setVideoQiNiuHost(String videoQiNiuHost) {
|
||||
this.videoQiNiuHost = videoQiNiuHost;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_appid")
|
||||
public String getTxCosAppId() {
|
||||
return txCosAppId;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_appid")
|
||||
public void setTxCosAppId(String txCosAppId) {
|
||||
this.txCosAppId = txCosAppId;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_region")
|
||||
public String getTxCosRegion() {
|
||||
return txCosRegion;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_region")
|
||||
public void setTxCosRegion(String txCosRegion) {
|
||||
this.txCosRegion = txCosRegion;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_bucket")
|
||||
public String getTxCosBucketName() {
|
||||
return txCosBucketName;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_bucket")
|
||||
public void setTxCosBucketName(String txCosBucketName) {
|
||||
this.txCosBucketName = txCosBucketName;
|
||||
}
|
||||
|
||||
@JSONField(name = "txvideofolder")
|
||||
public String getTxCosVideoPath() {
|
||||
return txCosVideoPath;
|
||||
}
|
||||
|
||||
@JSONField(name = "txvideofolder")
|
||||
public void setTxCosVideoPath(String txCosVideoPath) {
|
||||
this.txCosVideoPath = txCosVideoPath;
|
||||
}
|
||||
|
||||
@JSONField(name = "tximgfolder")
|
||||
public String getTxCosImagePath() {
|
||||
return txCosImagePath;
|
||||
}
|
||||
|
||||
@JSONField(name = "tximgfolder")
|
||||
public void setTxCosImagePath(String txCosImagePath) {
|
||||
this.txCosImagePath = txCosImagePath;
|
||||
}
|
||||
|
||||
@JSONField(name = "guide")
|
||||
public String getAdInfo() {
|
||||
return mAdInfo;
|
||||
}
|
||||
|
||||
@JSONField(name = "guide")
|
||||
public void setAdInfo(String adInfo) {
|
||||
mAdInfo = adInfo;
|
||||
}
|
||||
|
||||
@JSONField(name = "letter_switch")
|
||||
public int getPriMsgSwitch() {
|
||||
return priMsgSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "letter_switch")
|
||||
public void setPriMsgSwitch(int priMsgSwitch) {
|
||||
this.priMsgSwitch = priMsgSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "isup")
|
||||
public int getForceUpdate() {
|
||||
return forceUpdate;
|
||||
}
|
||||
|
||||
@JSONField(name = "isup")
|
||||
public void setForceUpdate(int forceUpdate) {
|
||||
this.forceUpdate = forceUpdate;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_type")
|
||||
public String getSproutType() {
|
||||
return sproutType;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_type")
|
||||
public void setSproutType(String sprout_type) {
|
||||
this.sproutType = sprout_type;
|
||||
}
|
||||
|
||||
@JSONField(name = "turntable_enable")
|
||||
public String getTurntableEnable() {
|
||||
return turntableEnable;
|
||||
}
|
||||
|
||||
@JSONField(name = "turntable_enable")
|
||||
public void setTurntableEnable(String turntable) {
|
||||
this.turntableEnable = turntable;
|
||||
}
|
||||
|
||||
|
||||
@JSONField(name = "tx_video_ugc_licence_url")
|
||||
public String getTxVideoUgcLicenceUrl() {
|
||||
return txVideoUgcLicenceUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "tx_video_ugc_licence_url")
|
||||
public void setTxVideoUgcLicenceUrl(String txVideoUgcLicenceUrl) {
|
||||
this.txVideoUgcLicenceUrl = txVideoUgcLicenceUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "tx_video_ugc_key")
|
||||
public String getTxVideoUgcKey() {
|
||||
return txVideoUgcKey;
|
||||
}
|
||||
|
||||
@JSONField(name = "tx_video_ugc_key")
|
||||
public void setTxVideoUgcKey(String txVideoUgcKey) {
|
||||
this.txVideoUgcKey = txVideoUgcKey;
|
||||
}
|
||||
|
||||
@JSONField(name = "360_paster_url")
|
||||
public String getPaster360Url() {
|
||||
return paster360Url;
|
||||
}
|
||||
|
||||
@JSONField(name = "360_paster_url")
|
||||
public void setPaster360Url(String paster360Url) {
|
||||
this.paster360Url = paster360Url;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_pk_time")
|
||||
public String getPkTime() {
|
||||
return pkTime;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_pk_time")
|
||||
public void setPkTime(String time) {
|
||||
this.pkTime = time;
|
||||
}
|
||||
|
||||
|
||||
@JSONField(name = "service_url")
|
||||
public String getCustomerServerUrl() {
|
||||
return serverUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "service_url")
|
||||
public void setCustomerServerUrl(String serverUrl) {
|
||||
this.serverUrl = serverUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "AllServerGiftIcon")
|
||||
public String getAllServerGiftIcon() {
|
||||
return AllServerGiftIcon;
|
||||
}
|
||||
|
||||
@JSONField(name = "AllServerGiftIcon")
|
||||
public void setAllServerGiftIcon(String allServerGiftIcon) {
|
||||
AllServerGiftIcon = allServerGiftIcon;
|
||||
}
|
||||
|
||||
@JSONField(name = "goldCoinName")
|
||||
public String getGoldCoinName() {
|
||||
return goldCoinName;
|
||||
}
|
||||
|
||||
@JSONField(name = "goldCoinName")
|
||||
public void setGoldCoinName(String goldCoinName) {
|
||||
this.goldCoinName = goldCoinName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 直播间榜单实体类
|
||||
*/
|
||||
public class ContributeModel extends BaseModel{
|
||||
@SerializedName("uid")
|
||||
private long uid;
|
||||
@SerializedName("total")
|
||||
private String total;
|
||||
@SerializedName("userinfo")
|
||||
private IMLoginModel userinfo;
|
||||
@SerializedName("dress_head")
|
||||
private String dressHead;
|
||||
|
||||
public long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public ContributeModel setUid(long uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public ContributeModel setTotal(String total) {
|
||||
this.total = total;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IMLoginModel getUserinfo() {
|
||||
return userinfo;
|
||||
}
|
||||
|
||||
public ContributeModel setUserinfo(IMLoginModel userinfo) {
|
||||
this.userinfo = userinfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressHead() {
|
||||
return dressHead;
|
||||
}
|
||||
|
||||
public ContributeModel setDressHead(String dressHead) {
|
||||
this.dressHead = dressHead;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ContributeModel{" +
|
||||
"uid=" + uid +
|
||||
", total='" + total + '\'' +
|
||||
", userinfo=" + userinfo +
|
||||
", dressHead='" + dressHead + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
34
common/src/main/java/com/yunbao/common/bean/CoolConfig.java
Normal file
34
common/src/main/java/com/yunbao/common/bean/CoolConfig.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class CoolConfig extends BaseModel {
|
||||
private int rate = 1;
|
||||
private String ticketCount = "0";
|
||||
private String yuanbao = "0";
|
||||
|
||||
public String getYuanbao() {
|
||||
return yuanbao;
|
||||
}
|
||||
|
||||
public CoolConfig setYuanbao(String yuanbao) {
|
||||
this.yuanbao = yuanbao;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTicketCount() {
|
||||
return ticketCount;
|
||||
}
|
||||
|
||||
public CoolConfig setTicketCount(String ticketCount) {
|
||||
this.ticketCount = ticketCount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
public CoolConfig setRate(int rate) {
|
||||
this.rate = rate;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用于统计记录崩溃的数据
|
||||
*/
|
||||
public class CrashSaveBean {
|
||||
private static CrashSaveBean bean;
|
||||
private long startTime;//应用启动时间
|
||||
private long enterRoom;//进入房间次数
|
||||
private long slidingRoom;//滑动直播间次数
|
||||
private long playSvga;//加载播放svga次数
|
||||
private List<WeakReference<Activity>> activities = new ArrayList<>();//Activity数量
|
||||
|
||||
private CrashSaveBean() {
|
||||
|
||||
}
|
||||
|
||||
public static CrashSaveBean getInstance() {
|
||||
if (bean == null) {
|
||||
bean = new CrashSaveBean();
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
public long getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(long startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public long getEnterRoom() {
|
||||
return enterRoom;
|
||||
}
|
||||
|
||||
public long getPlaySvga() {
|
||||
return playSvga;
|
||||
}
|
||||
|
||||
public long getSlidingRoom() {
|
||||
return slidingRoom;
|
||||
}
|
||||
|
||||
public void addEnterRoom() {
|
||||
enterRoom++;
|
||||
}
|
||||
|
||||
public void addPlaySvga() {
|
||||
playSvga++;
|
||||
}
|
||||
|
||||
public void addSlidingRoom() {
|
||||
slidingRoom++;
|
||||
}
|
||||
|
||||
public String getActivitySize() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
try {
|
||||
if (activity.get() != null) {
|
||||
builder.append(activity.get().getClass().getSimpleName()).append(",");
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public void setActivitySize(List<WeakReference<Activity>> activitySize) {
|
||||
this.activities = activitySize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CreateSudRoomModel extends BaseModel {
|
||||
|
||||
@SerializedName("sud_game_room_id")
|
||||
private String sudGameRoomId;
|
||||
@SerializedName("sud_game_id")
|
||||
private String sudGameId;
|
||||
@SerializedName("room_holder_id")
|
||||
private int roomHolderId;
|
||||
@SerializedName("room_holder_name")
|
||||
private String roomHolderName;
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
@SerializedName("room_holder_type")
|
||||
private int roomHolderType;
|
||||
@SerializedName("sud_game_name")
|
||||
private String sudGameName;
|
||||
@SerializedName("room_name")
|
||||
private String roomName;
|
||||
@SerializedName("room_status")
|
||||
private String roomStatus;
|
||||
@SerializedName("player_total")
|
||||
private String playerTotal;
|
||||
@SerializedName("ob_total")
|
||||
private String obTotal;
|
||||
@SerializedName("mg_id")
|
||||
private String mgId;
|
||||
@SerializedName("sud_game_icon")
|
||||
private String sudGameIcon;
|
||||
|
||||
public String getSudGameRoomId() {
|
||||
return sudGameRoomId;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setSudGameRoomId(String sudGameRoomId) {
|
||||
this.sudGameRoomId = sudGameRoomId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameId() {
|
||||
return sudGameId;
|
||||
}
|
||||
|
||||
public long getLongSudGameId() {
|
||||
try {
|
||||
if (TextUtils.isEmpty(sudGameId)) {
|
||||
return 0;
|
||||
} else {
|
||||
return Long.parseLong(sudGameId);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setSudGameId(String sudGameId) {
|
||||
this.sudGameId = sudGameId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getRoomHolderId() {
|
||||
return roomHolderId;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomHolderId(int roomHolderId) {
|
||||
this.roomHolderId = roomHolderId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomHolderName() {
|
||||
return roomHolderName;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomHolderName(String roomHolderName) {
|
||||
this.roomHolderName = roomHolderName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getRoomHolderType() {
|
||||
return roomHolderType;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomHolderType(int roomHolderType) {
|
||||
this.roomHolderType = roomHolderType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameName() {
|
||||
return sudGameName;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setSudGameName(String sudGameName) {
|
||||
this.sudGameName = sudGameName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomName() {
|
||||
return roomName;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomName(String roomName) {
|
||||
this.roomName = roomName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRoomStatus() {
|
||||
return roomStatus;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setRoomStatus(String roomStatus) {
|
||||
this.roomStatus = roomStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPlayerTotal() {
|
||||
return playerTotal;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setPlayerTotal(String playerTotal) {
|
||||
this.playerTotal = playerTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getObTotal() {
|
||||
return obTotal;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setObTotal(String obTotal) {
|
||||
this.obTotal = obTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMgId() {
|
||||
return mgId;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setMgId(String mgId) {
|
||||
this.mgId = mgId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameIcon() {
|
||||
return sudGameIcon;
|
||||
}
|
||||
|
||||
public CreateSudRoomModel setSudGameIcon(String sudGameIcon) {
|
||||
this.sudGameIcon = sudGameIcon;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
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 = "";
|
||||
@SerializedName("is_show")
|
||||
private String isShow;
|
||||
@SerializedName("sud_game_is_new")
|
||||
private String sudGameIsNew;
|
||||
|
||||
public String getSudGameIsNew() {
|
||||
return sudGameIsNew;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setSudGameIsNew(String sudGameIsNew) {
|
||||
this.sudGameIsNew = sudGameIsNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIsShow() {
|
||||
return isShow;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setIsShow(String isShow) {
|
||||
this.isShow = isShow;
|
||||
return this;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
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("sud_game_is_new")
|
||||
private String sudGameIsNew;
|
||||
@SerializedName("child")
|
||||
private List<CustomSidebarChildModel> child;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameIsNew() {
|
||||
return sudGameIsNew;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setSudGameIsNew(String sudGameIsNew) {
|
||||
this.sudGameIsNew = sudGameIsNew;
|
||||
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;
|
||||
}
|
||||
}
|
||||
109
common/src/main/java/com/yunbao/common/bean/DiscountsModel.java
Normal file
109
common/src/main/java/com/yunbao/common/bean/DiscountsModel.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 优惠卷
|
||||
*/
|
||||
public class DiscountsModel extends BaseModel {
|
||||
//------------------贵族--------------------
|
||||
public static final int TYPE_VISCOUNT=1;//子爵
|
||||
public static final int TYPE_MARQUIS=2;//侯爵
|
||||
public static final int TYPE_DUKE=3;//公爵
|
||||
public static final int TYPE_KING=4;//国王
|
||||
public static final int TYPE_EMPEROR=5;//皇帝
|
||||
//------------------守护--------------------
|
||||
public static final int TYPE_WEEKS=6;//周守护
|
||||
public static final int TYPE_MONTH=7;//月守护
|
||||
public static final int TYPE_YEARS=8;//月守护
|
||||
|
||||
@SerializedName("userCouponId")
|
||||
private int userCouponID;
|
||||
@SerializedName("num")
|
||||
private int num;
|
||||
@SerializedName("endTime")
|
||||
private long endTime;
|
||||
@SerializedName("img")
|
||||
private String img;
|
||||
@SerializedName("name")
|
||||
private String name;
|
||||
@SerializedName("discount")
|
||||
private double discount;
|
||||
@SerializedName("describe")
|
||||
private String describe;
|
||||
|
||||
public DiscountsModel() {
|
||||
}
|
||||
|
||||
public int getUserCouponID() {
|
||||
return userCouponID;
|
||||
}
|
||||
|
||||
public void setUserCouponID(int userCouponID) {
|
||||
this.userCouponID = userCouponID;
|
||||
}
|
||||
|
||||
public int getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(int num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public long getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(long endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public double getDiscount() {
|
||||
return discount;
|
||||
}
|
||||
|
||||
public void setDiscount(double discount) {
|
||||
this.discount = discount;
|
||||
}
|
||||
|
||||
public String getDescribe() {
|
||||
return describe;
|
||||
}
|
||||
|
||||
public void setDescribe(String describe) {
|
||||
this.describe = describe;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DiscountsModel{" +
|
||||
"userCouponID=" + userCouponID +
|
||||
", num=" + num +
|
||||
", endTime=" + endTime +
|
||||
", img='" + img + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", discount=" + discount +
|
||||
", describe='" + describe + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
59
common/src/main/java/com/yunbao/common/bean/DressModel.java
Normal file
59
common/src/main/java/com/yunbao/common/bean/DressModel.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 用户关联数据
|
||||
*/
|
||||
public class DressModel extends BaseModel {
|
||||
/**
|
||||
* avatar_frame :
|
||||
* bubble :
|
||||
* medal_new :
|
||||
*/
|
||||
|
||||
@SerializedName("avatar_frame")
|
||||
private String avatarFrame = "";
|
||||
@SerializedName("bubble")
|
||||
private String bubble = "";
|
||||
@SerializedName("medal_new")
|
||||
private String medalNew = "";
|
||||
@SerializedName("medal")
|
||||
private String medal = "";
|
||||
|
||||
public String getAvatarFrame() {
|
||||
return avatarFrame;
|
||||
}
|
||||
|
||||
public DressModel setAvatarFrame(String avatarFrame) {
|
||||
this.avatarFrame = avatarFrame;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBubble() {
|
||||
return bubble;
|
||||
}
|
||||
|
||||
public DressModel setBubble(String bubble) {
|
||||
this.bubble = bubble;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMedalNew() {
|
||||
return medalNew;
|
||||
}
|
||||
|
||||
public DressModel setMedalNew(String medalNew) {
|
||||
this.medalNew = medalNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMedal() {
|
||||
return medal;
|
||||
}
|
||||
|
||||
public DressModel setMedal(String medal) {
|
||||
this.medal = medal;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,601 @@
|
||||
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";
|
||||
@SerializedName("live_vote")
|
||||
private LiveRoomVoteModel voteModel;
|
||||
@SerializedName("red_packet")
|
||||
private RedPacketModel redPacketModel;
|
||||
|
||||
@SerializedName("gift_wall_lighten_number")
|
||||
private String giftWallLightenNumber;
|
||||
@SerializedName("gift_wall_lighten_total")
|
||||
private String giftWallLightenTotal;
|
||||
|
||||
public String getGiftWallLightenNumber() {
|
||||
return giftWallLightenNumber;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGiftWallLightenNumber(String giftWallLightenNumber) {
|
||||
this.giftWallLightenNumber = giftWallLightenNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftWallLightenTotal() {
|
||||
return giftWallLightenTotal;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setGiftWallLightenTotal(String giftWallLightenTotal) {
|
||||
this.giftWallLightenTotal = giftWallLightenTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RedPacketModel getRedPacketModel() {
|
||||
return redPacketModel;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setRedPacketModel(RedPacketModel redPacketModel) {
|
||||
this.redPacketModel = redPacketModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getJackpotLevel() {
|
||||
|
||||
return jackpotLevel;
|
||||
}
|
||||
|
||||
public LiveRoomVoteModel getVoteModel() {
|
||||
return voteModel;
|
||||
}
|
||||
|
||||
public void setVoteModel(LiveRoomVoteModel voteModel) {
|
||||
this.voteModel = voteModel;
|
||||
}
|
||||
|
||||
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() {
|
||||
if (StringUtil.isEmpty(isleave)) {
|
||||
isleave = "0";
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
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;
|
||||
@SerializedName("wishListProgress")
|
||||
private WishModel wishListProgress;
|
||||
|
||||
@SerializedName("sud_game_room_status")
|
||||
private String sudGameRoomStatus;
|
||||
@SerializedName("sud_game_room_name")
|
||||
private String sudGameRoomName;
|
||||
@SerializedName("sud_gameDate")
|
||||
private SudGameDateModel sudGameDateModel;
|
||||
@SerializedName("quick_gift_remaining_quantity")
|
||||
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
|
||||
@SerializedName("if_viewing_duration_complete")
|
||||
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数
|
||||
|
||||
public int getQuickGiftRemainingQuantity() {
|
||||
return quickGiftRemainingQuantity;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setQuickGiftRemainingQuantity(int quickGiftRemainingQuantity) {
|
||||
this.quickGiftRemainingQuantity = quickGiftRemainingQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIfViewingDurationComplete() {
|
||||
return ifViewingDurationComplete;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setIfViewingDurationComplete(int ifViewingDurationComplete) {
|
||||
this.ifViewingDurationComplete = ifViewingDurationComplete;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SudGameDateModel getSudGameDateModel() {
|
||||
return sudGameDateModel;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setSudGameDateModel(SudGameDateModel sudGameDateModel) {
|
||||
this.sudGameDateModel = sudGameDateModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameRoomName() {
|
||||
return sudGameRoomName;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setSudGameRoomName(String sudGameRoomName) {
|
||||
this.sudGameRoomName = sudGameRoomName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSudGameRoomStatus() {
|
||||
return sudGameRoomStatus;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setSudGameRoomStatus(String sudGameRoomStatus) {
|
||||
this.sudGameRoomStatus = sudGameRoomStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public WishModel getWishListProgress() {
|
||||
return wishListProgress;
|
||||
}
|
||||
|
||||
public EnterRoomNewModel setWishListProgress(WishModel wishListProgress) {
|
||||
this.wishListProgress = wishListProgress;
|
||||
return this;
|
||||
}
|
||||
|
||||
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 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class FaceBookUpModel extends BaseModel {
|
||||
String type,link;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class FansCheckRed extends BaseModel{
|
||||
@SerializedName("fans_level_upgrade_status")
|
||||
private int status;
|
||||
|
||||
public FansCheckRed() {
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class FansGroupGiftPack extends BaseModel{
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("quantity")
|
||||
private int quantity;
|
||||
@SerializedName("end_time")
|
||||
private String endTime;
|
||||
@SerializedName("giftname")
|
||||
private String giftName;
|
||||
@SerializedName("needcoin")
|
||||
private String needCoin;
|
||||
@SerializedName("gifticon")
|
||||
private String icon;
|
||||
|
||||
public FansGroupGiftPack() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(int quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public void setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
}
|
||||
|
||||
public String getNeedCoin() {
|
||||
return needCoin;
|
||||
}
|
||||
|
||||
public void setNeedCoin(String needCoin) {
|
||||
this.needCoin = needCoin;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FansGroupGiftPack{" +
|
||||
"id=" + id +
|
||||
", quantity=" + quantity +
|
||||
", endTime='" + endTime + '\'' +
|
||||
", giftName='" + giftName + '\'' +
|
||||
", needCoin='" + needCoin + '\'' +
|
||||
", icon='" + icon + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FansGroupGiftPackInfo extends BaseModel {
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("pack_name")
|
||||
private String packName;
|
||||
@SerializedName("description")
|
||||
private String description;
|
||||
@SerializedName("coin")
|
||||
private String coin;
|
||||
@SerializedName("data")
|
||||
private List<Gift> data;
|
||||
|
||||
public FansGroupGiftPackInfo() {
|
||||
}
|
||||
|
||||
public String getPackName() {
|
||||
return packName;
|
||||
}
|
||||
|
||||
public void setPackName(String packName) {
|
||||
this.packName = packName;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getCoin() {
|
||||
return coin;
|
||||
}
|
||||
|
||||
public void setCoin(String coin) {
|
||||
this.coin = coin;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<Gift> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<Gift> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FansGroupGiftPackInfo{" +
|
||||
"id=" + id +
|
||||
", packName='" + packName + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", coin='" + coin + '\'' +
|
||||
", data=" + data +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class Gift {
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("name")
|
||||
private String giftName;
|
||||
@SerializedName("needcoin")
|
||||
private String needCoin;
|
||||
@SerializedName("src")
|
||||
private String giftIcon;
|
||||
@SerializedName("quantity")
|
||||
private String quantity;
|
||||
@SerializedName("restrict")
|
||||
private int restrict;
|
||||
@SerializedName("type")
|
||||
private int type;
|
||||
|
||||
public Gift() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public void setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
}
|
||||
|
||||
public String getNeedCoin() {
|
||||
return needCoin;
|
||||
}
|
||||
|
||||
public void setNeedCoin(String needCoin) {
|
||||
this.needCoin = needCoin;
|
||||
}
|
||||
|
||||
public String getGiftIcon() {
|
||||
return giftIcon;
|
||||
}
|
||||
|
||||
public void setGiftIcon(String giftIcon) {
|
||||
this.giftIcon = giftIcon;
|
||||
}
|
||||
|
||||
public String getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(String quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public int getRestrict() {
|
||||
return restrict;
|
||||
}
|
||||
|
||||
public void setRestrict(int restrict) {
|
||||
this.restrict = restrict;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Gift{" +
|
||||
"id=" + id +
|
||||
", giftName='" + giftName + '\'' +
|
||||
", needCoin='" + needCoin + '\'' +
|
||||
", giftIcon='" + giftIcon + '\'' +
|
||||
", quantity='" + quantity + '\'' +
|
||||
", restrict='" + restrict + '\'' +
|
||||
", type=" + type +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user