From fe2af299cb43a99336c3b31a3f32a882146d49b6 Mon Sep 17 00:00:00 2001 From: hch <16607480311@163.com> Date: Tue, 26 Mar 2024 17:31:45 +0800 Subject: [PATCH] =?UTF-8?q?fix=20[=E4=BF=AE=E5=A4=8D-=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=A2=99=E5=9B=BE=E7=89=87=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/main/activity/UserHomeActivity.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java b/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java index 1cb782ce1..172771662 100644 --- a/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java @@ -5,12 +5,10 @@ import android.annotation.SuppressLint; import android.app.Dialog; import android.content.Intent; import android.content.pm.PackageManager; -import android.database.Cursor; import android.graphics.Color; import android.graphics.Outline; import android.net.Uri; import android.os.Build; -import android.provider.MediaStore; import android.util.SparseArray; import android.view.View; import android.view.ViewOutlineProvider; @@ -271,7 +269,7 @@ public class UserHomeActivity extends AbsActivity { tagList.add(userInfo.getUserHomeTopInfo().getAge() + (WordUtil.isNewZh() ? "歲" : "years old")); } if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getHeight())) { - tagList.add(userInfo.getUserHomeTopInfo().getHeight()+"cm"); + tagList.add(userInfo.getUserHomeTopInfo().getHeight() + "cm"); } if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCareer())) { tagList.add(userInfo.getUserHomeTopInfo().getCareer()); @@ -354,6 +352,9 @@ public class UserHomeActivity extends AbsActivity { public void onConfirmClick(Dialog dialog, String content) { bannerImgList.remove(position); uploadImg(false); + if (bannerImgList.isEmpty()) { + bannerImgList.add(userInfo.getUserHomeTopInfo().getUser_avatar()); + } } }); } @@ -761,6 +762,12 @@ public class UserHomeActivity extends AbsActivity { } private void uploadImg(boolean isUp) { + for (int i = 0; i < bannerImgList.size(); i++) { + if (bannerImgList.get(i).equals(userInfo.getUserHomeTopInfo().getUser_avatar())) { + bannerImgList.remove(i); + break; + } + } CommonHttpUtil.uploadUserInfoImg(new Gson().toJson(bannerImgList), new com.yunbao.common.http.HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) {