[Modify]加入房间功能开发

This commit is contained in:
wushaocheng
2023-02-20 22:04:41 +08:00
parent 333c0a2510
commit eda754d78a
9 changed files with 38 additions and 4 deletions

View File

@@ -76,4 +76,15 @@
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/tvApply"
android:layout_width="70dp"
android:layout_height="25dp"
android:layout_marginEnd="@dimen/dp_16"
android:background="@drawable/bg_common_select"
android:gravity="center"
android:textColor="@color/color_selector_6d6b89_false_ffffff"
android:textSize="@dimen/sp_12"
tools:text="@string/have_apply" />
</LinearLayout>

View File

@@ -76,6 +76,8 @@ public class ModuleClanActivity extends BaseActivity implements View.OnClickList
binding = ActivityModuleClanBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
binding.ivBack.setOnClickListener(this);
binding.tvHallAdmin.setOnClickListener(this);
binding.tvHallIncome.setOnClickListener(this);
@@ -141,8 +143,14 @@ public class ModuleClanActivity extends BaseActivity implements View.OnClickList
loadHallList();
if (clanInfo.isElderHasExchangeManagerAuth()) {
binding.tvHallExchange.setVisibility(View.VISIBLE);
binding.tvHallIncome.setBackgroundResource(R.drawable.bg_hall_income_small);
binding.tvHallAdmin.setBackgroundResource(R.drawable.bg_hall_admin_small);
binding.tvHallExchange.setBackgroundResource(R.drawable.bg_hall_exchange_small);
} else {
binding.tvHallExchange.setVisibility(View.GONE);
binding.tvHallIncome.setBackgroundResource(R.drawable.bg_hall_income);
binding.tvHallAdmin.setBackgroundResource(R.drawable.bg_hall_admin);
binding.tvHallExchange.setBackgroundResource(R.drawable.bg_hall_exchange);
}
} else {
binding.clClan.setVisibility(View.GONE);

View File

@@ -1,6 +1,7 @@
package com.yizhuan.erban.module_hall.hall.adapter;
import android.view.View;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
@@ -21,27 +22,41 @@ public class AssociationRoomAdapter extends BaseQuickAdapter<HallListInfo, BaseV
@Override
protected void convert(BaseViewHolder helper, HallListInfo item) {
if (helper.getAdapterPosition() == 0) {
if (helper.getLayoutPosition() == 0) {
helper.getView(R.id.view_guild).setVisibility(View.VISIBLE);
helper.getView(R.id.tv_guild).setVisibility(View.GONE);
helper.getView(R.id.view_guild).setBackgroundResource(R.drawable.guild_one);
} else if (helper.getAdapterPosition() == 1) {
} else if (helper.getLayoutPosition() == 1) {
helper.getView(R.id.view_guild).setVisibility(View.VISIBLE);
helper.getView(R.id.tv_guild).setVisibility(View.GONE);
helper.getView(R.id.view_guild).setBackgroundResource(R.drawable.guild_two);
} else if (helper.getAdapterPosition() == 2) {
} else if (helper.getLayoutPosition() == 2) {
helper.getView(R.id.view_guild).setVisibility(View.VISIBLE);
helper.getView(R.id.tv_guild).setVisibility(View.GONE);
helper.getView(R.id.view_guild).setBackgroundResource(R.drawable.guild_three);
} else {
helper.getView(R.id.view_guild).setVisibility(View.GONE);
helper.getView(R.id.tv_guild).setVisibility(View.VISIBLE);
helper.setText(R.id.tv_guild, String.valueOf(helper.getAdapterPosition() + 1));
helper.setText(R.id.tv_guild, String.valueOf(helper.getLayoutPosition() + 1));
}
ImageLoadUtilsV2.loadAvatar(helper.getView(R.id.iv_guild_icon), item.getOwnerAvatar());
helper.setText(R.id.tv_name, item.getHallName());
helper.setText(R.id.tv_room_id, mContext.getString(R.string.association_room_id, String.valueOf(item.getOwnerErbanNo())));
TextView tvApply = helper.getView(R.id.tvApply);
if (item.getApplyBtnStatus() == 0) {
tvApply.setVisibility(View.GONE);
} else if (item.getApplyBtnStatus() == 1) {
tvApply.setVisibility(View.VISIBLE);
tvApply.setSelected(true);
tvApply.setText(mContext.getString(R.string.apply_join));
} else if (item.getApplyBtnStatus() == 2) {
tvApply.setVisibility(View.VISIBLE);
tvApply.setSelected(false);
tvApply.setText(mContext.getString(R.string.have_apply));
}
helper.addOnClickListener(R.id.tvApply);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB