个人中心
This commit is contained in:
@@ -728,6 +728,10 @@
|
|||||||
android:name=".decoration.view.DecorationStoreActivity"
|
android:name=".decoration.view.DecorationStoreActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.user.UserGiftActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".friend.view.SelectFriendActivity"
|
android:name=".friend.view.SelectFriendActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
@@ -23,7 +23,7 @@ public class CollectionRoomAdapter extends BaseQuickAdapter<CollectionRoomInfo.F
|
|||||||
protected void convert(BaseViewHolder helper, CollectionRoomInfo.FansRoomListBean item) {
|
protected void convert(BaseViewHolder helper, CollectionRoomInfo.FansRoomListBean item) {
|
||||||
|
|
||||||
helper.setText(R.id.tv_room_name,item.getRoomName())
|
helper.setText(R.id.tv_room_name,item.getRoomName())
|
||||||
.setText(R.id.tv_room_id,"ID:"+item.getRoomUid())
|
.setText(R.id.tv_room_id,"ID:"+item.getErbanNo())
|
||||||
.setText(R.id.tv_room_online_num,item.getRoomOnlineNum() +"");
|
.setText(R.id.tv_room_online_num,item.getRoomOnlineNum() +"");
|
||||||
ImageView imageView = helper.getView(R.id.rriv_room_img);
|
ImageView imageView = helper.getView(R.id.rriv_room_img);
|
||||||
ImageLoadUtilsV2.loadImage(imageView, item.getRoomAvatar());
|
ImageLoadUtilsV2.loadImage(imageView, item.getRoomAvatar());
|
||||||
|
@@ -44,6 +44,15 @@ public class CollectionRoomInfo {
|
|||||||
private String roomName;
|
private String roomName;
|
||||||
private int roomOnlineNum;
|
private int roomOnlineNum;
|
||||||
private int roomUid;
|
private int roomUid;
|
||||||
|
private int erbanNo;
|
||||||
|
|
||||||
|
public int getErbanNo() {
|
||||||
|
return erbanNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErbanNo(int erbanNo) {
|
||||||
|
this.erbanNo = erbanNo;
|
||||||
|
}
|
||||||
|
|
||||||
public int getRoomUid() {
|
public int getRoomUid() {
|
||||||
return roomUid;
|
return roomUid;
|
||||||
|
@@ -65,12 +65,7 @@ public class ShowPhotoActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
photoAdapter.setmImageOnclickListener(new PhotoAdapter.imageOnclickListener() {
|
photoAdapter.setmImageOnclickListener(() -> finish());
|
||||||
@Override
|
|
||||||
public void onClick() {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
|
@@ -0,0 +1,25 @@
|
|||||||
|
package com.yizhuan.erban.ui.user;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import com.yizhuan.erban.R;
|
||||||
|
import com.yizhuan.erban.base.BaseActivity;
|
||||||
|
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.Unbinder;
|
||||||
|
|
||||||
|
public class UserGiftActivity extends BaseActivity {
|
||||||
|
|
||||||
|
private UserInfoGiftFragment userInfoGiftFragment;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_user_gift);
|
||||||
|
|
||||||
|
initTitleBar("礼物");
|
||||||
|
userInfoGiftFragment = UserInfoGiftFragment.newInstance();
|
||||||
|
getSupportFragmentManager().beginTransaction().replace(R.id.fl_gift_container, userInfoGiftFragment, "userInfoGiftFragment")
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
}
|
@@ -175,6 +175,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
|||||||
mBinding.ivUserBack.setOnClickListener(this);
|
mBinding.ivUserBack.setOnClickListener(this);
|
||||||
mBinding.ivEdit.setOnClickListener(this);
|
mBinding.ivEdit.setOnClickListener(this);
|
||||||
mBinding.tvEdit.setOnClickListener(this);
|
mBinding.tvEdit.setOnClickListener(this);
|
||||||
|
mBinding.tvGiftDetail.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getUserInfo(){
|
private void getUserInfo(){
|
||||||
@@ -537,6 +538,10 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case R.id.tv_gift_detail:
|
||||||
|
startActivity(new Intent(this,UserGiftActivity.class));
|
||||||
|
break;
|
||||||
|
|
||||||
// /**************** 测试代码 **************/
|
// /**************** 测试代码 **************/
|
||||||
// AVRoomActivity.start(this, 91, mRoomInfo!!.type)
|
// AVRoomActivity.start(this, 91, mRoomInfo!!.type)
|
||||||
}
|
}
|
||||||
|
@@ -48,7 +48,6 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
|||||||
|
|
||||||
private UserInfo userInfo;
|
private UserInfo userInfo;
|
||||||
private long userId = 0;
|
private long userId = 0;
|
||||||
|
|
||||||
private long time;
|
private long time;
|
||||||
|
|
||||||
private List<UserInfoItem> userInfoItems = new ArrayList<>();
|
private List<UserInfoItem> userInfoItems = new ArrayList<>();
|
||||||
@@ -91,9 +90,6 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initiate() {
|
public void initiate() {
|
||||||
|
|
||||||
initUserGiftItems();
|
|
||||||
|
|
||||||
mBinding.rvGift.setLayoutManager(new GridLayoutManager(mContext, 4));
|
mBinding.rvGift.setLayoutManager(new GridLayoutManager(mContext, 4));
|
||||||
userGiftAdapter = new UserGiftAdapter(mContext, userInfoItems);
|
userGiftAdapter = new UserGiftAdapter(mContext, userInfoItems);
|
||||||
userGiftAdapter.bindToRecyclerView(mBinding.rvGift);
|
userGiftAdapter.bindToRecyclerView(mBinding.rvGift);
|
||||||
@@ -103,19 +99,12 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
|||||||
List<UserInfoItem> list = userGiftAdapter.getData();
|
List<UserInfoItem> list = userGiftAdapter.getData();
|
||||||
if (ListUtils.isListEmpty(list))
|
if (ListUtils.isListEmpty(list))
|
||||||
return 4;
|
return 4;
|
||||||
|
|
||||||
UserInfoItem userInfoItem = list.get(position);
|
UserInfoItem userInfoItem = list.get(position);
|
||||||
int type = userInfoItem.getItemType();
|
int type = userInfoItem.getItemType();
|
||||||
if (type == UserInfoItem.TYPE_TITLE
|
if (type == UserInfoItem.TYPE_DIV || type == UserInfoItem.TYPE_GIFT_EMPTY) {
|
||||||
|| type == UserInfoItem.TYPE_MAGIC_ITEMS
|
|
||||||
|| type == UserInfoItem.TYPE_RADISH_ITEMS
|
|
||||||
|| type == UserInfoItem.TYPE_DIV
|
|
||||||
|| type == UserInfoItem.TYPE_GIFT_EMPTY) {
|
|
||||||
return 4;
|
return 4;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -127,13 +116,6 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
|||||||
initData(userInfo);
|
initData(userInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initUserGiftItems() {
|
|
||||||
for (int i = 0; i < 7; i++) {
|
|
||||||
UserInfoItem userInfoItem = new UserInfoItem(UserInfoItem.TYPE_NONE);
|
|
||||||
userInfoItems.add(userInfoItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initData(UserInfo userInfo) {
|
private void initData(UserInfo userInfo) {
|
||||||
if (null != userInfo) {
|
if (null != userInfo) {
|
||||||
Log.i("UserInfoGiftFragment", "not null");
|
Log.i("UserInfoGiftFragment", "not null");
|
||||||
@@ -141,41 +123,6 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
time = System.currentTimeMillis();
|
time = System.currentTimeMillis();
|
||||||
// 获取魔法数据
|
|
||||||
MagicModel.get().getTargetMagicWall(userId)
|
|
||||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
|
||||||
.subscribe(new BeanObserver<List<MagicInfo>>() {
|
|
||||||
@Override
|
|
||||||
public void onErrorMsg(String error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<MagicInfo> magicInfos) {
|
|
||||||
getMagicWallSuccessView(magicInfos);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
RadishGiftModel.get().getRadishWall(userId)
|
|
||||||
.subscribe(new SingleObserver<List<RadishWallInfo>>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<RadishWallInfo> radishWallInfos) {
|
|
||||||
getRadishWallSuccess(radishWallInfos);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
getRadishWallSuccess(null);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
UserModel.get().requestUserGiftWall(userId, 2)
|
UserModel.get().requestUserGiftWall(userId, 2)
|
||||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||||
.subscribe(new BeanObserver<List<GiftWallInfo>>() {
|
.subscribe(new BeanObserver<List<GiftWallInfo>>() {
|
||||||
@@ -189,106 +136,25 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
|||||||
onRequestGiftWall(giftWallInfos);
|
onRequestGiftWall(giftWallInfos);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
NobleInfo nobleInfo = userInfo.getNobleInfo();
|
|
||||||
userGiftAdapter.setNoble(nobleInfo != null);
|
|
||||||
userGiftAdapter.setmTextColor(ContextCompat.getColor(mContext, nobleInfo == null ? R.color.black : R.color.color_333333));
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Log.i("UserInfoGiftFragment", "null");
|
Log.i("UserInfoGiftFragment", "null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getRadishWallSuccess(List<RadishWallInfo> radishWallInfoList) {
|
|
||||||
if (ListUtils.isListEmpty(radishWallInfoList))
|
|
||||||
return;
|
|
||||||
|
|
||||||
int allMagicCounts = 0;
|
|
||||||
for (RadishWallInfo magicInfo : radishWallInfoList) {
|
|
||||||
allMagicCounts += magicInfo.getReceiveCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
GiftTitleInfo giftTitleInfo = new GiftTitleInfo();
|
|
||||||
giftTitleInfo.setTitle("收到的萝卜礼物");
|
|
||||||
giftTitleInfo.setNum(String.valueOf(allMagicCounts));
|
|
||||||
UserInfoItem userInfoItemTitle = userInfoItems.get(3);
|
|
||||||
userInfoItemTitle.setItemType(UserInfoItem.TYPE_TITLE);
|
|
||||||
userInfoItemTitle.setData(giftTitleInfo);
|
|
||||||
|
|
||||||
UserInfoItem userInfoItemList = userInfoItems.get(4);
|
|
||||||
userInfoItemList.setItemType(UserInfoItem.TYPE_RADISH_ITEMS);
|
|
||||||
userInfoItemList.setData((ArrayList<RadishWallInfo>) radishWallInfoList);
|
|
||||||
|
|
||||||
UserInfoItem div = userInfoItems.get(5);
|
|
||||||
div.setItemType(UserInfoItem.TYPE_DIV);
|
|
||||||
|
|
||||||
userGiftAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void getMagicWallSuccessView(List<MagicInfo> magicInfoList) {
|
|
||||||
if (ListUtils.isListEmpty(magicInfoList))
|
|
||||||
return;
|
|
||||||
|
|
||||||
int allMagicCounts = 0;
|
|
||||||
for (MagicInfo magicInfo : magicInfoList) {
|
|
||||||
allMagicCounts += magicInfo.getAmount();
|
|
||||||
}
|
|
||||||
|
|
||||||
GiftTitleInfo giftTitleInfo = new GiftTitleInfo();
|
|
||||||
giftTitleInfo.setTitle("被施展的魔法");
|
|
||||||
giftTitleInfo.setNum(String.valueOf(allMagicCounts));
|
|
||||||
UserInfoItem userInfoItemTitle = userInfoItems.get(0);
|
|
||||||
userInfoItemTitle.setItemType(UserInfoItem.TYPE_TITLE);
|
|
||||||
userInfoItemTitle.setData(giftTitleInfo);
|
|
||||||
|
|
||||||
UserInfoItem userInfoItemList = userInfoItems.get(1);
|
|
||||||
userInfoItemList.setItemType(UserInfoItem.TYPE_MAGIC_ITEMS);
|
|
||||||
userInfoItemList.setData((ArrayList<MagicInfo>) magicInfoList);
|
|
||||||
|
|
||||||
UserInfoItem div = userInfoItems.get(2);
|
|
||||||
div.setItemType(UserInfoItem.TYPE_DIV);
|
|
||||||
|
|
||||||
userGiftAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onRequestGiftWall(List<GiftWallInfo> giftWallInfoList) {
|
private void onRequestGiftWall(List<GiftWallInfo> giftWallInfoList) {
|
||||||
if (userInfo == null) return;
|
if (userInfo == null) return;
|
||||||
|
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
while (userInfoItems.size() > 7) {
|
|
||||||
userInfoItems.remove(7);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ListUtils.isListEmpty(giftWallInfoList)) {
|
if (ListUtils.isListEmpty(giftWallInfoList)) {
|
||||||
GiftTitleInfo giftTitleInfo = new GiftTitleInfo();
|
|
||||||
giftTitleInfo.setTitle("收到的礼物");
|
|
||||||
giftTitleInfo.setNum(String.valueOf(0));
|
|
||||||
UserInfoItem userInfoItemTitle = userInfoItems.get(6);
|
|
||||||
userInfoItemTitle.setItemType(UserInfoItem.TYPE_TITLE);
|
|
||||||
userInfoItemTitle.setData(giftTitleInfo);
|
|
||||||
|
|
||||||
UserInfoItem userInfoItem = new UserInfoItem(UserInfoItem.TYPE_GIFT_EMPTY);
|
UserInfoItem userInfoItem = new UserInfoItem(UserInfoItem.TYPE_GIFT_EMPTY);
|
||||||
userInfoItems.add(userInfoItem);
|
userInfoItems.add(userInfoItem);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int totalCount = 0;
|
|
||||||
for (GiftWallInfo giftWallInfo : giftWallInfoList) {
|
|
||||||
totalCount += giftWallInfo.getReciveCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
GiftTitleInfo giftTitleInfo = new GiftTitleInfo();
|
|
||||||
giftTitleInfo.setTitle("收到的礼物");
|
|
||||||
giftTitleInfo.setNum(String.valueOf(totalCount));
|
|
||||||
UserInfoItem userInfoItemTitle = userInfoItems.get(6);
|
|
||||||
userInfoItemTitle.setItemType(UserInfoItem.TYPE_TITLE);
|
|
||||||
userInfoItemTitle.setData(giftTitleInfo);
|
|
||||||
|
|
||||||
for (GiftWallInfo giftWallInfo : giftWallInfoList) {
|
for (GiftWallInfo giftWallInfo : giftWallInfoList) {
|
||||||
UserInfoItem<GiftWallInfo> userInfoItem = new UserInfoItem<>(UserInfoItem.TYPE_GIFT_ITEM, giftWallInfo);
|
UserInfoItem<GiftWallInfo> userInfoItem = new UserInfoItem<>(UserInfoItem.TYPE_GIFT_ITEM, giftWallInfo);
|
||||||
userInfoItems.add(userInfoItem);
|
userInfoItems.add(userInfoItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
userGiftAdapter.notifyDataSetChanged();
|
userGiftAdapter.notifyDataSetChanged();
|
||||||
|
@@ -20,18 +20,12 @@ import java.util.List;
|
|||||||
|
|
||||||
public class UserGiftAdapter extends UserTabBaseAdapter {
|
public class UserGiftAdapter extends UserTabBaseAdapter {
|
||||||
|
|
||||||
private boolean isNoble;
|
|
||||||
private int mTextColor;
|
|
||||||
|
|
||||||
public UserGiftAdapter(Context context, List<UserInfoItem> data) {
|
public UserGiftAdapter(Context context, List<UserInfoItem> data) {
|
||||||
super(context, data);
|
super(context, data);
|
||||||
|
|
||||||
addItemType(UserInfoItem.TYPE_MAGIC_ITEMS, R.layout.layout_gift_gallery);
|
|
||||||
addItemType(UserInfoItem.TYPE_RADISH_ITEMS, R.layout.layout_gift_gallery);
|
|
||||||
addItemType(UserInfoItem.TYPE_GIFT_ITEM, R.layout.list_item_gift_wall_info);
|
addItemType(UserInfoItem.TYPE_GIFT_ITEM, R.layout.list_item_gift_wall_info);
|
||||||
addItemType(UserInfoItem.TYPE_GIFT_EMPTY, R.layout.layout_gift_empty);
|
addItemType(UserInfoItem.TYPE_GIFT_EMPTY, R.layout.layout_gift_empty);
|
||||||
|
|
||||||
mTextColor = ContextCompat.getColor(mContext, R.color.black);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,15 +38,6 @@ public class UserGiftAdapter extends UserTabBaseAdapter {
|
|||||||
super.convert(helper, item);
|
super.convert(helper, item);
|
||||||
|
|
||||||
switch (item.getItemType()) {
|
switch (item.getItemType()) {
|
||||||
|
|
||||||
case UserInfoItem.TYPE_MAGIC_ITEMS:
|
|
||||||
setMagicGallery(helper, item);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case UserInfoItem.TYPE_RADISH_ITEMS:
|
|
||||||
setRadishGallery(helper, item);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case UserInfoItem.TYPE_GIFT_ITEM:
|
case UserInfoItem.TYPE_GIFT_ITEM:
|
||||||
setGiftItem(helper, item);
|
setGiftItem(helper, item);
|
||||||
break;
|
break;
|
||||||
@@ -63,56 +48,17 @@ public class UserGiftAdapter extends UserTabBaseAdapter {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMagicGallery(BaseViewHolder helper, UserInfoItem item) {
|
|
||||||
ArrayList<MagicInfo> magicInfoList = (ArrayList<MagicInfo>) item.getData();
|
|
||||||
|
|
||||||
if (!ListUtils.isListEmpty(magicInfoList)) {
|
|
||||||
RecyclerView recyclerView = helper.itemView.findViewById(R.id.recycler_view_magic_wall);
|
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
|
||||||
|
|
||||||
MyMagicWallAdapter mMagicListAdapter = new MyMagicWallAdapter();
|
|
||||||
mMagicListAdapter.bindToRecyclerView(recyclerView);
|
|
||||||
|
|
||||||
mMagicListAdapter.setNoble(isNoble);
|
|
||||||
mMagicListAdapter.setNewData(magicInfoList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setRadishGallery(BaseViewHolder helper, UserInfoItem item) {
|
|
||||||
ArrayList<RadishWallInfo> magicInfoList = (ArrayList<RadishWallInfo>) item.getData();
|
|
||||||
|
|
||||||
if (!ListUtils.isListEmpty(magicInfoList)) {
|
|
||||||
RecyclerView recyclerView = helper.itemView.findViewById(R.id.recycler_view_magic_wall);
|
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
|
||||||
|
|
||||||
RadishWallAdapter radishWallAdapter = new RadishWallAdapter();
|
|
||||||
radishWallAdapter.bindToRecyclerView(recyclerView);
|
|
||||||
|
|
||||||
radishWallAdapter.setNewData(magicInfoList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setGiftItem(BaseViewHolder helper, UserInfoItem item) {
|
private void setGiftItem(BaseViewHolder helper, UserInfoItem item) {
|
||||||
GiftWallInfo giftWallInfo = (GiftWallInfo) item.getData();
|
GiftWallInfo giftWallInfo = (GiftWallInfo) item.getData();
|
||||||
|
|
||||||
if (giftWallInfo != null) {
|
if (giftWallInfo != null) {
|
||||||
|
|
||||||
helper.setText(R.id.gift_name, giftWallInfo.getGiftName());
|
helper.setText(R.id.gift_name, giftWallInfo.getGiftName());
|
||||||
helper.setText(R.id.gift_num, String.valueOf(giftWallInfo.getReciveCount()));
|
helper.setText(R.id.gift_num, "x"+String.valueOf(giftWallInfo.getReciveCount()));
|
||||||
helper.setTextColor(R.id.gift_name, mTextColor);
|
|
||||||
helper.setTextColor(R.id.gift_num, mTextColor);
|
|
||||||
|
|
||||||
ImageView giftPic = helper.itemView.findViewById(R.id.gift_img);
|
ImageView giftPic = helper.itemView.findViewById(R.id.gift_img);
|
||||||
ImageLoadUtils.loadImage(mContext, giftWallInfo.getPicUrl(), giftPic);
|
ImageLoadUtils.loadImage(mContext, giftWallInfo.getPicUrl(), giftPic);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNoble(boolean noble) {
|
|
||||||
isNoble = noble;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setmTextColor(int mTextColor) {
|
|
||||||
this.mTextColor = mTextColor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package com.yizhuan.erban.ui.user.adapter;
|
package com.yizhuan.erban.ui.user.adapter;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -9,7 +10,10 @@ import android.widget.ImageView;
|
|||||||
|
|
||||||
import com.jude.rollviewpager.adapter.StaticPagerAdapter;
|
import com.jude.rollviewpager.adapter.StaticPagerAdapter;
|
||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.R;
|
||||||
|
import com.yizhuan.erban.UIHelper;
|
||||||
|
import com.yizhuan.erban.ui.setting.SettingActivity;
|
||||||
import com.yizhuan.erban.ui.user.ShowPhotoActivity;
|
import com.yizhuan.erban.ui.user.ShowPhotoActivity;
|
||||||
|
import com.yizhuan.erban.ui.user.UserPhotoAdapter;
|
||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||||
import com.yizhuan.erban.utils.CommonJumpHelper;
|
import com.yizhuan.erban.utils.CommonJumpHelper;
|
||||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||||
@@ -45,7 +49,7 @@ public class UserInfoPhotoAdapter extends StaticPagerAdapter {
|
|||||||
if (photoInfo == null) return imgBanner;
|
if (photoInfo == null) return imgBanner;
|
||||||
ImageLoadUtils.loadImage(context, photoInfo.getPhotoUrl(), imgBanner);
|
ImageLoadUtils.loadImage(context, photoInfo.getPhotoUrl(), imgBanner);
|
||||||
imgBanner.setOnClickListener(v -> {
|
imgBanner.setOnClickListener(v -> {
|
||||||
showUserPhoto(position,photoBeanList);
|
showUserPhoto(position);
|
||||||
});
|
});
|
||||||
return imgBanner;
|
return imgBanner;
|
||||||
}
|
}
|
||||||
@@ -60,12 +64,13 @@ public class UserInfoPhotoAdapter extends StaticPagerAdapter {
|
|||||||
this.photoBeanList = bannerInfos;
|
this.photoBeanList = bannerInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showUserPhoto(int position,List<UserDetailInfo.DataBean.PrivatePhotoBean> photoBeanList) {
|
|
||||||
|
private void showUserPhoto(int position) {
|
||||||
//创建一个集合拿来做用户所有照片信息
|
//创建一个集合拿来做用户所有照片信息
|
||||||
ArrayList<UserDetailInfo.DataBean.PrivatePhotoBean> userPhotos = new ArrayList<>();
|
ArrayList<UserPhoto> userPhotos = new ArrayList<>();
|
||||||
for (UserDetailInfo.DataBean.PrivatePhotoBean photo: photoBeanList) {
|
for (int i = 0 ; i < photoBeanList.size() ; i++) {
|
||||||
UserDetailInfo.DataBean.PrivatePhotoBean newPhoto = new UserDetailInfo.DataBean.PrivatePhotoBean();
|
UserPhoto newPhoto = new UserPhoto();
|
||||||
newPhoto.setPhotoUrl(photo.getPhotoUrl());
|
newPhoto.setPhotoUrl(photoBeanList.get(i).getPhotoUrl());
|
||||||
userPhotos.add(newPhoto);
|
userPhotos.add(newPhoto);
|
||||||
}
|
}
|
||||||
Intent intent = new Intent(context, ShowPhotoActivity.class);
|
Intent intent = new Intent(context, ShowPhotoActivity.class);
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<solid android:color="#EFEBFF"/>
|
<solid android:color="#EFEBFF"/>
|
||||||
<corners android:topLeftRadius="7.5dp"
|
<corners android:topLeftRadius="8dp"
|
||||||
android:topRightRadius="@dimen/dp_4"
|
android:topRightRadius="@dimen/dp_4"
|
||||||
android:bottomRightRadius="7.5dp"
|
android:bottomRightRadius="8dp"
|
||||||
android:bottomLeftRadius="7.5dp"/>
|
android:bottomLeftRadius="8dp"/>
|
||||||
</shape>
|
</shape>
|
21
app/src/main/res/layout/activity_user_gift.xml
Normal file
21
app/src/main/res/layout/activity_user_gift.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<com.yizhuan.erban.base.TitleBar
|
||||||
|
android:id="@+id/title_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fl_gift_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -193,16 +193,17 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_corner_shadow_12"
|
android:background="@drawable/bg_corner_shadow_12"
|
||||||
android:padding="@dimen/dp_15"
|
|
||||||
android:layout_marginStart="@dimen/dp_15"
|
android:layout_marginStart="@dimen/dp_15"
|
||||||
android:layout_marginEnd="@dimen/dp_15"
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
android:layout_marginTop="@dimen/dp_13"
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
>
|
>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_gift_detail"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="礼物"
|
android:text="礼物"
|
||||||
|
android:padding="@dimen/dp_15"
|
||||||
android:textSize="@dimen/sp_13"
|
android:textSize="@dimen/sp_13"
|
||||||
android:textColor="@color/color_333333"
|
android:textColor="@color/color_333333"
|
||||||
android:drawableEnd="@drawable/arrow_right_2"
|
android:drawableEnd="@drawable/arrow_right_2"
|
||||||
@@ -212,6 +213,9 @@
|
|||||||
android:id="@+id/rv_gift"
|
android:id="@+id/rv_gift"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_15"
|
||||||
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
|
android:layout_marginBottom="@dimen/dp_15"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -3,5 +3,5 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="fitXY" />
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
|
@@ -5,9 +5,17 @@
|
|||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<LinearLayout
|
||||||
android:id="@+id/rv_gift"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_gift"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/gift_empty"
|
android:id="@+id/gift_empty"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="250dp"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="visible">
|
android:visibility="visible">
|
||||||
|
|
||||||
|
@@ -4,31 +4,37 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:paddingStart="@dimen/dp_15"
|
||||||
|
android:paddingEnd="@dimen/dp_15"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/gift_img"
|
android:id="@+id/gift_img"
|
||||||
android:layout_width="60dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_marginTop="15dp" />
|
android:layout_marginTop="10dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/gift_num"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="-10dp"
|
||||||
|
android:textColor="@color/appColor"
|
||||||
|
android:textSize="12dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_user_gift_count"
|
||||||
|
tools:text="x120" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/gift_name"
|
android:id="@+id/gift_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="8dp"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/color_333333"
|
||||||
android:textSize="12sp"
|
android:textSize="13dp"
|
||||||
tools:text="天使" />
|
tools:text="天使" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/gift_num"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="x120" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Reference in New Issue
Block a user