From 325d7254f08eb6f9b547644222393002702915d0 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 3 Apr 2023 15:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E5=9B=BE=E8=B5=84=E6=BA=90=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=BF=83=E6=84=BF=E5=8D=95?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/activity/AbsActivity.java | 16 ++++++++-------- .../java/com/yunbao/common/bean/WishModel.java | 6 ++---- .../common/fragment/LiveNewWishListFragment.java | 2 +- .../common/views/LiveNewWishListPopup.java | 2 +- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java index 42fa80d32..e75bf5ae6 100644 --- a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java @@ -43,14 +43,14 @@ public abstract class AbsActivity extends AppCompatActivity { protected List mLifeCycleListeners; protected boolean isFullWindow; -// @Override -// public Resources getResources() { -// Resources res = super.getResources(); -// Configuration config = new Configuration(); -// config.setToDefaults(); -// res.updateConfiguration(config, res.getDisplayMetrics()); -// return res; -// } + @Override + public Resources getResources() { + Resources res = super.getResources(); + Configuration config = new Configuration(); + config.setToDefaults(); + res.updateConfiguration(config, res.getDisplayMetrics()); + return res; + } @Override diff --git a/common/src/main/java/com/yunbao/common/bean/WishModel.java b/common/src/main/java/com/yunbao/common/bean/WishModel.java index 136fbe952..30fb89f69 100644 --- a/common/src/main/java/com/yunbao/common/bean/WishModel.java +++ b/common/src/main/java/com/yunbao/common/bean/WishModel.java @@ -1,7 +1,5 @@ package com.yunbao.common.bean; -import androidx.room.Transaction; - import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -31,8 +29,8 @@ public class WishModel extends BaseModel { private int giftType; @SerializedName("price") private int price; - @SerializedName("isShow") - private transient int isShow = -1; + @Expose(serialize = false) + private int isShow = -1; public int getIsShow() { return isShow; diff --git a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java index 897c19eb9..d87e38c21 100644 --- a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java @@ -105,7 +105,7 @@ public class LiveNewWishListFragment extends BaseFragment { // 1. Gson构造器 GsonBuilder builder = new GsonBuilder(); // 2. 排除使用特定修饰符的字段 - builder.excludeFieldsWithModifiers(Modifier.TRANSIENT); + builder.excludeFieldsWithoutExposeAnnotation(); // 3. 格式良好的输出 builder.setPrettyPrinting(); // 4. 创建Gson对象 diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java index a2b6f830b..c0249092b 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java @@ -291,7 +291,7 @@ public class LiveNewWishListPopup extends BottomPopupView { // 1. Gson构造器 GsonBuilder builder = new GsonBuilder(); // 2. 排除使用特定修饰符的字段 - builder.excludeFieldsWithModifiers(Modifier.TRANSIENT); + builder.excludeFieldsWithoutExposeAnnotation(); // 3. 格式良好的输出 builder.setPrettyPrinting(); // 4. 创建Gson对象