[Modify]加入房間功能修改
This commit is contained in:
@@ -6,6 +6,8 @@ import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
@@ -65,8 +67,24 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapte
|
||||
|
||||
if (fromType == AbstractSelectFriendAction.TYPE_MODULE_HALL) {
|
||||
//模厅搜索
|
||||
if (item.getHallBtnStatus() == 0) {
|
||||
holder.stvOp.setVisibility(View.GONE);
|
||||
} else if (item.getHallBtnStatus() == 4) {
|
||||
holder.stvOp.setVisibility(View.VISIBLE);
|
||||
holder.stvOp.setText(ResUtil.getString(R.string.ui_search_searchadapter_02));
|
||||
holder.stvOp.setTextColor(ContextCompat.getColor(context, R.color.color_white));
|
||||
holder.stvOp.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_common_confirm_normal));
|
||||
} else if (item.getHallBtnStatus() == 5) {
|
||||
holder.stvOp.setVisibility(View.VISIBLE);
|
||||
holder.stvOp.setText(ResUtil.getString(R.string.ready_pass));
|
||||
holder.stvOp.setTextColor(ContextCompat.getColor(context, R.color.color_B3B3C3));
|
||||
holder.stvOp.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_e6e6f0_15));
|
||||
} else if (item.getHallBtnStatus() == 6) {
|
||||
holder.stvOp.setVisibility(View.VISIBLE);
|
||||
holder.stvOp.setText(ResUtil.getString(R.string.to_audit));
|
||||
holder.stvOp.setTextColor(ContextCompat.getColor(context, R.color.color_white));
|
||||
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);
|
||||
@@ -86,8 +104,7 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapte
|
||||
holder.stvOp.setEnabled(cpState != 1 && cpState != 2);
|
||||
holder.addOnClickListener(R.id.stv_op);
|
||||
holder.stvOp.setBackground(context.getResources().getDrawable(R.drawable.bg_button_relation_invite));
|
||||
}
|
||||
else if (fromType == AbstractSelectFriendAction.TYPE_SEND_DECORATION) {
|
||||
} else if (fromType == AbstractSelectFriendAction.TYPE_SEND_DECORATION) {
|
||||
holder.stvOp.setVisibility(View.VISIBLE);
|
||||
holder.stvOp.setText(ResUtil.getString(R.string.ui_search_searchadapter_03));
|
||||
holder.addOnClickListener(R.id.stv_op);
|
||||
|
@@ -120,8 +120,14 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
item.getNick(),
|
||||
item.getUid());
|
||||
} else {
|
||||
if (item.getHallBtnStatus() == 5) {
|
||||
toast(getString(R.string.invite_has_been_send));
|
||||
} else if (item.getHallBtnStatus() == 6) {
|
||||
|
||||
} else if (item.getHallBtnStatus() == 4) {
|
||||
showSureDialog(item.getUid() + "", item.getAvatar(), item.getNick());
|
||||
}
|
||||
}
|
||||
});
|
||||
recyclerView.setAdapter(searchAdapter);
|
||||
}
|
||||
|
9
app/src/main/res/drawable/bg_e6e6f0_15.xml
Normal file
9
app/src/main/res/drawable/bg_e6e6f0_15.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/dp_15"/>
|
||||
|
||||
<solid android:color="@color/color_E6E6F0"/>
|
||||
|
||||
</shape>
|
9
app/src/main/res/drawable/bg_e6e6f0_30.xml
Normal file
9
app/src/main/res/drawable/bg_e6e6f0_30.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/dp_30"/>
|
||||
|
||||
<solid android:color="@color/color_E6E6F0"/>
|
||||
|
||||
</shape>
|
9
app/src/main/res/drawable/bg_ffbc51_15.xml
Normal file
9
app/src/main/res/drawable/bg_ffbc51_15.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/dp_15"/>
|
||||
|
||||
<solid android:color="@color/color_ffbc51"/>
|
||||
|
||||
</shape>
|
@@ -2,13 +2,14 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_normal_1c1b22"
|
||||
android:background="@color/color_F3F5FA"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_height="92dp"
|
||||
android:paddingTop="@dimen/dp_44"
|
||||
android:background="@color/color_white"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
@@ -26,7 +27,7 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_weight="1.0"
|
||||
android:background="@drawable/bg_search_edit"
|
||||
android:background="@drawable/bg_hall_search_edit"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -81,8 +82,8 @@
|
||||
android:id="@+id/ll_search_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/indicator"
|
||||
@@ -90,28 +91,25 @@
|
||||
android:layout_height="48dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.yizhuan.erban.common.widget.StatusLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
>
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</com.yizhuan.erban.common.widget.StatusLayout>
|
||||
|
||||
</LinearLayout>
|
@@ -5074,5 +5074,12 @@
|
||||
<string name="max_to_add_label">最多只能添加20個標簽哦~</string>
|
||||
<string name="edit_your_user_label">設置你的個人標簽</string>
|
||||
<string name="other_label">TA的標簽</string>
|
||||
<string name="ready_pass">待通過</string>
|
||||
<string name="to_audit">去審核</string>
|
||||
<string name="invite_has_been_send">已發送邀請,等待用戶通過</string>
|
||||
<string name="join_room">加入房間</string>
|
||||
<string name="delay_to_audit">待審核</string>
|
||||
<string name="by_invitation">通過邀請</string>
|
||||
<string name="room_join_request">加入房間申請</string>
|
||||
|
||||
</resources>
|
@@ -81,9 +81,9 @@
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@drawable/bg_common_select"
|
||||
android:background="@drawable/bg_common_confirm_15"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_selector_6d6b89_false_ffffff"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="@string/have_apply" />
|
||||
|
||||
|
@@ -97,6 +97,7 @@ 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();
|
||||
@@ -369,6 +370,9 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
break;
|
||||
case R.id.tv_exit:
|
||||
showExitDialog();
|
||||
break;
|
||||
case R.id.tvJoinRoom:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,8 @@ package com.yizhuan.erban.module_hall.hall.adapter;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.yizhuan.erban.R;
|
||||
@@ -45,16 +47,25 @@ public class AssociationRoomAdapter extends BaseQuickAdapter<HallListInfo, BaseV
|
||||
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) {
|
||||
if (item.getHallBtnStatus() == 0) {
|
||||
tvApply.setVisibility(View.GONE);
|
||||
} else if (item.getApplyBtnStatus() == 1) {
|
||||
} else if (item.getHallBtnStatus() == 1) {
|
||||
tvApply.setVisibility(View.VISIBLE);
|
||||
tvApply.setSelected(true);
|
||||
tvApply.setTextColor(ContextCompat.getColor(mContext,R.color.color_white));
|
||||
tvApply.setBackgroundResource(R.drawable.bg_common_confirm_15);
|
||||
tvApply.setText(mContext.getString(R.string.apply_join));
|
||||
} else if (item.getApplyBtnStatus() == 2) {
|
||||
} else if (item.getHallBtnStatus() == 2) {
|
||||
tvApply.setVisibility(View.VISIBLE);
|
||||
tvApply.setSelected(false);
|
||||
tvApply.setText(mContext.getString(R.string.have_apply));
|
||||
tvApply.setTextColor(ContextCompat.getColor(mContext,R.color.color_6D6B89));
|
||||
tvApply.setBackgroundResource(R.drawable.bg_e6e6f0_15);
|
||||
tvApply.setText(mContext.getString(R.string.delay_to_audit));
|
||||
} else if(item.getHallBtnStatus() == 3){
|
||||
tvApply.setVisibility(View.VISIBLE);
|
||||
tvApply.setSelected(false);
|
||||
tvApply.setTextColor(ContextCompat.getColor(mContext,R.color.color_white));
|
||||
tvApply.setBackgroundResource(R.drawable.bg_ffbc51_15);
|
||||
tvApply.setText(mContext.getString(R.string.by_invitation));
|
||||
}
|
||||
helper.addOnClickListener(R.id.tvApply);
|
||||
|
||||
|
@@ -22,6 +22,9 @@ import com.yizhuan.erban.databinding.FragmentAssociationRoomBinding
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity
|
||||
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
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
|
||||
@@ -103,6 +106,35 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
info?.ownerUid ?: 0L
|
||||
)
|
||||
}
|
||||
associationRoomAdapter.setOnItemChildClickListener { adapter, view, position ->
|
||||
val bean = associationRoomAdapter.getItem(position)
|
||||
bean?.let {
|
||||
if(it.hallBtnStatus == 2){
|
||||
toast(getString(R.string.can_not_apply_7_day))
|
||||
return@let
|
||||
}
|
||||
if (it.hallBtnStatus == 3){
|
||||
|
||||
return@let
|
||||
}
|
||||
dialogManager.showProgressDialog(context)
|
||||
HallModel.get().applyJoinHall(it.hallId)
|
||||
.compose(RxHelper.bindFragment(this))
|
||||
.subscribe(object : BeanObserver<String?>() {
|
||||
override fun onErrorMsg(error: String) {
|
||||
dialogManager.dismissDialog()
|
||||
toast(error)
|
||||
}
|
||||
|
||||
override fun onSuccess(s: String) {
|
||||
dialogManager.dismissDialog()
|
||||
it.hallBtnStatus = 2
|
||||
associationRoomAdapter.notifyItemChanged(position)
|
||||
toast(s)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
rvDelegate = RVDelegate.Builder<HallListInfo>()
|
||||
.setAdapter(associationRoomAdapter)
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
|
BIN
app/src/module_labour_union/res/drawable-xhdpi/ic_hall_add.webp
Normal file
BIN
app/src/module_labour_union/res/drawable-xhdpi/ic_hall_add.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 578 B |
@@ -173,6 +173,27 @@
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</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"
|
||||
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>
|
||||
@@ -233,4 +254,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:paddingStart="@dimen/dp_20"
|
||||
android:paddingEnd="@dimen/dp_20"
|
||||
@@ -18,7 +18,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/layout_layout_hall_msg_view_holder_01" />
|
||||
tools:text="@string/room_join_request" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
|
@@ -5,20 +5,14 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
@@ -31,9 +25,6 @@ import com.yizhuan.xchat_android_core.UriHelper;
|
||||
import com.yizhuan.xchat_android_core.upgrade.bean.NewestVersionInfo;
|
||||
import com.yizhuan.xchat_android_core.upgrade.model.UpgradeModel;
|
||||
import com.yizhuan.xchat_android_library.utils.AppMetaDataUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class AppUpdateDialog extends DialogFragment implements View.OnClickListener {
|
||||
|
||||
@@ -118,9 +109,9 @@ public class AppUpdateDialog extends DialogFragment implements View.OnClickListe
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("android.intent.action.VIEW");
|
||||
Uri content_url = null;
|
||||
if(AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)){
|
||||
if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
|
||||
content_url = Uri.parse(UriHelper.applyTimestampForUrl(XChatConstants.appDownloadUrl));//拼接上时间戳,避免访问缓存文件
|
||||
}else if(newestVersionInfo != null){
|
||||
} else if (newestVersionInfo != null) {
|
||||
content_url = Uri.parse(newestVersionInfo.getUpdateDownloadLink());
|
||||
}
|
||||
intent.setData(content_url);
|
||||
|
@@ -14,6 +14,6 @@ public class HallListInfo {
|
||||
private Integer memberCount;
|
||||
private Long ownerErbanNo;
|
||||
private Double roomIncome;
|
||||
private int applyBtnStatus;//0=不显示 1=可申请 2=已申请
|
||||
|
||||
private int hallBtnStatus;//0=不显示 1=可申请 2=待审核 3通过邀请
|
||||
private int hallRecordId;//通过邀请时的邀请记录id
|
||||
}
|
||||
|
@@ -59,6 +59,9 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
private ArrayList<BannerInfo> bannerInfos;
|
||||
public boolean newUser;
|
||||
|
||||
private int hallBtnStatus;//0不显示,4可邀请,5待通过,6通过申请
|
||||
private int hallRecordId;//当hallBtnStatus=6时返回申请记录Id
|
||||
|
||||
public SearchRoomInfo() {
|
||||
}
|
||||
|
||||
@@ -75,6 +78,9 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
|
||||
bannerInfos = in.createTypedArrayList(BannerInfo.CREATOR);
|
||||
|
||||
hallBtnStatus = in.readInt();
|
||||
hallRecordId = in.readInt();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +97,9 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
|
||||
dest.writeTypedList(bannerInfos);
|
||||
|
||||
dest.writeInt(hallBtnStatus);
|
||||
dest.writeInt(hallRecordId);
|
||||
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
|
Reference in New Issue
Block a user