房间用户资料卡增加资料卡装扮(贵族)
This commit is contained in:
@@ -55,7 +55,7 @@ public class MyCarAdapter extends BaseAdapter<CarInfo> {
|
||||
if (remainingDay >= 0 && status == CarInfo.STATUS_USER_CAN_USE) {
|
||||
String days;
|
||||
if (item.getRemainingDay() > 99){
|
||||
days = item.getRemainingDay()+"+";
|
||||
days = "99+";
|
||||
}else {
|
||||
days = item.getRemainingDay()+"";
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ public class MyHeadWearAdapter extends BaseAdapter<HeadWearInfo> {
|
||||
} else {
|
||||
String days;
|
||||
if (item.getExpireDays() > 99){
|
||||
days = item.getExpireDays()+"+";
|
||||
days = "99+";
|
||||
}else {
|
||||
days = item.getExpireDays()+"";
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ public class MyNamePlateAdapter extends BaseQuickAdapter<NamePlateInfo.Nameplate
|
||||
} else {
|
||||
String days;
|
||||
if (item.getExpireDays() > 99) {
|
||||
days = item.getExpireDays() + "+";
|
||||
days = "99+";
|
||||
} else {
|
||||
days = item.getExpireDays() + "";
|
||||
}
|
||||
|
@@ -0,0 +1,80 @@
|
||||
package com.yizhuan.erban.decoration.adapter;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.bindadapter.BaseAdapter;
|
||||
import com.yizhuan.erban.bindadapter.BindingViewHolder;
|
||||
import com.yizhuan.erban.databinding.ItemMyHeadWearBinding;
|
||||
import com.yizhuan.erban.databinding.ItemMyUserCardWearBinding;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.UserCardWearInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/5/11.
|
||||
*/
|
||||
|
||||
public class MyUserCardWearAdapter extends BaseAdapter<UserCardWearInfo> {
|
||||
|
||||
public MyUserCardWearAdapter(int layoutResId, int brid) {
|
||||
super(layoutResId, brid);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(@NonNull BindingViewHolder helper, UserCardWearInfo item) {
|
||||
super.convert(helper, item);
|
||||
ItemMyUserCardWearBinding binding = (ItemMyUserCardWearBinding) helper.getBinding();
|
||||
ImageLoadUtils.loadImage(mContext, item.getPic(), binding.ivUserCardWear);
|
||||
helper.addOnClickListener(R.id.tv_used);
|
||||
|
||||
if (item.getLabelType() == HeadWearInfo.LABEL_TYPE_NORMAL) {
|
||||
binding.ivTag.setVisibility(View.GONE);
|
||||
|
||||
} else if (HeadWearInfo.LABEL_TYPE_NEW == item.getLabelType()) {
|
||||
binding.ivTag.setVisibility(View.VISIBLE);
|
||||
binding.ivTag.setImageResource(R.drawable.ic_mark_new);
|
||||
|
||||
} else if (HeadWearInfo.LABEL_TYPE_DISCOUNT == item.getLabelType()) {
|
||||
binding.ivTag.setVisibility(View.VISIBLE);
|
||||
binding.ivTag.setImageResource(R.drawable.ic_mark_discount);
|
||||
|
||||
} else if (HeadWearInfo.LABEL_TYPE_LIMIT == item.getLabelType()) {
|
||||
binding.ivTag.setVisibility(View.VISIBLE);
|
||||
binding.ivTag.setImageResource(R.drawable.ic_mark_limit);
|
||||
|
||||
} else if (HeadWearInfo.LABEL_TYPE_EXCLUSIVE == item.getLabelType()) {
|
||||
binding.ivTag.setVisibility(View.VISIBLE);
|
||||
binding.ivTag.setImageResource(R.drawable.ic_mark_exclusive);
|
||||
}
|
||||
|
||||
// 过期状态不可使用
|
||||
if (item.isHasExpired()) {
|
||||
binding.tvUsed.setVisibility(View.GONE);
|
||||
binding.tvUsed.setEnabled(false);
|
||||
binding.tvUsed.setText("使用");
|
||||
} else {
|
||||
binding.tvUsed.setVisibility(View.VISIBLE);
|
||||
binding.tvUsed.setEnabled(true);
|
||||
|
||||
}
|
||||
|
||||
// 日期展示
|
||||
if (item.isHasExpired()) { // 过期
|
||||
binding.tvCounters.setText(mContext.getString(R.string.past_due));
|
||||
} else {
|
||||
String days;
|
||||
if (item.getExpireDays() > 99) {
|
||||
days = "99+";
|
||||
} else {
|
||||
days = item.getExpireDays() + "";
|
||||
}
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -8,6 +8,7 @@ import android.graphics.drawable.GradientDrawable;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
@@ -56,17 +57,18 @@ import io.reactivex.disposables.Disposable;
|
||||
public class MyDecorationActivity extends BaseBindingActivity<ActivityMyDecorationBinding>
|
||||
implements ICarView, View.OnClickListener, CarMagicIndicator.OnItemSelectListener {
|
||||
|
||||
/**
|
||||
* 我的装饰Banner
|
||||
*/
|
||||
private static final String BANNER_TYPE = "3";
|
||||
private ViewPager viewPager;
|
||||
private int mPosition;
|
||||
private boolean carGarageNeedUpdate = true;
|
||||
private MyHeadWearFragment myHeadWearFragment;
|
||||
private MyCarFragment mMyCarFragment;
|
||||
private MyNamePlateFragment mMyNamePlateFragment;
|
||||
private MyUserCardWearFragment mMyUserCardWearFragment;
|
||||
private MagicIndicator mMagicIndicator;
|
||||
/**
|
||||
* 我的装饰Banner
|
||||
*/
|
||||
private static final String BANNER_TYPE = "3";
|
||||
|
||||
public static void start(Context context, int position) {
|
||||
Intent intent = new Intent(context, MyDecorationActivity.class);
|
||||
@@ -87,10 +89,11 @@ public class MyDecorationActivity extends BaseBindingActivity<ActivityMyDecorati
|
||||
viewPager = mBinding.viewpager;
|
||||
mMagicIndicator = mBinding.viewIndicator;
|
||||
|
||||
List<TabInfo> tabInfoList = new ArrayList<>(2);
|
||||
List<TabInfo> tabInfoList = new ArrayList<>(4);
|
||||
tabInfoList.add(new TabInfo(1, "头饰"));
|
||||
tabInfoList.add(new TabInfo(2, "座驾"));
|
||||
tabInfoList.add(new TabInfo(3, "铭牌"));
|
||||
tabInfoList.add(new TabInfo(4, "资料卡"));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(this);
|
||||
commonNavigator.setAdjustMode(true);
|
||||
CarMagicIndicator indicator = new CarMagicIndicator(this, tabInfoList, 0);
|
||||
@@ -102,20 +105,24 @@ public class MyDecorationActivity extends BaseBindingActivity<ActivityMyDecorati
|
||||
myHeadWearFragment = new MyHeadWearFragment();
|
||||
mMyCarFragment = MyCarFragment.instance(this);
|
||||
mMyNamePlateFragment = new MyNamePlateFragment();
|
||||
mMyUserCardWearFragment = new MyUserCardWearFragment();
|
||||
viewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 3;
|
||||
return tabInfoList.size();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
if (position == 0){
|
||||
return myHeadWearFragment;
|
||||
} else if (position == 1){
|
||||
if (position == 0) {
|
||||
return myHeadWearFragment;
|
||||
} else if (position == 1) {
|
||||
return mMyCarFragment;
|
||||
} else if (position == 2) {
|
||||
return mMyNamePlateFragment;
|
||||
}
|
||||
return mMyNamePlateFragment;
|
||||
return mMyUserCardWearFragment;
|
||||
}
|
||||
});
|
||||
viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
||||
@@ -147,24 +154,24 @@ public class MyDecorationActivity extends BaseBindingActivity<ActivityMyDecorati
|
||||
mMyCarFragment.getAdapter().setCarInfoHasBeenRenew(carInfo);
|
||||
// 更新商店这辆车的数据
|
||||
if (myHeadWearFragment != null && myHeadWearFragment.getShopAdapter() != null)
|
||||
// 提示是否需要立即驾驶
|
||||
getDialogManager().showOkCancelDialog("购买成功,是否立即驾驶?",
|
||||
true,
|
||||
() -> CarModel.get().driveThisCar(carInfo.getCarId())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe((voidServiceResult, throwable1) -> {
|
||||
if (voidServiceResult != null && voidServiceResult.isSuccess()) {
|
||||
SingleToastUtil.showToastShort("驾驶成功");
|
||||
// 实时更新座驾被选中
|
||||
mMyCarFragment.getAdapter().check(carInfo);
|
||||
} else if (voidServiceResult != null && !voidServiceResult.isSuccess()) {
|
||||
SingleToastUtil.showToastShort("驾驶失败: 网络异常!");
|
||||
} else if (throwable1 != null) {
|
||||
SingleToastUtil.showToastShort("驾驶失败: 网络异常!");
|
||||
} else {
|
||||
SingleToastUtil.showToastShort("驾驶失败: 网络异常!");
|
||||
}
|
||||
}));
|
||||
// 提示是否需要立即驾驶
|
||||
getDialogManager().showOkCancelDialog("购买成功,是否立即驾驶?",
|
||||
true,
|
||||
() -> CarModel.get().driveThisCar(carInfo.getCarId())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe((voidServiceResult, throwable1) -> {
|
||||
if (voidServiceResult != null && voidServiceResult.isSuccess()) {
|
||||
SingleToastUtil.showToastShort("驾驶成功");
|
||||
// 实时更新座驾被选中
|
||||
mMyCarFragment.getAdapter().check(carInfo);
|
||||
} else if (voidServiceResult != null && !voidServiceResult.isSuccess()) {
|
||||
SingleToastUtil.showToastShort("驾驶失败: 网络异常!");
|
||||
} else if (throwable1 != null) {
|
||||
SingleToastUtil.showToastShort("驾驶失败: 网络异常!");
|
||||
} else {
|
||||
SingleToastUtil.showToastShort("驾驶失败: 网络异常!");
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -255,7 +262,7 @@ public class MyDecorationActivity extends BaseBindingActivity<ActivityMyDecorati
|
||||
viewPager.setCurrentItem(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
protected boolean needSteepStateBar() {
|
||||
return true;
|
||||
}
|
||||
|
@@ -0,0 +1,115 @@
|
||||
package com.yizhuan.erban.decoration.view;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.yizhuan.erban.BR;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseBindingFragment;
|
||||
import com.yizhuan.erban.common.NoDataFragment;
|
||||
import com.yizhuan.erban.databinding.FrgMyDecorationCommonBinding;
|
||||
import com.yizhuan.erban.decoration.adapter.MyHeadWearAdapter;
|
||||
import com.yizhuan.erban.decoration.adapter.MyUserCardWearAdapter;
|
||||
import com.yizhuan.erban.decoration.helper.DecorationDialogHelper;
|
||||
import com.yizhuan.erban.decoration.helper.DecorationSaleType;
|
||||
import com.yizhuan.erban.decoration.viewmodel.HeadWearVm;
|
||||
import com.yizhuan.erban.decoration.viewmodel.UserCardWearVm;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.UserCardWearInfo;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/5/7.
|
||||
*/
|
||||
@ActLayoutRes(R.layout.frg_my_decoration_common)
|
||||
public class MyUserCardWearFragment extends BaseBindingFragment<FrgMyDecorationCommonBinding> {
|
||||
private UserCardWearVm wearVm;
|
||||
private MyUserCardWearAdapter shopAdapter;
|
||||
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
wearVm = new UserCardWearVm();
|
||||
mBinding.setViewmodel(wearVm);
|
||||
|
||||
shopAdapter = new MyUserCardWearAdapter(R.layout.item_my_user_card_wear, BR.headWearInfo);
|
||||
shopAdapter.setOnItemChildClickListener((adapter, view, position) -> {
|
||||
if (view.getId() == R.id.tv_used) {
|
||||
setUsedStatus(position);
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.swipeRefresh.setOnRefreshListener(() -> loadData(false));
|
||||
shopAdapter.setOnLoadMoreListener(() -> loadData(true), mBinding.recyclerView);
|
||||
mBinding.recyclerView.setAdapter(shopAdapter);
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
loadData(false);
|
||||
}
|
||||
|
||||
private void loadData(boolean isLode) {
|
||||
wearVm.loadData(isLode)
|
||||
.compose(bindToLifecycle())
|
||||
.doAfterTerminate(() -> {
|
||||
if (ListUtils.isListEmpty(shopAdapter.getData())) {
|
||||
showNoData(R.drawable.icon_common_failure, "亲爱的用户,你还没有头饰哦!");
|
||||
}
|
||||
})
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showNoData(View view, int drawable, CharSequence charSequence) {
|
||||
if (!checkActivityValid())
|
||||
return;
|
||||
|
||||
if (view == null) {
|
||||
return;
|
||||
}
|
||||
View status = view.findViewById(R.id.status_layout);
|
||||
if (status == null || status.getId() == View.NO_ID) {
|
||||
return;
|
||||
}
|
||||
NoDataFragment fragment = NoDataFragment.newInstance(R.layout.fragment_no_data_large_iv, drawable, charSequence);
|
||||
fragment.setListener(getLoadListener());
|
||||
getChildFragmentManager().beginTransaction().replace(status.getId(), fragment, STATUS_TAG).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void setUsedStatus(int position) {
|
||||
UserCardWearInfo headWearInfo = shopAdapter.getData().get(position);
|
||||
|
||||
|
||||
// id == 0标识不使用头饰
|
||||
|
||||
wearVm.userHeadWear(headWearInfo.isUsed() ? null : headWearInfo.getCardId())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doOnError(throwable -> {
|
||||
toast(throwable.getMessage());
|
||||
})
|
||||
.subscribe(s -> {
|
||||
for (int i = 0; i < shopAdapter.getData().size(); i++) {
|
||||
shopAdapter.getData().get(i).setUsed(headWearInfo.getCardId().equals(shopAdapter.getData().get(i).getCardId()));
|
||||
}
|
||||
shopAdapter.notifyDataSetChanged();
|
||||
//更新用户信息
|
||||
UserModel.get().updateCurrentUserInfo().subscribe();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.yizhuan.erban.decoration.viewmodel;
|
||||
|
||||
import com.yizhuan.erban.base.BaseListViewModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.HeadwearModel;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.UserCardWearInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/5/10.
|
||||
*/
|
||||
|
||||
public class UserCardWearVm extends BaseListViewModel<UserCardWearInfo> {
|
||||
|
||||
@Override
|
||||
public Single<ServiceResult<List<UserCardWearInfo>>> getSingle() {
|
||||
return HeadwearModel.get().getUserCardWearList(page , pageSize );
|
||||
}
|
||||
|
||||
public Single<String> userHeadWear(String wearId) {
|
||||
return HeadwearModel.get().useUserCardWear(wearId);
|
||||
}
|
||||
|
||||
}
|
@@ -130,6 +130,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
private AppCompatImageView mIvGoodNumber;
|
||||
private AppCompatImageView mIvUserLevel;
|
||||
private AppCompatImageView mIvUserCharm;
|
||||
private ImageView ivUserCardWear;
|
||||
private TextView tvFamilyNameLabel;
|
||||
private TextView tvFamilyName;
|
||||
private FlexboxLayout flexbox;
|
||||
@@ -206,6 +207,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
mIvGoodNumber = findViewById(R.id.iv_good_number);
|
||||
mIvUserLevel = findViewById(R.id.iv_user_level);
|
||||
mIvUserCharm = findViewById(R.id.iv_user_charm);
|
||||
ivUserCardWear = findViewById(R.id.iv_user_card_wear);
|
||||
|
||||
tvFamilyNameLabel = (TextView) findViewById(R.id.tv_family_name_label);
|
||||
tvFamilyName = (TextView) findViewById(R.id.tv_family_name);
|
||||
@@ -530,6 +532,13 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
setOfficialMask(null, null);
|
||||
}
|
||||
|
||||
//资料卡装扮
|
||||
if (!TextUtils.isEmpty(userInfo.getUserInfoCardPic())) {
|
||||
ImageLoadUtils.loadImage(context, userInfo.getUserInfoCardPic(), ivUserCardWear);
|
||||
} else {
|
||||
ivUserCardWear.setImageDrawable(null);
|
||||
}
|
||||
|
||||
if (null != findHimView) {
|
||||
//获取用户房间信息
|
||||
AvRoomModel.get().getUserRoom(userInfo.getUid())
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/bg_user_card_wear.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_user_card_wear.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_user_card_wear_mask.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_user_card_wear_mask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 93 KiB |
@@ -8,291 +8,304 @@
|
||||
android:orientation="vertical"
|
||||
tools:background="#000">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_userinfo"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="112dp"
|
||||
tools:background="@color/appColor_tran_10">
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:corner="11dp"
|
||||
app:left_bottom_corner="false"
|
||||
app:left_top_corner="true"
|
||||
app:right_bottom_corner="false"
|
||||
app:right_top_corner="true"
|
||||
app:solid="@color/color_f5f5f5"
|
||||
tools:contentDescription="默认底色"
|
||||
tools:visibility="invisible" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_avatar_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_corner_radius_top_left="@dimen/dp_10"
|
||||
app:riv_corner_radius_top_right="@dimen/dp_10"
|
||||
tools:contentDescription="头像高斯模糊做背景" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:corner="@dimen/dp_10"
|
||||
app:left_bottom_corner="false"
|
||||
app:left_top_corner="true"
|
||||
app:right_bottom_corner="false"
|
||||
app:right_top_corner="true"
|
||||
app:solid="@color/black_transparent_10" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_avatar_layout"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_nick_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_toEndOf="@id/fl_avatar_layout"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:gravity="center_vertical"
|
||||
android:maxWidth="165dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_vip_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
android:layout_marginEnd="3dp"
|
||||
tools:src="@drawable/ic_user_charm_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="100dp"
|
||||
android:maxLength="10"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="南方菇凉男男女男男女" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gender"
|
||||
android:layout_width="@dimen/dp_21"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_gender_female" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
tools:contentDescription="性别等级">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_badge"
|
||||
android:layout_width="@dimen/dp_13"
|
||||
android:layout_height="@dimen/dp_13"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level_king"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/in_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_official_mask"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="22dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_official_mask"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_official_mask"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="金牌主持" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include
|
||||
android:id="@+id/in_nameplate"
|
||||
layout="@layout/layout_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="5.5dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_official"
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:src="@mipmap/ic_user_official_10dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_new_user"
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:src="@mipmap/ic_user_new_10dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_good_number"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:src="@mipmap/ic_good_num"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_erban_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="ID123456" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_family"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_family_name_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/family_user_card_label"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_family_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
tools:text="@string/empty_family_text" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_report"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_alignTop="@+id/close_image"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_toStartOf="@+id/close_image"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
android:text="举报"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close_image"
|
||||
android:layout_width="@dimen/dp_35"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:padding="@dimen/dp_8"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_close_user_dialog" />
|
||||
android:id="@+id/iv_user_card_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
tools:background="@drawable/bg_user_card_wear" />
|
||||
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_userinfo"
|
||||
android:layout_width="285dp"
|
||||
android:layout_height="110dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
tools:background="@color/appColor_tran_10">
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:corner="11dp"
|
||||
app:left_bottom_corner="false"
|
||||
app:left_top_corner="true"
|
||||
app:right_bottom_corner="false"
|
||||
app:right_top_corner="true"
|
||||
app:solid="@color/color_f5f5f5"
|
||||
tools:contentDescription="默认底色"
|
||||
tools:visibility="invisible" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_avatar_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_corner_radius_top_left="@dimen/dp_10"
|
||||
app:riv_corner_radius_top_right="@dimen/dp_10"
|
||||
tools:contentDescription="头像高斯模糊做背景" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:corner="@dimen/dp_10"
|
||||
app:left_bottom_corner="false"
|
||||
app:left_top_corner="true"
|
||||
app:right_bottom_corner="false"
|
||||
app:right_top_corner="true"
|
||||
app:solid="@color/black_transparent_10" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_avatar_layout"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_10">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_nick_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_toEndOf="@id/fl_avatar_layout"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:gravity="center_vertical"
|
||||
android:maxWidth="165dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_vip_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/ic_user_charm_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="100dp"
|
||||
android:maxLength="10"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="南方菇凉男男女男男女" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gender"
|
||||
android:layout_width="@dimen/dp_21"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_gender_female" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
tools:contentDescription="性别等级">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_badge"
|
||||
android:layout_width="@dimen/dp_13"
|
||||
android:layout_height="@dimen/dp_13"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level_king"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/in_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_official_mask"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="22dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_official_mask"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_official_mask"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="金牌主持" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include
|
||||
android:id="@+id/in_nameplate"
|
||||
layout="@layout/layout_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="5.5dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_official"
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:src="@mipmap/ic_user_official_10dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_new_user"
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:src="@mipmap/ic_user_new_10dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_good_number"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:src="@mipmap/ic_good_num"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_erban_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="ID123456" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_family"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_family_name_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/family_user_card_label"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_family_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
tools:text="@string/empty_family_text" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_report"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_alignTop="@+id/close_image"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_toStartOf="@+id/close_image"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
android:text="举报"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close_image"
|
||||
android:layout_width="@dimen/dp_35"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:padding="@dimen/dp_8"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_close_user_dialog" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fans_number"
|
||||
@@ -306,8 +319,9 @@
|
||||
tools:text="1290粉丝" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="285dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/bg_user_info_dialog_bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
134
app/src/main/res/layout/item_my_user_card_wear.xml
Normal file
134
app/src/main/res/layout/item_my_user_card_wear.xml
Normal file
@@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="headWearInfo"
|
||||
type="com.yizhuan.xchat_android_core.decoration.headwear.bean.UserCardWearInfo" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:background="@drawable/bg_secondary_radius_15">
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/stv_line"
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
app:corner="2dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:shaderEnable="true"
|
||||
app:shaderEndColor="#FFFFA936"
|
||||
app:shaderMode="topToBottom"
|
||||
app:shaderStartColor="#FFFFCB47" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:drawableStart="@{headWearInfo.comeFrom==1?null:@drawable/ic_send_tag}"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@{headWearInfo.name}"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/stv_line"
|
||||
app:layout_constraintStart_toEndOf="@id/stv_line"
|
||||
app:layout_constraintTop_toTopOf="@id/stv_line"
|
||||
tools:drawableStart="@drawable/ic_send_tag"
|
||||
tools:text="骑士贵族资料卡" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_tag"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_mark_limit" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_used"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignTop="@id/tv_name"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="@dimen/dp_9"
|
||||
android:background="@{headWearInfo.used ? @drawable/bg_common_cancel : @drawable/bg_common_confirm}"
|
||||
android:gravity="center"
|
||||
android:text="@{headWearInfo.used ? @string/label_used : @string/label_can_use}"
|
||||
android:textColor="@{headWearInfo.used ? @color/color_4C5AF1 : @color/white}"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:background="@drawable/bg_common_confirm"
|
||||
tools:text="@string/label_can_use"
|
||||
tools:textColor="@color/white"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_counters"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:drawablePadding="1dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/tv_name"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_name"
|
||||
tools:text="剩余666天" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_user_card_wear_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="23dp"
|
||||
android:layout_marginEnd="23dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bg_user_card_wear_mask"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_user_card_wear"
|
||||
app:layout_constraintDimensionRatio="570:220"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_user_card_wear"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_user_card_wear" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_user_card_wear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="660:360"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name"
|
||||
tools:src="@drawable/bg_user_card_wear" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@@ -181,7 +181,7 @@
|
||||
<dimen name="sp_9">9sp</dimen>
|
||||
<dimen name="dp_33">33dp</dimen>
|
||||
<dimen name="dp_31">31dp</dimen>
|
||||
<dimen name="dp_room_user_dialog_width">314dp</dimen>
|
||||
<dimen name="dp_room_user_dialog_width">330dp</dimen>
|
||||
<dimen name="dp_44">44dp</dimen>
|
||||
<dimen name="dp_19">19dp</dimen>
|
||||
<dimen name="dp_23">23dp</dimen>
|
||||
|
@@ -4,8 +4,8 @@ import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.UserCardWearInfo;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.throwable.HeadwearPulledOffShelvesException;
|
||||
import com.yizhuan.xchat_android_core.decoration.nameplate.bean.NamePlateInfo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.utils.net.BalanceNotEnoughExeption;
|
||||
@@ -27,6 +27,10 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
private volatile static IHeadwearModel model;
|
||||
private Api api;
|
||||
|
||||
private HeadwearModel() {
|
||||
api = RxNet.create(Api.class);
|
||||
}
|
||||
|
||||
public static IHeadwearModel get() {
|
||||
if (model == null) {
|
||||
synchronized (HeadwearModel.class) {
|
||||
@@ -38,13 +42,9 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
return model;
|
||||
}
|
||||
|
||||
private HeadwearModel() {
|
||||
api = RxNet.create(Api.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取商城头饰列表
|
||||
*
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
@@ -66,11 +66,12 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 获取头饰详情
|
||||
*
|
||||
* @param headwearId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<ServiceResult<HeadWearInfo>> getHeadWearDetail(String headwearId){
|
||||
public Single<ServiceResult<HeadWearInfo>> getHeadWearDetail(String headwearId) {
|
||||
return api.getHeadWearDetai(headwearId)
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
@@ -100,6 +101,7 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 获取头饰账单
|
||||
*
|
||||
* @param uid
|
||||
* @param page
|
||||
* @param pageSize
|
||||
@@ -108,27 +110,28 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
@Override
|
||||
public Single<ServiceResult<List<HeadWearInfo>>> getMyHeadWearBill(String uid,
|
||||
String page,
|
||||
String pageSize){
|
||||
return api.getMyHeadWearBill(uid,page,pageSize)
|
||||
String pageSize) {
|
||||
return api.getMyHeadWearBill(uid, page, pageSize)
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用已经购买的头饰
|
||||
*
|
||||
* @param headwearId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<String> userMyHeadWear(String headwearId){
|
||||
public Single<String> userMyHeadWear(String headwearId) {
|
||||
long uid = AuthModel.get().getCurrentUid();
|
||||
String ticket = AuthModel.get().getTicket();
|
||||
return api.userMyHeadWear(String.valueOf(uid),headwearId,ticket)
|
||||
return api.userMyHeadWear(String.valueOf(uid), headwearId, ticket)
|
||||
.flatMap(new Function<ServiceResult<String>, SingleSource<String>>() {
|
||||
@Override
|
||||
public SingleSource<String> apply(ServiceResult<String> stringServiceResult) throws Exception {
|
||||
if (stringServiceResult.isSuccess()) {
|
||||
return Single.just("使用成功");
|
||||
}else {
|
||||
} else {
|
||||
return Single.error(new Throwable(stringServiceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -142,13 +145,15 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 购买/续费头饰
|
||||
*
|
||||
* @param headwearId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<String> buyHeadWear(long headwearId, String type){
|
||||
public Single<String> buyHeadWear(long headwearId, String type) {
|
||||
long uid = AuthModel.get().getCurrentUid();
|
||||
String ticket = AuthModel.get().getTicket();
|
||||
return api.buyHeadWear(
|
||||
@@ -160,13 +165,13 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
.flatMap(new Function<ServiceResult<String>, SingleSource<String>>() {
|
||||
@Override
|
||||
public SingleSource<String> apply(ServiceResult<String> stringServiceResult) throws Exception {
|
||||
if (stringServiceResult.isSuccess()){
|
||||
if (stringServiceResult.isSuccess()) {
|
||||
return Single.just("购买成功.");
|
||||
}else if (BalanceNotEnoughExeption.code == stringServiceResult.getCode()){
|
||||
} else if (BalanceNotEnoughExeption.code == stringServiceResult.getCode()) {
|
||||
return Single.error(new BalanceNotEnoughExeption(stringServiceResult.getMessage()));
|
||||
}else if (HeadwearPulledOffShelvesException.code == stringServiceResult.getCode()){
|
||||
} else if (HeadwearPulledOffShelvesException.code == stringServiceResult.getCode()) {
|
||||
return Single.error(new HeadwearPulledOffShelvesException(stringServiceResult.getMessage()));
|
||||
}else {
|
||||
} else {
|
||||
return Single.error(new Throwable(stringServiceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -202,12 +207,13 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 赠送头饰给某人
|
||||
*
|
||||
* @param headwearId
|
||||
* @param targetUid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<String> sendHeadWear(String headwearId, String targetUid){
|
||||
public Single<String> sendHeadWear(String headwearId, String targetUid) {
|
||||
long uid = AuthModel.get().getCurrentUid();
|
||||
String ticket = AuthModel.get().getTicket();
|
||||
return api.sendHeadWear(String.valueOf(uid),
|
||||
@@ -218,13 +224,13 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
.flatMap(new Function<ServiceResult<String>, SingleSource<String>>() {
|
||||
@Override
|
||||
public SingleSource<String> apply(ServiceResult<String> stringServiceResult) throws Exception {
|
||||
if (stringServiceResult.isSuccess()){
|
||||
if (stringServiceResult.isSuccess()) {
|
||||
return Single.just("赠送成功.");
|
||||
}else if (BalanceNotEnoughExeption.code == stringServiceResult.getCode()){
|
||||
} else if (BalanceNotEnoughExeption.code == stringServiceResult.getCode()) {
|
||||
return Single.error(new BalanceNotEnoughExeption(stringServiceResult.getMessage()));
|
||||
}else if (HeadwearPulledOffShelvesException.code == stringServiceResult.getCode()){
|
||||
} else if (HeadwearPulledOffShelvesException.code == stringServiceResult.getCode()) {
|
||||
return Single.error(new HeadwearPulledOffShelvesException(stringServiceResult.getMessage()));
|
||||
}else {
|
||||
} else {
|
||||
return Single.error(new Throwable(stringServiceResult.getMessage()));
|
||||
}
|
||||
}
|
||||
@@ -257,10 +263,43 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取头饰列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<ServiceResult<List<UserCardWearInfo>>> getUserCardWearList(int page, int pageSize) {
|
||||
return api.getMyUserCardWearList(page,pageSize)
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 使用已经购买的头饰
|
||||
*
|
||||
* @param wearId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<String> useUserCardWear(String wearId) {
|
||||
return api.userMyUserCardWear(wearId)
|
||||
.flatMap(serviceResult -> {
|
||||
if (serviceResult.isSuccess()) {
|
||||
return Single.just("使用成功");
|
||||
} else {
|
||||
return Single.error(new Throwable(serviceResult.getMessage()));
|
||||
}
|
||||
})
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
|
||||
/**
|
||||
* 获取商城头饰列表
|
||||
*
|
||||
* @param uid
|
||||
* @param page
|
||||
* @param pageSize
|
||||
@@ -281,6 +320,7 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 获取头饰详情
|
||||
*
|
||||
* @param headwearId
|
||||
* @return
|
||||
*/
|
||||
@@ -289,6 +329,7 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 获取我的头饰
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@@ -306,6 +347,7 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 获取头饰账单
|
||||
*
|
||||
* @param uid
|
||||
* @param page
|
||||
* @param pageSize
|
||||
@@ -318,6 +360,7 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 使用头饰
|
||||
*
|
||||
* @param uid
|
||||
* @param headwear_id
|
||||
* @param ticket
|
||||
@@ -330,6 +373,7 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 购买/续费头饰
|
||||
*
|
||||
* @param uid
|
||||
* @param headwearId
|
||||
* @param ticket
|
||||
@@ -356,6 +400,7 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
|
||||
/**
|
||||
* 赠送头饰
|
||||
*
|
||||
* @param uid
|
||||
* @param headwearId
|
||||
* @param target_uid
|
||||
@@ -378,6 +423,24 @@ public class HeadwearModel extends BaseModel implements IHeadwearModel {
|
||||
@Query("currencyType") int currencyType,
|
||||
@Query("headwearId") String headwearId,
|
||||
@Query("targetUid") String targetUid);
|
||||
|
||||
/**
|
||||
* 使用资料卡装扮
|
||||
*
|
||||
* @param cardId
|
||||
* @return
|
||||
*/
|
||||
@GET("userInfoCard/optUserInfoCard")
|
||||
Single<ServiceResult<String>> userMyUserCardWear(@Query("cardId") String cardId);
|
||||
|
||||
/**
|
||||
* 分页获取用户资料卡装扮列表
|
||||
*/
|
||||
@GET("userInfoCard/listByPage")
|
||||
Single<ServiceResult<List<UserCardWearInfo>>> getMyUserCardWearList(@Query("page") int page,
|
||||
@Query("pageSize") int pageSize);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ package com.yizhuan.xchat_android_core.decoration.headwear;
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.UserCardWearInfo;
|
||||
import com.yizhuan.xchat_android_core.decoration.nameplate.bean.NamePlateInfo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -93,4 +94,8 @@ public interface IHeadwearModel extends IModel {
|
||||
* 支付货币类型:0钻石,1萝卜
|
||||
*/
|
||||
Single<String> sendHeadWearV2(int currencyType, String headwearId, String targetUid);
|
||||
|
||||
Single<ServiceResult<List<UserCardWearInfo>>> getUserCardWearList(int page, int pageSize);
|
||||
|
||||
Single<String> useUserCardWear(String wearId);
|
||||
}
|
||||
|
@@ -0,0 +1,16 @@
|
||||
package com.yizhuan.xchat_android_core.decoration.headwear.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserCardWearInfo {
|
||||
private String cardId;
|
||||
private int comeFrom;
|
||||
private int expireDays;
|
||||
private String expireTime;
|
||||
private boolean hasExpired;
|
||||
private String name;
|
||||
private String pic;
|
||||
private boolean used;
|
||||
private int labelType;
|
||||
}
|
Reference in New Issue
Block a user