[Modify]修改用户未加入房间时的展示逻辑

This commit is contained in:
wushaocheng
2023-01-12 23:04:19 +08:00
parent 4397cbb2ab
commit da012b004a
3 changed files with 23 additions and 1 deletions

View File

@@ -79,10 +79,19 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
private fun initPersonalData(clanAndHallInfo: ClanAndHallInfo) { private fun initPersonalData(clanAndHallInfo: ClanAndHallInfo) {
val hallInfo: HallInfo? = clanAndHallInfo.hall val hallInfo: HallInfo? = clanAndHallInfo.hall
val clanInfo: ClanInfo? = clanAndHallInfo.clan val clanInfo: ClanInfo? = clanAndHallInfo.clan
if (hallInfo != null && hallInfo.hallId > 0) { if (hallInfo != null && hallInfo.hallId > 0) {
binding.tvRoom.visibility = View.VISIBLE
binding.tvJoinRoom.visibility = View.GONE
binding.tvRoom.text = hallInfo.hallName binding.tvRoom.text = hallInfo.hallName
} else { } else {
binding.llRoom.visibility = View.GONE binding.tvRoom.visibility = View.GONE
binding.tvJoinRoom.visibility = View.VISIBLE
if (AuthModel.get().currentUid == hallInfo?.ownerUid) {
binding.tvJoinRoom.text = getString(R.string.no_room_has_been_added_yet)
}else{
binding.tvJoinRoom.text = getString(R.string.user_no_room_has_been_added_yet)
}
} }
if (clanInfo != null && clanInfo.id > 0) { if (clanInfo != null && clanInfo.id > 0) {
binding.tvAssociation.text = clanInfo.name binding.tvAssociation.text = clanInfo.name

View File

@@ -108,6 +108,17 @@
android:textSize="@dimen/sp_12" android:textSize="@dimen/sp_12"
tools:text="QX家族" /> tools:text="QX家族" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvJoinRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10"
android:visibility="gone"
android:gravity="center"
android:textColor="@color/text_title_color"
android:textSize="@dimen/sp_12"
tools:text="@string/no_room_has_been_added_yet"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout

View File

@@ -5047,5 +5047,7 @@
<string name="user_room">房間:</string> <string name="user_room">房間:</string>
<string name="user_association">公會:</string> <string name="user_association">公會:</string>
<string name="sound_duration">%d"</string> <string name="sound_duration">%d"</string>
<string name="no_room_has_been_added_yet">暫未加入房間</string>
<string name="user_no_room_has_been_added_yet">該用戶暫未加入房間</string>
</resources> </resources>