feat:完成个人资料页-UI改版
@@ -26,6 +26,7 @@ import com.chwl.app.support.FragmentVisibleStateHelper
|
||||
import com.chwl.app.ui.im.friend.FriendListFragment
|
||||
import com.chwl.app.ui.im.recent.RecentListFragment
|
||||
import com.chwl.app.ui.relation.FansListFragment
|
||||
import com.chwl.app.ui.user.adapter.ContactsIndicatorAdapter
|
||||
import com.chwl.app.ui.user.adapter.UserInfoIndicatorAdapter
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import com.chwl.core.Constants
|
||||
@@ -85,7 +86,7 @@ class ContactsListFragment : BaseViewBindingFragment<FragmentContactListBinding>
|
||||
tagList.add(getString(R.string.layout_fragment_contact_list_04))
|
||||
val commonNavigator = CommonNavigator(context)
|
||||
commonNavigator.setTitleWrapContent(false)
|
||||
val magicIndicatorAdapter = UserInfoIndicatorAdapter(context, tagList)
|
||||
val magicIndicatorAdapter = ContactsIndicatorAdapter(context, tagList)
|
||||
magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? ->
|
||||
binding.viewPager.currentItem = position
|
||||
}
|
||||
|
@@ -7,21 +7,28 @@ import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.CountDownTimer;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.chwl.app.avroom.adapter.CommonVPAdapter;
|
||||
import com.chwl.app.ui.user.adapter.UserInfoTopAlbumAdapter;
|
||||
import com.chwl.app.ui.user.fragment.UserInfoDataFragment;
|
||||
import com.chwl.app.utils.AppBarStateChangeListener;
|
||||
import com.chwl.core.decoration.headwear.bean.HeadWearInfo;
|
||||
import com.chwl.core.noble.NobleUtil;
|
||||
import com.example.lib_utils.UiUtils;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nim.uikit.common.util.sys.TimeUtil;
|
||||
import com.netease.nim.uikit.impl.cache.NimUserInfoCache;
|
||||
import com.netease.nimlib.sdk.RequestCallbackWrapper;
|
||||
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
|
||||
@@ -32,7 +39,6 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.UIHelper;
|
||||
import com.chwl.app.audio.helper.AudioPlayerHelper;
|
||||
import com.chwl.app.audio.helper.OnPlayListener;
|
||||
import com.chwl.app.avroom.ButtonItemFactory;
|
||||
import com.chwl.app.avroom.activity.AVRoomActivity;
|
||||
import com.chwl.app.base.BaseBindingActivity;
|
||||
@@ -41,12 +47,8 @@ import com.chwl.app.common.widget.dialog.DialogManager;
|
||||
import com.chwl.app.databinding.ActivityUserInfoBinding;
|
||||
import com.chwl.app.ui.im.avtivity.NimFriendModel;
|
||||
import com.chwl.app.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.chwl.app.ui.user.adapter.SelfPhotoAdapter;
|
||||
import com.chwl.app.ui.user.adapter.UserInfoIndicatorAdapter;
|
||||
import com.chwl.app.ui.user.adapter.UserInfoPhotoAdapter;
|
||||
import com.chwl.app.ui.user.adapter.UserPhotoAdapter;
|
||||
import com.chwl.app.ui.user.fragment.UserInfoGiftWallFragment;
|
||||
import com.chwl.app.ui.user.fragment.UserInfoInfoFragment;
|
||||
import com.chwl.app.ui.user.viewmodel.UserInfoViewModel;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtilsV2;
|
||||
@@ -56,13 +58,9 @@ import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavi
|
||||
import com.chwl.app.ui.widget.rollviewpager.adapter.StaticPagerAdapterWrapper;
|
||||
import com.chwl.app.utils.RegexUtil;
|
||||
import com.chwl.core.XConstants;
|
||||
import com.chwl.core.Constants;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.chwl.core.bean.RoomQueueInfo;
|
||||
import com.chwl.core.im.friend.IMFriendModel;
|
||||
import com.chwl.core.level.UserLevelVo;
|
||||
import com.chwl.core.manager.AudioEngineManager;
|
||||
import com.chwl.core.manager.AvRoomDataManager;
|
||||
import com.chwl.core.praise.PraiseModel;
|
||||
import com.chwl.core.praise.event.IsLikedEvent;
|
||||
import com.chwl.core.praise.event.PraiseEvent;
|
||||
@@ -72,12 +70,10 @@ import com.chwl.core.user.bean.UserDetailInfo;
|
||||
import com.chwl.core.user.bean.UserInfo;
|
||||
import com.chwl.core.user.bean.UserPhoto;
|
||||
import com.chwl.core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.chwl.core.utils.LogUtils;
|
||||
import com.chwl.core.utils.CoreLogger;
|
||||
import com.chwl.library.annatation.ActLayoutRes;
|
||||
import com.chwl.library.utils.ListUtils;
|
||||
import com.chwl.library.utils.SingleToastUtil;
|
||||
import com.chwl.library.utils.SizeUtils;
|
||||
import com.zhpan.bannerview.BannerViewPager;
|
||||
import com.zhpan.bannerview.constants.IndicatorGravity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -107,24 +103,20 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
private ImageView ivOfficialMask;
|
||||
private TextView tvOfficialMask;
|
||||
|
||||
private StaticPagerAdapterWrapper bannerAdapter;
|
||||
|
||||
private UserInfoViewModel viewModel;
|
||||
|
||||
private boolean audioPlaying = false;
|
||||
|
||||
private boolean isRemoteMute = false;//是否静音
|
||||
private boolean isMute = true;//是否开麦
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
protected void init() {
|
||||
mActivity = this;
|
||||
userId = getIntent().getLongExtra("userId", 0);
|
||||
viewModel = new ViewModelProvider(this).get(UserInfoViewModel.class);
|
||||
viewModel.setUserId(userId);
|
||||
UserInfoUiMgr.get().setUid(userId);
|
||||
|
||||
onFindViews();
|
||||
onSetListener();
|
||||
initTopAlbumView();
|
||||
EventBus.getDefault().register(this);
|
||||
initUserInfoDetailObserver();
|
||||
initAttentionView();
|
||||
@@ -150,18 +142,8 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
|
||||
private void initAttentionView() {
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
RoomQueueInfo roomQueueInfo = AvRoomDataManager.get()
|
||||
.getRoomQueueMemberInfoByAccount(String.valueOf(AuthModel.get().getCurrentUid()));
|
||||
if (roomQueueInfo != null && roomQueueInfo.mRoomMicInfo != null) {
|
||||
isMute = AudioEngineManager.get().isMute();
|
||||
}
|
||||
isRemoteMute = AudioEngineManager.get().isRemoteMute();
|
||||
}
|
||||
|
||||
if (AuthModel.get().getCurrentUid() == userId) {
|
||||
identityState = OWN;
|
||||
mBinding.tvFansCount.setOnClickListener(this);
|
||||
mBinding.layoutLive.setVisibility(View.GONE);
|
||||
if (bottomViewLayout != null)
|
||||
bottomViewLayout.setVisibility(View.GONE);
|
||||
@@ -222,12 +204,12 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
|
||||
private void initViewPager() {
|
||||
List<Fragment> fragmentList = new ArrayList<>(2);
|
||||
fragmentList.add(new UserInfoInfoFragment());
|
||||
fragmentList.add(new UserInfoGiftWallFragment());
|
||||
final List<String> tagList = new ArrayList<>(2);
|
||||
List<Fragment> fragmentList = new ArrayList<>(1);
|
||||
fragmentList.add(new UserInfoDataFragment());
|
||||
// fragmentList.add(new UserInfoGiftWallFragment());
|
||||
final List<String> tagList = new ArrayList<>(1);
|
||||
tagList.add(getString(R.string.me_data));
|
||||
tagList.add(getString(R.string.me_gift_wall));
|
||||
// tagList.add(getString(R.string.me_gift_wall));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(context);
|
||||
commonNavigator.setTitleWrapContent(false);
|
||||
UserInfoIndicatorAdapter magicIndicatorAdapter = new UserInfoIndicatorAdapter(context, tagList);
|
||||
@@ -236,9 +218,8 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
});
|
||||
commonNavigator.setAdapter(magicIndicatorAdapter);
|
||||
mBinding.magicIndicator.setNavigator(commonNavigator);
|
||||
commonNavigator.getTitleContainer().setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
|
||||
mBinding.viewPager.setOffscreenPageLimit(2);
|
||||
mBinding.viewPager.setAdapter(new CommonVPAdapter(getSupportFragmentManager(),getLifecycle(),fragmentList));
|
||||
mBinding.viewPager.setOffscreenPageLimit(fragmentList.size());
|
||||
mBinding.viewPager.setAdapter(new CommonVPAdapter(getSupportFragmentManager(), getLifecycle(), fragmentList));
|
||||
mBinding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
@@ -256,10 +237,10 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
mBinding.magicIndicator.onPageScrollStateChanged(state);
|
||||
}
|
||||
});
|
||||
mBinding.viewPager.setUserInputEnabled(false);
|
||||
}
|
||||
|
||||
private void initUserInfoDetailObserver() {
|
||||
viewModel = new ViewModelProvider(this).get(UserInfoViewModel.class);
|
||||
viewModel.getUserInfoDetailData().observe(this, dataBean -> {
|
||||
initPhoto(dataBean.getPrivatePhoto());
|
||||
setWhereVisible();
|
||||
@@ -287,6 +268,18 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
private void initData(UserInfo userInfo) {
|
||||
if (null != userInfo) {
|
||||
ImageLoadUtilsV2.loadImage(mBinding.ivUserHead, userInfo.getAvatar());
|
||||
HeadWearInfo headWearInfo = userInfo.getUserHeadwear();
|
||||
if (headWearInfo != null && headWearInfo.getFirstUrl() != null) {
|
||||
NobleUtil.loadHeadWear(headWearInfo.getFirstUrl(), mBinding.ivHeadWear);
|
||||
mBinding.ivHeadWear.setVisibility(View.VISIBLE);
|
||||
mBinding.ivUserHead.setPadding(0, 0, 0, 0);
|
||||
mBinding.ivUserHead.setStrokeWidth(0);
|
||||
} else {
|
||||
int padding = getResources().getDimensionPixelOffset(R.dimen.dp_0_5);
|
||||
mBinding.ivUserHead.setPadding(padding, padding, padding, padding);
|
||||
mBinding.ivUserHead.setStrokeWidth(getResources().getDimensionPixelOffset(R.dimen.dp_1));
|
||||
mBinding.ivHeadWear.setVisibility(View.GONE);
|
||||
}
|
||||
//设置昵称
|
||||
String nick = RegexUtil.getPrintableString(userInfo.getNick());
|
||||
mBinding.tvNick.setText(nick);
|
||||
@@ -298,8 +291,31 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
mBinding.tvGenderAge.setBirthDay(userInfo.getBirth());
|
||||
|
||||
mBinding.tvFansCount.setText(String.valueOf(userInfo.getFansNum()));
|
||||
mBinding.tvErbanId.setText(getString(R.string.me_user_id, userInfo.getErbanNo()));
|
||||
mBinding.ivGoodNumber.setVisibility(userInfo.isHasPrettyErbanNo() ? View.VISIBLE : View.GONE);
|
||||
mBinding.tvFollowCount.setText(String.valueOf(userInfo.getFollowNum()));
|
||||
mBinding.tvErbanId.setText(String.valueOf(userInfo.getErbanNo()));
|
||||
if (userInfo.isHasPrettyErbanNo()) {
|
||||
mBinding.ivId.setVisibility(View.GONE);
|
||||
mBinding.tvErbanId.setTextColor(ContextCompat.getColor(context, R.color.color_FEFFBF));
|
||||
mBinding.tvErbanId.setBackgroundResource(R.drawable.user_info_bg_good_id);
|
||||
} else {
|
||||
mBinding.tvErbanId.setTextColor(ContextCompat.getColor(context, R.color.color_CC191919));
|
||||
mBinding.tvErbanId.setBackgroundDrawable(null);
|
||||
mBinding.ivId.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
String birth = TimeUtil.getChinaDateTimeString(userInfo.getBirth(), "yyyy-MM-dd");
|
||||
mBinding.tvRegion.setText(userInfo.getRegion());
|
||||
mBinding.tvBirthday.setText(birth);
|
||||
if (mBinding.tvRegion.getText().length() == 0 || mBinding.tvBirthday.getText().length() == 0) {
|
||||
mBinding.vRegionBirthdayLine.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.vRegionBirthdayLine.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (mBinding.tvRegion.getText().length() == 0 && mBinding.tvBirthday.getText().length() == 0) {
|
||||
mBinding.layoutRegion.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.layoutRegion.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
//等级魅力值
|
||||
setUserLevel(userInfo.getUserLevelVo());
|
||||
@@ -311,15 +327,8 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
|
||||
mBinding.ivChargeAgent.setVisibility(userInfo.isRechargeUser() ? View.VISIBLE : View.GONE);
|
||||
|
||||
// VipHelper.loadVipIcon(mBinding.ivVipIcon, userInfo.getUserVipInfoVO());
|
||||
|
||||
initVoiceShow(userInfo.getAudioCard());
|
||||
|
||||
// initLabel(userInfo.getLabels());
|
||||
|
||||
mBinding.tvErbanId.setOnLongClickListener(view -> {
|
||||
mBinding.llId.setOnClickListener(view -> {
|
||||
copyName();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -369,36 +378,34 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
// userInfoLabelAdapter.setNewData(labels);
|
||||
// }
|
||||
|
||||
private void initTopAlbumView() {
|
||||
UserInfoTopAlbumAdapter adapter = new UserInfoTopAlbumAdapter(viewModel.isMe());
|
||||
int width = context.getResources().getDimensionPixelOffset(R.dimen.dp_5);
|
||||
boolean isRTL = UiUtils.INSTANCE.isRtl(this);
|
||||
int marginEnd = context.getResources().getDimensionPixelOffset(R.dimen.dp_8);
|
||||
mBinding.bannerView
|
||||
.setLifecycleRegistry(getLifecycle())
|
||||
.setOnPageClickListener((clickedView, position) -> {
|
||||
showUserPhoto(position);
|
||||
})
|
||||
.setRTLMode(isRTL)
|
||||
.setIndicatorHeight(width)
|
||||
.setIndicatorGravity(isRTL ? IndicatorGravity.START : IndicatorGravity.END)
|
||||
.setIndicatorSliderWidth(width, width * 2)
|
||||
.setIndicatorSliderGap(context.getResources().getDimensionPixelOffset(R.dimen.dp_6))
|
||||
.setIndicatorMargin(isRTL ? marginEnd : 0, 0, isRTL ? 0 : marginEnd, context.getResources().getDimensionPixelOffset(R.dimen.dp_71))
|
||||
.setAdapter(adapter).create();
|
||||
}
|
||||
|
||||
/**
|
||||
* 相册
|
||||
*/
|
||||
private void initPhoto(List<UserDetailInfo.DataBean.PrivatePhotoBean> list) {
|
||||
if (ListUtils.isListEmpty(list)) {
|
||||
return;
|
||||
if (list == null) {
|
||||
mBinding.bannerView.refreshData(new ArrayList());
|
||||
} else {
|
||||
mBinding.bannerView.refreshData(list);
|
||||
}
|
||||
if (bannerAdapter == null) {
|
||||
// mBinding.rollView.setHintViewDelegate(new RollPagerView.HintViewDelegate() {
|
||||
// @SuppressLint("SetTextI18n")
|
||||
// @Override
|
||||
// public void setCurrentPosition(int position, HintView hintView) {
|
||||
// if (mBinding.rollView.getAdapter() != null) {
|
||||
// mBinding.tvRollHint.setText((position + 1) + "/" + mBinding.rollView.getAdapter().getCount());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void initView(int length, int gravity, HintView hintView) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
bannerAdapter = identityState == OWN ? new SelfPhotoAdapter(list, this)
|
||||
: new UserInfoPhotoAdapter(list, this);
|
||||
mBinding.rollView.setAdapter(bannerAdapter);
|
||||
//设置透明度
|
||||
mBinding.rollView.setAnimationDurtion(500);
|
||||
}
|
||||
bannerAdapter.setData(list);
|
||||
bannerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void setUserLevel(UserLevelVo userLevelVo) {
|
||||
@@ -424,24 +431,45 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
|
||||
private void initNestScrollView() {
|
||||
mBinding.appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
|
||||
LogUtils.d("verticalOffset=" + verticalOffset);
|
||||
if (flag == 0 && Math.abs(verticalOffset) > SizeUtils.dp2px(context, 200)) {
|
||||
//展开
|
||||
flag = 1;
|
||||
mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back_black);
|
||||
mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
setTitleVisible(true);
|
||||
setEditButton(identityState, true);
|
||||
} else if (flag == 1 && Math.abs(verticalOffset) <= 200) {
|
||||
//合起来
|
||||
flag = 0;
|
||||
mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back);
|
||||
mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.transparent));
|
||||
setTitleVisible(false);
|
||||
setEditButton(identityState, false);
|
||||
mBinding.appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||
@Override
|
||||
protected float getBias() {
|
||||
return 0.6f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChanged(AppBarLayout appBarLayout, State state) {
|
||||
if (state == State.COLLAPSED) {
|
||||
mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back_black);
|
||||
mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
setTitleVisible(true);
|
||||
setEditButton(identityState, true);
|
||||
}else{
|
||||
mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back);
|
||||
mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.transparent));
|
||||
setTitleVisible(false);
|
||||
setEditButton(identityState, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
// mBinding.appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
|
||||
// LogUtils.d("verticalOffset=" + verticalOffset);
|
||||
// if (flag == 0 && Math.abs(verticalOffset) > SizeUtils.dp2px(context, 200)) {
|
||||
// //展开
|
||||
// flag = 1;
|
||||
// mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back_black);
|
||||
// mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
// setTitleVisible(true);
|
||||
// setEditButton(identityState, true);
|
||||
// } else if (flag == 1 && Math.abs(verticalOffset) <= 200) {
|
||||
// //合起来
|
||||
// flag = 0;
|
||||
// mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back);
|
||||
// mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.transparent));
|
||||
// setTitleVisible(false);
|
||||
// setEditButton(identityState, false);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private void setEditButton(int identityState, boolean isExpanded) {
|
||||
@@ -480,9 +508,15 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
|
||||
private void showUserPhoto(int position) {
|
||||
if (userInfo == null) {
|
||||
return;
|
||||
}
|
||||
//创建一个集合拿来做用户所有照片信息
|
||||
ArrayList<UserPhoto> userPhotos = new ArrayList<>();
|
||||
List<UserPhoto> realmList = userInfo.getPrivatePhoto();
|
||||
if (realmList == null) {
|
||||
return;
|
||||
}
|
||||
for (UserPhoto photo : realmList) {
|
||||
UserPhoto newPhoto = new UserPhoto();
|
||||
newPhoto.setPid(photo.getPid());
|
||||
@@ -629,138 +663,9 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
}
|
||||
|
||||
public void initVoiceShow(UserInfo.SoundBean audioCard) {
|
||||
if (audioCard != null && !TextUtils.isEmpty(audioCard.getAudioUrl())) {
|
||||
if (AuthModel.get().getCurrentUid() == userId) {//主态
|
||||
if (audioCard.getStatus() == 2) {
|
||||
showSoundCard(audioCard);
|
||||
} else {
|
||||
mBinding.llAudio.setVisibility(View.GONE);
|
||||
// mBinding.llAudioTip.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else if (audioCard.getStatus() == 2) {//客态
|
||||
showSoundCard(audioCard);
|
||||
}
|
||||
} else {
|
||||
if (AuthModel.get().getCurrentUid() == userId) {//主态
|
||||
mBinding.llAudio.setVisibility(View.GONE);
|
||||
// mBinding.llAudioTip.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.llAudio.setVisibility(View.GONE);
|
||||
// mBinding.llAudioTip.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
// mBinding.llAudioTip.setOnClickListener(view -> {
|
||||
// // 点击跳转到声音签名页面
|
||||
// UIHelper.showSoundAct(
|
||||
// this,
|
||||
// UserInfoModifyActivity.Method.AUDIO,
|
||||
// ResUtil.getString(R.string.ui_user_userinfomodifyactivity_07),
|
||||
// audioCard);
|
||||
// });
|
||||
}
|
||||
|
||||
private void showSoundCard(UserInfo.SoundBean audioCard) {
|
||||
mBinding.llAudio.setVisibility(View.VISIBLE);
|
||||
// mBinding.llAudioTip.setVisibility(View.GONE);
|
||||
mBinding.tvAudio.setText(audioCard.getSecond() + "s");
|
||||
mBinding.livUser.stopAnimation();
|
||||
mBinding.llAudio.setOnClickListener(v -> toggleAudio(audioCard));
|
||||
}
|
||||
|
||||
private void toggleAudio(UserInfo.SoundBean audioCard) {
|
||||
String url = "";
|
||||
if (audioCard.getAudioUrl().contains("http")) {
|
||||
url = audioCard.getAudioUrl();
|
||||
}
|
||||
if (TextUtils.isEmpty(url)) return;
|
||||
if (!audioPlaying) {
|
||||
playAudio(url, audioCard.getSecond());
|
||||
} else {
|
||||
stopAudio(audioCard.getSecond());
|
||||
}
|
||||
}
|
||||
|
||||
private CountDownTimer timer = null;
|
||||
|
||||
private void playAudio(String url, int second) {
|
||||
if (audioPlaying) return;
|
||||
audioPlaying = true;
|
||||
playSvgaBg(mBinding.livUser, "svga/user_sound_play.svga");
|
||||
mBinding.ivAudioControl.setImageResource(R.drawable.user_info_ic_audio_pause);
|
||||
startCountDown(second);
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
AudioEngineManager.get().setRemoteMute(true);//設置靜音
|
||||
AudioEngineManager.get().setMute(true);//不能説話
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_AUDIENCE);
|
||||
}
|
||||
AudioPlayerHelper.get().playInThread(url, new OnPlayListener() {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
SingleToastUtil.showToast(getString(R.string.me_error_playing));
|
||||
stopAudio(second);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepared() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlaying(long currDuration) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompletion() {
|
||||
stopAudio(second);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void startCountDown(int time) {
|
||||
timer = new CountDownTimer((time + 1) * 1000L, 1000L) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
String time = String.valueOf(millisUntilFinished / 1000);
|
||||
mBinding.tvAudio.setText(time + "s");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
}
|
||||
};
|
||||
timer.start();
|
||||
}
|
||||
|
||||
private void stopCountDown(int second) {
|
||||
if (timer != null) {
|
||||
mBinding.tvAudio.setText(second+"s");
|
||||
timer.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private void stopAudio(int second) {
|
||||
stopCountDown(second);
|
||||
if (!audioPlaying) return;
|
||||
audioPlaying = false;
|
||||
mBinding.livUser.stopAnimation();
|
||||
mBinding.ivAudioControl.setImageResource(R.drawable.user_info_ic_audio_play);
|
||||
AudioPlayerHelper.get().endPlay();
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
AudioEngineManager.get().setRemoteMute(isRemoteMute);//非靜音
|
||||
AudioEngineManager.get().setMute(isMute);//能説話
|
||||
AudioEngineManager.get().setRole(isMute ? Constants.CLIENT_ROLE_AUDIENCE : Constants.CLIENT_ROLE_BROADCASTER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
if (audioPlaying) {
|
||||
stopAudio(userInfo.getAudioCard().getSecond());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -0,0 +1,100 @@
|
||||
package com.chwl.app.ui.user.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.Gravity;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.ui.widget.XRecyclerView.ScaleTransitionPagerTitleView;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ContactsIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
private final List<? extends CharSequence> mTitleList;
|
||||
|
||||
private int textSize = 16;
|
||||
private float minScale = 1f;
|
||||
private boolean showIndicator = true;
|
||||
private OnItemSelectListener mOnItemSelectListener;
|
||||
|
||||
public ContactsIndicatorAdapter(Context context, List<? extends CharSequence> charSequences) {
|
||||
this.mTitleList = charSequences;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mTitleList == null ? 0 : mTitleList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int i) {
|
||||
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
|
||||
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.color_84868A));
|
||||
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_1E1E1F));
|
||||
scaleTransitionPagerTitleView.setMinScale(minScale);
|
||||
scaleTransitionPagerTitleView.setTextSize(textSize);
|
||||
int padding = UIUtil.dip2px(context, 16);
|
||||
scaleTransitionPagerTitleView.setPadding(padding, 0, padding, 0);
|
||||
scaleTransitionPagerTitleView.setText(mTitleList.get(i));
|
||||
scaleTransitionPagerTitleView.setOnClickListener(view -> {
|
||||
if (mOnItemSelectListener != null) {
|
||||
mOnItemSelectListener.onItemSelect(i, scaleTransitionPagerTitleView);
|
||||
}
|
||||
});
|
||||
return scaleTransitionPagerTitleView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerIndicator getIndicator(Context context) {
|
||||
if (!showIndicator) return null;
|
||||
DrawableIndicator indicator = new DrawableIndicator(context);
|
||||
indicator.setMode(DrawableIndicator.MODE_EXACTLY);
|
||||
indicator.setDrawableWidth(UIUtil.dip2px(context, 24));
|
||||
indicator.setDrawableHeight(UIUtil.dip2px(context, 8));
|
||||
indicator.setIndicatorDrawable(context.getResources().getDrawable(R.drawable.base_ic_indicator));
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
lp.gravity = Gravity.END;
|
||||
indicator.setLayoutParams(lp);
|
||||
return indicator;
|
||||
}
|
||||
|
||||
public int getTextSize() {
|
||||
return textSize;
|
||||
}
|
||||
|
||||
public void setTextSize(int textSize) {
|
||||
this.textSize = textSize;
|
||||
}
|
||||
|
||||
public float getMinScale() {
|
||||
return minScale;
|
||||
}
|
||||
|
||||
public void setMinScale(float minScale) {
|
||||
this.minScale = minScale;
|
||||
}
|
||||
|
||||
public boolean isShowIndicator() {
|
||||
return showIndicator;
|
||||
}
|
||||
|
||||
public void setShowIndicator(boolean showIndicator) {
|
||||
this.showIndicator = showIndicator;
|
||||
}
|
||||
|
||||
public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) {
|
||||
mOnItemSelectListener = onItemSelectListener;
|
||||
}
|
||||
|
||||
public interface OnItemSelectListener {
|
||||
void onItemSelect(int position, TextView view);
|
||||
}
|
||||
}
|
@@ -1,48 +0,0 @@
|
||||
package com.chwl.app.ui.user.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.chwl.app.ui.widget.rollviewpager.adapter.StaticPagerAdapterWrapper
|
||||
import com.chwl.core.user.bean.UserDetailInfo
|
||||
|
||||
class SelfPhotoAdapter(
|
||||
photoBeans: List<UserDetailInfo.DataBean.PrivatePhotoBean>,
|
||||
context: Context
|
||||
) : StaticPagerAdapterWrapper<UserDetailInfo.DataBean.PrivatePhotoBean>(photoBeans, context) {
|
||||
private val origin by lazy {
|
||||
UserInfoPhotoAdapter(photoBeans, context)
|
||||
}
|
||||
|
||||
override fun getView(container: ViewGroup?, position: Int): View {
|
||||
val originView = origin.getView(container, position)
|
||||
val flContainer = FrameLayout(context)
|
||||
flContainer.layoutParams = FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
flContainer.addView(originView)
|
||||
//overlay
|
||||
val statusView = ImageView(context)
|
||||
statusView.setImageResource(R.drawable.ic_album_auditing)
|
||||
statusView.scaleType = ImageView.ScaleType.CENTER_INSIDE
|
||||
val statusViewLayoutParams =
|
||||
FrameLayout.LayoutParams(UIUtil.dip2px(context, 86.0), UIUtil.dip2px(context, 51.0))
|
||||
statusViewLayoutParams.gravity = Gravity.RIGHT
|
||||
flContainer.addView(statusView, statusViewLayoutParams)
|
||||
|
||||
val isVisit = (dataList.getOrNull(position)?.isReview == true)
|
||||
statusView.visibility = if (isVisit) View.VISIBLE else View.GONE
|
||||
return flContainer
|
||||
}
|
||||
|
||||
override fun setData(dataList: MutableList<UserDetailInfo.DataBean.PrivatePhotoBean>?) {
|
||||
super.setData(dataList)
|
||||
origin.setData(dataList)
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.chwl.app.ui.user.adapter
|
||||
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.ui.utils.load
|
||||
import com.chwl.core.user.bean.UserDetailInfo
|
||||
import com.chwl.core.user.bean.UserPhoto
|
||||
|
||||
class UserInfoAlbumAdapter :
|
||||
BaseQuickAdapter<UserDetailInfo.DataBean.PrivatePhotoBean, BaseViewHolder>(R.layout.user_info_item_album) {
|
||||
override fun convert(helper: BaseViewHolder, item: UserDetailInfo.DataBean.PrivatePhotoBean) {
|
||||
val imageView = helper.getView<ImageView>(R.id.iv_image)
|
||||
imageView.load(item.photoUrl)
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package com.chwl.app.ui.user.adapter
|
||||
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.ui.utils.load
|
||||
import com.chwl.core.bean.UserInfoItem
|
||||
import com.chwl.core.user.bean.GiftWallInfo
|
||||
|
||||
class UserInfoGiftAdapter(private val itemBgRes: Int = R.drawable.user_info_bg_gift) :
|
||||
BaseQuickAdapter<GiftWallInfo, BaseViewHolder>(R.layout.user_info_item_gift) {
|
||||
override fun onCreateDefViewHolder(parent: ViewGroup?, viewType: Int): BaseViewHolder {
|
||||
return super.onCreateDefViewHolder(parent, viewType).apply {
|
||||
getView<ImageView>(R.id.iv_bg).setImageResource(itemBgRes)
|
||||
}
|
||||
}
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: GiftWallInfo) {
|
||||
helper.setText(R.id.tv_name, item.giftName)
|
||||
helper.setText(R.id.tv_count, "x${item.reciveCount}")
|
||||
val iconView = helper.getView<ImageView>(R.id.iv_icon)
|
||||
iconView.load(item.picUrl)
|
||||
val rankView = helper.itemView.findViewById<ImageView>(R.id.iv_rank)
|
||||
if (helper.bindingAdapterPosition == 0) {
|
||||
rankView.setImageResource(R.drawable.ic_gift_one)
|
||||
} else if (helper.bindingAdapterPosition == 1) {
|
||||
rankView.setImageResource(R.drawable.ic_gift_two)
|
||||
} else if (helper.bindingAdapterPosition == 2) {
|
||||
rankView.setImageResource(R.drawable.ic_gift_three)
|
||||
} else {
|
||||
rankView.setImageDrawable(null)
|
||||
}
|
||||
}
|
||||
}
|
@@ -14,14 +14,15 @@ import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
private final List<? extends CharSequence> mTitleList;
|
||||
|
||||
private int textSize = 16;
|
||||
private float minScale = 1f;
|
||||
private int textSize = 20;
|
||||
private float minScale = 0.9f;
|
||||
private boolean showIndicator = true;
|
||||
private OnItemSelectListener mOnItemSelectListener;
|
||||
|
||||
@@ -37,11 +38,11 @@ public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, final int i) {
|
||||
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
|
||||
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.color_84868A));
|
||||
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_1E1E1F));
|
||||
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.color_7F191919));
|
||||
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_191919));
|
||||
scaleTransitionPagerTitleView.setMinScale(minScale);
|
||||
scaleTransitionPagerTitleView.setTextSize(textSize);
|
||||
int padding = UIUtil.dip2px(context, 16);
|
||||
int padding = UIUtil.dip2px(context, 12);
|
||||
scaleTransitionPagerTitleView.setPadding(padding, 0, padding, 0);
|
||||
scaleTransitionPagerTitleView.setText(mTitleList.get(i));
|
||||
scaleTransitionPagerTitleView.setOnClickListener(view -> {
|
||||
@@ -54,14 +55,14 @@ public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
|
||||
@Override
|
||||
public IPagerIndicator getIndicator(Context context) {
|
||||
if (!showIndicator) return null;
|
||||
DrawableIndicator indicator = new DrawableIndicator(context);
|
||||
indicator.setMode(DrawableIndicator.MODE_EXACTLY);
|
||||
indicator.setDrawableWidth(UIUtil.dip2px(context, 24));
|
||||
indicator.setDrawableHeight(UIUtil.dip2px(context, 8));
|
||||
indicator.setIndicatorDrawable(context.getResources().getDrawable(R.drawable.base_ic_indicator));
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
lp.gravity = Gravity.END;
|
||||
LinePagerIndicator indicator = new LinePagerIndicator(context);
|
||||
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
|
||||
indicator.setLineHeight(UIUtil.dip2px(context, 3));
|
||||
indicator.setRoundRadius(UIUtil.dip2px(context, 1.5));
|
||||
indicator.setLineWidth(UIUtil.dip2px(context, 17));
|
||||
indicator.setColors(context.getResources().getColor(R.color.color_26CC9C));
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
// lp.bottomMargin = mBottomMargin;
|
||||
indicator.setLayoutParams(lp);
|
||||
return indicator;
|
||||
}
|
||||
|
@@ -1,59 +0,0 @@
|
||||
package com.chwl.app.ui.user.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.ui.user.activity.ShowPhotoActivity;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
import com.chwl.app.ui.widget.rollviewpager.adapter.StaticPagerAdapterWrapper;
|
||||
import com.chwl.core.user.bean.UserDetailInfo;
|
||||
import com.chwl.core.user.bean.UserPhoto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @date 2017/8/7
|
||||
*/
|
||||
|
||||
public class UserInfoPhotoAdapter extends StaticPagerAdapterWrapper<UserDetailInfo.DataBean.PrivatePhotoBean> {
|
||||
private LayoutInflater mInflater;
|
||||
|
||||
public UserInfoPhotoAdapter(List<UserDetailInfo.DataBean.PrivatePhotoBean> photoBeans, Context context) {
|
||||
super(photoBeans, context);
|
||||
mInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View getView(ViewGroup container, int position) {
|
||||
UserDetailInfo.DataBean.PrivatePhotoBean photoInfo = dataList.get(position);
|
||||
ImageView imgBanner = (ImageView) mInflater.inflate(R.layout.banner_userinfo_photo_item, container, false);
|
||||
if (photoInfo == null) return imgBanner;
|
||||
ImageLoadUtils.loadImage(context, photoInfo.getPhotoUrl(), imgBanner);
|
||||
imgBanner.setOnClickListener(v -> {
|
||||
showUserPhoto(position);
|
||||
});
|
||||
return imgBanner;
|
||||
}
|
||||
|
||||
private void showUserPhoto(int position) {
|
||||
//创建一个集合拿来做用户所有照片信息
|
||||
ArrayList<UserPhoto> userPhotos = new ArrayList<>();
|
||||
for (int i = 0; i < dataList.size(); i++) {
|
||||
UserPhoto newPhoto = new UserPhoto();
|
||||
newPhoto.setPhotoUrl(dataList.get(i).getPhotoUrl());
|
||||
userPhotos.add(newPhoto);
|
||||
}
|
||||
Intent intent = new Intent(context, ShowPhotoActivity.class);
|
||||
intent.putExtra("position", position);
|
||||
intent.putExtra("photoList", userPhotos);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.chwl.app.ui.user.adapter
|
||||
|
||||
import android.view.View
|
||||
import androidx.core.view.isVisible
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.ui.utils.ImageLoadUtilsV2
|
||||
import com.chwl.core.user.bean.UserDetailInfo
|
||||
import com.zhpan.bannerview.BaseBannerAdapter
|
||||
import com.zhpan.bannerview.BaseViewHolder
|
||||
|
||||
class UserInfoTopAlbumAdapter(private val reviewStateEnabled: Boolean) :
|
||||
BaseBannerAdapter<UserDetailInfo.DataBean.PrivatePhotoBean?>() {
|
||||
override fun getLayoutId(viewType: Int): Int {
|
||||
return R.layout.user_info_item_top_album
|
||||
}
|
||||
|
||||
override fun bindData(
|
||||
helper: BaseViewHolder<UserDetailInfo.DataBean.PrivatePhotoBean?>,
|
||||
item: UserDetailInfo.DataBean.PrivatePhotoBean?,
|
||||
position: Int,
|
||||
pageSize: Int
|
||||
) {
|
||||
ImageLoadUtilsV2.loadImage(helper.findViewById(R.id.iv_image), item?.photoUrl)
|
||||
val reviewView = helper.findViewById<View>(R.id.iv_review)
|
||||
reviewView.isVisible = reviewStateEnabled && item?.isReview == true
|
||||
}
|
||||
}
|
@@ -0,0 +1,149 @@
|
||||
package com.chwl.app.ui.user.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseViewBindingFragment
|
||||
import com.chwl.app.databinding.UserInfoDataFragmentBinding
|
||||
import com.chwl.app.support.FragmentVisibleStateHelper
|
||||
import com.chwl.app.ui.user.activity.ShowPhotoActivity
|
||||
import com.chwl.app.ui.user.activity.UserInfoModifyActivity
|
||||
import com.chwl.app.ui.user.activity.UserModifyPhotosActivity
|
||||
import com.chwl.app.ui.user.adapter.UserInfoAlbumAdapter
|
||||
import com.chwl.app.ui.user.adapter.UserInfoGiftAdapter
|
||||
import com.chwl.app.ui.user.viewmodel.UserInfoViewModel
|
||||
import com.chwl.app.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
|
||||
import com.chwl.core.user.bean.UserPhoto
|
||||
import com.example.lib_utils.UiUtils
|
||||
|
||||
class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding>() {
|
||||
|
||||
private val albumAdapter = UserInfoAlbumAdapter()
|
||||
|
||||
private val giftAdapter = UserInfoGiftAdapter()
|
||||
|
||||
private val luckyGiftAdapter = UserInfoGiftAdapter(R.drawable.user_info_bg_lucku_gift)
|
||||
|
||||
private val viewModel: UserInfoViewModel by activityViewModels()
|
||||
|
||||
override fun init() {
|
||||
initAlbum()
|
||||
initGift()
|
||||
initLuckyGift()
|
||||
FragmentVisibleStateHelper(this).apply {
|
||||
this.start {
|
||||
onVisibleChanged(it, isFirstVisible)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initAlbum() {
|
||||
binding.ivAlbumMore.isVisible = viewModel.isMe
|
||||
binding.recyclerViewAlbum.adapter = albumAdapter
|
||||
binding.layoutAlbum.setOnClickListener {
|
||||
if (viewModel.isMe) {
|
||||
UserModifyPhotosActivity.startForResult(
|
||||
requireActivity(),
|
||||
viewModel.userId,
|
||||
UserInfoModifyActivity.Method.PHOTO
|
||||
)
|
||||
}
|
||||
}
|
||||
albumAdapter.setOnItemClickListener { adapter, view, position ->
|
||||
val list = albumAdapter.data.map {
|
||||
UserPhoto().apply {
|
||||
this.photoUrl = it.photoUrl
|
||||
}
|
||||
}
|
||||
showPhotoPreview(ArrayList(list), position)
|
||||
}
|
||||
viewModel.userInfoDetailData.observe(this) {
|
||||
binding.tvAlbumCount.text = "(${it.privatePhoto?.size ?: 0})"
|
||||
binding.tvAlbumStatus.isVisible = it.privatePhoto.isNullOrEmpty()
|
||||
albumAdapter.setNewData(it.privatePhoto)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initGift() {
|
||||
var isMiniMode = true
|
||||
binding.ivGiftMore.setOnClickListener {
|
||||
isMiniMode = !isMiniMode
|
||||
val list = viewModel.giftListLiveData.value ?: emptyList()
|
||||
loadListData(giftAdapter, 4, isMiniMode, list, binding.ivGiftMore)
|
||||
binding.ivGiftMore.animate().rotationBy(180f).start()
|
||||
}
|
||||
binding.recyclerViewGift.addItemDecoration(
|
||||
GridSpacingItemNewDecoration(
|
||||
UiUtils.dip2px(10f),
|
||||
UiUtils.dip2px(2f),
|
||||
true
|
||||
)
|
||||
)
|
||||
binding.recyclerViewGift.adapter = giftAdapter
|
||||
viewModel.giftListLiveData.observe(this) {
|
||||
loadListData(giftAdapter, 4, isMiniMode, it, binding.ivGiftMore)
|
||||
binding.tvGiftStatus.isVisible = it.isNullOrEmpty()
|
||||
}
|
||||
viewModel.requestGiftList()
|
||||
}
|
||||
|
||||
private fun initLuckyGift() {
|
||||
var isMiniMode = true
|
||||
binding.ivLuckyGiftMore.setOnClickListener {
|
||||
isMiniMode = !isMiniMode
|
||||
val list = viewModel.luckyGiftListLiveData.value ?: emptyList()
|
||||
loadListData(luckyGiftAdapter, 4, isMiniMode, list, binding.ivLuckyGiftMore)
|
||||
binding.ivLuckyGiftMore.animate().rotationBy(180f).start()
|
||||
}
|
||||
binding.recyclerViewLuckyGift.addItemDecoration(
|
||||
GridSpacingItemNewDecoration(
|
||||
UiUtils.dip2px(10f),
|
||||
UiUtils.dip2px(2f),
|
||||
false
|
||||
)
|
||||
)
|
||||
binding.recyclerViewLuckyGift.adapter = luckyGiftAdapter
|
||||
viewModel.luckyGiftListLiveData.observe(this) {
|
||||
loadListData(luckyGiftAdapter, 4, isMiniMode, it, binding.ivLuckyGiftMore)
|
||||
binding.tvLuckyGiftStatus.isVisible = it.isNullOrEmpty()
|
||||
}
|
||||
viewModel.requestLuckyGiftList()
|
||||
}
|
||||
|
||||
private fun <T> loadListData(
|
||||
adapter: BaseQuickAdapter<T, *>,
|
||||
miniCount: Int,
|
||||
miniOrFull: Boolean,
|
||||
list: List<T>,
|
||||
moreView: View
|
||||
) {
|
||||
val finalList = if (miniOrFull) {
|
||||
list.take(miniCount)
|
||||
} else {
|
||||
list
|
||||
}
|
||||
adapter.setNewData(finalList)
|
||||
moreView.isVisible = list.size > miniCount
|
||||
}
|
||||
|
||||
private fun showPhotoPreview(list: ArrayList<UserPhoto>, position: Int) {
|
||||
val intent = Intent(context, ShowPhotoActivity::class.java)
|
||||
intent.putExtra("position", position)
|
||||
intent.putExtra("photoList", list)
|
||||
context?.startActivity(intent)
|
||||
}
|
||||
|
||||
private fun onVisibleChanged(isVisible: Boolean, isFirstVisible: Boolean) {
|
||||
if (isVisible && !isFirstVisible) {
|
||||
if (viewModel.giftListLiveData.value.isNullOrEmpty()) {
|
||||
viewModel.requestGiftList()
|
||||
}
|
||||
if (viewModel.luckyGiftListLiveData.value.isNullOrEmpty()) {
|
||||
viewModel.requestLuckyGiftList()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -4,12 +4,15 @@ import android.annotation.SuppressLint
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.chwl.app.base.BaseViewModel
|
||||
import com.chwl.app.module_hall.HallDataManager
|
||||
import com.chwl.core.auth.AuthModel
|
||||
import com.chwl.core.module_hall.hall.HallModel
|
||||
import com.chwl.core.module_hall.hall.bean.ClanAndHallInfo
|
||||
import com.chwl.core.module_hall.hall.bean.UserClanInfo
|
||||
import com.chwl.core.user.UserInfoUiMgr
|
||||
import com.chwl.core.user.UserModel
|
||||
import com.chwl.core.user.bean.GiftWallInfo
|
||||
import com.chwl.core.user.bean.UserDetailInfo
|
||||
import com.chwl.core.user.bean.UserInfo
|
||||
import com.chwl.core.utils.net.BeanObserver
|
||||
@@ -17,13 +20,13 @@ import com.chwl.core.utils.extension.toast
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
class UserInfoViewModel : ViewModel() {
|
||||
val userId: Long by lazy {
|
||||
UserInfoUiMgr.get().uid
|
||||
}
|
||||
class UserInfoViewModel : BaseViewModel() {
|
||||
var userId: Long = 0
|
||||
|
||||
var mRoomUid: Long = 0
|
||||
|
||||
val isMe get() = userId == AuthModel.get().currentUid
|
||||
|
||||
private val _userInfoData = MutableLiveData<UserInfo>()
|
||||
val userInfoData: LiveData<UserInfo> = _userInfoData
|
||||
|
||||
@@ -32,9 +35,8 @@ class UserInfoViewModel : ViewModel() {
|
||||
|
||||
val userClanData = MutableLiveData<UserClanInfo>()
|
||||
|
||||
private val disposable: CompositeDisposable by lazy {
|
||||
CompositeDisposable()
|
||||
}
|
||||
val giftListLiveData = MutableLiveData<List<GiftWallInfo>>()
|
||||
val luckyGiftListLiveData = MutableLiveData<List<GiftWallInfo>>()
|
||||
|
||||
fun getUserInfo() {
|
||||
UserModel.get().getUserInfoFromServer(userId)
|
||||
@@ -46,21 +48,30 @@ class UserInfoViewModel : ViewModel() {
|
||||
override fun onSuccess(info: UserInfo) {
|
||||
_userInfoData.value = info
|
||||
}
|
||||
override fun onSubscribe(d: Disposable) { disposable.add(d) }
|
||||
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun getUserInfoDetail() {
|
||||
UserModel.get().getUserInfoDetail(userId)
|
||||
.subscribe(object : BeanObserver<UserDetailInfo?>() {
|
||||
override fun onErrorMsg(error: String) { error.toast() }
|
||||
override fun onErrorMsg(error: String) {
|
||||
error.toast()
|
||||
}
|
||||
|
||||
override fun onSuccess(info: UserDetailInfo) {
|
||||
info.let {
|
||||
mRoomUid = it.data.roomUid
|
||||
_userInfoDetailData.value = it.data
|
||||
}
|
||||
}
|
||||
override fun onSubscribe(d: Disposable) { disposable.add(d) }
|
||||
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -75,11 +86,18 @@ class UserInfoViewModel : ViewModel() {
|
||||
th.message?.toast()
|
||||
}
|
||||
)
|
||||
disposable.add(subscribe)
|
||||
addDisposable(subscribe)
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
disposable.dispose()
|
||||
fun requestGiftList() {
|
||||
addDisposable(UserModel.get().requestUserGiftWall(userId, 1, 2).subscribe { it ->
|
||||
giftListLiveData.postValue(it)
|
||||
})
|
||||
}
|
||||
|
||||
fun requestLuckyGiftList() {
|
||||
addDisposable(UserModel.get().requestUserGiftWall(userId, 2, 2).subscribe { it ->
|
||||
luckyGiftListLiveData.postValue(it)
|
||||
})
|
||||
}
|
||||
}
|
@@ -19,7 +19,7 @@ public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffset
|
||||
onStateChanged(appBarLayout, State.EXPANDED);
|
||||
}
|
||||
mCurrentState = State.EXPANDED;
|
||||
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {
|
||||
} else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange() * getBias()) {
|
||||
if (mCurrentState != State.COLLAPSED) {
|
||||
onStateChanged(appBarLayout, State.COLLAPSED);
|
||||
}
|
||||
@@ -32,5 +32,9 @@ public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffset
|
||||
}
|
||||
}
|
||||
|
||||
protected float getBias() {
|
||||
return 1f;
|
||||
}
|
||||
|
||||
public abstract void onStateChanged(AppBarLayout appBarLayout, State state);
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xxhdpi/user_info_bg_gift.webp
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
app/src/main/res/drawable-xxhdpi/user_info_bg_good_id.9.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable-xxhdpi/user_info_bg_lucku_gift.webp
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
app/src/main/res/drawable-xxhdpi/user_info_ic_arrow_down.webp
Normal file
After Width: | Height: | Size: 336 B |
BIN
app/src/main/res/drawable-xxhdpi/user_info_ic_arrow_right.webp
Normal file
After Width: | Height: | Size: 468 B |
BIN
app/src/main/res/drawable-xxhdpi/user_info_ic_copy.webp
Normal file
After Width: | Height: | Size: 306 B |
BIN
app/src/main/res/drawable-xxhdpi/user_info_ic_id.webp
Normal file
After Width: | Height: | Size: 600 B |
7
app/src/main/res/drawable/shape_white_top_8dp.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/white"/>
|
||||
<corners android:topLeftRadius="@dimen/dp_8"
|
||||
android:topRightRadius="@dimen/dp_8"/>
|
||||
</shape>
|
10
app/src/main/res/drawable/user_info_bg_fans_follow.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_14" />
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#41EABA"
|
||||
android:startColor="#26CC9C " />
|
||||
</shape>
|
@@ -1,7 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="12dp" />
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_11"
|
||||
android:bottomRightRadius="0px"
|
||||
android:topLeftRadius="@dimen/dp_11"
|
||||
android:topRightRadius="0px" />
|
||||
|
||||
<gradient android:startColor="#70E9FF" android:centerColor="#AE87FF" android:endColor="#FF5CE1"/>
|
||||
<gradient
|
||||
android:endColor="#FFD936"
|
||||
android:startColor="#F2A20F" />
|
||||
</shape>
|
@@ -2,6 +2,7 @@
|
||||
<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">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -26,100 +27,108 @@
|
||||
app:contentScrim="@color/white"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="@dimen/dp_20">
|
||||
android:clipToPadding="false">
|
||||
|
||||
<com.chwl.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/roll_view"
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_190"
|
||||
android:layout_height="@dimen/dp_256"
|
||||
app:bvp_auto_play="true"
|
||||
app:bvp_can_loop="true"
|
||||
app:bvp_indicator_checked_color="#FFFFFF"
|
||||
app:bvp_indicator_gravity="end"
|
||||
app:bvp_indicator_normal_color="#4CFFFFFF"
|
||||
app:bvp_indicator_slide_mode="scale"
|
||||
app:bvp_indicator_style="round_rect"
|
||||
app:bvp_indicator_visibility="visible"
|
||||
app:bvp_interval="5000"
|
||||
app:bvp_scroll_duration="500"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:rollviewpager_play_delay="5000" />
|
||||
tools:background="@drawable/default_banner" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_166"
|
||||
android:background="@drawable/user_info_bg_top_cover"
|
||||
app:layout_constraintTop_toTopOf="@id/roll_view" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llAudio"
|
||||
android:layout_width="@dimen/dp_98"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_marginTop="@dimen/dp_132"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:background="@drawable/user_info_bg_audio"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_audio_control"
|
||||
android:layout_width="@dimen/dp_26"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:src="@drawable/user_info_ic_audio_play" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/liv_user"
|
||||
android:layout_width="@dimen/dp_23"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:layout_marginStart="@dimen/dp_7"
|
||||
android:src="@drawable/user_info_ic_audio_palying"
|
||||
app:autoPlay="true" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvAudio"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
tools:text="60S" />
|
||||
|
||||
</LinearLayout>
|
||||
app:layout_constraintTop_toTopOf="@id/banner_view" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_180"
|
||||
android:background="@drawable/shape_white_top_12dp"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
android:background="@drawable/shape_white_top_8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="@id/iv_user_head" />
|
||||
|
||||
<com.chwl.app.common.widget.CircleImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/iv_user_head"
|
||||
android:layout_width="@dimen/dp_88"
|
||||
android:layout_height="@dimen/dp_88"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:layout_width="@dimen/dp_74"
|
||||
android:layout_height="@dimen/dp_74"
|
||||
android:layout_marginTop="@dimen/dp_179"
|
||||
android:padding="@dimen/dp_0_5"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/v_bg" />
|
||||
app:layout_constraintTop_toTopOf="@id/banner_view"
|
||||
app:shapeAppearance="@style/shape_circle"
|
||||
app:strokeColor="@color/white"
|
||||
app:strokeWidth="@dimen/dp_1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head_wear"
|
||||
android:layout_width="@dimen/dp_97"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_user_head"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_user_head"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_user_head"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_user_head" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_gender_age"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_user_head"
|
||||
tools:text="Name" />
|
||||
|
||||
<com.chwl.app.view.GenderAgeTextView
|
||||
android:id="@+id/tv_gender_age"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_nick"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_nick"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_nick" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_live"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:background="@drawable/user_info_bg_live"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp_7"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_user_head"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_user_head"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_user_head"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
@@ -134,139 +143,101 @@
|
||||
android:id="@+id/tvLive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:text="@string/me_in_live"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11" />
|
||||
android:textColor="#F7F7F7"
|
||||
android:textSize="@dimen/dp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_1E1E1F"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_id"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_gender_age"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_user_head"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_user_head"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_goneMarginStart="@dimen/dp_12"
|
||||
tools:text="Name" />
|
||||
|
||||
<com.chwl.app.view.GenderAgeTextView
|
||||
android:id="@+id/tv_gender_age"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/tv_nick"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_nick" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_id"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_desc"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_nick"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_nick">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_id"
|
||||
android:layout_width="@dimen/dp_11"
|
||||
android:layout_height="@dimen/dp_11"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:src="@drawable/user_info_ic_id" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_erban_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_84868A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="ID:7958626" />
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:textColor="@color/color_CC191919"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="7958626" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_good_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:src="@mipmap/ic_good_num"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="@dimen/dp_7"
|
||||
android:layout_marginHorizontal="@dimen/dp_8"
|
||||
android:background="#FFB4B7BD" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:baselineAligned="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fans_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_84868A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="19" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_fan_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:text="@string/fan"
|
||||
android:textColor="@color/color_84868A"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
android:id="@+id/iv_id_copy"
|
||||
android:layout_width="@dimen/dp_13"
|
||||
android:layout_height="@dimen/dp_13"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:src="@drawable/user_info_ic_copy" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_region"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_84868A"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_level"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_nick"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_id"
|
||||
tools:text="@string/layout_activity_user_info_04" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_id">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_region"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="@dimen/dp_12"
|
||||
tools:text="GZ" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v_region_birthday_line"
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="@dimen/dp_7_5"
|
||||
android:layout_marginHorizontal="@dimen/dp_6"
|
||||
android:background="#1A1A1A" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_birthday"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="@dimen/dp_12"
|
||||
tools:text="2000-10-12" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_level"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_user_head"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_nick"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_desc">
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_region">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
@@ -334,13 +305,125 @@
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/dp_23"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="#991A1A1A"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_level"
|
||||
tools:text="@string/layout_activity_user_info_04" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_marginHorizontal="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:background="@drawable/user_info_bg_fans_follow"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_desc">
|
||||
|
||||
<View
|
||||
android:id="@+id/v_fans_follow_line"
|
||||
android:layout_width="@dimen/dp_1_5"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:background="#99FFFFFF"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_follow_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/attention"
|
||||
android:textColor="#CCFFFFFF"
|
||||
android:textSize="@dimen/dp_13"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_follow_count"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.271"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_follow_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_18"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/tv_follow_title"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_follow_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_follow_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fans_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fan"
|
||||
android:textColor="#CCFFFFFF"
|
||||
android:textSize="@dimen/dp_13"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_fans_count"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.728"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fans_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_18"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/tv_fans_title"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_fans_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_fans_title" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v_follow_click"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/v_fans_follow_line"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v_fans_click"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/v_fans_follow_line"
|
||||
tools:visibility="gone" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/tb_user_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_44"
|
||||
android:paddingTop="@dimen/dp_30"
|
||||
android:visibility="visible"
|
||||
app:contentInsetStart="0dp"
|
||||
app:layout_collapseMode="pin">
|
||||
@@ -393,28 +476,22 @@
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
|
||||
<com.chwl.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:layout_marginStart="@dimen/dp_4" />
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:background="@color/color_F7F7F7" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:paddingStart="@dimen/dp_3"
|
||||
tools:background="#22000000" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:background="#33000000" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop" />
|
||||
|
205
app/src/main/res/layout/user_info_data_fragment.xml
Normal file
@@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="@dimen/dp_66">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_album"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_21">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_album_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/picker_image_folder"
|
||||
android:textColor="#191919"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_album_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:text="(0)"
|
||||
android:textColor="#666666"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_album_title"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_album_title"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_album_title" />
|
||||
|
||||
<com.chwl.app.view.AutoMirroredImageView
|
||||
android:id="@+id/iv_album_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@drawable/user_info_ic_arrow_right"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_album_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_album_title" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_album"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_81"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
android:overScrollMode="never"
|
||||
android:paddingHorizontal="@dimen/dp_13"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_album_title"
|
||||
tools:background="#33000000"
|
||||
tools:listitem="@layout/user_info_item_album" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_album_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/photo_album_empty_tips"
|
||||
android:textColor="#7F191919"
|
||||
android:textSize="@dimen/dp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/recycler_view_album"
|
||||
app:layout_constraintEnd_toEndOf="@id/recycler_view_album"
|
||||
app:layout_constraintStart_toStartOf="@id/recycler_view_album"
|
||||
app:layout_constraintTop_toTopOf="@id/recycler_view_album" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_21">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/me_ordinary_gift"
|
||||
android:textColor="#191919"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:minHeight="@dimen/dp_81"
|
||||
android:orientation="vertical"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_gift_title"
|
||||
app:spanCount="4"
|
||||
tools:background="#33000000"
|
||||
tools:listitem="@layout/user_info_item_gift" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_empty_tips"
|
||||
android:textColor="#7F191919"
|
||||
android:textSize="@dimen/dp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/recycler_view_gift"
|
||||
app:layout_constraintEnd_toEndOf="@id/recycler_view_gift"
|
||||
app:layout_constraintStart_toStartOf="@id/recycler_view_gift"
|
||||
app:layout_constraintTop_toTopOf="@id/recycler_view_gift" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift_more"
|
||||
android:layout_width="@dimen/dp_25"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/user_info_ic_arrow_down"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/recycler_view_gift"
|
||||
tools:visibility="visible" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_lucky_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lucky_gift_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/me_lucky_gift"
|
||||
android:textColor="#191919"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_lucky_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:minHeight="@dimen/dp_81"
|
||||
android:orientation="vertical"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_lucky_gift_title"
|
||||
app:spanCount="4"
|
||||
tools:background="#33000000"
|
||||
tools:listitem="@layout/user_info_item_gift" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lucky_gift_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_empty_tips"
|
||||
android:textColor="#7F191919"
|
||||
android:textSize="@dimen/dp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/recycler_view_lucky_gift"
|
||||
app:layout_constraintEnd_toEndOf="@id/recycler_view_lucky_gift"
|
||||
app:layout_constraintStart_toStartOf="@id/recycler_view_lucky_gift"
|
||||
app:layout_constraintTop_toTopOf="@id/recycler_view_lucky_gift" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_lucky_gift_more"
|
||||
android:layout_width="@dimen/dp_25"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/user_info_ic_arrow_down"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/recycler_view_lucky_gift"
|
||||
tools:visibility="visible" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
21
app/src/main/res/layout/user_info_item_album.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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="@dimen/dp_2"
|
||||
tools:layout_height="@dimen/dp_81">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/iv_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:shapeAppearance="@style/shape_corner_12dp"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
77
app/src/main/res/layout/user_info_item_gift.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout_width="@dimen/dp_84">
|
||||
|
||||
<com.chwl.app.view.AutoMirroredImageView
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/user_info_bg_gift"
|
||||
app:layout_constraintDimensionRatio="84:116"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.214"
|
||||
app:layout_constraintWidth_percent="0.714"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_3_5"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/ic_gift_one"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.214"
|
||||
app:layout_constraintWidth_percent="0.226" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:textColor="#515860"
|
||||
android:textSize="@dimen/dp_11"
|
||||
app:autoSizeMaxTextSize="@dimen/dp_11"
|
||||
app:autoSizeMinTextSize="@dimen/dp_8"
|
||||
app:autoSizeStepGranularity="1px"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_count"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_icon"
|
||||
tools:text="Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:textColor="#99515860"
|
||||
android:textSize="@dimen/dp_11"
|
||||
app:autoSizeMaxTextSize="@dimen/dp_11"
|
||||
app:autoSizeMinTextSize="@dimen/dp_8"
|
||||
app:autoSizeStepGranularity="1px"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name"
|
||||
tools:text="x10" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
23
app/src/main/res/layout/user_info_item_top_album.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_review"
|
||||
android:layout_width="@dimen/dp_86"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:src="@drawable/ic_album_auditing"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
@@ -5301,4 +5301,7 @@
|
||||
<string name="level_up_wear_dress_tips_format">تهانينا على أن تصبح (%s)! تم ارتداء هذا المستوى من الزي تلقائيًا. هل تريد الاحتفاظ بالزي الأصلي ام لا ؟</string>
|
||||
<string name="home_room_card_topic_empty_def">اهلا بك في غرفتي</string>
|
||||
<string name="lately">مؤخرًا</string>
|
||||
|
||||
<string name="photo_album_empty_tips">塹無照片</string>
|
||||
<string name="gift_empty_tips">塹無禮物</string>
|
||||
</resources>
|
@@ -5243,4 +5243,6 @@
|
||||
<string name="level_up_wear_dress_tips_format">恭喜你成為「%s」!當前已自動佩戴該等級裝扮,是否保留原有裝扮?</string>
|
||||
<string name="home_room_card_topic_empty_def">歡迎來到我的房間</string>
|
||||
<string name="lately">最近</string>
|
||||
<string name="photo_album_empty_tips">塹無照片</string>
|
||||
<string name="gift_empty_tips">塹無禮物</string>
|
||||
</resources>
|
@@ -737,4 +737,9 @@
|
||||
<color name="color_73B8FF">#73B8FF</color>
|
||||
<color name="color_FF396F">#FF396F</color>
|
||||
<color name="color_FF4B81">#FF4B81</color>
|
||||
<color name="color_26CC9C">#26CC9C</color>
|
||||
<color name="color_191919">#191919</color>
|
||||
<color name="color_7F191919">#7F191919</color>
|
||||
<color name="color_CC191919">#CC191919</color>
|
||||
<color name="color_FEFFBF">#FEFFBF</color>
|
||||
</resources>
|
||||
|
@@ -5282,6 +5282,9 @@ You cannot join again within 24 hours after leaving</string>
|
||||
<string name="level_up_wear_dress_tips_format">Congratulations on becoming (%s)! This level of uniform was worn automatically. Do you want to wear the original dress or not?</string>
|
||||
<string name="home_room_card_topic_empty_def">Welcome to my room</string>
|
||||
<string name="lately">Recent</string>
|
||||
|
||||
<string name="photo_album_empty_tips">塹無照片</string>
|
||||
<string name="gift_empty_tips">塹無禮物</string>
|
||||
</resources>
|
||||
|
||||
|
||||
|
@@ -623,4 +623,9 @@
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSize">@dimen/dp_8</item>
|
||||
</style>
|
||||
|
||||
<style name="shape_corner_12dp">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSize">@dimen/dp_12</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
@@ -113,4 +113,14 @@ public class HeadWearInfo extends BaseDecoration implements Serializable {
|
||||
public boolean isRenew() {
|
||||
return status == HeadWearInfo.STATUS_IN_USED;
|
||||
}
|
||||
|
||||
public String getFirstUrl() {
|
||||
if (effect != null && effect.length() > 0) {
|
||||
return effect;
|
||||
}
|
||||
if (pic != null && pic.length() > 0) {
|
||||
return pic;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|