Browse Source

修改测试问题

Pq 1 năm trước cách đây
mục cha
commit
71b7fbe528

+ 24 - 10
chatModule/src/main/java/com/cooleshow/chatmodule/ui/CreateGroupActivity.java

@@ -4,6 +4,7 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.View;
+import android.widget.RadioGroup;
 
 import com.alibaba.android.arouter.facade.annotation.Route;
 import com.alibaba.android.arouter.launcher.ARouter;
@@ -89,16 +90,18 @@ public class CreateGroupActivity extends BaseMVPActivity<TcActivityCreateGroupBi
             groupType = GROUP_TYPE_FAN;
         }
 
-        List<StudentPageListBean.RowsBean> data = mMemberAdapter.getData();
-        if (data.size() == 0) {
-            ToastUtil.getInstance().showShort("请选择群成员");
-            return false;
-        }
-        memberListResult = new ArrayList<>();
-        for (int i = data.size() - 1; i >= 0; i--) {
-            StudentPageListBean.RowsBean rowsBean = data.get(i);
-            if (!TextUtils.equals(currentUserId, rowsBean.getUserId())) {
-                memberListResult.add(rowsBean.getUserId());
+        if (groupType == GROUP_TYPE_ORG) {
+            List<StudentPageListBean.RowsBean> data = mMemberAdapter.getData();
+            if (data.size() == 0) {
+                ToastUtil.getInstance().showShort("请选择群成员");
+                return false;
+            }
+            memberListResult = new ArrayList<>();
+            for (int i = data.size() - 1; i >= 0; i--) {
+                StudentPageListBean.RowsBean rowsBean = data.get(i);
+                if (!TextUtils.equals(currentUserId, rowsBean.getUserId())) {
+                    memberListResult.add(rowsBean.getUserId());
+                }
             }
         }
         return true;
@@ -131,6 +134,17 @@ public class CreateGroupActivity extends BaseMVPActivity<TcActivityCreateGroupBi
         mMemberAdapter = new CreateGroupMemberAdapter(userId);
         viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
         viewBinding.recyclerView.setAdapter(mMemberAdapter);
+
+        initListener();
+    }
+
+    private void initListener() {
+        viewBinding.rgGroupType.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                viewBinding.csMember.setVisibility(checkedId == viewBinding.rbJgGroupType.getId() ? View.VISIBLE : View.GONE);
+            }
+        });
     }
 
     @NonNull

+ 2 - 2
chatModule/src/main/res/layout/tc_activity_create_group.xml

@@ -229,14 +229,14 @@
                     app:layout_constraintTop_toTopOf="parent" />
 
                 <androidx.recyclerview.widget.RecyclerView
+                    tools:visibility="visible"
                     android:id="@+id/recyclerView"
                     android:layout_width="0dp"
                     android:layout_marginTop="20dp"
-                    android:layout_height="0dp"
+                    android:layout_height="wrap_content"
                     android:visibility="gone"
                     android:overScrollMode="never"
                     android:scrollbars="none"
-                    app:layout_constraintBottom_toBottomOf="parent"
                     app:layout_constraintLeft_toLeftOf="parent"
                     app:layout_constraintRight_toRightOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/tv_members_title" />