[BugFix]加入房間按鈕修改
This commit is contained in:
@@ -86,9 +86,7 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapte
|
||||
holder.stvOp.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_ffbc51_15));
|
||||
}
|
||||
holder.addOnClickListener(R.id.stv_op);
|
||||
if (!UserModel.get().isMyseft(item.getUid())) {
|
||||
holder.stvOp.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
if (UserModel.get().isMyseft(item.getUid())) {
|
||||
holder.stvOp.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ import com.yizhuan.erban.module_hall.HallDataManager;
|
||||
import com.yizhuan.erban.module_hall.hall.adapter.GroupMemberListAdapter;
|
||||
import com.yizhuan.erban.module_hall.hall.presenter.ModuleHallPresenter;
|
||||
import com.yizhuan.erban.module_hall.hall.view.IModuleHallView;
|
||||
import com.yizhuan.erban.module_hall.team.activity.HallTeamMessageActivity;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.yizhuan.erban.ui.user.activity.UserInfoActivity;
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -103,7 +103,6 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
binding.ivBack.setOnClickListener(this);
|
||||
binding.ivSetting.setOnClickListener(this);
|
||||
binding.tvExit.setOnClickListener(this);
|
||||
binding.tvJoinRoom.setOnClickListener(this);
|
||||
hallId = getIntent().getLongExtra(KEY_HALL_ID, HallModel.get().getHallId());
|
||||
ownerUid = getIntent().getLongExtra(KEY_OWNER_UID, AuthModel.get().getCurrentUid());
|
||||
isSelfHall = hallId == HallModel.get().getHallId();
|
||||
@@ -142,7 +141,7 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
binding.tvJoinRoom.setOnClickListener(view -> {
|
||||
if(joinRoomInfo != null) {
|
||||
if (joinRoomInfo.getHallBtnStatus() == 3) {
|
||||
HallTeamMessageActivity.start(this, String.valueOf(joinRoomInfo.getHallMessageUid()));
|
||||
NimP2PMessageActivity.startRecord(this, String.valueOf(joinRoomInfo.getHallMessageUid()), String.valueOf(joinRoomInfo.getRecordId()));
|
||||
} else if (joinRoomInfo.getHallBtnStatus() == 1) {
|
||||
getDialogManager().showProgressDialog(context);
|
||||
HallModel.get().applyJoinHall(hallId)
|
||||
@@ -443,9 +442,6 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
break;
|
||||
case R.id.tv_exit:
|
||||
showExitDialog();
|
||||
break;
|
||||
case R.id.tvJoinRoom:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -19,8 +19,8 @@ import com.yizhuan.erban.common.EmptyViewHelper
|
||||
import com.yizhuan.erban.databinding.FragmentAssociationRoomBinding
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity
|
||||
import com.yizhuan.erban.module_hall.hall.adapter.AssociationRoomAdapter
|
||||
import com.yizhuan.erban.module_hall.team.activity.HallTeamMessageActivity
|
||||
import com.yizhuan.erban.module_hall.viewmodel.AssociationViewModel
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.association.bean.HallListInfo
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel
|
||||
@@ -42,7 +42,7 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
private lateinit var associationRoomAdapter: AssociationRoomAdapter
|
||||
private lateinit var rvDelegate: RVDelegate<HallListInfo>
|
||||
|
||||
private var list : MutableList<HallListInfo> = ArrayList()
|
||||
private var list: MutableList<HallListInfo> = ArrayList()
|
||||
|
||||
private val associationViewModel: AssociationViewModel by viewModels()
|
||||
|
||||
@@ -50,13 +50,18 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
binding.mTvSearch.setOnClickListener {
|
||||
if (!TextUtils.isEmpty(binding.etSearch.text.toString())) {
|
||||
val hallList = list
|
||||
val list = hallList.filter { it.hallName.contains(binding.etSearch.text.toString()) || it.hallId.toString().contains(binding.etSearch.text.toString()) }
|
||||
if(list.isEmpty()){
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text = getString(R.string.no_search_room)
|
||||
val list = hallList.filter {
|
||||
it.hallName.contains(binding.etSearch.text.toString()) || it.hallId.toString()
|
||||
.contains(binding.etSearch.text.toString())
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text =
|
||||
getString(R.string.no_search_room)
|
||||
}
|
||||
rvDelegate.setNewData(list)
|
||||
}else{
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text = getString(R.string.association_hall_list_empty)
|
||||
} else {
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text =
|
||||
getString(R.string.association_hall_list_empty)
|
||||
rvDelegate.setNewData(list)
|
||||
}
|
||||
hideSoftInput()
|
||||
@@ -68,7 +73,8 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
|
||||
override fun afterTextChanged(s: Editable) {
|
||||
if (s.toString() == "") {
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text = getString(R.string.association_hall_list_empty)
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text =
|
||||
getString(R.string.association_hall_list_empty)
|
||||
rvDelegate.setNewData(list)
|
||||
}
|
||||
}
|
||||
@@ -79,13 +85,17 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
val newStr: String = binding.etSearch.text.toString().trim { it <= ' ' }
|
||||
if (!TextUtils.isEmpty(newStr)) {
|
||||
val hallList = list
|
||||
val list = hallList.filter { it.hallName.contains(newStr) || it.hallId.toString().contains(newStr)}
|
||||
if(list.isEmpty()){
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text = getString(R.string.no_search_room)
|
||||
val list = hallList.filter {
|
||||
it.hallName.contains(newStr) || it.hallId.toString().contains(newStr)
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text =
|
||||
getString(R.string.no_search_room)
|
||||
}
|
||||
rvDelegate.setNewData(list)
|
||||
} else {
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text = getString(R.string.association_hall_list_empty)
|
||||
rvDelegate.adapter.emptyView.findViewById<TextView>(R.id.tv_hint).text =
|
||||
getString(R.string.association_hall_list_empty)
|
||||
rvDelegate.setNewData(list)
|
||||
}
|
||||
hideSoftInput()
|
||||
@@ -109,11 +119,14 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
associationRoomAdapter.setOnItemChildClickListener { _, _, position ->
|
||||
val bean = associationRoomAdapter.getItem(position)
|
||||
bean?.let {
|
||||
if(it.hallBtnStatus == 2){
|
||||
if (it.hallBtnStatus == 2) {
|
||||
return@let
|
||||
}
|
||||
if (it.hallBtnStatus == 3){
|
||||
HallTeamMessageActivity.start(mContext, bean.hallMessageUid.toString())
|
||||
if (it.hallBtnStatus == 3) {
|
||||
NimP2PMessageActivity.startRecord(
|
||||
mContext, bean.hallMessageUid.toString(),
|
||||
bean.hallRecordId.toString()
|
||||
)
|
||||
return@let
|
||||
}
|
||||
dialogManager.showProgressDialog(context)
|
||||
@@ -156,7 +169,10 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
|
||||
private fun hideSoftInput() {
|
||||
val imm = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm.hideSoftInputFromWindow(binding.etSearch.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
|
||||
imm.hideSoftInputFromWindow(
|
||||
binding.etSearch.windowToken,
|
||||
InputMethodManager.HIDE_NOT_ALWAYS
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
@@ -149,8 +149,8 @@
|
||||
android:id="@+id/iv_hall_member_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:drawableEnd="@drawable/ic_hall_member_more"
|
||||
android:gravity="center"
|
||||
android:text="@string/layout_activity_module_hall_04"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="12sp"
|
||||
@@ -174,27 +174,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvJoinRoom"
|
||||
android:text="@string/join_room"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textColor="@color/color_white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="46dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:drawableStart="@drawable/ic_hall_add"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:background="@drawable/bg_common_confirm_30"
|
||||
android:paddingStart="@dimen/dp_60"
|
||||
android:paddingEnd="@dimen/dp_60"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/ll_member_list"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ll_member_list"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ll_member_list"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@@ -206,8 +185,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:visibility="visible"
|
||||
app:contentInsetStart="0dp"
|
||||
app:layout_collapseMode="pin"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_collapseMode="pin">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -256,6 +234,23 @@
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvJoinRoom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="46dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:background="@drawable/bg_common_confirm_30"
|
||||
android:drawableStart="@drawable/ic_hall_add"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_60"
|
||||
android:paddingEnd="@dimen/dp_60"
|
||||
android:text="@string/join_room"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
Reference in New Issue
Block a user