个人主页公会模块优化

This commit is contained in:
huangjian
2021-09-03 14:44:14 +08:00
parent e74c880b74
commit 42cac60d44
3 changed files with 56 additions and 26 deletions

View File

@@ -318,40 +318,36 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
boolean showApply = AuthModel.get().getCurrentUid() != userId && HallDataManager.get().getHallId() <= 0;
if (hallInfo != null && hallInfo.getHallId() > 0) {
mBinding.llHall.setVisibility(View.VISIBLE);
mBinding.tvHallId.setText("公会ID:" + hallInfo.getHallId() + "");
mBinding.tvHallId.setText("房间ID:" + hallInfo.getHallId() + "");
mBinding.tvHallName.setText(hallInfo.getHallName());
mBinding.tvHallMemberNum.setText("公会人数:" + hallInfo.getMemberCount());
mBinding.tvHallMemberNum.setText("房间人数:" + hallInfo.getMemberCount());
GlideApp.with(this)
.load(hallInfo.getOwnerAvatar())
.placeholder(R.drawable.default_avatar)
.into(mBinding.ivHallAvatar);
if (clanInfo == null || clanInfo.getId() <= 0) {
mBinding.tvOnlyHallDetail.setVisibility(View.VISIBLE);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(ScreenUtil.dip2px(15), ScreenUtil.dip2px(14), ScreenUtil.dip2px(15), 0);
mBinding.llHall.setPadding(ScreenUtil.dip2px(1), ScreenUtil.dip2px(2), ScreenUtil.dip2px(2), ScreenUtil.dip2px(15));
mBinding.llHall.setLayoutParams(layoutParams);
mBinding.llHall.setBackgroundResource(R.drawable.bg_corner_shadow_12);
mBinding.llHall.setBackgroundResource(R.drawable.bg_secondary_radius_10);
mBinding.flRoomBg.setVisibility(View.GONE);
} else {
mBinding.llHall.setBackgroundResource(R.drawable.bg_3c3c4e_radius_10);
mBinding.flRoomBg.setVisibility(View.VISIBLE);
}
if (showApply) {
mBinding.tvApplyHall.setVisibility(View.VISIBLE);
mBinding.tvApplyHall.setOnClickListener(v -> applyJoinHall(hallInfo.getHallId()));
} else {
mBinding.tvApplyHall.setVisibility(View.GONE);
}
} else {
mBinding.llHall.setVisibility(View.GONE);
}
if (clanInfo != null && clanInfo.getId() > 0) {
if (hallInfo != null && hallInfo.getHallId() > 0) {
mBinding.tvHallDetail.setText("家族.公会");
} else {
mBinding.tvHallDetail.setText("家族");
}
mBinding.llModuleHall.setVisibility(View.VISIBLE);
mBinding.llClan.setVisibility(View.VISIBLE);
mBinding.tvClanId.setText("家族ID:" + clanInfo.getId());
mBinding.tvClanId.setText("公会ID:" + clanInfo.getId());
mBinding.tvClanName.setText(clanInfo.getName());
mBinding.tvClanMemberNum.setText("家族人数:" + clanInfo.getClanMemberNum());
mBinding.tvClanHallNum.setText("公会数量:" + clanInfo.getClanHallNum());
mBinding.tvClanMemberNum.setText("公会人数:" + clanInfo.getClanMemberNum());
mBinding.tvClanHallNum.setText("房间数量:" + clanInfo.getClanHallNum());
GlideApp.with(this)
.load(clanInfo.getAvatar())
.placeholder(R.drawable.default_avatar)
@@ -360,8 +356,14 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
.load(clanInfo.getLevelIcon())
.placeholder(R.drawable.default_cover)
.into(mBinding.ivClanLevel);
if (hallInfo != null && hallInfo.getHallId() > 0) {
mBinding.llModuleHall.setBackgroundResource(R.drawable.bg_secondary_radius_top_10);
} else {
mBinding.llModuleHall.setBackgroundResource(R.drawable.bg_secondary_radius_10);
}
} else {
mBinding.llClan.setVisibility(View.GONE);
mBinding.llModuleHall.setVisibility(View.GONE);
}
/* mBinding.llHall.setOnClickListener(v -> {
if (hallInfo != null && hallInfo.getHallId() != 0) {

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="10dp"
android:height="20dp"
android:viewportWidth="10"
android:viewportHeight="20"
android:tint="#2A2A39">
<path
android:fillColor="#ffffff"
android:pathData="M 0,0 h10 V20 z"/>
</vector>

View File

@@ -236,6 +236,7 @@
android:textSize="@dimen/dp_11"
app:layout_constraintTop_toBottomOf="@id/ll_id"
tools:text="喜欢我就关注我" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
@@ -247,6 +248,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="15dp"
android:background="@drawable/bg_3c3c4e_radius_10"
android:gravity="center_vertical"
@@ -268,8 +270,7 @@
android:paddingEnd="@dimen/dp_15"
android:text="所属房间"
android:textColor="@color/text_normal_c6c6e9"
android:textSize="@dimen/sp_13"
android:visibility="visible" />
android:textSize="@dimen/sp_13" />
<LinearLayout
android:layout_width="match_parent"
@@ -386,7 +387,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_15"
android:paddingBottom="@dimen/dp_15">
android:paddingBottom="@dimen/dp_5">
<com.yizhuan.erban.common.widget.RectRoundImageView
android:id="@+id/iv_clan_avatar"
@@ -477,17 +478,34 @@
android:id="@+id/line_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginBottom="25dp"
app:layout_constraintBottom_toBottomOf="@id/ll_module_hall"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_goneMarginBottom="0dp" />
<com.coorchice.library.SuperTextView
<FrameLayout
android:id="@+id/fl_room_bg"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_marginStart="100dp"
android:layout_marginEnd="15dp"
android:background="@color/bg_secondary_2a2a39"
app:layout_constraintTop_toBottomOf="@id/ll_module_hall" />
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/ll_module_hall"
tools:visibility="visible">
<View
android:layout_width="10dp"
android:layout_height="20dp"
android:background="@drawable/bg_user_info_room" />
<View
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_marginStart="10dp"
android:background="@color/bg_secondary_2a2a39" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>