add 新增消息设置
add 新增消息-语音设置 add 新增接单设置
This commit is contained in:
@@ -221,5 +221,8 @@ dependencies {
|
||||
//samsung插件包
|
||||
api project(':IAP6Helper')
|
||||
|
||||
//時間選擇器
|
||||
api 'com.contrarywind:Android-PickerView:4.1.9'
|
||||
|
||||
|
||||
}
|
||||
|
||||
25
common/src/main/java/com/yunbao/common/bean/AvatarBean.java
Normal file
25
common/src/main/java/com/yunbao/common/bean/AvatarBean.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class AvatarBean extends BaseModel {
|
||||
private String avatar;
|
||||
private String avatarThumb;
|
||||
|
||||
public AvatarBean() {
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getAvatarThumb() {
|
||||
return avatarThumb;
|
||||
}
|
||||
|
||||
public void setAvatarThumb(String avatarThumb) {
|
||||
this.avatarThumb = avatarThumb;
|
||||
}
|
||||
}
|
||||
101
common/src/main/java/com/yunbao/common/bean/MessageHiBean.java
Normal file
101
common/src/main/java/com/yunbao/common/bean/MessageHiBean.java
Normal file
@@ -0,0 +1,101 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MessageHiBean extends BaseModel {
|
||||
public static final int TYPE_TEXT = 1;
|
||||
public static final int TYPE_IMAGE = 2;
|
||||
public static final int TYPE_AUDIO = 3;
|
||||
private int id;
|
||||
private int uid;
|
||||
private String content;
|
||||
private int duration;
|
||||
private String base64;
|
||||
private int type;
|
||||
private long createTime;
|
||||
private long updateTime;
|
||||
private int status;
|
||||
|
||||
// Getter方法
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public String getBase64() {
|
||||
return base64;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public long getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
// Setter方法
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public void setBase64(String base64) {
|
||||
this.base64 = base64;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setCreateTime(long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(long updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
// 转换时间戳为Date(可选)
|
||||
public Date getCreateTimeAsDate() {
|
||||
return new Date(createTime * 1000); // 假设时间戳是秒单位
|
||||
}
|
||||
|
||||
public Date getUpdateTimeAsDate() {
|
||||
return new Date(updateTime * 1000); // 假设时间戳是秒单位
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,12 @@ public class MessageUserInfoBean extends BaseModel{
|
||||
private String career;
|
||||
private String height;
|
||||
private String age;
|
||||
@SerializedName("open_off")
|
||||
private int openOff;//接单设置 1开启 2关闭
|
||||
|
||||
public int getOpenOff() {
|
||||
return openOff;
|
||||
}
|
||||
|
||||
public String getAge() {
|
||||
if(StringUtil.isEmpty(age)){
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.AvatarBean;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
@@ -45,6 +46,7 @@ import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.bean.MedalAchievementModel;
|
||||
import com.yunbao.common.bean.MessageChatIsAnchor;
|
||||
import com.yunbao.common.bean.MessageChatUserBean;
|
||||
import com.yunbao.common.bean.MessageHiBean;
|
||||
import com.yunbao.common.bean.MessageUserInfoBean;
|
||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||
import com.yunbao.common.bean.NewPeopleInfo;
|
||||
@@ -81,10 +83,14 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
@@ -1169,17 +1175,68 @@ public interface PDLiveApi {
|
||||
|
||||
@GET("/api/public/?service=Pdluser.friend")
|
||||
Observable<ResponseModel<List<MessageChatUserBean>>> getPdluserFriend(@Query("p") int p);
|
||||
|
||||
@GET("/api/public/?service=Pdluser.follow")
|
||||
Observable<ResponseModel<List<MessageChatUserBean>>> getPdluserFollow(@Query("p") int p);
|
||||
|
||||
@GET("/api/public/?service=Pdluser.fans")
|
||||
Observable<ResponseModel<List<MessageChatUserBean>>> getPdluserFans(@Query("p") int p);
|
||||
|
||||
@GET("/api/public/?service=Pdluser.search")
|
||||
Observable<ResponseModel<List<MessageChatUserBean>>> addressBookSearch(@Query("user_nicename") String key);
|
||||
|
||||
@GET("/api/public/?service=Pdlinfos.getOtherInfo")
|
||||
Observable<ResponseModel<MessageUserInfoBean>> getOtherInfo(@Query("tuid") String tuid);
|
||||
|
||||
@GET("/api/public/?service=Userhome.getUserHomeBanner")
|
||||
Observable<ResponseModel<List<String>>> getUserHomeBanner(@Query("select_uid") String tuid);
|
||||
|
||||
@GET("/api/public/?service=Pdlinfos.getIsAnchor")
|
||||
Observable<ResponseModel<MessageChatIsAnchor>> getIsAnchor();
|
||||
|
||||
@GET("/api/public/?service=Pdlinfos.getText")
|
||||
Observable<ResponseModel<List<MessageHiBean>>> getHiConfig();
|
||||
|
||||
@POST("/api/public/?service=Pdlinfos.addText")
|
||||
Observable<ResponseModel<List<BaseModel>>> setHiConfig(
|
||||
@Body JSONObject content,
|
||||
@Query("uid")String uid,
|
||||
@Query("token")String token
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Pdlinfos.editText")
|
||||
Observable<ResponseModel<List<BaseModel>>> updateHiConfig(
|
||||
@Query("id") int id,
|
||||
@Query("content") String content,
|
||||
@Query("type") int type,
|
||||
@Query("duration") int duration,
|
||||
@Query("status") int status
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Pdlinfos.delText")
|
||||
Observable<ResponseModel<List<BaseModel>>> delHiConfig(
|
||||
@Query("id") int id
|
||||
);
|
||||
@Multipart
|
||||
@POST("/api/public/?service=Friendappinfos.updateAvatar")
|
||||
Observable<ResponseModel<AvatarBean>> updateFile(@Part MultipartBody.Part file, @Query("uid") String uid, @Query("token") String token);
|
||||
@Multipart
|
||||
@POST("/api/public/?service=Pdlinfos.updateMp3")
|
||||
Observable<ResponseModel<AvatarBean>> updateFileToMp3(@Part MultipartBody.Part file, @Query("uid") String uid, @Query("token") String token);
|
||||
@GET("/api/public/?service=Pdlinfos.setInfo")
|
||||
Observable<ResponseModel<List<BaseModel>>> initUserInfo(
|
||||
@Query("sex") int sex,
|
||||
@Query("user_nicename") String user_nicename,
|
||||
@Query("avatar") String avatar,
|
||||
@Query("birthday") String birthday
|
||||
);
|
||||
|
||||
/**
|
||||
* 接单设置
|
||||
* @param status 1开启 2关闭
|
||||
*/
|
||||
@GET("/api/public/?service=Pdlinfos.setOpenOff")
|
||||
Observable<ResponseModel<List<BaseModel>>> setOpenOff(
|
||||
@Query("open_off") int status
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,12 @@ import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AvatarBean;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BattlePassPoints;
|
||||
import com.yunbao.common.bean.BattlePassTask;
|
||||
@@ -28,6 +31,7 @@ import com.yunbao.common.bean.GiftNamingInfoModel;
|
||||
import com.yunbao.common.bean.GiftWallGiftDetail;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
@@ -45,6 +49,7 @@ import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.bean.MedalAchievementModel;
|
||||
import com.yunbao.common.bean.MessageChatIsAnchor;
|
||||
import com.yunbao.common.bean.MessageChatUserBean;
|
||||
import com.yunbao.common.bean.MessageHiBean;
|
||||
import com.yunbao.common.bean.MessageUserInfoBean;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
@@ -76,8 +81,10 @@ import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -87,6 +94,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
|
||||
/**
|
||||
@@ -2774,7 +2785,7 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void addChatCount(String stream,HttpCallback<HttpCallbackModel> callback) {
|
||||
public void addChatCount(String stream, HttpCallback<HttpCallbackModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.addChatCount(stream)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -2934,7 +2945,8 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
|
||||
}
|
||||
public void getPdluserFriend(int p,HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
|
||||
public void getPdluserFriend(int p, HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getPdluserFriend(p)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -2953,7 +2965,8 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getPdluserFollow(int p,HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
|
||||
public void getPdluserFollow(int p, HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getPdluserFollow(p)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -2972,7 +2985,8 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getPdluserFans(int p,HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
|
||||
public void getPdluserFans(int p, HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getPdluserFans(p)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -2991,7 +3005,8 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void addressBookSearch(String search,HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
|
||||
public void addressBookSearch(String search, HttpCallback<List<MessageChatUserBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.addressBookSearch(search)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -3010,7 +3025,8 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getOtherInfo(String touid,HttpCallback<MessageUserInfoBean> callback) {
|
||||
|
||||
public void getOtherInfo(String touid, HttpCallback<MessageUserInfoBean> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getOtherInfo(touid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -3029,7 +3045,8 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getUserHomeBanner(String search,HttpCallback<List<String>> callback) {
|
||||
|
||||
public void getUserHomeBanner(String search, HttpCallback<List<String>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getUserHomeBanner(search)
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -3068,6 +3085,190 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getHiConfig(HttpCallback<List<MessageHiBean>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getHiConfig()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void setHiConfig(
|
||||
JSONObject content,
|
||||
HttpCallback<List<BaseModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setHiConfig(content, CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void updateHiConfig(
|
||||
int id,
|
||||
String content,
|
||||
int type,
|
||||
int duration,
|
||||
HttpCallback<List<BaseModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.updateHiConfig(id, content, type, duration, 1)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void delHiConfig(
|
||||
int id,
|
||||
HttpCallback<List<BaseModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.delHiConfig(id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void updateFile(File file, HttpCallback<AvatarBean> callback) {
|
||||
MultipartBody.Part uploadFile = createUploadFile(file);
|
||||
API.get().pdLiveApi(mContext)
|
||||
.updateFile(uploadFile, CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<AvatarBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<AvatarBean> model) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(model.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void updateFileToMp3(File file, HttpCallback<AvatarBean> callback) {
|
||||
MultipartBody.Part uploadFile = createUploadFile(file);
|
||||
API.get().pdLiveApi(mContext)
|
||||
.updateFileToMp3(uploadFile, CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<AvatarBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<AvatarBean> model) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(model.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void initUserInfo(
|
||||
int sex,
|
||||
String user_nicename,
|
||||
String avatar,
|
||||
String birthday,
|
||||
HttpCallback<List<BaseModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.initUserInfo(sex, user_nicename, avatar, birthday)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void setOpenOff(
|
||||
int status,
|
||||
HttpCallback<List<BaseModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setOpenOff(status)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(roomMicStatusModelResponseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
throwable.printStackTrace();
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
private MultipartBody.Part createUploadFile(File file) {
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -1,16 +1,38 @@
|
||||
package com.yunbao.common.interfaces;
|
||||
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.AvatarBean;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/29.
|
||||
*/
|
||||
|
||||
public interface ImageResultCallback {
|
||||
public abstract class ImageResultCallback {
|
||||
//跳转相机前执行
|
||||
void beforeCamera();
|
||||
public void beforeCamera() {
|
||||
}
|
||||
|
||||
void onSuccess(File file);
|
||||
public void onSuccess(File file) {
|
||||
}
|
||||
|
||||
void onFailure();
|
||||
public void onFailure() {
|
||||
}
|
||||
|
||||
public void onSuccessToUrl(File file, OnItemClickListener<String> listener) {
|
||||
LiveNetManager.get(CommonAppContext.getTopActivity())
|
||||
.updateFile(file, new com.yunbao.common.http.base.HttpCallback<AvatarBean>() {
|
||||
@Override
|
||||
public void onSuccess(AvatarBean data) {
|
||||
listener.onItemClick(data.getAvatar(), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
listener.onItemClick(null, -1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,7 @@ public class ViewUtils {
|
||||
public static <T extends View> T findViewById(View view,int id,Class<T> clazz){
|
||||
return view.findViewById(id);
|
||||
}
|
||||
public static <T extends View> T findViewById(View view,int id){
|
||||
return view.findViewById(id);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
common/src/main/res/drawable/bg_msg_more.9.png
Normal file
BIN
common/src/main/res/drawable/bg_msg_more.9.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 932 B |
Reference in New Issue
Block a user