From 938bee4fdb195387173bb3f5592862588140b5f1 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 20 Mar 2024 11:03:29 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99-?= =?UTF-8?q?=E8=81=8C=E4=B8=9A=E3=80=81=E8=BA=AB=E9=AB=98=E3=80=81=E7=88=B1?= =?UTF-8?q?=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/bean/CareerBean.java | 76 + .../com/yunbao/common/http/PDLiveApi.java | 21 + .../common/http/live/LiveNetManager.java | 97 +- .../main/res/layout/view_title_not_color.xml | 69 + common/src/main/res/values/style.xml | 7 + main/src/main/AndroidManifest.xml | 1 + .../main/activity/EditProfileActivity.java | 142 +- .../main/activity/EditUserHobbyActivity.java | 126 ++ .../main/adapter/EditUserHobbyAdapter.java | 86 ++ .../main/res/layout/activity_edit_profile.xml | 1324 ++++++++++------- .../res/layout/activity_edit_user_hobby.xml | 76 + .../main/res/layout/item_edit_user_hobby.xml | 15 + .../main/res/mipmap-xxhdpi/ic_edit_avatar.png | Bin 0 -> 1931 bytes .../res/mipmap-xxhdpi/ic_edit_birthday.png | Bin 0 -> 2382 bytes .../main/res/mipmap-xxhdpi/ic_edit_city.png | Bin 0 -> 2948 bytes .../main/res/mipmap-xxhdpi/ic_edit_height.png | Bin 0 -> 2482 bytes .../main/res/mipmap-xxhdpi/ic_edit_hobby.png | Bin 0 -> 2904 bytes .../main/res/mipmap-xxhdpi/ic_edit_name.png | Bin 0 -> 1832 bytes .../res/mipmap-xxhdpi/ic_edit_occupation.png | Bin 0 -> 2786 bytes .../main/res/mipmap-xxhdpi/ic_edit_phone.png | Bin 0 -> 909 bytes .../main/res/mipmap-xxhdpi/ic_edit_sex.png | Bin 0 -> 2554 bytes .../main/res/mipmap-xxhdpi/ic_edit_sign.png | Bin 0 -> 1895 bytes main/src/main/res/values-zh/strings.xml | 5 + main/src/main/res/values/strings.xml | 5 + 24 files changed, 1473 insertions(+), 577 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/CareerBean.java create mode 100644 common/src/main/res/layout/view_title_not_color.xml create mode 100644 main/src/main/java/com/yunbao/main/activity/EditUserHobbyActivity.java create mode 100644 main/src/main/java/com/yunbao/main/adapter/EditUserHobbyAdapter.java create mode 100644 main/src/main/res/layout/activity_edit_user_hobby.xml create mode 100644 main/src/main/res/layout/item_edit_user_hobby.xml create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_avatar.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_birthday.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_city.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_height.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_hobby.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_name.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_occupation.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_phone.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_sex.png create mode 100644 main/src/main/res/mipmap-xxhdpi/ic_edit_sign.png 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 +