调整礼物包裹UI
This commit is contained in:
parent
06bc518372
commit
1435848f2a
@ -291,7 +291,6 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
SpUtil.setStringValue("userData",info[0]);
|
||||
userInfo = new Gson().fromJson(info[0], IMLoginModel.class);
|
||||
if (!TextUtils.isEmpty(uidAndToken[1])) {
|
||||
userInfo.setToken(uidAndToken[1]);
|
||||
|
@ -977,7 +977,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
GiftCacheUtil.getInstance().resetStatus();
|
||||
GiftCacheUtil.getInstance().downloadAllGift();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,11 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
||||
import static com.yunbao.live.views.LiveRoomViewHolder.bean1;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@ -39,13 +45,13 @@ import com.yunbao.common.bean.LiveGiftBean2;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.NobleUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
@ -65,12 +71,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
||||
import static com.yunbao.live.views.LiveRoomViewHolder.bean1;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/12.
|
||||
@ -285,18 +285,24 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 设置贵族状态
|
||||
*/
|
||||
private void loadUserVip() {
|
||||
String userData = SpUtil.getStringValue("userData");
|
||||
if (userData != null && !userData.isEmpty()) {
|
||||
JSONObject user = JSONObject.parseObject(userData);
|
||||
int nobleId = user.getIntValue("noble_id");
|
||||
int resId = NobleUtil.nobleIdToImageResId(nobleId);
|
||||
if(resId!=-1){
|
||||
mVipGoldIcon.setImageResource(resId);
|
||||
mVipGoldTitle.setText(user.getString("noble_name"));
|
||||
mVipGoldDesc.setText("前往貴族中心");
|
||||
}
|
||||
|
||||
}
|
||||
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
|
||||
.params("uid", IMLoginManager.get(mContext).getUserInfo().getId())
|
||||
.params("token", IMLoginManager.get(mContext).getUserInfo().getToken())
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject user = JSONObject.parseObject(info[0]);
|
||||
int nobleId = user.getIntValue("noble_id");
|
||||
int resId = NobleUtil.nobleIdToImageResId(nobleId);
|
||||
if(resId!=-1){
|
||||
mVipGoldIcon.setImageResource(resId);
|
||||
mVipGoldTitle.setText(user.getString("noble_name"));
|
||||
mVipGoldDesc.setText("前往貴族中心");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void loadGiftListData() {
|
||||
@ -382,11 +388,8 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
if(!GiftCacheUtil.getInstance().isDownloading()){
|
||||
GiftCacheUtil.getInstance().downloadAllGift();
|
||||
}
|
||||
int size = list.size();
|
||||
if (size <= 0) {
|
||||
mVPWrapList.setBackground(getResources().getDrawable(R.mipmap.wrap_empty));
|
||||
} else {
|
||||
mVPWrapList.setBackground(getResources().getDrawable(R.mipmap.bg_gift_list));
|
||||
if (list.size() == 0) {
|
||||
mVPWrapList.setBackgroundResource(R.mipmap.wrap_empty);
|
||||
}
|
||||
showWrapList(list);
|
||||
}
|
||||
@ -520,6 +523,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
mVPWrapList.setVisibility(View.VISIBLE);
|
||||
mRGroupWrap.setVisibility(View.VISIBLE);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -574,7 +578,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
mGiftCountPopupWindow = new PopupWindow(v, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||
mGiftCountPopupWindow.setBackgroundDrawable(new ColorDrawable());
|
||||
mGiftCountPopupWindow.setOutsideTouchable(true);
|
||||
mGiftCountPopupWindow.showAtLocation(mBtnChooseCount, Gravity.BOTTOM | Gravity.RIGHT, DpUtil.dp2px(70), DpUtil.dp2px(40));
|
||||
mGiftCountPopupWindow.showAtLocation(mBtnChooseCount, Gravity.BOTTOM | Gravity.END, DpUtil.dp2px(70), DpUtil.dp2px(40));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -136,7 +136,6 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@mipmap/bg_gift_list"
|
||||
android:visibility="gone" />
|
||||
|
||||
<RadioGroup
|
||||
@ -242,6 +241,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:text="123"
|
||||
app:dt_left_drawable="@mipmap/diamond"
|
||||
app:dt_left_height="20dp"
|
||||
app:dt_left_width="20dp"
|
||||
@ -254,7 +254,7 @@
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/charge"
|
||||
|
@ -237,7 +237,6 @@ public class MainHttpUtil {
|
||||
if (code == 0 && info.length > 0) {
|
||||
IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).upDataUserInfo(info[0]);
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
SpUtil.setStringValue("userData",info[0]);
|
||||
UserBean bean = JSON.toJavaObject(obj, UserBean.class);
|
||||
bean.setMedalName(obj.getString("medal_name"));
|
||||
bean.setMedalLevel(obj.getIntValue("medal_level"));
|
||||
|
Loading…
Reference in New Issue
Block a user