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对象