合并接口第五次次上传

This commit is contained in:
18401019693 2022-11-26 16:12:22 +08:00
parent 2843131151
commit 3bdee09402
4 changed files with 24 additions and 13 deletions

View File

@ -6,6 +6,7 @@ import android.util.Log;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.R;
import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
@ -59,7 +60,7 @@ public class GiftCacheUtil {
} else { } else {
DownloadUtil downloadUtil = new DownloadUtil(); DownloadUtil downloadUtil = new DownloadUtil();
if (forwhat.equals("1")) { if (forwhat.equals("1")) {
ToastUtil.show("礼物正在获取中..."); ToastUtil.show(R.string.gift_way);
} }
downloadUtil.download(CommonHttpConsts.DOWNLOAD_GIF, dir, fileName, url, new DownloadUtil.Callback() { downloadUtil.download(CommonHttpConsts.DOWNLOAD_GIF, dir, fileName, url, new DownloadUtil.Callback() {
String TAG="下载"; String TAG="下载";

View File

@ -964,4 +964,5 @@
<string name="image_quality_selection" translatable="false">畫質選擇</string> <string name="image_quality_selection" translatable="false">畫質選擇</string>
<string name="more_settings" translatable="false">更多設置</string> <string name="more_settings" translatable="false">更多設置</string>
<string name="moer">查看更多</string> <string name="moer">查看更多</string>
<string name="gift_way">礼物正在获取中...</string>
</resources> </resources>

View File

@ -319,7 +319,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//接口整合新加参数 //接口整合新加参数
private GuardUserModel guardUserModel; private GuardUserModel guardUserModel;
private ViewFlipper flipper;
public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) { public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) {
super(context, parentView); super(context, parentView);
Contexts = context; Contexts = context;
@ -694,7 +694,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mic_view = (RelativeLayout) findViewById(R.id.mic_view); mic_view = (RelativeLayout) findViewById(R.id.mic_view);
mic_view1 = (RelativeLayout) findViewById(R.id.mic_view1); mic_view1 = (RelativeLayout) findViewById(R.id.mic_view1);
mic_view2 = (RelativeLayout) findViewById(R.id.mic_view2); mic_view2 = (RelativeLayout) findViewById(R.id.mic_view2);
flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
mic_ico = (ImageView) findViewById(R.id.mic_ico); mic_ico = (ImageView) findViewById(R.id.mic_ico);
newMessage = (ImageView) findViewById(R.id.new_message); newMessage = (ImageView) findViewById(R.id.new_message);
atMessage = (ImageView) findViewById(R.id.at_message); atMessage = (ImageView) findViewById(R.id.at_message);
@ -1488,7 +1488,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
public void initHourRank(RankHourModel model) { public void initHourRank(RankHourModel model) {
ViewFlipper flipper = (ViewFlipper) findViewById(R.id.hour_rank_list); if (flipper.getChildCount()>0){
flipper.removeAllViews();
}
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16)); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16));
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textParams.leftMargin = DpUtil.dp2px(5); textParams.leftMargin = DpUtil.dp2px(5);
@ -1534,7 +1536,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 初始化小时榜 * 初始化小时榜
*/ */
public void initHourRankList() { public void initHourRankList() {
ViewFlipper flipper = (ViewFlipper) findViewById(R.id.hour_rank_list); if (flipper.getChildCount()>0){
flipper.removeAllViews();
}
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16)); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16));
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textParams.leftMargin = DpUtil.dp2px(5); textParams.leftMargin = DpUtil.dp2px(5);
@ -2475,8 +2479,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 刷新用户列表 * 刷新用户列表
*/ */
public void refreshUserList(JSONObject obj) { public void refreshUserList(JSONObject obj) {
List<LiveUserGiftBean> list = GsonUtils.fromJson(obj.getString("userlist"), new TypeToken<List<LiveUserGiftBean>>() { List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlist"), LiveUserGiftBean.class);
}.getType());
mLiveUserAdapter.refreshList(list); mLiveUserAdapter.refreshList(list);
} }

View File

@ -154,12 +154,18 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
private MainStartChooseCallback mMainStartChooseCallback = new MainStartChooseCallback() { private MainStartChooseCallback mMainStartChooseCallback = new MainStartChooseCallback() {
@Override @Override
public void onLiveClick() { public void onLiveClick() {
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
if (isAnchor) {
mProcessResultUtil.requestPermissions(new String[]{ mProcessResultUtil.requestPermissions(new String[]{
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.CAMERA, Manifest.permission.CAMERA,
Manifest.permission.RECORD_AUDIO Manifest.permission.RECORD_AUDIO
}, mStartLiveRunnable); }, mStartLiveRunnable);
} else {
ToastUtil.show(getString(R.string.only_open_anchor));
}
} }
@Override @Override