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 88801f6bd..0348168f1 100644 --- a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java @@ -1,6 +1,7 @@ package com.yunbao.common.fragment; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -19,6 +20,7 @@ import com.yunbao.common.bean.WishModel2; import com.yunbao.common.event.LiveNewWishListCloseEvent; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; @@ -34,7 +36,11 @@ public class LiveNewWishListFragment extends BaseFragment { private RecyclerView wishList; private LiveNewWishAdapter liveNewWishAdapter; private ImageView imageView2, tvDone; + private CommonCallback mSetResultCallback ; + public void setResultCallback(CommonCallback mCommonCallback) { + this.mSetResultCallback = mCommonCallback; + } @Override public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) { return layoutInflater.inflate(R.layout.view_live_new_wish, viewGroup, false); @@ -151,6 +157,9 @@ public class LiveNewWishListFragment extends BaseFragment { @Override public void onSuccess(String data) { ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success"); + if (mSetResultCallback!=null){ + mSetResultCallback.callback(true); + } } @Override @@ -183,6 +192,10 @@ public class LiveNewWishListFragment extends BaseFragment { @Override public void onSuccess(String data) { ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success"); + //这里需要通知刷新心愿信息 + if (mSetResultCallback!=null){ + mSetResultCallback.callback(true); + } } @Override @@ -202,6 +215,9 @@ public class LiveNewWishListFragment extends BaseFragment { @Override public void onSuccess(String data) { ToastUtil.show(WordUtil.isNewZh()?"修改成功":"Success"); + if (mSetResultCallback!=null){ + mSetResultCallback.callback(true); + } } @Override 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 b0f409204..af38b6a8f 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java @@ -2,6 +2,8 @@ package com.yunbao.common.views; import android.graphics.Color; import android.text.TextUtils; +import android.util.Log; +import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -28,6 +30,7 @@ import com.yunbao.common.event.PopupViewDismissEvent; import com.yunbao.common.fragment.LiveNewWishListFragment; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; @@ -61,6 +64,12 @@ public class LiveNewWishListPopup extends BottomPopupView { private LiveNewWishListFragment dayWishFragment, zhouXinFragment, lunarWishFragment, seasonalWishFragment; private ImageView wishListTop; + private CommonCallback mSetResultCallback ; + + public void setResultCallback(CommonCallback mCommonCallback) { + this.mSetResultCallback = mCommonCallback; + } + public LiveNewWishListPopup(@NonNull FragmentActivity context) { super(context); mContext = context; @@ -198,6 +207,10 @@ public class LiveNewWishListPopup extends BottomPopupView { zhouXinFragment = LiveNewWishListFragment.newInstance(2); lunarWishFragment = LiveNewWishListFragment.newInstance(3); seasonalWishFragment = LiveNewWishListFragment.newInstance(4); + dayWishFragment.setResultCallback(mSetResultCallback); + zhouXinFragment.setResultCallback(mSetResultCallback); + lunarWishFragment.setResultCallback(mSetResultCallback); + seasonalWishFragment.setResultCallback(mSetResultCallback); ViewList.add(dayWishFragment); ViewList.add(zhouXinFragment); ViewList.add(lunarWishFragment); diff --git a/common/src/main/res/values-en-rUS/strings.xml b/common/src/main/res/values-en-rUS/strings.xml index f3e7c73d0..b65faa9cc 100644 --- a/common/src/main/res/values-en-rUS/strings.xml +++ b/common/src/main/res/values-en-rUS/strings.xml @@ -1504,7 +1504,7 @@ Limited ride And limited avatar frame Notice Start Q&A Language Settings - openVip + open Vip After this setting, all robot languages will be covered by translation, please confirm whether this operation is completed! return diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 3ccf33fc5..ab2c7a76e 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1447,7 +1447,7 @@ Limited ride And limited avatar frame Game Notice Start Q&A - openVip + open Vip Language Settings After this setting, all robot languages will be covered by translation, please confirm whether this operation is completed! diff --git a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java index 9ffffe5c7..81455f0bd 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java @@ -68,6 +68,7 @@ import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.LiveHttpConsts; import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.MicUserManager; import com.yunbao.common.manager.MicedUserManager; @@ -588,6 +589,14 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl } + private CommonCallback resultCallBack = new CommonCallback() { + @Override + public void callback(Boolean bean) { + if(true && mLiveRoomViewHolder!=null){ + mLiveRoomViewHolder.initWishData(); + } + } + }; /** * 打开心愿单窗口 */ @@ -596,10 +605,11 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl // if (mContext instanceof LiveRyAnchorActivity) { // fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveWishListDialogFragment"); // } + LiveNewWishListPopup popup= new LiveNewWishListPopup(LiveSwAnchorActivity.this); + popup.setResultCallback(resultCallBack); new XPopup.Builder(mContext) .enableDrag(false) - .asCustom(new LiveNewWishListPopup(LiveSwAnchorActivity.this)) - + .asCustom(popup) .show(); }