diff --git a/common/src/main/java/com/yunbao/common/bean/CareerBean.java b/common/src/main/java/com/yunbao/common/bean/CareerBean.java new file mode 100644 index 000000000..405785447 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/CareerBean.java @@ -0,0 +1,76 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class CareerBean extends BaseModel { + int id; + int pid; + @SerializedName("cn_title") + String titleCn; + @SerializedName("en_title") + String titleEn; + @SerializedName("create_time") + long createTime; + @SerializedName("uplong_time") + long uplongTime; + @SerializedName("children") + List children; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getTitleCn() { + return titleCn; + } + + public void setTitleCn(String titleCn) { + this.titleCn = titleCn; + } + + public String getTitleEn() { + return titleEn; + } + + public void setTitleEn(String titleEn) { + this.titleEn = titleEn; + } + + public long getCreateTime() { + return createTime; + } + + public void setCreateTime(long createTime) { + this.createTime = createTime; + } + + public long getUplongTime() { + return uplongTime; + } + + public void setUplongTime(long uplongTime) { + this.uplongTime = uplongTime; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 39a114f28..1f85509a1 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -10,6 +10,7 @@ import com.yunbao.common.bean.BattlePassPoints; import com.yunbao.common.bean.BattlePassTask; import com.yunbao.common.bean.BattlePassUserInfoBean; import com.yunbao.common.bean.BlindBoxInfoModel; +import com.yunbao.common.bean.CareerBean; import com.yunbao.common.bean.CheckLiveModel; import com.yunbao.common.bean.CheckRemainingBalance; import com.yunbao.common.bean.ContributeModel; @@ -1267,4 +1268,24 @@ public interface PDLiveApi { @GET("/api/public/?service=Pdluserhome.getUserHomeInfo") Observable> getUserHomeExhibitInfo(@Query("select_uid") String tuid); + @GET("/api/public/?service=Pdlinfos.getCareer") + Observable>> getCareer(); + + @GET("/api/public/?service=Pdlinfos.setCareer") + Observable>> setCareer( + @Query("career") String career, + @Query("en_career") String en + ); + + @GET("/api/public/?service=Pdlinfos.setHeight") + Observable>> setUserHeight( + @Query("height") String height + ); + + @GET("/api/public/?service=Pdllable.get") + Observable>> getHobby(); + @GET("/api/public/?service=Pdlinfos.setLabel") + Observable>> setHobby( + @Query("labels") String labelsId + ); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 512cf203b..8998844cb 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -15,6 +15,7 @@ import com.yunbao.common.bean.BattlePassPoints; import com.yunbao.common.bean.BattlePassTask; import com.yunbao.common.bean.BattlePassUserInfoBean; import com.yunbao.common.bean.BlindBoxInfoModel; +import com.yunbao.common.bean.CareerBean; import com.yunbao.common.bean.CheckLiveModel; import com.yunbao.common.bean.CheckRemainingBalance; import com.yunbao.common.bean.CoolConfig; @@ -3381,7 +3382,101 @@ public class LiveNetManager { } }).isDisposed(); } - + public void getCareer(HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getCareer() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(roomMicStatusModelResponseModel -> { + if (callback != null) { + callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + public void setCareer(String career,String careerEn, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .setCareer(career,careerEn) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(listResponseModel -> { + if (callback != null) { + callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg())); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + public void setUserHeight(String height, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .setUserHeight(height) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(listResponseModel -> { + if (callback != null) { + callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg())); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + public void getHobby(HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getHobby() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(roomMicStatusModelResponseModel -> { + if (callback != null) { + callback.onSuccess(roomMicStatusModelResponseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + public void setHobby(String ids, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .setHobby(ids) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(listResponseModel -> { + if (callback != null) { + callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg())); + } + }, new Consumer() { + @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); diff --git a/common/src/main/res/layout/view_title_not_color.xml b/common/src/main/res/layout/view_title_not_color.xml new file mode 100644 index 000000000..82f5bf9a9 --- /dev/null +++ b/common/src/main/res/layout/view_title_not_color.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + diff --git a/common/src/main/res/values/style.xml b/common/src/main/res/values/style.xml index c444de78d..0511f2543 100644 --- a/common/src/main/res/values/style.xml +++ b/common/src/main/res/values/style.xml @@ -98,6 +98,13 @@ 15dp @color/white +