diff --git a/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java b/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java
index 23557d78e..207accd38 100644
--- a/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java
+++ b/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java
@@ -6,6 +6,7 @@ import android.util.Log;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
+import com.yunbao.common.R;
import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.interfaces.CommonCallback;
@@ -59,7 +60,7 @@ public class GiftCacheUtil {
} else {
DownloadUtil downloadUtil = new DownloadUtil();
if (forwhat.equals("1")) {
- ToastUtil.show("礼物正在获取中...");
+ ToastUtil.show(R.string.gift_way);
}
downloadUtil.download(CommonHttpConsts.DOWNLOAD_GIF, dir, fileName, url, new DownloadUtil.Callback() {
String TAG="下载";
diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml
index 96b1d70fb..800292db6 100644
--- a/common/src/main/res/values/strings.xml
+++ b/common/src/main/res/values/strings.xml
@@ -964,4 +964,5 @@
畫質選擇
更多設置
查看更多
+ 礼物正在获取中...
diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
index 696f41a63..f2e4b922f 100644
--- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
@@ -319,7 +319,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//接口整合新加参数
private GuardUserModel guardUserModel;
-
+ private ViewFlipper flipper;
public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) {
super(context, parentView);
Contexts = context;
@@ -694,7 +694,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mic_view = (RelativeLayout) findViewById(R.id.mic_view);
mic_view1 = (RelativeLayout) findViewById(R.id.mic_view1);
mic_view2 = (RelativeLayout) findViewById(R.id.mic_view2);
-
+ flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
mic_ico = (ImageView) findViewById(R.id.mic_ico);
newMessage = (ImageView) findViewById(R.id.new_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) {
- 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 textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textParams.leftMargin = DpUtil.dp2px(5);
@@ -1534,7 +1536,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 初始化小时榜
*/
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 textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textParams.leftMargin = DpUtil.dp2px(5);
@@ -2475,8 +2479,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 刷新用户列表
*/
public void refreshUserList(JSONObject obj) {
- List list = GsonUtils.fromJson(obj.getString("userlist"), new TypeToken>() {
- }.getType());
+ List list = JSON.parseArray(obj.getString("userlist"), LiveUserGiftBean.class);
mLiveUserAdapter.refreshList(list);
}
diff --git a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java
index 7d598b45a..e7b0d026a 100644
--- a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java
+++ b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java
@@ -154,12 +154,18 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
private MainStartChooseCallback mMainStartChooseCallback = new MainStartChooseCallback() {
@Override
public void onLiveClick() {
- mProcessResultUtil.requestPermissions(new String[]{
- Manifest.permission.READ_EXTERNAL_STORAGE,
- Manifest.permission.WRITE_EXTERNAL_STORAGE,
- Manifest.permission.CAMERA,
- Manifest.permission.RECORD_AUDIO
- }, mStartLiveRunnable);
+ boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
+ if (isAnchor) {
+ mProcessResultUtil.requestPermissions(new String[]{
+ Manifest.permission.READ_EXTERNAL_STORAGE,
+ Manifest.permission.WRITE_EXTERNAL_STORAGE,
+ Manifest.permission.CAMERA,
+ Manifest.permission.RECORD_AUDIO
+ }, mStartLiveRunnable);
+ } else {
+ ToastUtil.show(getString(R.string.only_open_anchor));
+ }
+
}
@Override