心愿单审核和贵族购买

This commit is contained in:
18142669586
2023-04-08 17:27:26 +08:00
parent 9c3fbe0506
commit 8ae58e9c14
6 changed files with 55 additions and 3 deletions

View File

@@ -1345,6 +1345,23 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
}
public void openNewBuyGuardWindow(String by) {
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGuardInfo == null) {
return;
}
LiveNewGuardBuyDialogFragment fragment = new LiveNewGuardBuyDialogFragment();
fragment.setLiveGuardInfo(mLiveGuardInfo);
Bundle bundle = new Bundle();
bundle.putString(Constants.COIN_NAME, mCoinName);
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.LIVE_ANCHER_NAME, mAncherName);
bundle.putString(Constants.STREAM, mStream);
bundle.putString(Constants.LIVE_ANCHER_ICON, mAncherIcon);
bundle.putString(Constants.USER_ICON, CommonAppConfig.getInstance().getUserBean().getAvatar());
bundle.putString("by", by);
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
}
/**
* 打开购买守护的弹窗
*/

View File

@@ -29,6 +29,7 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
@@ -558,7 +559,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
public void scrollToBottom() {
if (mList.size() > 0) {
mRecyclerView.smoothScrollToPosition(getItemCount() - 1);
mRecyclerView.smoothScrollToPosition(getItemCount());
}
mRecyclerViewScrolledDy = 0;
}

View File

@@ -21,6 +21,7 @@ import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -28,9 +29,11 @@ import androidx.fragment.app.FragmentManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.JsWishBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.HttpCallback;
@@ -44,6 +47,7 @@ import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.activity.ZhuangBanActivity;
import com.yunbao.live.event.LiveRoomChangeEvent;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
@@ -357,6 +361,15 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
);
}
//守護
}else if(TextUtils.equals(event.getMethod(), "BuyProtection")){
((LiveActivity) mContext).openNewBuyGuardWindow(event.getData());
}else if(TextUtils.equals(event.getMethod(), "BuyVIP")){
UserBean u = CommonAppConfig.getInstance().getUserBean();
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname="
+ u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&uid="
+ CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&active="+event.getData();
ZhuangBanActivity.forward(mContext, url, false);
}
}
}

View File

@@ -198,7 +198,11 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
mGuardRightAdapter.setList(mRightList);
buyItemsAdapter.notifyDataSetChanged();
refreshList(1);
if(bundle.getString("by")!=null){
refreshList(Integer.parseInt(bundle.getString("by"))-1);
}else{
refreshList(1);
}
} else {
ToastUtil.show(msg);
@@ -275,6 +279,8 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
}
}
mGuardRightAdapter.notifyDataSetChanged();
buyItemsAdapter.changeItem(index);
buyItemsAdapter.notifyDataSetChanged();
// mBtnBuy.setEnabled(mCoinVal >= guardBuyBean.getCoin());
}