add 编辑资料-职业、身高、爱好

This commit is contained in:
2024-03-20 11:03:29 +08:00
parent 3127a5faaf
commit 938bee4fdb
24 changed files with 1473 additions and 577 deletions

View File

@@ -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<CareerBean> 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<CareerBean> getChildren() {
return children;
}
public void setChildren(List<CareerBean> children) {
this.children = children;
}
}

View File

@@ -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<ResponseModel<HomeUserExhibitInfoBean>> getUserHomeExhibitInfo(@Query("select_uid") String tuid);
@GET("/api/public/?service=Pdlinfos.getCareer")
Observable<ResponseModel<List<CareerBean>>> getCareer();
@GET("/api/public/?service=Pdlinfos.setCareer")
Observable<ResponseModel<List<BaseModel>>> setCareer(
@Query("career") String career,
@Query("en_career") String en
);
@GET("/api/public/?service=Pdlinfos.setHeight")
Observable<ResponseModel<List<BaseModel>>> setUserHeight(
@Query("height") String height
);
@GET("/api/public/?service=Pdllable.get")
Observable<ResponseModel<List<CareerBean>>> getHobby();
@GET("/api/public/?service=Pdlinfos.setLabel")
Observable<ResponseModel<List<BaseModel>>> setHobby(
@Query("labels") String labelsId
);
}

View File

@@ -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<List<CareerBean>> callback) {
API.get().pdLiveApi(mContext)
.getCareer()
.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 setCareer(String career,String careerEn, HttpCallback<HttpCallbackModel> 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<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 setUserHeight(String height, HttpCallback<HttpCallbackModel> 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<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 getHobby(HttpCallback<List<CareerBean>> callback) {
API.get().pdLiveApi(mContext)
.getHobby()
.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 setHobby(String ids, HttpCallback<HttpCallbackModel> 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<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);

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="72dp"
android:paddingTop="24dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/titleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/btn_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:onClick="backClick"
android:padding="9dp"
android:src="@mipmap/icon_back"
android:tint="@color/textColor" />
<ImageView
android:id="@+id/img_more"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:padding="9dp"
android:src="@mipmap/btn_more_black"
android:tint="@color/textColor"
android:visibility="gone" />
<TextView
android:id="@+id/rView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/redPacketMain"
android:layout_marginRight="10dp"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="13sp"
android:textStyle="bold"
android:text="@string/not_received"
android:visibility="gone"
tools:visibility="visible" />
<ImageView
android:id="@+id/redPacketMain"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:visibility="invisible"
app:srcCompat="@mipmap/ic_red_packet_record"
tools:visibility="visible" />
</RelativeLayout>
</FrameLayout>

View File

@@ -98,6 +98,13 @@
<item name="android:paddingRight">15dp</item>
<item name="android:background">@color/white</item>
</style>
<style name="edit_profile_group_not_color" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">45dp</item>
<item name="android:paddingLeft">15dp</item>
<item name="android:paddingRight">15dp</item>
</style>
<style name="Theme.PayssionTrans" parent="Theme.AppCompat.Light">
<item name="android:windowIsTranslucent">true</item>