删除mengsheng和haha
This commit is contained in:
@@ -50,38 +50,12 @@ android {
|
||||
]
|
||||
jniLibs.srcDirs = ['libs', 'umeng-app-libs/jniLibs', 'shumei-tianwang-libs/jniLibs']
|
||||
}
|
||||
|
||||
mengsheng {
|
||||
java.srcDirs = [
|
||||
'src/main/java',
|
||||
'src/diff_src_mengsheng/java',
|
||||
'src/model_smscode/java'
|
||||
]
|
||||
jniLibs.srcDirs = ['libs']
|
||||
}
|
||||
haha {
|
||||
java.srcDirs = [
|
||||
'src/main/java',
|
||||
'src/diff_src_haha/java',
|
||||
'src/model_smscode/java',
|
||||
'src/model_pay/java'
|
||||
]
|
||||
jniLibs.srcDirs = ['libs']
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
productFlavors{
|
||||
accompany {
|
||||
dimension 'default'
|
||||
}
|
||||
mengsheng{
|
||||
dimension 'default'
|
||||
}
|
||||
haha{
|
||||
dimension 'default'
|
||||
}
|
||||
|
||||
}
|
||||
buildToolsVersion = '28.0.3'
|
||||
|
||||
|
@@ -1,152 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
import com.yizhuan.xchat_android_library.utils.pref.CommonPref;
|
||||
|
||||
/**
|
||||
* 请求接口接口地址
|
||||
*/
|
||||
public class UriProvider {
|
||||
|
||||
public static void init(Env.UriSetting uriSetting, String url) {
|
||||
if (uriSetting == Env.UriSetting.Product) {
|
||||
//生产环境地址
|
||||
initProductUri(url);
|
||||
} else if (uriSetting == Env.UriSetting.Test) {
|
||||
//测试环境地址
|
||||
initTestUri(url);
|
||||
}
|
||||
}
|
||||
|
||||
private static String DEBUG_URL;
|
||||
|
||||
public static void initDevUri(String url) {
|
||||
DEBUG_URL = url;
|
||||
JAVA_WEB_URL = url;
|
||||
IM_SERVER_URL = url;
|
||||
}
|
||||
|
||||
private static void initProductUri(String url) {
|
||||
JAVA_WEB_URL = url;
|
||||
IM_SERVER_URL = url;
|
||||
}
|
||||
|
||||
|
||||
private static void initTestUri(String url) {
|
||||
int enviroment = CommonPref.instance(BasicConfig.INSTANCE.getAppContext()).getInt("enviroment");
|
||||
if (enviroment == 0) {
|
||||
initProductUri(url);//其他使用DEV的配置,就神曲这个跟新一下
|
||||
} else {
|
||||
if (!TextUtils.isEmpty(DEBUG_URL))
|
||||
initDevUri(DEBUG_URL);
|
||||
else
|
||||
initDevUri(url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认以下生产环境地址
|
||||
*/
|
||||
public static String JAVA_WEB_URL = "http://www.daxiaomao.com";
|
||||
public static String IM_SERVER_URL = "https://www.daxiaomao.com";
|
||||
|
||||
public static String getGroupResourceBaseUri() {
|
||||
return JAVA_WEB_URL.concat("/app/service/resource/list");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getLotteryActivityPage() {
|
||||
return IM_SERVER_URL.concat("/activity/double12/index.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 贵族订单页面
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
public static String getNobleOrderPage() {
|
||||
return IM_SERVER_URL.concat("/modules/noble/order.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取房间背景(有动效)
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
public static String getRoomBg() {
|
||||
return IM_SERVER_URL.concat("/modules/noble/roomBgList.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取贵族推荐页面
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
public static String getNobleIntroducePage() {
|
||||
return IM_SERVER_URL.concat("/modules/noble/intro.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取贵族个人管理页面
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
public static String getNobleHomePage() {
|
||||
return IM_SERVER_URL.concat("/modules/noble/homepage.html");
|
||||
}
|
||||
|
||||
/** 贵族介绍页 */
|
||||
public static String getNobleIntro() {
|
||||
return "modules/noble/intro.html";
|
||||
}
|
||||
|
||||
/** 等级界面 */
|
||||
public static String getUserLevelUrl() {
|
||||
return "modules/level/levelExper.html";
|
||||
}
|
||||
/** 等级界面 */
|
||||
public static String getUserCUrl() {
|
||||
return "modules/level/levelCharm.html";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 耳伴头条 http://beta.erbanyy.com/modules/headNews/index.html
|
||||
* @return
|
||||
*/
|
||||
public static String getErbanTopMessageUrl() {
|
||||
return JAVA_WEB_URL.concat("/modules/headNews/index.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建家族
|
||||
* @return
|
||||
*/
|
||||
public static String getCreateFamilyUrl() {
|
||||
return JAVA_WEB_URL.concat("/modules/family/create.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 家族指南
|
||||
* @return
|
||||
*/
|
||||
public static String getFamilyInstructionUrl() {
|
||||
return JAVA_WEB_URL.concat("/modules/family/handbook.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 家族币获取帮助
|
||||
* @return
|
||||
*/
|
||||
public static String getFamilyCurrencyHelpUrl() {
|
||||
return JAVA_WEB_URL.concat("/modules/family/faq.html");
|
||||
}
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.find;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.find.bean.FindWeekStarInfo;
|
||||
import com.yizhuan.xchat_android_core.find.bean.FindInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.http.GET;
|
||||
|
||||
/**
|
||||
* create by lvzebiao on 2018/9/13
|
||||
*/
|
||||
public class FindModel extends BaseModel implements IFindModel {
|
||||
|
||||
private final Api api = RxNet.create(Api.class);
|
||||
|
||||
private static final class Helper {
|
||||
public static final FindModel INSTANCE = new FindModel();
|
||||
}
|
||||
|
||||
public static FindModel get() {
|
||||
return Helper.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<ServiceResult<List<FindInfo>>> getFindInfo() {
|
||||
return api.getFindInfo()
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<List<FindWeekStarInfo>> getFindWeekStar() {
|
||||
return api.getFindWeekStar()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
private interface Api{
|
||||
@GET("week/star/previous")
|
||||
Single<ServiceResult<List<FindWeekStarInfo>>> getFindWeekStar();
|
||||
|
||||
@GET("discovery/items")
|
||||
Single<ServiceResult<List<FindInfo>>> getFindInfo();
|
||||
}
|
||||
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.find;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.find.bean.FindInfo;
|
||||
import com.yizhuan.xchat_android_core.find.bean.FindWeekStarInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
/**
|
||||
* create by lvzebiao on 2018/9/13
|
||||
*/
|
||||
public interface IFindModel extends IModel {
|
||||
|
||||
Single<ServiceResult<List<FindInfo>>> getFindInfo();
|
||||
|
||||
Single<List<FindWeekStarInfo>> getFindWeekStar();
|
||||
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.find.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FindInfo {
|
||||
/**
|
||||
* id : 3
|
||||
* name : 邀请好友来玩哈哈
|
||||
* routerType : 14
|
||||
* seqNo : 3
|
||||
* status : 1
|
||||
* createTime : 1535528000000
|
||||
* updateTime : 1535528003000
|
||||
*/
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String subheading;
|
||||
private String icon;
|
||||
private String routerValue;
|
||||
private int routerType;
|
||||
private int seqNo;
|
||||
private int status;
|
||||
private long createTime;
|
||||
private long updateTime;
|
||||
|
||||
}
|
@@ -1,292 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.find.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FindWeekStarInfo {
|
||||
|
||||
/**
|
||||
* stars : [{"erbanNo":6666,"nick":"虎爷套现85卖靓号","avatar":"https://image.zhongjialx.com/FroBcMNb5ya6FzRenQYJd-SN9m1f?imageslim","totalCount":506418,"seqNo":0,"uid":90004445}]
|
||||
* gift : {"giftId":1149,"giftName":"爱情锁","goldPrice":66,"seqNo":10,"nobleId":0,"nobleName":"","isNobleGift":false,"giftType":2,"giftStatus":1,"picUrl":"https://image.zhongjialx.com/Fhf25vW7zxeq96Tp510ffEGgDwyc?imageslim","hasVggPic":false,"vggUrl":"","isLatest":true,"isTimeLimit":false,"hasEffect":false,"isWholeServer":false,"notifyStaySecond":0,"isSendMsg":false,"isSkipRoom":false}
|
||||
*/
|
||||
|
||||
private GiftBean gift;
|
||||
private List<StarsBean> stars;
|
||||
|
||||
public GiftBean getGift() {
|
||||
return gift;
|
||||
}
|
||||
|
||||
public void setGift(GiftBean gift) {
|
||||
this.gift = gift;
|
||||
}
|
||||
|
||||
public List<StarsBean> getStars() {
|
||||
return stars;
|
||||
}
|
||||
|
||||
public void setStars(List<StarsBean> stars) {
|
||||
this.stars = stars;
|
||||
}
|
||||
|
||||
public static class GiftBean {
|
||||
/**
|
||||
* giftId : 1149
|
||||
* giftName : 爱情锁
|
||||
* goldPrice : 66
|
||||
* seqNo : 10
|
||||
* nobleId : 0
|
||||
* nobleName :
|
||||
* isNobleGift : false
|
||||
* giftType : 2
|
||||
* giftStatus : 1
|
||||
* picUrl : https://image.zhongjialx.com/Fhf25vW7zxeq96Tp510ffEGgDwyc?imageslim
|
||||
* hasVggPic : false
|
||||
* vggUrl :
|
||||
* isLatest : true
|
||||
* isTimeLimit : false
|
||||
* hasEffect : false
|
||||
* isWholeServer : false
|
||||
* notifyStaySecond : 0
|
||||
* isSendMsg : false
|
||||
* isSkipRoom : false
|
||||
*/
|
||||
|
||||
private int giftId;
|
||||
private String giftName;
|
||||
private int goldPrice;
|
||||
private int seqNo;
|
||||
private int nobleId;
|
||||
private String nobleName;
|
||||
private boolean isNobleGift;
|
||||
private int giftType;
|
||||
private int giftStatus;
|
||||
private String picUrl;
|
||||
private boolean hasVggPic;
|
||||
private String vggUrl;
|
||||
private boolean isLatest;
|
||||
private boolean isTimeLimit;
|
||||
private boolean hasEffect;
|
||||
private boolean isWholeServer;
|
||||
private int notifyStaySecond;
|
||||
private boolean isSendMsg;
|
||||
private boolean isSkipRoom;
|
||||
|
||||
public int getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public void setGiftId(int giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public void setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
}
|
||||
|
||||
public int getGoldPrice() {
|
||||
return goldPrice;
|
||||
}
|
||||
|
||||
public void setGoldPrice(int goldPrice) {
|
||||
this.goldPrice = goldPrice;
|
||||
}
|
||||
|
||||
public int getSeqNo() {
|
||||
return seqNo;
|
||||
}
|
||||
|
||||
public void setSeqNo(int seqNo) {
|
||||
this.seqNo = seqNo;
|
||||
}
|
||||
|
||||
public int getNobleId() {
|
||||
return nobleId;
|
||||
}
|
||||
|
||||
public void setNobleId(int nobleId) {
|
||||
this.nobleId = nobleId;
|
||||
}
|
||||
|
||||
public String getNobleName() {
|
||||
return nobleName;
|
||||
}
|
||||
|
||||
public void setNobleName(String nobleName) {
|
||||
this.nobleName = nobleName;
|
||||
}
|
||||
|
||||
public boolean isIsNobleGift() {
|
||||
return isNobleGift;
|
||||
}
|
||||
|
||||
public void setIsNobleGift(boolean isNobleGift) {
|
||||
this.isNobleGift = isNobleGift;
|
||||
}
|
||||
|
||||
public int getGiftType() {
|
||||
return giftType;
|
||||
}
|
||||
|
||||
public void setGiftType(int giftType) {
|
||||
this.giftType = giftType;
|
||||
}
|
||||
|
||||
public int getGiftStatus() {
|
||||
return giftStatus;
|
||||
}
|
||||
|
||||
public void setGiftStatus(int giftStatus) {
|
||||
this.giftStatus = giftStatus;
|
||||
}
|
||||
|
||||
public String getPicUrl() {
|
||||
return picUrl;
|
||||
}
|
||||
|
||||
public void setPicUrl(String picUrl) {
|
||||
this.picUrl = picUrl;
|
||||
}
|
||||
|
||||
public boolean isHasVggPic() {
|
||||
return hasVggPic;
|
||||
}
|
||||
|
||||
public void setHasVggPic(boolean hasVggPic) {
|
||||
this.hasVggPic = hasVggPic;
|
||||
}
|
||||
|
||||
public String getVggUrl() {
|
||||
return vggUrl;
|
||||
}
|
||||
|
||||
public void setVggUrl(String vggUrl) {
|
||||
this.vggUrl = vggUrl;
|
||||
}
|
||||
|
||||
public boolean isIsLatest() {
|
||||
return isLatest;
|
||||
}
|
||||
|
||||
public void setIsLatest(boolean isLatest) {
|
||||
this.isLatest = isLatest;
|
||||
}
|
||||
|
||||
public boolean isIsTimeLimit() {
|
||||
return isTimeLimit;
|
||||
}
|
||||
|
||||
public void setIsTimeLimit(boolean isTimeLimit) {
|
||||
this.isTimeLimit = isTimeLimit;
|
||||
}
|
||||
|
||||
public boolean isHasEffect() {
|
||||
return hasEffect;
|
||||
}
|
||||
|
||||
public void setHasEffect(boolean hasEffect) {
|
||||
this.hasEffect = hasEffect;
|
||||
}
|
||||
|
||||
public boolean isIsWholeServer() {
|
||||
return isWholeServer;
|
||||
}
|
||||
|
||||
public void setIsWholeServer(boolean isWholeServer) {
|
||||
this.isWholeServer = isWholeServer;
|
||||
}
|
||||
|
||||
public int getNotifyStaySecond() {
|
||||
return notifyStaySecond;
|
||||
}
|
||||
|
||||
public void setNotifyStaySecond(int notifyStaySecond) {
|
||||
this.notifyStaySecond = notifyStaySecond;
|
||||
}
|
||||
|
||||
public boolean isIsSendMsg() {
|
||||
return isSendMsg;
|
||||
}
|
||||
|
||||
public void setIsSendMsg(boolean isSendMsg) {
|
||||
this.isSendMsg = isSendMsg;
|
||||
}
|
||||
|
||||
public boolean isIsSkipRoom() {
|
||||
return isSkipRoom;
|
||||
}
|
||||
|
||||
public void setIsSkipRoom(boolean isSkipRoom) {
|
||||
this.isSkipRoom = isSkipRoom;
|
||||
}
|
||||
}
|
||||
|
||||
public static class StarsBean {
|
||||
/**
|
||||
* erbanNo : 6666
|
||||
* nick : 虎爷套现85卖靓号
|
||||
* avatar : https://image.zhongjialx.com/FroBcMNb5ya6FzRenQYJd-SN9m1f?imageslim
|
||||
* totalCount : 506418
|
||||
* seqNo : 0
|
||||
* uid : 90004445
|
||||
*/
|
||||
|
||||
private int erbanNo;
|
||||
private String nick;
|
||||
private String avatar;
|
||||
private int totalCount;
|
||||
private int seqNo;
|
||||
private int uid;
|
||||
|
||||
public int getErbanNo() {
|
||||
return erbanNo;
|
||||
}
|
||||
|
||||
public void setErbanNo(int erbanNo) {
|
||||
this.erbanNo = erbanNo;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public int getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public void setTotalCount(int totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public int getSeqNo() {
|
||||
return seqNo;
|
||||
}
|
||||
|
||||
public void setSeqNo(int seqNo) {
|
||||
this.seqNo = seqNo;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,221 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home;
|
||||
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom;
|
||||
import com.yizhuan.xchat_android_core.home.bean.TabInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleSource;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public class HomeModel extends BaseModel implements IHomeModel {
|
||||
private volatile static IHomeModel instance;
|
||||
private Api api;
|
||||
|
||||
private List<TabInfo> mTabInfoList;
|
||||
|
||||
public static IHomeModel get() {
|
||||
if (instance == null){
|
||||
synchronized (HomeModel.class){
|
||||
if (instance == null){
|
||||
instance = new HomeModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private HomeModel(){
|
||||
api = RxNet.create(Api.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存的房间分类数据
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TabInfo> getmTabInfoList() {
|
||||
return mTabInfoList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取首页Tab失败
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<List<TabInfo>> getMainTabData() {
|
||||
return api.getMainTabList(AuthModel.get().getCurrentUid())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.doOnSuccess(new Consumer<List<TabInfo>>() {
|
||||
@Override
|
||||
public void accept(List<TabInfo> tabInfos) throws Exception {
|
||||
mTabInfoList = tabInfos;
|
||||
}
|
||||
})
|
||||
.doOnError(new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Logger.e("获取首页Tab失败......");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页数据
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<HomeInfo> getHomeData(final int page, int pageSize) {
|
||||
return api.getMainHotData(
|
||||
String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
String.valueOf(page),
|
||||
String.valueOf(pageSize)
|
||||
)
|
||||
.flatMap(new Function<ServiceResult<HomeInfo>, SingleSource<HomeInfo>>() {
|
||||
@Override
|
||||
public SingleSource<HomeInfo> apply(ServiceResult<HomeInfo> result) throws Exception {
|
||||
if (result == null || !result.isSuccess()) {
|
||||
return Single.error(new Throwable(RxHelper.getValidMessage(result)));
|
||||
}
|
||||
HomeInfo homeInfo = result.getData();
|
||||
//如果为null,也需要返回成功,否则加载更多的逻辑就无法执行
|
||||
if (homeInfo == null) {
|
||||
homeInfo = new HomeInfo();
|
||||
}
|
||||
return Single.just(homeInfo);
|
||||
}
|
||||
})
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈
|
||||
* @param feedbackDesc
|
||||
* @param contact
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<String> commitFeedback(String feedbackDesc, String contact) {
|
||||
return api.commitFeedback(
|
||||
String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
feedbackDesc,
|
||||
contact,
|
||||
AuthModel.get().getTicket()
|
||||
)
|
||||
.flatMap(new Function<ServiceResult, SingleSource<String>>() {
|
||||
@Override
|
||||
public SingleSource<String> apply(ServiceResult serviceResult) throws Exception {
|
||||
if (serviceResult.isSuccess()) {
|
||||
return Single.just("反馈成功");
|
||||
} else {
|
||||
return Single.error(new Throwable(serviceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
})
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分类 获取房间列表
|
||||
* @param tagId
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
*/
|
||||
@Override
|
||||
public Single<List<HomeRoom>> getMainDataByTab(final int tagId, final int pageNum, int pageSize) {
|
||||
return api.getMainDataByTab(
|
||||
String.valueOf(tagId),
|
||||
String.valueOf(pageNum),
|
||||
String.valueOf(pageSize)
|
||||
)
|
||||
.flatMap(new Function<ServiceResult<List<HomeRoom>>, SingleSource<List<HomeRoom>>>() {
|
||||
@Override
|
||||
public SingleSource<List<HomeRoom>> apply(ServiceResult<List<HomeRoom>> listServiceResult) throws Exception {
|
||||
if (listServiceResult.isSuccess()){
|
||||
if (listServiceResult.getData() == null){
|
||||
return Single.just(new ArrayList<HomeRoom>());
|
||||
}
|
||||
return Single.just(listServiceResult.getData());
|
||||
}else {
|
||||
return Single.error(new Throwable(listServiceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
})
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private interface Api{
|
||||
/**
|
||||
* 获取首页热门数据
|
||||
*
|
||||
* @param uid
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GET("/home/v2/hotindex")
|
||||
Single<ServiceResult<HomeInfo>> getMainHotData(@Query("uid") String uid,
|
||||
@Query("pageNum") String pageNum,
|
||||
@Query("pageSize") String pageSize);
|
||||
|
||||
/**
|
||||
* 提交反馈
|
||||
*
|
||||
* @param uid
|
||||
* @param feedbackDesc
|
||||
* @param contact
|
||||
* @param ticket
|
||||
* @return
|
||||
*/
|
||||
@POST("/feedback")
|
||||
Single<ServiceResult> commitFeedback(@Query("uid") String uid,
|
||||
@Query("feedbackDesc") String feedbackDesc,
|
||||
@Query("contact") String contact,
|
||||
@Query("ticket") String ticket);
|
||||
|
||||
|
||||
/**
|
||||
* 获取首页tab数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/room/tag/top")
|
||||
Single<ServiceResult<List<TabInfo>>> getMainTabList(@Query("uid") long uid);
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @param tagId
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@POST("home/v2/tagindex")
|
||||
Single<ServiceResult<List<HomeRoom>>> getMainDataByTab(@Query("tagId") String tagId,
|
||||
@Query("pageNum") String pageNum,
|
||||
@Query("pageSize") String pageSize);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,48 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom;
|
||||
import com.yizhuan.xchat_android_core.home.bean.TabInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
public interface IHomeModel extends IModel {
|
||||
/**
|
||||
* 获取缓存的房间分类数据
|
||||
* @return
|
||||
*/
|
||||
List<TabInfo> getmTabInfoList();
|
||||
|
||||
/**
|
||||
* 获取首页Tab失败
|
||||
* @return
|
||||
*/
|
||||
Single<List<TabInfo>> getMainTabData();
|
||||
|
||||
/**
|
||||
* 获取首页数据
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
Single<HomeInfo> getHomeData(int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 反馈
|
||||
* @param feedbackDesc
|
||||
* @param contact
|
||||
* @return
|
||||
*/
|
||||
Single<String> commitFeedback(String feedbackDesc, String contact);
|
||||
|
||||
/**
|
||||
* 根据分类 获取房间列表
|
||||
* @param tagId
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
*/
|
||||
Single<List<HomeRoom>> getMainDataByTab(int tagId, int pageNum, int pageSize);
|
||||
}
|
@@ -1,75 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/8/7.
|
||||
*/
|
||||
@Data
|
||||
public class BannerInfo implements Parcelable {
|
||||
/*
|
||||
bannerId:1 //id
|
||||
bannerName: xx//横幅广告名称
|
||||
bannerPic:xx //横幅图片
|
||||
skipType:xx // 1跳app页面,2跳聊天室,3跳h5页面
|
||||
displayType //1顶部banner 2底部banner
|
||||
skipUri:xx //跳转uri
|
||||
*/
|
||||
private int bannerId;
|
||||
private String bannerName;
|
||||
private String bannerPic;
|
||||
private int skipType;
|
||||
private int displayType;
|
||||
private String skipUri;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BannerInfo{" +
|
||||
"bannerId=" + bannerId +
|
||||
", bannerName='" + bannerName + '\'' +
|
||||
", bannerPic='" + bannerPic + '\'' +
|
||||
", skipType=" + skipType +
|
||||
", skipUri='" + skipUri + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
protected BannerInfo(Parcel in) {
|
||||
bannerId = in.readInt();
|
||||
bannerName = in.readString();
|
||||
bannerPic = in.readString();
|
||||
skipType = in.readInt();
|
||||
skipUri = in.readString();
|
||||
displayType = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(bannerId);
|
||||
dest.writeString(bannerName);
|
||||
dest.writeString(bannerPic);
|
||||
dest.writeInt(skipType);
|
||||
dest.writeString(skipUri);
|
||||
dest.writeInt(displayType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<BannerInfo> CREATOR = new Creator<BannerInfo>() {
|
||||
@Override
|
||||
public BannerInfo createFromParcel(Parcel in) {
|
||||
return new BannerInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BannerInfo[] newArray(int size) {
|
||||
return new BannerInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/1/31.
|
||||
*/
|
||||
|
||||
public class FindInfo {
|
||||
/**
|
||||
* advName : 测试啊
|
||||
* advIcon : http://img.letusmix.com/FvbRJRJgufTpntjatyfL8xx1yBQ5?imageslim
|
||||
* skipType : 3
|
||||
* skipUri : www.baidu.com
|
||||
*/
|
||||
|
||||
private String advName;
|
||||
private String advIcon;
|
||||
private int skipType;
|
||||
private String skipUri;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FindInfo{" +
|
||||
"advName='" + advName + '\'' +
|
||||
", advIcon='" + advIcon + '\'' +
|
||||
", skipType=" + skipType +
|
||||
", skipUri='" + skipUri + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getAdvName() {
|
||||
return advName;
|
||||
}
|
||||
|
||||
public void setAdvName(String advName) {
|
||||
this.advName = advName;
|
||||
}
|
||||
|
||||
public String getAdvIcon() {
|
||||
return advIcon;
|
||||
}
|
||||
|
||||
public void setAdvIcon(String advIcon) {
|
||||
this.advIcon = advIcon;
|
||||
}
|
||||
|
||||
public int getSkipType() {
|
||||
return skipType;
|
||||
}
|
||||
|
||||
public void setSkipType(int skipType) {
|
||||
this.skipType = skipType;
|
||||
}
|
||||
|
||||
public String getSkipUri() {
|
||||
return skipUri;
|
||||
}
|
||||
|
||||
public void setSkipUri(String skipUri) {
|
||||
this.skipUri = skipUri;
|
||||
}
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 首页数据 </p>
|
||||
*
|
||||
* @author Administrator
|
||||
* @date 2017/11/22
|
||||
*/
|
||||
public class HomeInfo {
|
||||
public List<BannerInfo> banners;
|
||||
/** 排行数据 */
|
||||
public RankingInfo rankHome;
|
||||
/** 热门推荐 */
|
||||
public List<HomeRoom> hotRooms;
|
||||
/** 房间推荐 */
|
||||
public List<HomeRoom> listRoom;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HomeInfo{" +
|
||||
"banners=" + banners +
|
||||
", rankHome=" + rankHome +
|
||||
", hotRooms=" + hotRooms +
|
||||
", listRoom=" + listRoom +
|
||||
'}';
|
||||
}
|
||||
}
|
@@ -1,82 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 首页热门实体u </p>
|
||||
*
|
||||
* @author Administrator
|
||||
* @date 2017/11/16
|
||||
*/
|
||||
public class HomeItem implements MultiItemEntity, Parcelable {
|
||||
|
||||
public static final int BANNER = 1;
|
||||
public static final int RANKING = 2;
|
||||
public static final int RECOMMEND = 3;
|
||||
public static final int NORMAL = 4;
|
||||
|
||||
|
||||
private int itemType;
|
||||
|
||||
//正常数据
|
||||
public List<HomeRoom> recomList;
|
||||
public List<HomeRoom> homeItemRoomList;
|
||||
public List<BannerInfo> bannerInfoList;
|
||||
public RankingInfo mRankingInfo;
|
||||
|
||||
|
||||
public HomeItem(int itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
|
||||
|
||||
public HomeItem(int itemType, RankingInfo rankingInfo) {
|
||||
this.itemType = itemType;
|
||||
mRankingInfo = rankingInfo;
|
||||
}
|
||||
|
||||
protected HomeItem(Parcel in) {
|
||||
itemType = in.readInt();
|
||||
recomList = in.createTypedArrayList(HomeRoom.CREATOR);
|
||||
homeItemRoomList = in.createTypedArrayList(HomeRoom.CREATOR);
|
||||
bannerInfoList = in.createTypedArrayList(BannerInfo.CREATOR);
|
||||
mRankingInfo = in.readParcelable(RankingInfo.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(itemType);
|
||||
dest.writeTypedList(recomList);
|
||||
dest.writeTypedList(homeItemRoomList);
|
||||
dest.writeTypedList(bannerInfoList);
|
||||
dest.writeParcelable(mRankingInfo, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<HomeItem> CREATOR = new Creator<HomeItem>() {
|
||||
@Override
|
||||
public HomeItem createFromParcel(Parcel in) {
|
||||
return new HomeItem(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HomeItem[] newArray(int size) {
|
||||
return new HomeItem[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
}
|
@@ -1,164 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author zhouxiangfeng
|
||||
* @date 2017/5/17
|
||||
*/
|
||||
|
||||
public class HomeRoom extends RoomInfo implements Parcelable, MultiItemEntity {
|
||||
|
||||
public static final int BANNER = 1;
|
||||
public static final int NORMAL = 2;
|
||||
|
||||
//性别 1:男 2:女 0 :未知
|
||||
private int gender;
|
||||
|
||||
private String nick;
|
||||
//1普通账号,2官方账号,3机器账号
|
||||
private int defUser;
|
||||
|
||||
private long erbanNo;
|
||||
|
||||
//角标相关的
|
||||
public String badge;
|
||||
|
||||
/** 是否是靓号,1:靓号 */
|
||||
public boolean hasPrettyErbanNo;
|
||||
public NobleInfo nobleUsers;
|
||||
public UserLevelVo userLevelVo;
|
||||
public boolean newUser;
|
||||
private ArrayList<BannerInfo> bannerInfos;
|
||||
|
||||
public HomeRoom() {
|
||||
}
|
||||
|
||||
protected HomeRoom(Parcel in) {
|
||||
super(in);
|
||||
gender = in.readInt();
|
||||
nick = in.readString();
|
||||
defUser = in.readInt();
|
||||
erbanNo = in.readLong();
|
||||
badge = in.readString();
|
||||
hasPrettyErbanNo = in.readByte() != 0;
|
||||
bannerInfos = in.createTypedArrayList(BannerInfo.CREATOR);
|
||||
newUser = in.readByte() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
dest.writeInt(gender);
|
||||
dest.writeString(nick);
|
||||
dest.writeInt(defUser);
|
||||
dest.writeLong(erbanNo);
|
||||
dest.writeString(badge);
|
||||
dest.writeByte((byte) (hasPrettyErbanNo ? 1 : 0));
|
||||
dest.writeTypedList(bannerInfos);
|
||||
dest.writeByte((byte) (newUser ? 1 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<HomeRoom> CREATOR = new Creator<HomeRoom>() {
|
||||
@Override
|
||||
public HomeRoom createFromParcel(Parcel in) {
|
||||
return new HomeRoom(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HomeRoom[] newArray(int size) {
|
||||
return new HomeRoom[size];
|
||||
}
|
||||
};
|
||||
|
||||
public int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(int gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public int getDefUser() {
|
||||
return defUser;
|
||||
}
|
||||
|
||||
public void setDefUser(int defUser) {
|
||||
this.defUser = defUser;
|
||||
}
|
||||
|
||||
public long getErbanNo() {
|
||||
return erbanNo;
|
||||
}
|
||||
|
||||
public void setErbanNo(long erbanNo) {
|
||||
this.erbanNo = erbanNo;
|
||||
}
|
||||
|
||||
public String getBadge() {
|
||||
return badge;
|
||||
}
|
||||
|
||||
public void setBadge(String badge) {
|
||||
this.badge = badge;
|
||||
}
|
||||
|
||||
public boolean isHasPrettyErbanNo() {
|
||||
return hasPrettyErbanNo;
|
||||
}
|
||||
|
||||
public void setHasPrettyErbanNo(boolean hasPrettyErbanNo) {
|
||||
this.hasPrettyErbanNo = hasPrettyErbanNo;
|
||||
}
|
||||
|
||||
public NobleInfo getNobleUsers() {
|
||||
return nobleUsers;
|
||||
}
|
||||
|
||||
public void setNobleUsers(NobleInfo nobleUsers) {
|
||||
this.nobleUsers = nobleUsers;
|
||||
}
|
||||
|
||||
public UserLevelVo getUserLevelVo() {
|
||||
return userLevelVo;
|
||||
}
|
||||
|
||||
public void setUserLevelVo(UserLevelVo userLevelVo) {
|
||||
this.userLevelVo = userLevelVo;
|
||||
}
|
||||
|
||||
public ArrayList<BannerInfo> getBannerInfos() {
|
||||
return bannerInfos;
|
||||
}
|
||||
|
||||
public void setBannerInfos(ArrayList<BannerInfo> bannerInfos) {
|
||||
this.bannerInfos = bannerInfos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return ListUtils.isListEmpty(bannerInfos)?NORMAL:BANNER;
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by chenran on 2017/10/4.
|
||||
*/
|
||||
|
||||
public class HomeRoomList implements Serializable{
|
||||
private List<HomeRoom> recomRooms;
|
||||
private List<HomeRoom> gameRooms;
|
||||
private List<HomeRoom> chatRooms;
|
||||
|
||||
public List<HomeRoom> getRecomRooms() {
|
||||
return recomRooms;
|
||||
}
|
||||
|
||||
public void setRecomRooms(List<HomeRoom> recomRooms) {
|
||||
this.recomRooms = recomRooms;
|
||||
}
|
||||
|
||||
public List<HomeRoom> getGameRooms() {
|
||||
return gameRooms;
|
||||
}
|
||||
|
||||
public void setGameRooms(List<HomeRoom> gameRooms) {
|
||||
this.gameRooms = gameRooms;
|
||||
}
|
||||
|
||||
public List<HomeRoom> getChatRooms() {
|
||||
return chatRooms;
|
||||
}
|
||||
|
||||
public void setChatRooms(List<HomeRoom> chatRooms) {
|
||||
this.chatRooms = chatRooms;
|
||||
}
|
||||
}
|
@@ -1,158 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 首页排行信息 </p>
|
||||
* Created by Administrator on 2017/11/8.
|
||||
*/
|
||||
public class RankingInfo implements Parcelable {
|
||||
|
||||
public List<Ranking> starList;
|
||||
public List<Ranking> nobleList;
|
||||
public List<Ranking> roomList;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RankingInfo{" +
|
||||
"starList=" + starList +
|
||||
", nobleList=" + nobleList +
|
||||
", roomList=" + roomList +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class Ranking implements Parcelable {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Ranking{" +
|
||||
"erbanNo=" + erbanNo +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", nick='" + nick + '\'' +
|
||||
", gender=" + gender +
|
||||
", totalNum=" + totalNum +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* erbanNo : 850379
|
||||
* avatar : https://nos.netease.com/nim/NDI3OTA4NQ==/bmltYV83Nzg4MzQyNDJfMTUwNzIwMzM4NTc2N184YmJlZmQ4ZS01YzdiLTRmMWMtYmFhOC0xMWRlNzg3MzRlMzk=
|
||||
* nick : 阿拉善
|
||||
* gender : 1
|
||||
* totalNum : 9988923
|
||||
*/
|
||||
|
||||
private int erbanNo;
|
||||
private String avatar;
|
||||
private String nick;
|
||||
private int gender;
|
||||
private int totalNum;
|
||||
|
||||
protected Ranking(Parcel in) {
|
||||
erbanNo = in.readInt();
|
||||
avatar = in.readString();
|
||||
nick = in.readString();
|
||||
gender = in.readInt();
|
||||
totalNum = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(erbanNo);
|
||||
dest.writeString(avatar);
|
||||
dest.writeString(nick);
|
||||
dest.writeInt(gender);
|
||||
dest.writeInt(totalNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<Ranking> CREATOR = new Creator<Ranking>() {
|
||||
@Override
|
||||
public Ranking createFromParcel(Parcel in) {
|
||||
return new Ranking(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ranking[] newArray(int size) {
|
||||
return new Ranking[size];
|
||||
}
|
||||
};
|
||||
|
||||
public int getErbanNo() {
|
||||
return erbanNo;
|
||||
}
|
||||
|
||||
public void setErbanNo(int erbanNo) {
|
||||
this.erbanNo = erbanNo;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(int gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public int getTotalNum() {
|
||||
return totalNum;
|
||||
}
|
||||
|
||||
public void setTotalNum(int totalNum) {
|
||||
this.totalNum = totalNum;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected RankingInfo(Parcel in) {
|
||||
starList = in.createTypedArrayList(Ranking.CREATOR);
|
||||
nobleList = in.createTypedArrayList(Ranking.CREATOR);
|
||||
roomList = in.createTypedArrayList(Ranking.CREATOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeTypedList(starList);
|
||||
dest.writeTypedList(nobleList);
|
||||
dest.writeTypedList(roomList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<RankingInfo> CREATOR = new Creator<RankingInfo>() {
|
||||
@Override
|
||||
public RankingInfo createFromParcel(Parcel in) {
|
||||
return new RankingInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RankingInfo[] newArray(int size) {
|
||||
return new RankingInfo[size];
|
||||
}
|
||||
};
|
||||
}
|
@@ -1,119 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p> tab 标签数据 </p>
|
||||
*
|
||||
* @author Administrator
|
||||
* @date 2017/11/21
|
||||
*/
|
||||
@Data
|
||||
public class TabInfo implements Parcelable, Serializable{
|
||||
|
||||
/**
|
||||
* id : 8
|
||||
* name : 聊天
|
||||
* pict : https://image.zhongjialx.com/tag%E8%81%8A%E5%A4%A9.png
|
||||
* seq : 3
|
||||
* type : 1
|
||||
* status : true
|
||||
* istop : true
|
||||
* createTime : 1511155717000
|
||||
*/
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String pict;
|
||||
private String icon;
|
||||
private int seq;
|
||||
private int type;
|
||||
private boolean status;
|
||||
private boolean istop;
|
||||
private long createTime;
|
||||
|
||||
public TabInfo(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public TabInfo(int id, String name,String icon) {
|
||||
this(id, name);
|
||||
this.icon=icon;
|
||||
}
|
||||
|
||||
|
||||
protected TabInfo(Parcel in) {
|
||||
id = in.readInt();
|
||||
name = in.readString();
|
||||
pict = in.readString();
|
||||
seq = in.readInt();
|
||||
type = in.readInt();
|
||||
status = in.readByte() != 0;
|
||||
istop = in.readByte() != 0;
|
||||
createTime = in.readLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(id);
|
||||
dest.writeString(name);
|
||||
dest.writeString(pict);
|
||||
dest.writeInt(seq);
|
||||
dest.writeInt(type);
|
||||
dest.writeByte((byte) (status ? 1 : 0));
|
||||
dest.writeByte((byte) (istop ? 1 : 0));
|
||||
dest.writeLong(createTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<TabInfo> CREATOR = new Creator<TabInfo>() {
|
||||
@Override
|
||||
public TabInfo createFromParcel(Parcel in) {
|
||||
return new TabInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TabInfo[] newArray(int size) {
|
||||
return new TabInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
public static List<TabInfo> getTabDefaultList() {
|
||||
List<TabInfo> tabInfoList = new ArrayList<>();
|
||||
tabInfoList.add(new TabInfo(1, "新秀","https://img.letusmix.com/xinxiu_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(2, "遇见","https://img.letusmix.com/xiehou_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(3, "交友","https://img.letusmix.com/jiaoyou_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(4, "娱乐","https://img.letusmix.com/yule_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(5, "音乐","https://img.letusmix.com/yinyue_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(6, "电台","https://img.letusmix.com/diantai_tag_icon.png"));
|
||||
return tabInfoList;
|
||||
}
|
||||
|
||||
|
||||
public static List<TabInfo> getTabCheckVersion() {
|
||||
List<TabInfo> tabInfoList = new ArrayList<>();
|
||||
tabInfoList.add(new TabInfo(16, "邂逅","https://img.letusmix.com/xiehou_tag_icon.png"));
|
||||
return tabInfoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TabInfo{" +
|
||||
"name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,679 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.manager;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.ktv.event.RemoteVideoEvent;
|
||||
import com.yizhuan.xchat_android_core.statistic.LogFactory;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.LogProtocol;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import io.agora.ktvkit.IKTVKitEventHandler;
|
||||
import io.agora.ktvkit.KTVKit;
|
||||
import io.agora.rtc.Constants;
|
||||
import io.agora.rtc.IRtcEngineEventHandler;
|
||||
import io.agora.rtc.RtcEngine;
|
||||
import io.agora.rtc.video.VideoCanvas;
|
||||
|
||||
import static io.agora.rtc.Constants.AUDIO_PROFILE_DEFAULT;
|
||||
import static io.agora.rtc.Constants.AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO;
|
||||
import static io.agora.rtc.Constants.AUDIO_PROFILE_SPEECH_STANDARD;
|
||||
import static io.agora.rtc.Constants.AUDIO_RECORDING_QUALITY_LOW;
|
||||
import static io.agora.rtc.Constants.AUDIO_SCENARIO_GAME_STREAMING;
|
||||
|
||||
/**
|
||||
* <p> 声网管理类 </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/12
|
||||
*/
|
||||
public final class RtcEngineManager {
|
||||
private static volatile RtcEngineManager sEngineManager;
|
||||
private static final Object SYNC_OBJECT = new Object();
|
||||
@Nullable
|
||||
private RtcEngine mRtcEngine;
|
||||
private Map<String, Integer> speakers;
|
||||
/**
|
||||
* 说话列表
|
||||
*/
|
||||
private List<Integer> speakMembersPosition;
|
||||
/**
|
||||
* 队列说话列表
|
||||
*/
|
||||
private List<Integer> speakQueueMembersPosition;
|
||||
private String uid;
|
||||
public boolean isAudienceRole;
|
||||
/**
|
||||
* 麦上是否闭麦,true:闭麦,false:开麦
|
||||
*/
|
||||
public boolean isMute;
|
||||
/**
|
||||
* 听筒是否关闭
|
||||
*/
|
||||
public boolean isRemoteMute;
|
||||
private boolean needRecord;
|
||||
//是否在房间,判断是切换品质还是第一次进
|
||||
private boolean inRoom;
|
||||
private EngineEventHandler eventHandler;
|
||||
|
||||
private static final class Helper {
|
||||
private static final RtcEngineManager INSTANCE = new RtcEngineManager();
|
||||
}
|
||||
|
||||
private RtcEngineManager() {
|
||||
System.out.println("hehehehe" + RtcEngine.getSdkVersion());
|
||||
speakMembersPosition = new ArrayList<>();
|
||||
speakQueueMembersPosition = new ArrayList<>();
|
||||
}
|
||||
|
||||
public static RtcEngineManager get() {
|
||||
return Helper.INSTANCE;
|
||||
}
|
||||
|
||||
public void startRtcEngine(long uid) {
|
||||
RoomInfo curRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
// if (curRoomInfo.getAudioQuality() == RoomInfo.ROOMTYPE_LIGHT_CHAT) {
|
||||
// joinHighQualityChannel(curRoomInfo.getRoomId(), uid,true);
|
||||
// } else {
|
||||
joinChannel(curRoomInfo.getRoomId(), uid);
|
||||
// }
|
||||
if (curRoomInfo.getUid() == uid && curRoomInfo.getType() != RoomInfo.ROOMTYPE_HOME_PARTY) {
|
||||
//设置用户角色为主播,轰趴房不能默认设置房主为主播
|
||||
setRole(Constants.CLIENT_ROLE_BROADCASTER);
|
||||
} else {
|
||||
setRole(Constants.CLIENT_ROLE_AUDIENCE);
|
||||
}
|
||||
}
|
||||
|
||||
public void joinChannel(long channelId, long uid) {
|
||||
initRtcEngine(channelId, uid, AUDIO_PROFILE_DEFAULT, AUDIO_PROFILE_SPEECH_STANDARD);
|
||||
}
|
||||
|
||||
public void joinHighQualityChannel(long channelId, long uid, boolean record) {
|
||||
this.needRecord = record;
|
||||
initRtcEngine(channelId, uid, AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO, AUDIO_SCENARIO_GAME_STREAMING);
|
||||
}
|
||||
|
||||
public void reJoinChannel(long channelId, long uid) {
|
||||
enterChannel(channelId, (int) uid, AUDIO_PROFILE_DEFAULT, AUDIO_PROFILE_SPEECH_STANDARD);
|
||||
setRemoteMute(isRemoteMute);
|
||||
setMute(isMute);
|
||||
}
|
||||
|
||||
public void reJoinHighQualityChannel(long channelId, long uid, boolean record) {
|
||||
this.needRecord = record;
|
||||
enterChannel(channelId, (int) uid, AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO, AUDIO_SCENARIO_GAME_STREAMING);
|
||||
setRemoteMute(isRemoteMute);
|
||||
setMute(isMute);
|
||||
}
|
||||
|
||||
private void initRtcEngine(long channelId, long uid, int quality, int audioShowRoom) {
|
||||
this.uid = uid + "";
|
||||
this.isMute = false;
|
||||
this.isRemoteMute = false;
|
||||
enterChannel(channelId, (int) uid, quality, audioShowRoom);
|
||||
}
|
||||
|
||||
private void enterChannel(long channelId, int uid, int quality, int audioShowRoom) {
|
||||
if (mRtcEngine == null) {
|
||||
try {
|
||||
eventHandler = new EngineEventHandler(this);
|
||||
mRtcEngine = RtcEngine.create(BasicConfig.INSTANCE.getAppContext(), XChatConstants.AGORA_KEY, eventHandler);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
|
||||
}
|
||||
//设置频道模式为直播
|
||||
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING);
|
||||
mRtcEngine.setAudioProfile(quality, audioShowRoom);
|
||||
mRtcEngine.enableAudioVolumeIndication(600, 3);
|
||||
mRtcEngine.setDefaultAudioRoutetoSpeakerphone(true);
|
||||
mRtcEngine.setExternalVideoSource(true, false, true);
|
||||
mRtcEngine.setRecordingAudioFrameParameters(48000, 2, 2, 960);
|
||||
mRtcEngine.setVideoProfile(Constants.VIDEO_PROFILE_360P, false);
|
||||
mRtcEngine.enableDualStreamMode(true);
|
||||
mRtcEngine.setParameters(String.format(Locale.US, "{\"che.audio.profile\":{\"scenario\":%d}}", 1));
|
||||
mRtcEngine.setParameters(String.format(Locale.US, "{\"che.audio.headset.monitoring,true\"}"));
|
||||
mRtcEngine.setParameters(String.format(Locale.US, "{\"che.audio.enable.androidlowlatencymode,true\"}"));
|
||||
mRtcEngine.setLogFile(Environment.getExternalStorageDirectory()
|
||||
+ File.separator + BasicConfig.INSTANCE.getAppContext().getPackageName() + "/log/agora-rtc.log");
|
||||
}
|
||||
//创建并加入频道
|
||||
mRtcEngine.joinChannel(null, String.valueOf(channelId), null, uid);
|
||||
}
|
||||
|
||||
|
||||
public int stopAudioMixing() {
|
||||
if (mRtcEngine != null) {
|
||||
return mRtcEngine.stopAudioMixing();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void resetChannel() {
|
||||
if (mRtcEngine != null) {
|
||||
stopAudioMixing();
|
||||
mRtcEngine.leaveChannel();
|
||||
mRtcEngine = null;
|
||||
}
|
||||
if (handler != null)
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
|
||||
public void leaveChannel() {
|
||||
if (mRtcEngine != null) {
|
||||
stopAudioMixing();
|
||||
mRtcEngine.leaveChannel();
|
||||
mRtcEngine = null;
|
||||
}
|
||||
if (handler != null)
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
// isAudienceRole = true;
|
||||
isMute = false;
|
||||
isRemoteMute = false;
|
||||
needRecord = false;
|
||||
inRoom = false;
|
||||
}
|
||||
|
||||
public boolean isSpeaking(int position) {
|
||||
if (speakMembersPosition != null) {
|
||||
if (speakMembersPosition.contains(position)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isQueueSpeaking(int position) {
|
||||
if (speakQueueMembersPosition != null) {
|
||||
if (speakQueueMembersPosition.contains(position)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//设置静音
|
||||
public void setRemoteMute(boolean mute) {
|
||||
if (mRtcEngine != null) {
|
||||
int result = mRtcEngine.muteAllRemoteAudioStreams(mute);
|
||||
if (result == 0) {
|
||||
isRemoteMute = mute;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRemoteMute(int uid, boolean mute) {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.muteRemoteAudioStream(uid, mute);
|
||||
}
|
||||
}
|
||||
|
||||
public void setRemoteMute(ChatRoomMember chatRoomMember, boolean mute) {
|
||||
if (chatRoomMember != null && !TextUtils.isEmpty(chatRoomMember.getAccount())) {
|
||||
String account = chatRoomMember.getAccount();
|
||||
Integer uid = Integer.valueOf(account);
|
||||
if (uid != 0)
|
||||
RtcEngineManager.get().setRemoteMute(uid, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置角色,上麦,下麦(调用)
|
||||
*
|
||||
* @param role CLIENT_ROLE_AUDIENCE: 听众 ,CLIENT_ROLE_BROADCASTER: 主播
|
||||
*/
|
||||
public void setRole(int role) {
|
||||
if (mRtcEngine != null) {
|
||||
//先已是否静音为准
|
||||
mRtcEngine.setClientRole(role);
|
||||
//isAudienceRole = role != Constants.CLIENT_ROLE_BROADCASTER;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否能说话,静音,人自己的行为
|
||||
*
|
||||
* @param mute true:静音,false:不静音
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
public void setMute(boolean mute) {
|
||||
if (mRtcEngine != null) {
|
||||
int result = mRtcEngine.muteLocalAudioStream(mute);
|
||||
if (result == 0) {
|
||||
isMute = mute;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Handler handler = new RtcEngineHandler(this);
|
||||
|
||||
private static class RtcEngineHandler extends Handler {
|
||||
private WeakReference<RtcEngineManager> mReference;
|
||||
|
||||
RtcEngineHandler(RtcEngineManager manager) {
|
||||
mReference = new WeakReference<>(manager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
RtcEngineManager rtcEngineManager = mReference.get();
|
||||
if (rtcEngineManager == null) return;
|
||||
if (msg.what == 0) {
|
||||
if (!RtcEngineManager.get().inRoom) {
|
||||
IMNetEaseManager.get().joinAvRoom();
|
||||
}
|
||||
|
||||
RtcEngineManager.get().inRoom = true;
|
||||
if (rtcEngineManager.needRecord && rtcEngineManager.mRtcEngine != null) {
|
||||
rtcEngineManager.mRtcEngine.startAudioRecording(Environment.getExternalStorageDirectory()
|
||||
+ File.separator + BasicConfig.INSTANCE.getAppContext().getPackageName()
|
||||
+ "/audio/" + System.currentTimeMillis() + ".aac", AUDIO_RECORDING_QUALITY_LOW);
|
||||
}
|
||||
|
||||
} else if (msg.what == 1) {//onAudioVolumeIndication 说话声音音量提示回调
|
||||
IRtcEngineEventHandler.AudioVolumeInfo[] speakers = (IRtcEngineEventHandler.AudioVolumeInfo[]) msg.obj;
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
if (rtcEngineManager.speakQueueMembersPosition.size() > 0) {
|
||||
rtcEngineManager.speakQueueMembersPosition.clear();
|
||||
}
|
||||
if (speakers == null || speakers.length == 0) return;
|
||||
for (IRtcEngineEventHandler.AudioVolumeInfo speaker : speakers) {
|
||||
// 0 代表的是房主,其他代表的是uid
|
||||
int uid = speaker.uid == 0 ? Integer.valueOf(rtcEngineManager.uid) : speaker.uid;
|
||||
int micPosition = AvRoomDataManager.get().getMicPosition(uid);
|
||||
// 如果是房主的话,并且房主的mic位置没有的啊,则把房主的位置设置为-1(兼容ios轻聊房光晕)
|
||||
if (uid == AvRoomDataManager.get().mCurrentRoomInfo.getUid() &&
|
||||
AvRoomDataManager.get().mCurrentRoomInfo.getType() == RoomInfo.ROOMTYPE_LIGHT_CHAT
|
||||
&& micPosition == Integer.MIN_VALUE) {
|
||||
micPosition = -1;
|
||||
}
|
||||
if (micPosition == Integer.MIN_VALUE &&
|
||||
uid == AuthModel.get().getCurrentUid()) {
|
||||
// 如果麦上没有自己,并且自己在说话,要把自己变成听众
|
||||
RtcEngineManager.get().setRole(Constants.CLIENT_ROLE_AUDIENCE);
|
||||
} else if (micPosition == Integer.MIN_VALUE &&
|
||||
uid != AuthModel.get().getCurrentUid()) {
|
||||
// 如果麦上没有这个人,要把他静音
|
||||
RtcEngineManager.get().setRemoteMute(uid, true);
|
||||
}
|
||||
if (micPosition == Integer.MIN_VALUE) continue;
|
||||
rtcEngineManager.speakQueueMembersPosition.add(micPosition);
|
||||
}
|
||||
IMNetEaseManager.get().getChatRoomEventObservable().onNext(
|
||||
new RoomEvent().setEvent(RoomEvent.SPEAK_STATE_CHANGE)
|
||||
.setMicPositionList(rtcEngineManager.speakQueueMembersPosition)
|
||||
);
|
||||
} else if (msg.what == 2) {//onUserMuteAudio 用户静音回调
|
||||
Integer uid = (Integer) msg.obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class EngineEventHandler extends IRtcEngineEventHandler {
|
||||
private WeakReference<RtcEngineManager> mReference;
|
||||
private boolean isEnter;
|
||||
|
||||
EngineEventHandler(RtcEngineManager manager) {
|
||||
mReference = new WeakReference<>(manager);
|
||||
isEnter = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoinChannelSuccess(String channel, int uid, int elapsed) {
|
||||
super.onJoinChannelSuccess(channel, uid, elapsed);
|
||||
|
||||
//声网进入频道成功日志
|
||||
StatisticManager.Instance().sendAliyunLog(LogFactory.create(
|
||||
LogProtocol.LogLevel.LEVEL_VERBOSE,
|
||||
LogProtocol.Topic.TOPIC_AUDIO_LOG,
|
||||
LogProtocol.Event.EVENT_AUDIO_CHANNEL
|
||||
)
|
||||
.append("uid", String.valueOf(AuthModel.get().getCurrentUid()))
|
||||
.append("type", "1")
|
||||
.append("room_id", channel));
|
||||
if (mReference.get() != null && isEnter) {
|
||||
isEnter = false;
|
||||
mReference.get().handler.sendEmptyMessage(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRejoinChannelSuccess(String channel, int uid, int elapsed) {
|
||||
super.onRejoinChannelSuccess(channel, uid, elapsed);
|
||||
//声网重新链接频道成功日志
|
||||
StatisticManager.Instance().sendAliyunLog(LogFactory.create(
|
||||
LogProtocol.LogLevel.LEVEL_VERBOSE,
|
||||
LogProtocol.Topic.TOPIC_AUDIO_LOG,
|
||||
LogProtocol.Event.EVENT_AUDIO_CHANNEL
|
||||
)
|
||||
.append("uid", String.valueOf(AuthModel.get().getCurrentUid()))
|
||||
.append("type", "3")
|
||||
.append("room_id", channel));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeaveChannel(RtcStats stats) {
|
||||
super.onLeaveChannel(stats);
|
||||
//声网离开频道成功日志
|
||||
StatisticManager.Instance().sendAliyunLog(LogFactory.create(
|
||||
LogProtocol.LogLevel.LEVEL_VERBOSE,
|
||||
LogProtocol.Topic.TOPIC_AUDIO_LOG,
|
||||
LogProtocol.Event.EVENT_AUDIO_CHANNEL
|
||||
)
|
||||
.append("uid", String.valueOf(AuthModel.get().getCurrentUid()))
|
||||
.append("type", "2"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserJoined(int uid, int elapsed) {
|
||||
super.onUserJoined(uid, elapsed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActiveSpeaker(int uid) {
|
||||
super.onActiveSpeaker(uid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLastmileQuality(int quality) {
|
||||
super.onLastmileQuality(quality);
|
||||
if (quality >= 3) {
|
||||
IMNetEaseManager.postRoomEvent(new RoomEvent().setEvent(RoomEvent.RTC_ENGINE_NETWORK_BAD)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionInterrupted() {
|
||||
super.onConnectionInterrupted();
|
||||
IMNetEaseManager.postRoomEvent(new RoomEvent().setEvent(RoomEvent.RTC_ENGINE_NETWORK_CLOSE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionLost() {
|
||||
super.onConnectionLost();
|
||||
IMNetEaseManager.postRoomEvent(new RoomEvent().setEvent(RoomEvent.RTC_ENGINE_NETWORK_CLOSE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioVolumeIndication(AudioVolumeInfo[] speakers, int totalVolume) {
|
||||
super.onAudioVolumeIndication(speakers, totalVolume);
|
||||
RtcEngineManager manager = mReference.get();
|
||||
if (manager != null) {
|
||||
Message message = manager.handler.obtainMessage();
|
||||
message.what = 1;
|
||||
message.obj = speakers;
|
||||
manager.handler.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserMuteAudio(int uid, boolean muted) {
|
||||
super.onUserMuteAudio(uid, muted);
|
||||
RtcEngineManager manager = mReference.get();
|
||||
if (manager != null) {
|
||||
if (muted) {
|
||||
Message message = manager.handler.obtainMessage();
|
||||
message.what = 2;
|
||||
message.obj = uid;
|
||||
manager.handler.sendMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClientRoleChanged(int oldRole, int newRole) {
|
||||
super.onClientRoleChanged(oldRole, newRole);
|
||||
if (newRole==1)
|
||||
get().setMute(get().isMute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioMixingFinished() {//伴奏播放已结束回调
|
||||
super.onAudioMixingFinished();
|
||||
IMNetEaseManager.get().getChatRoomEventObservable().onNext(
|
||||
new RoomEvent().setEvent(RoomEvent.METHOD_ON_AUDIO_MIXING_FINISHED)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstRemoteVideoDecoded(final int uid, int width, int height, int elapsed) {
|
||||
RxBus.get().post(new RemoteVideoEvent(uid));
|
||||
get().remoteUid = uid;
|
||||
}
|
||||
}
|
||||
|
||||
//音乐播放相关---------------begin--------------------------
|
||||
|
||||
public void adjustAudioMixingVolume(int volume) {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.adjustAudioMixingVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustRecordingSignalVolume(int volume) {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.adjustRecordingSignalVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
public int resumeAudioMixing() {
|
||||
if (mRtcEngine != null) {
|
||||
int result = mRtcEngine.resumeAudioMixing();
|
||||
return result;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int pauseAudioMixing() {
|
||||
if (mRtcEngine != null) {
|
||||
int result = mRtcEngine.pauseAudioMixing();
|
||||
return result;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
public int startAudioMixing(String filePath, boolean loopback, int cycle) {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.stopAudioMixing();
|
||||
int result = 0;
|
||||
try {
|
||||
result = mRtcEngine.startAudioMixing(filePath, loopback, false, cycle);
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int getAudioMixingCurrentPosition() {
|
||||
return mRtcEngine.getAudioMixingCurrentPosition();
|
||||
}
|
||||
|
||||
public int getAudioMixingDuration() {
|
||||
return mRtcEngine.getAudioMixingDuration();
|
||||
}
|
||||
//音乐播放相关---------------end--------------------------
|
||||
|
||||
|
||||
//ktv相关---------------begin--------------------------
|
||||
private boolean isPlaying;
|
||||
private boolean isAccompany = true;
|
||||
private boolean isPush;
|
||||
private boolean isOpenKtv;
|
||||
private boolean isLive;
|
||||
private int remoteUid;
|
||||
private double accompanyVoice = 0.5;
|
||||
private double personVoice = 0.5;
|
||||
@Nullable
|
||||
private KTVKit ktvKit;
|
||||
|
||||
public synchronized void openKtvModel() {
|
||||
if (mRtcEngine == null || isOpenKtv) return;
|
||||
try {
|
||||
ktvKit = KTVKit.create(mRtcEngine, BasicConfig.INSTANCE.getAppContext(), new IKTVKitEventHandler() {
|
||||
@Override
|
||||
public void onPlayerError(int error) {
|
||||
SingleToastUtil.showToast("MV播放出现未知错误,可以点击报错向我们反馈哦~~");
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mRtcEngine.enableVideo();
|
||||
mRtcEngine.enableLocalVideo(false);
|
||||
isOpenKtv = true;
|
||||
}
|
||||
|
||||
public synchronized void closeKtvModel() {
|
||||
if (!isOpenKtv) return;
|
||||
stopPush();
|
||||
isPlaying = false;
|
||||
isOpenKtv = false;
|
||||
isLive = false;
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.disableVideo();
|
||||
}
|
||||
if (ktvKit != null) {
|
||||
KTVKit.destroy();
|
||||
ktvKit = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void stopPush() {
|
||||
if (isPush){
|
||||
isPush = false;
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.muteLocalVideoStream(true);
|
||||
mRtcEngine.enableLocalVideo(false);
|
||||
// mRtcEngine.enableInEarMonitoring(false);
|
||||
}
|
||||
if (ktvKit != null) ktvKit.stopPlayVideoFile();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void startMv(String url) {
|
||||
if (ktvKit == null || mRtcEngine == null || !isOpenKtv || !AvRoomDataManager.get().isOwnerOnMic())
|
||||
return;
|
||||
mRtcEngine.enableLocalVideo(true);
|
||||
//mRtcEngine.enableInEarMonitoring(true);
|
||||
mRtcEngine.muteLocalVideoStream(false);
|
||||
ktvKit.openAndPlayVideoFile(url);
|
||||
setAccompanyVoice(accompanyVoice);
|
||||
setPersonVoice(personVoice);
|
||||
isPlaying = true;
|
||||
isPush = true;
|
||||
isLive = true;
|
||||
}
|
||||
|
||||
public synchronized void setupRemoteVideo(VideoCanvas canvas, int remoteUid) {
|
||||
if (mRtcEngine != null && isOpenKtv) {
|
||||
isPlaying = true;
|
||||
isLive = true;
|
||||
mRtcEngine.setupRemoteVideo(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void playOrPause() {
|
||||
if (ktvKit != null) ktvKit.pause();
|
||||
isPlaying = !isPlaying;
|
||||
}
|
||||
|
||||
public void changeAudioStream() {
|
||||
if (ktvKit != null) ktvKit.switchAudioTrack();
|
||||
isAccompany = !isAccompany;
|
||||
}
|
||||
|
||||
public void setAccompanyVoice(double progress) {
|
||||
if (progress < 0 || progress > 1) {
|
||||
return;
|
||||
}
|
||||
accompanyVoice = progress;
|
||||
if (ktvKit != null) ktvKit.adjustAccompanyVolume(progress);
|
||||
}
|
||||
|
||||
public void setPersonVoice(double progress) {
|
||||
if (progress < 0 || progress > 1) {
|
||||
return;
|
||||
}
|
||||
personVoice = progress;
|
||||
if (ktvKit != null) ktvKit.adjustVoiceVolume(personVoice);
|
||||
}
|
||||
|
||||
public boolean isPlaying() {
|
||||
return isPlaying;
|
||||
}
|
||||
|
||||
public boolean isPush() {
|
||||
return isPush;
|
||||
}
|
||||
|
||||
public boolean isAccompany() {
|
||||
return isAccompany;
|
||||
}
|
||||
|
||||
public boolean isOpenKtv() {
|
||||
return isOpenKtv;
|
||||
}
|
||||
|
||||
public boolean isLive() {
|
||||
return isLive;
|
||||
}
|
||||
|
||||
public void setLive(boolean live) {
|
||||
isLive = live;
|
||||
}
|
||||
|
||||
public int getRemoteUid() {
|
||||
return remoteUid;
|
||||
}
|
||||
|
||||
public double getAccompanyVoice() {
|
||||
return accompanyVoice;
|
||||
}
|
||||
|
||||
public double getPersonVoice() {
|
||||
return personVoice;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public KTVKit getKtvKit() {
|
||||
return ktvKit;
|
||||
}
|
||||
|
||||
public double getPlayPos() {
|
||||
return ktvKit == null ? 0 : ktvKit.getCurrentPosition();
|
||||
}
|
||||
|
||||
public int getPlayDuration() {
|
||||
return ktvKit == null ? 0 : ktvKit.getDuration();
|
||||
}
|
||||
|
||||
//ktv相关---------------end--------------------------
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.version;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.bean.VersionInfo;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* create by lvzebiao on 2018/9/14
|
||||
*/
|
||||
public interface IVersionModel extends IModel{
|
||||
|
||||
Single<VersionInfo> getVersion(@Query("version") String version);
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.version;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.VersionInfo;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* create by lvzebiao on 2018/9/14
|
||||
*/
|
||||
public class VersionModel extends BaseModel implements IVersionModel{
|
||||
|
||||
private Api api;
|
||||
|
||||
public VersionModel() {
|
||||
api = RxNet.create(Api.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<VersionInfo> getVersion(String version) {
|
||||
return api.getVersion(version)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
/**
|
||||
*版本
|
||||
*/
|
||||
@GET("version/get")
|
||||
Single<ServiceResult<VersionInfo>> getVersion(@Query("version") String version);
|
||||
}
|
||||
|
||||
}
|
@@ -1,152 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
import com.yizhuan.xchat_android_library.utils.pref.CommonPref;
|
||||
|
||||
/**
|
||||
* 请求接口接口地址
|
||||
*/
|
||||
public class UriProvider {
|
||||
|
||||
public static void init(Env.UriSetting uriSetting, String url) {
|
||||
if (uriSetting == Env.UriSetting.Product) {
|
||||
//生产环境地址
|
||||
initProductUri(url);
|
||||
} else if (uriSetting == Env.UriSetting.Test) {
|
||||
//测试环境地址
|
||||
initTestUri(url);
|
||||
}
|
||||
}
|
||||
|
||||
private static String DEBUG_URL;
|
||||
|
||||
public static void initDevUri(String url) {
|
||||
DEBUG_URL = url;
|
||||
JAVA_WEB_URL = url;
|
||||
IM_SERVER_URL = url;
|
||||
}
|
||||
|
||||
private static void initProductUri(String url) {
|
||||
JAVA_WEB_URL = url;
|
||||
IM_SERVER_URL = url;
|
||||
}
|
||||
|
||||
|
||||
private static void initTestUri(String url) {
|
||||
int enviroment = CommonPref.instance(BasicConfig.INSTANCE.getAppContext()).getInt("enviroment");
|
||||
if (enviroment == 0) {
|
||||
initProductUri(url);//其他使用DEV的配置,就神曲这个跟新一下
|
||||
} else {
|
||||
if (!TextUtils.isEmpty(DEBUG_URL))
|
||||
initDevUri(DEBUG_URL);
|
||||
else
|
||||
initDevUri(url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认以下生产环境地址
|
||||
*/
|
||||
public static String JAVA_WEB_URL = "http://www.daxiaomao.com";
|
||||
public static String IM_SERVER_URL = "https://www.daxiaomao.com";
|
||||
|
||||
public static String getGroupResourceBaseUri() {
|
||||
return JAVA_WEB_URL.concat("/app/service/resource/list");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getLotteryActivityPage() {
|
||||
return IM_SERVER_URL.concat("/ms/modules/userDraw/index.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 贵族订单页面
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
public static String getNobleOrderPage() {
|
||||
return IM_SERVER_URL.concat("/modules/noble/order.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取房间背景(有动效)
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
public static String getRoomBg() {
|
||||
return IM_SERVER_URL.concat("/modules/noble/roomBgList.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取贵族推荐页面
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
public static String getNobleIntroducePage() {
|
||||
return IM_SERVER_URL.concat("/modules/noble/intro.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取贵族个人管理页面
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
public static String getNobleHomePage() {
|
||||
return IM_SERVER_URL.concat("/modules/noble/homepage.html");
|
||||
}
|
||||
|
||||
/** 贵族介绍页 */
|
||||
public static String getNobleIntro() {
|
||||
return "modules/noble/intro.html";
|
||||
}
|
||||
|
||||
/** 等级界面 */
|
||||
public static String getUserLevelUrl() {
|
||||
return "modules/level/levelExper.html";
|
||||
}
|
||||
/** 等级界面 */
|
||||
public static String getUserCUrl() {
|
||||
return "modules/level/levelCharm.html";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 耳伴头条 http://beta.erbanyy.com/modules/headNews/index.html
|
||||
* @return
|
||||
*/
|
||||
public static String getErbanTopMessageUrl() {
|
||||
return JAVA_WEB_URL.concat("/modules/headNews/index.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建家族
|
||||
* @return
|
||||
*/
|
||||
public static String getCreateFamilyUrl() {
|
||||
return JAVA_WEB_URL.concat("/ms/modules/family/create.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 家族指南
|
||||
* @return
|
||||
*/
|
||||
public static String getFamilyInstructionUrl() {
|
||||
return JAVA_WEB_URL.concat("/ms/modules/family/handbook.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 家族币获取帮助
|
||||
* @return
|
||||
*/
|
||||
public static String getFamilyCurrencyHelpUrl() {
|
||||
return JAVA_WEB_URL.concat("/ms/modules/family/faq.html");
|
||||
}
|
||||
}
|
@@ -1,45 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.find;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.home.bean.FindInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.http.GET;
|
||||
|
||||
public class FindModel extends BaseModel implements IFindModel {
|
||||
|
||||
private Api api;
|
||||
|
||||
private FindModel() {
|
||||
api = RxNet.create(Api.class);
|
||||
}
|
||||
|
||||
public static FindModel get() {
|
||||
return FindModelHolder.instance;
|
||||
}
|
||||
|
||||
private static class FindModelHolder {
|
||||
private static FindModel instance = new FindModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<ServiceResult<List<FindInfo>>> getFindInfo() {
|
||||
return api.getFindInfo()
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
interface Api {
|
||||
|
||||
/**
|
||||
* 获取发现页广告位的列表
|
||||
* @return
|
||||
*/
|
||||
@GET("advertise/getList")
|
||||
Single<ServiceResult<List<FindInfo>>> getFindInfo();
|
||||
}
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.find;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.home.bean.FindInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
public interface IFindModel extends IModel {
|
||||
|
||||
/**
|
||||
* 发现页广告位列表
|
||||
* @return
|
||||
*/
|
||||
Single<ServiceResult<List<FindInfo>>> getFindInfo();
|
||||
}
|
@@ -1,208 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home;
|
||||
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom;
|
||||
import com.yizhuan.xchat_android_core.home.bean.TabInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleSource;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public class HomeModel extends BaseModel implements IHomeModel {
|
||||
private volatile static IHomeModel instance;
|
||||
private Api api;
|
||||
|
||||
private List<TabInfo> mTabInfoList;
|
||||
|
||||
public static IHomeModel get() {
|
||||
if (instance == null){
|
||||
synchronized (HomeModel.class){
|
||||
if (instance == null){
|
||||
instance = new HomeModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private HomeModel(){
|
||||
api = RxNet.create(Api.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存的房间分类数据
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TabInfo> getmTabInfoList() {
|
||||
return mTabInfoList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取首页Tab失败
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<List<TabInfo>> getMainTabData() {
|
||||
return api.getMainTabList()
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.doOnSuccess(new Consumer<List<TabInfo>>() {
|
||||
@Override
|
||||
public void accept(List<TabInfo> tabInfos) throws Exception {
|
||||
mTabInfoList = tabInfos;
|
||||
}
|
||||
})
|
||||
.doOnError(new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Logger.e("获取首页Tab失败......");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页数据
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<HomeInfo> getHomeData(final int page, int pageSize) {
|
||||
return api.getMainHotData(
|
||||
String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
String.valueOf(page),
|
||||
String.valueOf(pageSize)
|
||||
)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈
|
||||
* @param feedbackDesc
|
||||
* @param contact
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<String> commitFeedback(String feedbackDesc, String contact) {
|
||||
return api.commitFeedback(
|
||||
String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
feedbackDesc,
|
||||
contact,
|
||||
AuthModel.get().getTicket()
|
||||
)
|
||||
.flatMap(new Function<ServiceResult, SingleSource<String>>() {
|
||||
@Override
|
||||
public SingleSource<String> apply(ServiceResult serviceResult) throws Exception {
|
||||
if (serviceResult.isSuccess()) {
|
||||
return Single.just("反馈成功");
|
||||
} else {
|
||||
return Single.error(new Throwable(serviceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
})
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分类 获取房间列表
|
||||
* @param tagId
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
*/
|
||||
@Override
|
||||
public Single<List<HomeRoom>> getMainDataByTab(final int tagId, final int pageNum, int pageSize) {
|
||||
return api.getMainDataByTab(
|
||||
String.valueOf(tagId),
|
||||
String.valueOf(pageNum),
|
||||
String.valueOf(pageSize)
|
||||
)
|
||||
.flatMap(new Function<ServiceResult<List<HomeRoom>>, SingleSource<List<HomeRoom>>>() {
|
||||
@Override
|
||||
public SingleSource<List<HomeRoom>> apply(ServiceResult<List<HomeRoom>> listServiceResult) throws Exception {
|
||||
if (listServiceResult.isSuccess()){
|
||||
if (listServiceResult.getData() == null){
|
||||
return Single.just(new ArrayList<HomeRoom>());
|
||||
}
|
||||
return Single.just(listServiceResult.getData());
|
||||
}else {
|
||||
return Single.error(new Throwable(listServiceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
})
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private interface Api{
|
||||
/**
|
||||
* 获取首页热门数据
|
||||
*
|
||||
* @param uid
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GET("/home/v2/hotindex")
|
||||
Single<ServiceResult<HomeInfo>> getMainHotData(@Query("uid") String uid,
|
||||
@Query("pageNum") String pageNum,
|
||||
@Query("pageSize") String pageSize);
|
||||
|
||||
/**
|
||||
* 提交反馈
|
||||
*
|
||||
* @param uid
|
||||
* @param feedbackDesc
|
||||
* @param contact
|
||||
* @param ticket
|
||||
* @return
|
||||
*/
|
||||
@POST("/feedback")
|
||||
Single<ServiceResult> commitFeedback(@Query("uid") String uid,
|
||||
@Query("feedbackDesc") String feedbackDesc,
|
||||
@Query("contact") String contact,
|
||||
@Query("ticket") String ticket);
|
||||
|
||||
|
||||
/**
|
||||
* 获取首页tab数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/room/tag/top")
|
||||
Single<ServiceResult<List<TabInfo>>> getMainTabList();
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @param tagId
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@POST("home/v2/tagindex")
|
||||
Single<ServiceResult<List<HomeRoom>>> getMainDataByTab(@Query("tagId") String tagId,
|
||||
@Query("pageNum") String pageNum,
|
||||
@Query("pageSize") String pageSize);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,48 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoom;
|
||||
import com.yizhuan.xchat_android_core.home.bean.TabInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
public interface IHomeModel extends IModel {
|
||||
/**
|
||||
* 获取缓存的房间分类数据
|
||||
* @return
|
||||
*/
|
||||
List<TabInfo> getmTabInfoList();
|
||||
|
||||
/**
|
||||
* 获取首页Tab失败
|
||||
* @return
|
||||
*/
|
||||
Single<List<TabInfo>> getMainTabData();
|
||||
|
||||
/**
|
||||
* 获取首页数据
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
Single<HomeInfo> getHomeData(int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 反馈
|
||||
* @param feedbackDesc
|
||||
* @param contact
|
||||
* @return
|
||||
*/
|
||||
Single<String> commitFeedback( String feedbackDesc, String contact);
|
||||
|
||||
/**
|
||||
* 根据分类 获取房间列表
|
||||
* @param tagId
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
*/
|
||||
Single<List<HomeRoom>> getMainDataByTab(int tagId, int pageNum, int pageSize);
|
||||
}
|
@@ -1,75 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/8/7.
|
||||
*/
|
||||
@Data
|
||||
public class BannerInfo implements Parcelable {
|
||||
/*
|
||||
bannerId:1 //id
|
||||
bannerName: xx//横幅广告名称
|
||||
bannerPic:xx //横幅图片
|
||||
skipType:xx // 1跳app页面,2跳聊天室,3跳h5页面
|
||||
displayType //1顶部banner 2底部banner
|
||||
skipUri:xx //跳转uri
|
||||
*/
|
||||
private int bannerId;
|
||||
private String bannerName;
|
||||
private String bannerPic;
|
||||
private int skipType;
|
||||
private int displayType;
|
||||
private String skipUri;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BannerInfo{" +
|
||||
"bannerId=" + bannerId +
|
||||
", bannerName='" + bannerName + '\'' +
|
||||
", bannerPic='" + bannerPic + '\'' +
|
||||
", skipType=" + skipType +
|
||||
", skipUri='" + skipUri + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
protected BannerInfo(Parcel in) {
|
||||
bannerId = in.readInt();
|
||||
bannerName = in.readString();
|
||||
bannerPic = in.readString();
|
||||
skipType = in.readInt();
|
||||
skipUri = in.readString();
|
||||
displayType = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(bannerId);
|
||||
dest.writeString(bannerName);
|
||||
dest.writeString(bannerPic);
|
||||
dest.writeInt(skipType);
|
||||
dest.writeString(skipUri);
|
||||
dest.writeInt(displayType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<BannerInfo> CREATOR = new Creator<BannerInfo>() {
|
||||
@Override
|
||||
public BannerInfo createFromParcel(Parcel in) {
|
||||
return new BannerInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BannerInfo[] newArray(int size) {
|
||||
return new BannerInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/1/31.
|
||||
*/
|
||||
|
||||
public class FindInfo {
|
||||
/**
|
||||
* advName : 测试啊
|
||||
* advIcon : http://img.letusmix.com/FvbRJRJgufTpntjatyfL8xx1yBQ5?imageslim
|
||||
* skipType : 3
|
||||
* skipUri : www.baidu.com
|
||||
*/
|
||||
|
||||
private String advName;
|
||||
private String advIcon;
|
||||
private int skipType;
|
||||
private String skipUri;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FindInfo{" +
|
||||
"advName='" + advName + '\'' +
|
||||
", advIcon='" + advIcon + '\'' +
|
||||
", skipType=" + skipType +
|
||||
", skipUri='" + skipUri + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getAdvName() {
|
||||
return advName;
|
||||
}
|
||||
|
||||
public void setAdvName(String advName) {
|
||||
this.advName = advName;
|
||||
}
|
||||
|
||||
public String getAdvIcon() {
|
||||
return advIcon;
|
||||
}
|
||||
|
||||
public void setAdvIcon(String advIcon) {
|
||||
this.advIcon = advIcon;
|
||||
}
|
||||
|
||||
public int getSkipType() {
|
||||
return skipType;
|
||||
}
|
||||
|
||||
public void setSkipType(int skipType) {
|
||||
this.skipType = skipType;
|
||||
}
|
||||
|
||||
public String getSkipUri() {
|
||||
return skipUri;
|
||||
}
|
||||
|
||||
public void setSkipUri(String skipUri) {
|
||||
this.skipUri = skipUri;
|
||||
}
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 首页数据 </p>
|
||||
*
|
||||
* @author Administrator
|
||||
* @date 2017/11/22
|
||||
*/
|
||||
public class HomeInfo {
|
||||
public List<BannerInfo> banners;
|
||||
/** 排行数据 */
|
||||
public RankingInfo rankHome;
|
||||
/** 热门推荐 */
|
||||
public List<HomeRoom> hotRooms;
|
||||
/** 房间推荐 */
|
||||
public List<HomeRoom> listRoom;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HomeInfo{" +
|
||||
"banners=" + banners +
|
||||
", rankHome=" + rankHome +
|
||||
", hotRooms=" + hotRooms +
|
||||
", listRoom=" + listRoom +
|
||||
'}';
|
||||
}
|
||||
}
|
@@ -1,82 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 首页热门实体u </p>
|
||||
*
|
||||
* @author Administrator
|
||||
* @date 2017/11/16
|
||||
*/
|
||||
public class HomeItem implements MultiItemEntity, Parcelable {
|
||||
|
||||
public static final int BANNER = 1;
|
||||
public static final int RANKING = 2;
|
||||
public static final int RECOMMEND = 3;
|
||||
public static final int NORMAL = 4;
|
||||
|
||||
|
||||
private int itemType;
|
||||
|
||||
//正常数据
|
||||
public List<HomeRoom> recomList;
|
||||
public List<HomeRoom> homeItemRoomList;
|
||||
public List<BannerInfo> bannerInfoList;
|
||||
public RankingInfo mRankingInfo;
|
||||
|
||||
|
||||
public HomeItem(int itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
|
||||
|
||||
public HomeItem(int itemType, RankingInfo rankingInfo) {
|
||||
this.itemType = itemType;
|
||||
mRankingInfo = rankingInfo;
|
||||
}
|
||||
|
||||
protected HomeItem(Parcel in) {
|
||||
itemType = in.readInt();
|
||||
recomList = in.createTypedArrayList(HomeRoom.CREATOR);
|
||||
homeItemRoomList = in.createTypedArrayList(HomeRoom.CREATOR);
|
||||
bannerInfoList = in.createTypedArrayList(BannerInfo.CREATOR);
|
||||
mRankingInfo = in.readParcelable(RankingInfo.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(itemType);
|
||||
dest.writeTypedList(recomList);
|
||||
dest.writeTypedList(homeItemRoomList);
|
||||
dest.writeTypedList(bannerInfoList);
|
||||
dest.writeParcelable(mRankingInfo, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<HomeItem> CREATOR = new Creator<HomeItem>() {
|
||||
@Override
|
||||
public HomeItem createFromParcel(Parcel in) {
|
||||
return new HomeItem(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HomeItem[] newArray(int size) {
|
||||
return new HomeItem[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
}
|
@@ -1,165 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author zhouxiangfeng
|
||||
* @date 2017/5/17
|
||||
*/
|
||||
|
||||
public class HomeRoom extends RoomInfo implements Parcelable, MultiItemEntity {
|
||||
|
||||
public static final int BANNER = 1;
|
||||
public static final int NORMAL = 2;
|
||||
|
||||
//性别 1:男 2:女 0 :未知
|
||||
private int gender;
|
||||
|
||||
private String nick;
|
||||
//1普通账号,2官方账号,3机器账号
|
||||
private int defUser;
|
||||
|
||||
private long erbanNo;
|
||||
|
||||
//角标相关的
|
||||
public String badge;
|
||||
|
||||
/** 是否是靓号,1:靓号 */
|
||||
public boolean hasPrettyErbanNo;
|
||||
public NobleInfo nobleUsers;
|
||||
public UserLevelVo userLevelVo;
|
||||
public boolean newUser;
|
||||
private ArrayList<BannerInfo> bannerInfos;
|
||||
|
||||
public HomeRoom() {
|
||||
}
|
||||
|
||||
protected HomeRoom(Parcel in) {
|
||||
super(in);
|
||||
gender = in.readInt();
|
||||
nick = in.readString();
|
||||
defUser = in.readInt();
|
||||
erbanNo = in.readLong();
|
||||
badge = in.readString();
|
||||
hasPrettyErbanNo = in.readByte() != 0;
|
||||
bannerInfos = in.createTypedArrayList(BannerInfo.CREATOR);
|
||||
newUser = in.readByte() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
dest.writeInt(gender);
|
||||
dest.writeString(nick);
|
||||
dest.writeInt(defUser);
|
||||
dest.writeLong(erbanNo);
|
||||
dest.writeString(badge);
|
||||
dest.writeByte((byte) (hasPrettyErbanNo ? 1 : 0));
|
||||
dest.writeTypedList(bannerInfos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<HomeRoom> CREATOR = new Creator<HomeRoom>() {
|
||||
@Override
|
||||
public HomeRoom createFromParcel(Parcel in) {
|
||||
return new HomeRoom(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HomeRoom[] newArray(int size) {
|
||||
return new HomeRoom[size];
|
||||
}
|
||||
};
|
||||
|
||||
public int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(int gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public int getDefUser() {
|
||||
return defUser;
|
||||
}
|
||||
|
||||
public void setDefUser(int defUser) {
|
||||
this.defUser = defUser;
|
||||
}
|
||||
|
||||
public long getErbanNo() {
|
||||
return erbanNo;
|
||||
}
|
||||
|
||||
public void setErbanNo(long erbanNo) {
|
||||
this.erbanNo = erbanNo;
|
||||
}
|
||||
|
||||
public String getBadge() {
|
||||
return badge;
|
||||
}
|
||||
|
||||
public void setBadge(String badge) {
|
||||
this.badge = badge;
|
||||
}
|
||||
|
||||
public boolean isHasPrettyErbanNo() {
|
||||
return hasPrettyErbanNo;
|
||||
}
|
||||
|
||||
public void setHasPrettyErbanNo(boolean hasPrettyErbanNo) {
|
||||
this.hasPrettyErbanNo = hasPrettyErbanNo;
|
||||
}
|
||||
|
||||
public NobleInfo getNobleUsers() {
|
||||
return nobleUsers;
|
||||
}
|
||||
|
||||
public void setNobleUsers(NobleInfo nobleUsers) {
|
||||
this.nobleUsers = nobleUsers;
|
||||
}
|
||||
|
||||
public UserLevelVo getUserLevelVo() {
|
||||
return userLevelVo;
|
||||
}
|
||||
|
||||
public void setUserLevelVo(UserLevelVo userLevelVo) {
|
||||
this.userLevelVo = userLevelVo;
|
||||
}
|
||||
|
||||
public ArrayList<BannerInfo> getBannerInfos() {
|
||||
return bannerInfos;
|
||||
}
|
||||
|
||||
public void setBannerInfos(ArrayList<BannerInfo> bannerInfos) {
|
||||
this.bannerInfos = bannerInfos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return ListUtils.isListEmpty(bannerInfos)?NORMAL:BANNER;
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by chenran on 2017/10/4.
|
||||
*/
|
||||
|
||||
public class HomeRoomList implements Serializable{
|
||||
private List<HomeRoom> recomRooms;
|
||||
private List<HomeRoom> gameRooms;
|
||||
private List<HomeRoom> chatRooms;
|
||||
|
||||
public List<HomeRoom> getRecomRooms() {
|
||||
return recomRooms;
|
||||
}
|
||||
|
||||
public void setRecomRooms(List<HomeRoom> recomRooms) {
|
||||
this.recomRooms = recomRooms;
|
||||
}
|
||||
|
||||
public List<HomeRoom> getGameRooms() {
|
||||
return gameRooms;
|
||||
}
|
||||
|
||||
public void setGameRooms(List<HomeRoom> gameRooms) {
|
||||
this.gameRooms = gameRooms;
|
||||
}
|
||||
|
||||
public List<HomeRoom> getChatRooms() {
|
||||
return chatRooms;
|
||||
}
|
||||
|
||||
public void setChatRooms(List<HomeRoom> chatRooms) {
|
||||
this.chatRooms = chatRooms;
|
||||
}
|
||||
}
|
@@ -1,158 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 首页排行信息 </p>
|
||||
* Created by Administrator on 2017/11/8.
|
||||
*/
|
||||
public class RankingInfo implements Parcelable {
|
||||
|
||||
public List<Ranking> starList;
|
||||
public List<Ranking> nobleList;
|
||||
public List<Ranking> roomList;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RankingInfo{" +
|
||||
"starList=" + starList +
|
||||
", nobleList=" + nobleList +
|
||||
", roomList=" + roomList +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class Ranking implements Parcelable {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Ranking{" +
|
||||
"erbanNo=" + erbanNo +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", nick='" + nick + '\'' +
|
||||
", gender=" + gender +
|
||||
", totalNum=" + totalNum +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* erbanNo : 850379
|
||||
* avatar : https://nos.netease.com/nim/NDI3OTA4NQ==/bmltYV83Nzg4MzQyNDJfMTUwNzIwMzM4NTc2N184YmJlZmQ4ZS01YzdiLTRmMWMtYmFhOC0xMWRlNzg3MzRlMzk=
|
||||
* nick : 阿拉善
|
||||
* gender : 1
|
||||
* totalNum : 9988923
|
||||
*/
|
||||
|
||||
private int erbanNo;
|
||||
private String avatar;
|
||||
private String nick;
|
||||
private int gender;
|
||||
private int totalNum;
|
||||
|
||||
protected Ranking(Parcel in) {
|
||||
erbanNo = in.readInt();
|
||||
avatar = in.readString();
|
||||
nick = in.readString();
|
||||
gender = in.readInt();
|
||||
totalNum = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(erbanNo);
|
||||
dest.writeString(avatar);
|
||||
dest.writeString(nick);
|
||||
dest.writeInt(gender);
|
||||
dest.writeInt(totalNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<Ranking> CREATOR = new Creator<Ranking>() {
|
||||
@Override
|
||||
public Ranking createFromParcel(Parcel in) {
|
||||
return new Ranking(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ranking[] newArray(int size) {
|
||||
return new Ranking[size];
|
||||
}
|
||||
};
|
||||
|
||||
public int getErbanNo() {
|
||||
return erbanNo;
|
||||
}
|
||||
|
||||
public void setErbanNo(int erbanNo) {
|
||||
this.erbanNo = erbanNo;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(int gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public int getTotalNum() {
|
||||
return totalNum;
|
||||
}
|
||||
|
||||
public void setTotalNum(int totalNum) {
|
||||
this.totalNum = totalNum;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected RankingInfo(Parcel in) {
|
||||
starList = in.createTypedArrayList(Ranking.CREATOR);
|
||||
nobleList = in.createTypedArrayList(Ranking.CREATOR);
|
||||
roomList = in.createTypedArrayList(Ranking.CREATOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeTypedList(starList);
|
||||
dest.writeTypedList(nobleList);
|
||||
dest.writeTypedList(roomList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<RankingInfo> CREATOR = new Creator<RankingInfo>() {
|
||||
@Override
|
||||
public RankingInfo createFromParcel(Parcel in) {
|
||||
return new RankingInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RankingInfo[] newArray(int size) {
|
||||
return new RankingInfo[size];
|
||||
}
|
||||
};
|
||||
}
|
@@ -1,118 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.home.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p> tab 标签数据 </p>
|
||||
*
|
||||
* @author Administrator
|
||||
* @date 2017/11/21
|
||||
*/
|
||||
@Data
|
||||
public class TabInfo implements Parcelable {
|
||||
|
||||
/**
|
||||
* id : 8
|
||||
* name : 聊天
|
||||
* pict : https://image.zhongjialx.com/tag%E8%81%8A%E5%A4%A9.png
|
||||
* seq : 3
|
||||
* type : 1
|
||||
* status : true
|
||||
* istop : true
|
||||
* createTime : 1511155717000
|
||||
*/
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String pict;
|
||||
private String icon;
|
||||
private int seq;
|
||||
private int type;
|
||||
private boolean status;
|
||||
private boolean istop;
|
||||
private long createTime;
|
||||
|
||||
public TabInfo(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public TabInfo(int id, String name,String icon) {
|
||||
this(id, name);
|
||||
this.icon=icon;
|
||||
}
|
||||
|
||||
|
||||
protected TabInfo(Parcel in) {
|
||||
id = in.readInt();
|
||||
name = in.readString();
|
||||
pict = in.readString();
|
||||
seq = in.readInt();
|
||||
type = in.readInt();
|
||||
status = in.readByte() != 0;
|
||||
istop = in.readByte() != 0;
|
||||
createTime = in.readLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(id);
|
||||
dest.writeString(name);
|
||||
dest.writeString(pict);
|
||||
dest.writeInt(seq);
|
||||
dest.writeInt(type);
|
||||
dest.writeByte((byte) (status ? 1 : 0));
|
||||
dest.writeByte((byte) (istop ? 1 : 0));
|
||||
dest.writeLong(createTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<TabInfo> CREATOR = new Creator<TabInfo>() {
|
||||
@Override
|
||||
public TabInfo createFromParcel(Parcel in) {
|
||||
return new TabInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TabInfo[] newArray(int size) {
|
||||
return new TabInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
public static List<TabInfo> getMsTabDefaultList() {
|
||||
List<TabInfo> tabInfoList = new ArrayList<>();
|
||||
tabInfoList.add(new TabInfo(1, "新秀","https://img.letusmix.com/xinxiu_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(2, "遇见","https://img.letusmix.com/xiehou_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(3, "交友","https://img.letusmix.com/jiaoyou_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(4, "娱乐","https://img.letusmix.com/yule_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(5, "音乐","https://img.letusmix.com/yinyue_tag_icon.png"));
|
||||
tabInfoList.add(new TabInfo(6, "电台","https://img.letusmix.com/diantai_tag_icon.png"));
|
||||
return tabInfoList;
|
||||
}
|
||||
|
||||
|
||||
public static List<TabInfo> getTabCheckVersion() {
|
||||
List<TabInfo> tabInfoList = new ArrayList<>();
|
||||
tabInfoList.add(new TabInfo(16, "邂逅","https://img.letusmix.com/xiehou_tag_icon.png"));
|
||||
return tabInfoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TabInfo{" +
|
||||
"name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.version;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.bean.VersionInfo;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* create by lvzebiao on 2018/9/14
|
||||
*/
|
||||
public interface IVersionModel extends IModel{
|
||||
|
||||
Single<VersionInfo> getVersion(@Query("version") String version);
|
||||
|
||||
}
|
@@ -1,48 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.version;
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.VersionInfo;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* create by lvzebiao on 2018/9/14
|
||||
* updated by MadisonRong on 2018/9/26
|
||||
*/
|
||||
public class VersionModel extends BaseModel implements IVersionModel{
|
||||
|
||||
private Api api;
|
||||
|
||||
private VersionModel() {
|
||||
api = RxNet.create(Api.class);
|
||||
}
|
||||
|
||||
public static VersionModel get() {
|
||||
return VersionModelHolder.instance;
|
||||
}
|
||||
|
||||
private static class VersionModelHolder {
|
||||
private static VersionModel instance = new VersionModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<VersionInfo> getVersion(String version) {
|
||||
return api.getVersion(version)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
/**
|
||||
*版本
|
||||
*/
|
||||
@GET("version/get")
|
||||
Single<ServiceResult<VersionInfo>> getVersion(@Query("version") String version);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user