diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/HallConstant.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/HallConstant.java new file mode 100644 index 0000000..c6ad4d9 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/HallConstant.java @@ -0,0 +1,29 @@ +package com.chwl.app.module_hall; + +/** + * 模厅的常量 + * Created by lvzebiao on 2019/1/14. + */ + +public class HallConstant { + + /** + * 云信群聊ID + */ + public static final String EXTRA_TID = "extra_tid"; + /** + * 服务器群聊ID + */ + public static final String EXTRA_CHAT_ID = "extra_chat_id"; + /** + * 群的角色 + */ + public static final String EXTRA_CHAT_ROLE = "extra_chat_role"; + /**厅群成员列表的类型*/ + public static final String EXTRA_HTEAM_LIST_TYPE = "extra_hteam_list_type"; + /** + * 用于activity传递 + */ + public static final String EXTRA_DATA_BEAN = "extra_data_bean"; + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/HallDataManager.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/HallDataManager.java new file mode 100644 index 0000000..38458be --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/HallDataManager.java @@ -0,0 +1,271 @@ +package com.chwl.app.module_hall; + +import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_MODULE_HALL; + +import android.annotation.SuppressLint; + +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.Observer; + +import com.chwl.app.module_hall.im.msgholder.HallMsgViewHolder; +import com.chwl.core.auth.AuthModel; +import com.chwl.core.auth.event.LogoutEvent; +import com.chwl.core.im.custom.AttachManager; +import com.chwl.core.manager.event.HallInfoChangeEvent; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.ClanAndHallInfo; +import com.chwl.core.module_hall.hall.bean.ClanInfo; +import com.chwl.core.module_hall.hall.bean.HallInfo; +import com.chwl.core.module_hall.hall.bean.RoleType; +import com.chwl.core.module_hall.hall.bean.UserClanInfo; +import com.chwl.core.module_hall.hall.event.UserHallUpdateEvent; +import com.chwl.core.module_hall.im.HallAttachment; +import com.chwl.core.user.UserModel; +import com.chwl.core.user.bean.UserInfo; +import com.netease.nim.uikit.api.NimUIKit; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import io.reactivex.Single; + +/** + * Created by lvzebiao on 2019/1/7. + */ + +public class HallDataManager { + + private UserClanInfo userClanInfo; + + private HallInfo hallInfo; + /** + * 模厅名字 + */ + private MutableLiveData liveHallName; + /** + * 公会ID + */ + private MutableLiveData liveHallID; + /** + * 厅主ID + */ + private MutableLiveData liveOwnerUid; + /** + * 是否具有模厅 + */ + private MutableLiveData liveHallExist; + /** + * 上一次厅ID + */ + private long lastHallId = -1; + + private int roleType = 0; + + private boolean isClanElder = false; + + private boolean hasClan; + + + /** + * 家族信息 + */ + private MutableLiveData liveClanInfo; + + private static final class Helper { + public static final HallDataManager INSTANCE = new HallDataManager(); + } + + private HallDataManager() { + EventBus.getDefault().register(this); + liveHallName = new MutableLiveData<>(); + liveHallExist = new MutableLiveData<>(); + liveHallID = new MutableLiveData<>(); + liveHallName.setValue(""); + liveHallID.setValue(0L); + liveHallExist.setValue(false); + } + + public static HallDataManager get() { + return Helper.INSTANCE; + } + + /** + * application的初始化 + */ + public void application() { + AttachManager.register(CUSTOM_MSG_MODULE_HALL, HallAttachment.class); + HallModel.get(); + } + + public void refreshApi() { + HallModel.get().refreshApi(); + } + + /** + * 云信模块 + */ + public void mainNimOnCreate() { + NimUIKit.registerMsgItemViewHolder(HallAttachment.class, HallMsgViewHolder.class); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onHallInfoChangeEvent(HallInfoChangeEvent event) { + UserModel.get().updateCurrentUserInfo().subscribe(); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onUserHallUpdate(UserHallUpdateEvent event) { + initHallInfo(); + } + + private void initHallInfo() { + UserInfo userInfo = UserModel.get().getCacheLoginUserInfo(); + if (userInfo != null) { + updateHallInfo(); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLogout(LogoutEvent event) { + hallInfo = null; + liveHallName.setValue(""); + liveHallID.setValue(0L); + liveHallExist.setValue(false); + } + + public long getHallId() { + return HallModel.get().getHallId(); + } + + public void registerName(LifecycleOwner owner, Observer observer) { + liveHallName.observe(owner, observer); + } + + public void registerClanInfo(LifecycleOwner owner, Observer observer) { + liveClanInfo.observe(owner, observer); + } + + public void registerHallID(LifecycleOwner owner, Observer observer) { + liveHallID.observe(owner, observer); + } + + public void registerHallExist(LifecycleOwner owner, Observer observer) { + liveHallExist.observe(owner, observer); + } + + public Single requestUserClanInfo(long uid){ + return HallModel.get().getUserClanInfo(uid).map( + info -> { + if (uid == AuthModel.get().getCurrentUid()) { + userClanInfo = info; + ClanAndHallInfo clanAndHallInfo = info.asClanHall(); + if (clanAndHallInfo != null) { + updateHallInfo(userClanInfo.getClan()); + } else { + updateHallInfo(new ClanAndHallInfo()); + } + } + return info; + } + ); + } + + @SuppressLint("CheckResult") + public void updateHallInfo() { + requestUserClanInfo(AuthModel.get().getCurrentUid()).subscribe(info -> {}); + } + + public void updateHallInfo(ClanAndHallInfo clanAndHallInfo) { + hallInfo = clanAndHallInfo.getHall(); + if (clanAndHallInfo.getClan() != null) { + isClanElder = clanAndHallInfo.getClan().isUserIsElder(); + hasClan = clanAndHallInfo.getClan().getId() > 0; + } else { + isClanElder = false; + hasClan = false; + } + if (hallInfo != null) { + lastHallId = hallInfo.getHallId(); + liveHallName.setValue(hallInfo.getHallName()); + liveHallID.setValue(hallInfo.getHallId()); + roleType = hallInfo.getRoleType(); + } else { + roleType = 0; + lastHallId = -1; + } + liveHallExist.setValue(lastHallId > 0 || isClanElder); + } + + + public String getHallName() { + String hallName = liveHallName.getValue(); + if (hallName == null) { + hallName = ""; + } + return hallName; + } + + public void updateHallName(String newHallName) { + if (newHallName == null) { + newHallName = ""; + } + hallInfo.setHallName(newHallName); + liveHallName.setValue(newHallName); + } + + /** + * 获取自己的角色 + */ + public int getRoleType() { + return roleType; + } + + /** + * @return true if owner or admin + */ + public boolean isManager() { + return roleType == RoleType.OWNER || roleType == RoleType.ADMIN; + } + + public boolean isClanElder() { + return isClanElder; + } + + public boolean isHasClan() { + return hasClan; + } + + public void setHasClan(boolean hasClan) { + this.hasClan = hasClan; + } + + public boolean hasLiveHall() { + if (liveHallExist == null) + return false; + + Object hasLiveHall = liveHallExist.getValue(); + return hasLiveHall != null && (boolean) hasLiveHall; + } + + public long getOwnerUid() { + return hallInfo == null ? 0 : hallInfo.getOwnerUid(); + } + + public UserClanInfo getUserClanInfo() { + return userClanInfo; + } + + public String getOwnerNick() { + return hallInfo == null ? "" : hallInfo.getOwnerNick(); + } + + public String getOwnerAvatar() { + return hallInfo == null ? "" : hallInfo.getOwnerAvatar(); + } + + public int getMemberCount() { + return hallInfo == null ? 0 : hallInfo.getMemberCount(); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AdminAddActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AdminAddActivity.java new file mode 100644 index 0000000..c5e40a0 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AdminAddActivity.java @@ -0,0 +1,242 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.text.SpannableString; +import android.text.Spanned; +import android.text.style.ForegroundColorSpan; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.common.widget.dialog.DialogManager; +import com.chwl.app.module_hall.hall.adapter.GroupMemberListAdapter; +import com.chwl.app.module_hall.hall.presenter.AdminAddPresenter; +import com.chwl.app.module_hall.hall.view.IAdminAddView; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.ListMemberInfo; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.core.module_hall.income.event.UpdateMemberListEvent; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.core.utils.net.RxHelper; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ListUtils; +import com.chwl.library.utils.ResUtil; + +import org.greenrobot.eventbus.EventBus; + +import java.util.List; + +@CreatePresenter(AdminAddPresenter.class) +public class AdminAddActivity extends BaseMvpActivity + implements IAdminAddView { + + private SwipeRefreshLayout srlGroup; + private RecyclerView recyclerView; + private TextView tvCount; + + private GroupMemberListAdapter mGroupMemberListAdapter; + + private long mTargetUid = -1; + + private long hallId; + + public static void start(Context context, long hallId) { + Intent intent = new Intent(context, AdminAddActivity.class); + intent.putExtra("hallId", hallId); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + hallId = getIntent().getLongExtra("hallId", 0); + setContentView(R.layout.activity_admin_add); + findView(); + + initWhiteTitleBar(ResUtil.getString(R.string.hall_activity_adminaddactivity_01)); + + srlGroup.setOnRefreshListener(() -> { + srlGroup.setRefreshing(false); + getAllMembers(); + }); + + recyclerView.setLayoutManager(new LinearLayoutManager(this)); + mGroupMemberListAdapter = new GroupMemberListAdapter(this, null); + mGroupMemberListAdapter.setmType(GroupMemberListAdapter.TYPE_CHECK); + mGroupMemberListAdapter.setOnItemChildClickListener((adapter, view, position) -> { + List memberInfoList = mGroupMemberListAdapter.getData(); + if (memberInfoList.size() > 0) { + MemberInfo memberInfo = memberInfoList.get(position); + + showSureDialog(memberInfo.getUid(), memberInfo.getNick(), memberInfo.getRoleType() == 2); + } + }); + recyclerView.setAdapter(mGroupMemberListAdapter); + getAllMembers(); + } + + private void findView() { + srlGroup = findViewById(R.id.srl_group); + recyclerView = findViewById(R.id.recycler_view); + tvCount = findViewById(R.id.tv_count); + } + + private void setTvCount() { + + int count = 0; + if (mGroupMemberListAdapter != null) { + List list = mGroupMemberListAdapter.getData(); + + for (MemberInfo info : list) { + if (info.getRoleType() == 2) + count++; + } + } + + tvCount.setText(ResUtil.getString(R.string.hall_activity_adminaddactivity_02) + count + ResUtil.getString(R.string.hall_activity_adminaddactivity_03)); + } + + private void getAllMembers() { + HallModel.get().getAllMembers(hallId, 1, 500) + .compose(RxHelper.bindActivity(this)) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + getAllMembersFail("no data"); + setTvCount(); + } + + @Override + public void onSuccess(ListMemberInfo listMemberInfo) { + if (!ListUtils.isListEmpty(listMemberInfo.getMembers())) { + getAllMembersSuccess(listMemberInfo.getMembers()); + } else + getAllMembersFail("no data"); + + setTvCount(); + } + }); + + } + + public void showSureDialog(long targetUid, String nick, boolean isAdmin) { + mTargetUid = targetUid; + + String message; + if (!isAdmin) + message = ResUtil.getString(R.string.hall_activity_adminaddactivity_04) + nick + ResUtil.getString(R.string.hall_activity_adminaddactivity_05); + else + message = ResUtil.getString(R.string.hall_activity_adminaddactivity_06) + nick + ResUtil.getString(R.string.hall_activity_adminaddactivity_07); + + SpannableString spannableString = new SpannableString(message); + ForegroundColorSpan colorSpan = new ForegroundColorSpan(ContextCompat.getColor(this, R.color.color_333333)); + ForegroundColorSpan colorSpan1 = new ForegroundColorSpan(ContextCompat.getColor(this, R.color.appColor)); + + int firstPoint = !isAdmin ? 3 : 4; + int secondPoint = firstPoint + nick.length(); + int thirdPoint = message.length(); + + spannableString.setSpan(colorSpan, 0, firstPoint, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(colorSpan1, firstPoint, secondPoint, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(colorSpan, secondPoint, thirdPoint, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + + getDialogManager().showOkCancelWithTitleDialog(ResUtil.getString(R.string.hall_activity_adminaddactivity_08), spannableString, ResUtil.getString(R.string.hall_activity_adminaddactivity_09), ResUtil.getString(R.string.hall_activity_adminaddactivity_010), new DialogManager.OkCancelDialogListener() { + @Override + public void onCancel() { + getDialogManager().dismissDialog(); + mTargetUid = -1; + } + + @Override + public void onOk() { + if (!isAdmin) + getMvpPresenter().setManager(targetUid, hallId); + else + getMvpPresenter().removeManager(targetUid, hallId); + } + }); + } + + private void refreshLocal() { + + if (mTargetUid != -1) { + List memberInfoList = mGroupMemberListAdapter.getData(); + + for (MemberInfo memberInfo : memberInfoList) { + + if (memberInfo.getUid() == mTargetUid) { + int roleType = memberInfo.getRoleType(); + if (roleType == 2) + memberInfo.setRoleType(3); + else if (roleType == 3) + memberInfo.setRoleType(2); + + break; + } + } + + mGroupMemberListAdapter.notifyDataSetChanged(); + } + + setTvCount(); + + mTargetUid = -1; + + } + + private void refreshOption() { + refreshLocal(); + EventBus.getDefault().post(new UpdateMemberListEvent()); // 更新成员列表页 + } + + @Override + public void getAllMembersSuccess(List memberInfoList) { + mGroupMemberListAdapter.setNewData(memberInfoList); + mGroupMemberListAdapter.notifyDataSetChanged(); + } + + @Override + public void getAllMembersFail(String message) { + + } + + @Override + public void setManagerSuccess(String message) { + refreshOption(); + } + + @Override + public void setManagerFail(String message) { + toast(message); + } + + @Override + public void removeManagerSuccess(String message) { + refreshOption(); + } + + @Override + public void removeManagerFail(String message) { + + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AdminListActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AdminListActivity.java new file mode 100644 index 0000000..a9c31ae --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AdminListActivity.java @@ -0,0 +1,123 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.base.TitleBar; +import com.chwl.app.module_hall.hall.adapter.GroupMemberListAdapter; +import com.chwl.app.module_hall.hall.presenter.AdminListPresenter; +import com.chwl.app.module_hall.hall.view.IAdminListView; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ResUtil; + +import java.util.ArrayList; +import java.util.List; + +@CreatePresenter(AdminListPresenter.class) +public class AdminListActivity extends BaseMvpActivity + implements IAdminListView { + + private SwipeRefreshLayout srlGroup; + private RecyclerView recyclerView; + + private GroupMemberListAdapter mGroupMemberListAdapter; + private List listInfos = new ArrayList<>(); + + private long hallId; + + public static void start(Context context, long hallId) { + Intent intent = new Intent(context, AdminListActivity.class); + intent.putExtra("hallId", hallId); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + hallId = getIntent().getLongExtra("hallId", 0); + setContentView(R.layout.activity_admin_list); + + findView(); + initWhiteTitleBar(ResUtil.getString(R.string.hall_activity_adminlistactivity_01)); + setRightOption(); + + srlGroup.setOnRefreshListener(() -> getMvpPresenter().getHallManager(hallId)); + recyclerView.setLayoutManager(new LinearLayoutManager(this)); + mGroupMemberListAdapter = new GroupMemberListAdapter(this, null); + mGroupMemberListAdapter.setmType(GroupMemberListAdapter.TYPE_NEXT); + mGroupMemberListAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() { + @Override + public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) { + // TODO 跳转到权限列表页 + List memberInfoList = mGroupMemberListAdapter.getData(); + if (memberInfoList.size() > 0) { + MemberInfo memberInfo = memberInfoList.get(position); + AuthSettingActivity.start(AdminListActivity.this, memberInfo, hallId); + } + } + }); + recyclerView.setAdapter(mGroupMemberListAdapter); + + } + + private void findView() { + srlGroup = findViewById(R.id.srl_group); + recyclerView = findViewById(R.id.recycler_view); + } + + @Override + protected void onResume() { + super.onResume(); + getMvpPresenter().getHallManager(hallId); + } + + private void setRightOption() { + + mTitleBar.addAction(new TitleBar.ImageAction(R.drawable.ic_admin_add) { + @Override + public void performAction(View view) { + AdminAddActivity.start(AdminListActivity.this, hallId); + } + }); + + } + + @Override + public void getHallManagerSuccess(List memberInfoList) { + srlGroup.setRefreshing(false); + hideStatus(); + mGroupMemberListAdapter.setNewData(memberInfoList); + mGroupMemberListAdapter.notifyDataSetChanged(); + } + + @Override + public void getHallManagerFail(String message) { + hideStatus(); + showNoData(); + mGroupMemberListAdapter.setNewData(null); + mGroupMemberListAdapter.notifyDataSetChanged(); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AuthSettingActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AuthSettingActivity.java new file mode 100644 index 0000000..1d4a944 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/AuthSettingActivity.java @@ -0,0 +1,218 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.text.SpannableString; +import android.text.TextUtils; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; + +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.base.TitleBar; +import com.chwl.app.common.widget.dialog.DialogManager; +import com.chwl.app.module_hall.hall.adapter.AuthSettingAdapter; +import com.chwl.app.module_hall.hall.presenter.AuthSettingPresenter; +import com.chwl.app.module_hall.hall.view.IAuthSettingView; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.core.module_hall.hall.bean.AuthInfo; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ResUtil; + +import java.util.ArrayList; +import java.util.List; + +@CreatePresenter(AuthSettingPresenter.class) +public class AuthSettingActivity extends BaseMvpActivity + implements IAuthSettingView { + + private List mAuthSettingAdapterList = new ArrayList<>(); + + private ImageView mAvatar; + private TextView tvName; + private LinearLayout mLlAuthGroup; + + public static void start(Context context, MemberInfo memberInfo, long hallId) { + Intent intent = new Intent(context, AuthSettingActivity.class); + intent.putExtra("memberInfo", memberInfo); + intent.putExtra("hallId", hallId); + context.startActivity(intent); + } + + private MemberInfo mMemberInfo; + private long hallId; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.activity_auth_setting); + findView(); + initTitle(); + + mMemberInfo = (MemberInfo) getIntent().getSerializableExtra("memberInfo"); + hallId = getIntent().getLongExtra("hallId", 0); + if (mMemberInfo != null) { + ImageLoadUtils.loadAvatar(this, mMemberInfo.getAvatar(), mAvatar); + tvName.setText(mMemberInfo.getNick()); + getMvpPresenter().getHallManagerAuths(mMemberInfo.getUid()); + } else + finish(); + } + + private void findView() { + mAvatar = findViewById(R.id.iv_avatar); + tvName = findViewById(R.id.tv_name); + mLlAuthGroup = findViewById(R.id.ll_auth_group); + } + + private void initTitle() { + initWhiteTitleBar(ResUtil.getString(R.string.hall_activity_authsettingactivity_01)); + mTitleBar.setActionTextColor(ContextCompat.getColor(this, R.color.appColor)); + mTitleBar.addAction(new TitleBar.TextAction(ResUtil.getString(R.string.hall_activity_authsettingactivity_02)) { + @Override + public void performAction(View view) { + commitAuth(); + } + }); + } + + private List mAuthInfoList; + + private void setAuthList(List authInfoList) { + if (authInfoList == null || authInfoList.size() == 0) + return; + + mAuthInfoList = authInfoList; + + mLlAuthGroup.removeAllViews(); + mAuthSettingAdapterList.clear(); + for (AuthInfo authInfo : authInfoList) { + AuthSettingAdapter authSettingAdapter = new AuthSettingAdapter(this, mLlAuthGroup, authInfo); + + mAuthSettingAdapterList.add(authSettingAdapter); + mLlAuthGroup.addView(authSettingAdapter.getRoot()); + } + + } + + private void commitAuth() { + + StringBuilder authStr = new StringBuilder(); + + for (AuthSettingAdapter authSettingAdapter : mAuthSettingAdapterList) { + + String code = authSettingAdapter.getOnCode(); + if (!TextUtils.isEmpty(code)) { + authStr.append(code); + authStr.append(","); + } + + } + + if (authStr.length() > 0) { + authStr.lastIndexOf(","); + } + + getMvpPresenter().setHallManagerAuths(mMemberInfo.getUid(), hallId, authStr.toString()); + + } + + @Override + public void getHallManagerAuthsSuccess(List authInfoList) { + setAuthList(authInfoList); + } + + @Override + public void getHallManagerAuthsFail(String message) { + toast(message); + } + + @Override + public void setAuthSuccess() { + toast(ResUtil.getString(R.string.hall_activity_authsettingactivity_03)); + finish(); + } + + @Override + public void setAuthFail(String message) { + toast(message); + } + + @Override + public void onBackPressed() { + + boolean hasChange = false; + if (mAuthInfoList != null && mAuthInfoList.size() > 0 && mAuthSettingAdapterList != null && mAuthSettingAdapterList.size() > 0) { + + for (AuthSettingAdapter authSettingAdapter : mAuthSettingAdapterList) { + if (hasChange) + break; + + for (AuthInfo authInfo : mAuthInfoList) { + + if (authInfo.getCode().equals(authSettingAdapter.getCode())) { + + if (authInfo.getStatus() != authSettingAdapter.getViewStatus()) { + hasChange = true; + break; + } + + } + } + } + + } + + if (hasChange) { + showExitDialog(); + + } else { + super.onBackPressed(); + } + + } + + public void showExitDialog() { + + String message = ResUtil.getString(R.string.hall_activity_authsettingactivity_04); + + SpannableString spannableString = new SpannableString(message); + + getDialogManager().showOkCancelWithTitleDialog(ResUtil.getString(R.string.hall_activity_authsettingactivity_05), spannableString, ResUtil.getString(R.string.hall_activity_authsettingactivity_06), ResUtil.getString(R.string.hall_activity_authsettingactivity_07), new DialogManager.OkCancelDialogListener() { + @Override + public void onCancel() { + } + + @Override + public void onOk() { + finish(); + } + }); + } + + @Override + protected void onLeftClickListener() { + onBackPressed(); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } +} + diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ClanIncomeActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ClanIncomeActivity.java new file mode 100644 index 0000000..9abf4bb --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ClanIncomeActivity.java @@ -0,0 +1,312 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.appcompat.widget.AppCompatTextView; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; + +import com.jzxiang.pickerview.data.Type; +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.module_hall.hall.view.dialog.TimePickerClanDialog; +import com.chwl.app.module_hall.income.ClanIncomeFragment; +import com.chwl.app.module_hall.income.presenter.ClanIncomePresenter; +import com.chwl.app.module_hall.income.view.IIncomeStatisticsView; +import com.chwl.app.module_hall.income.view.LiveIncomeFragment; +import com.chwl.app.ui.user.adapter.CommonWrapIndicatorAdapter; +import com.chwl.app.ui.widget.magicindicator.MagicIndicator; +import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper; +import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.CommonUtils; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.TimeUtils; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +/** + * 家族所有公会的收入统计 + * Created by lvzebiao on 2018/12/27. + */ +@CreatePresenter(ClanIncomePresenter.class) +public class ClanIncomeActivity extends BaseMvpActivity + implements IIncomeStatisticsView, TimePickerClanDialog.TimePickerListener, + ClanIncomeFragment.DayIncomeFragmentListener, LiveIncomeFragment.DayIncomeFragmentListener, + View.OnClickListener { + + private static final int TYPE_DAY = 0; + private static final int TYPE_WEEK = 1; + private static final int TYPE_MONTH = 2; + + List list = new ArrayList<>(); + + private ViewPager viewPager; + private MagicIndicator indicator; + private TextView tvMonthDayStart; + private TextView tvMonthDayEnd; + private TextView tvTotal; + private ImageView ivDateArrow; + private LinearLayout llDayGroup; + private AppCompatTextView tvTip; + + FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(getSupportFragmentManager()) { + @Override + public Fragment getItem(int position) { + return list.get(position); + } + + @Override + public int getCount() { + return list.size(); + } + }; + private boolean mHasInit = false; + private int mCurrentType; + private long mDayFirstTime = System.currentTimeMillis(); + private long mDayLastTime = mDayFirstTime; + private int mSelectPosition; + + public static void start(Context context, long id) { + Intent intent = new Intent(context, ClanIncomeActivity.class); + intent.putExtra(ClanIncomeFragment.FLAG_CLAN_ID, id); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_clan_income); + findView(); + initListener(); + initIndicator(); + long id = getIntent().getLongExtra(ClanIncomeFragment.FLAG_CLAN_ID, 0); + initWhiteTitleBar(ResUtil.getString(R.string.hall_activity_clanincomeactivity_01)); + + ClanIncomeFragment clanIncomeFragment = ClanIncomeFragment.getInstance(id); + clanIncomeFragment.setmDayIncomeFragmentListener(this); + list.add(clanIncomeFragment); + + LiveIncomeFragment liveIncomeFragment = LiveIncomeFragment.getInstance(id); + liveIncomeFragment.setmDayIncomeFragmentListener(this); + list.add(liveIncomeFragment); + + viewPager.setAdapter(adapter); + } + + private void findView() { + viewPager = findViewById(R.id.view_pager); + indicator = findViewById(R.id.indicator); + tvMonthDayStart = findViewById(R.id.tv_month_day_start); + tvMonthDayEnd = findViewById(R.id.tv_month_day_end); + tvTotal = findViewById(R.id.tv_total); + ivDateArrow = findViewById(R.id.iv_date_arrow); + llDayGroup = findViewById(R.id.ll_day_group); + tvTip = findViewById(R.id.tv_tip); + } + + private void initListener() { + ivDateArrow.setOnClickListener(this); + llDayGroup.setOnClickListener(this); + } + + @Override + protected void onResume() { + super.onResume(); + + if (!mHasInit) { + mHasInit = true; + initDay(); + } + } + + /** + * 初始化当前日,周 + */ + private void initDay() { + ClanIncomePresenter presenter = getMvpPresenter(); + presenter.initCurrentDay(); + getDayIncomeTotal(getDayFormat(mDayFirstTime), getDayFormat(mDayLastTime)); + } + + private void initIndicator() { + List tagList = new ArrayList<>(); + tagList.add(ResUtil.getString(R.string.clan_income)); + tagList.add(ResUtil.getString(R.string.live_income)); + CommonWrapIndicatorAdapter magicIndicatorAdapter = new CommonWrapIndicatorAdapter(context, tagList); + magicIndicatorAdapter.setOnItemSelectListener((position, view) -> { + viewPager.setCurrentItem(position); + }); + CommonNavigator navigator = new CommonNavigator(this); + navigator.setAdapter(magicIndicatorAdapter); + navigator.setAdjustMode(true); + indicator.setNavigator(navigator); + ViewPagerHelper.bind(indicator, viewPager); + + mCurrentType = TYPE_DAY; + + viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + + } + + @Override + public void onPageSelected(int position) { + mSelectPosition = position; + ClanIncomePresenter presenter = getMvpPresenter(); + + if (mCurrentType == TYPE_WEEK) { + getWeekIncomeTotal(presenter.getWeekFirstDay(), presenter.getWeekLastDay()); + } else if (mCurrentType == TYPE_DAY) { + getDayIncomeTotal(getDayFormat(mDayFirstTime), getDayFormat(mDayLastTime)); + } else { + getMonthIncomeTotal(presenter.getmStartTimeStr(), presenter.getmEndTimeStr()); + } + + } + + @Override + public void onPageScrollStateChanged(int state) { + + } + }); + + } + + @Override + public void onClick(View view) { + int viewId = view.getId(); + if (viewId == R.id.iv_date_arrow || viewId == R.id.ll_day_group) { + if (CommonUtils.isFastDoubleClick(500)) return; + ClanIncomePresenter presenter = getMvpPresenter(); + boolean isWeek = mCurrentType == TYPE_WEEK; + boolean isMonth = mCurrentType == TYPE_MONTH; + boolean isDay = mCurrentType == TYPE_DAY; + + TimePickerClanDialog.Builder builder = new TimePickerClanDialog.Builder() + .setType(Type.YEAR_MONTH_DAY) + .setTitleStringId("") + .setThemeColor(getResources().getColor(R.color.line_color)) + .setWheelItemTextNormalColor(getResources().getColor(R.color + .timetimepicker_default_text_color)) + .setWheelItemTextSelectorColor(getResources().getColor(R.color.black)) + // 根据上一次选中时间初始化日期控件 + .setCurrentMillseconds(isDay ? mDayFirstTime : (isWeek ? presenter.getmWeekChooseDay() : presenter.getmDay())) + .setmIsWeek(isWeek) + .setIsMonth(isMonth) + .setIsDay(isDay) + .setDayFirstTime(mDayFirstTime) + .setDayLastTime(mDayLastTime); + + TimePickerClanDialog dialog = builder.build(); + dialog.setmTimePickerListener(this); + dialog.show(getSupportFragmentManager(), "year_month_day"); + } + } + + @Override + public void getTime(long chooseTime, String weekFirstDay, String weekLastDay, int currentType) { + ClanIncomePresenter presenter = getMvpPresenter(); + mCurrentType = currentType; + if (mCurrentType == TYPE_DAY) { + mDayFirstTime = TimeUtils.getTimeMillis(weekFirstDay, TimeUtils.DATE_FORMAT); + mDayLastTime = TimeUtils.getTimeMillis(weekLastDay, TimeUtils.DATE_FORMAT); + getDayIncomeTotal(weekFirstDay, weekLastDay); + + } else if (mCurrentType == TYPE_WEEK) { + presenter.setmWeekChooseDay(chooseTime); + presenter.setWeekFirstDay(weekFirstDay); + presenter.setWeekLastDay(weekLastDay); + getWeekIncomeTotal(weekFirstDay, weekLastDay); + } else { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); + String time = format.format(chooseTime); + String startTimeStr = TimeUtils.getFirstDayOfMonth(time); + String endTimeStr = TimeUtils.getLastDayOfMonth(time); + presenter.setmDayStr(chooseTime); + presenter.setmStartTimeStr(startTimeStr); + presenter.setmEndTimeStr(endTimeStr); + getMonthIncomeTotal(startTimeStr, endTimeStr); + } + + } + + private void getDayIncomeTotal(String startTimeStr, String endTimeStr) { + tvTip.setVisibility(View.VISIBLE); + String[] dayArray = startTimeStr.split("-"); + String[] endDayArray = endTimeStr.split("-"); + tvMonthDayStart.setText(String.format(getString(R.string.format_year_month_day), dayArray[0], dayArray[1], dayArray[2])); + tvMonthDayEnd.setVisibility(View.VISIBLE); + tvMonthDayEnd.setText(String.format(getString(R.string.format_month_day_new), endDayArray[1], endDayArray[2])); + if (mSelectPosition == 0) { + ClanIncomeFragment clanIncomeFragment = (ClanIncomeFragment) list.get(0); + clanIncomeFragment.getIncomeTotal(startTimeStr, endTimeStr); + } else if (mSelectPosition == 1) { + LiveIncomeFragment liveIncomeFragment = (LiveIncomeFragment) list.get(1); + liveIncomeFragment.getIncomeTotal(startTimeStr, endTimeStr); + } + } + + private void getWeekIncomeTotal(String startTimeStr, String endTimeStr) { + tvTip.setVisibility(View.VISIBLE); + String[] weekFirstArray = startTimeStr.split("-"); + String[] weekLastArray = endTimeStr.split("-"); + tvMonthDayEnd.setVisibility(View.VISIBLE); + tvMonthDayStart.setText(String.format(getString(R.string.format_year_month_day), weekFirstArray[0], weekFirstArray[1], weekFirstArray[2])); + tvMonthDayEnd.setText(String.format(getString(R.string.format_month_day_new), weekLastArray[1], weekLastArray[2])); + if (mSelectPosition == 0) { + ClanIncomeFragment clanIncomeFragment = (ClanIncomeFragment) list.get(0); + clanIncomeFragment.getIncomeTotal(startTimeStr, endTimeStr); + } else if (mSelectPosition == 1) { + LiveIncomeFragment liveIncomeFragment = (LiveIncomeFragment) list.get(1); + liveIncomeFragment.getIncomeTotal(startTimeStr, endTimeStr); + } + } + + private void getMonthIncomeTotal(String startTimeStr, String endTimeStr) { + tvTip.setVisibility(View.GONE); + String[] startArray = startTimeStr.split("-"); + tvMonthDayEnd.setVisibility(View.GONE); + tvMonthDayStart.setText(String.format(getString(R.string.format_year_month_hall), startArray[0], startArray[1])); + if (mSelectPosition == 0) { + ClanIncomeFragment clanIncomeFragment = (ClanIncomeFragment) list.get(0); + clanIncomeFragment.getIncomeTotal(startTimeStr, endTimeStr); + } else if (mSelectPosition == 1) { + LiveIncomeFragment liveIncomeFragment = (LiveIncomeFragment) list.get(1); + liveIncomeFragment.getIncomeTotal(startTimeStr, endTimeStr); + } + } + + @Override + public void setTotal(double total) { + tvTotal.setText(getMvpPresenter().setTotal(total)); + } + + private String getDayFormat(long time) { + return TimeUtils.getDateTimeString(time, TimeUtils.DATE_FORMAT); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ExchangePermissionActivity.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ExchangePermissionActivity.kt new file mode 100644 index 0000000..4768e05 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ExchangePermissionActivity.kt @@ -0,0 +1,120 @@ +package com.chwl.app.module_hall.hall.activity + +import android.content.Context +import android.content.Intent +import android.view.View +import androidx.activity.viewModels +import androidx.core.content.ContextCompat +import com.netease.nim.uikit.StatusBarUtil +import com.chwl.app.R +import com.chwl.app.base.BaseViewBindingActivity +import com.chwl.library.common.util.Utils +import com.chwl.app.databinding.ActivityExchangePermissionBinding +import com.chwl.app.module_hall.hall.adapter.EnableExchangeAdapter +import com.chwl.app.module_hall.hall.adapter.NoExchangeAdapter +import com.chwl.app.module_hall.hall.view.dialog.CloseExchangeTipDialog +import com.chwl.app.module_hall.viewmodel.AssociationViewModel +import com.chwl.app.ui.widget.recyclerview.decoration.ColorDecoration +import com.chwl.library.utils.ResUtil + +/** + * 兑换权限管理 + * Created by wushaocheng on 2023/2/13. + */ +class ExchangePermissionActivity : BaseViewBindingActivity() { + + private val mNoExchangeAdapter by lazy { NoExchangeAdapter() } + + private val mEnableExchangeAdapter by lazy { EnableExchangeAdapter() } + + private val associationViewModel: AssociationViewModel by viewModels() + + companion object { + @JvmStatic + fun start(context: Context) { + val intent = Intent(context, ExchangePermissionActivity::class.java) + context.startActivity(intent) + } + } + + override fun init() { + initWhiteTitleBar(ResUtil.getString(R.string.exchange_permission_setting)) + + binding.mRecyclerViewNo.addItemDecoration( + ColorDecoration( + ContextCompat.getColor(this, R.color.color_F3F5FA), + 0, Utils.dip2px(this, 1f), false + ) + ) + binding.mRecyclerViewNo.adapter = mNoExchangeAdapter + binding.mRecyclerViewEnable.addItemDecoration( + ColorDecoration( + ContextCompat.getColor(this, R.color.color_F3F5FA), + 0, Utils.dip2px(this, 1f), false + ) + ) + binding.mRecyclerViewEnable.adapter = mEnableExchangeAdapter + + mNoExchangeAdapter.setOnItemChildClickListener { _, _, position -> + associationViewModel.operateMemberExchange( + 1, + mNoExchangeAdapter.data[position].uid, + "1" + ) + } + + mEnableExchangeAdapter.setOnItemChildClickListener { _, _, position -> + CloseExchangeTipDialog(context).apply { + setName(mEnableExchangeAdapter.data[position].nick) + setOnActionListener(object : CloseExchangeTipDialog.OnActionListener { + override fun onOk() { + associationViewModel.operateMemberExchange( + 0, + mEnableExchangeAdapter.data[position].uid, + "0" + ) + } + }) + }.show() + } + + associationViewModel.loadingLiveData.observe(this) { loading -> + if (loading) dialogManager.showProgressDialog(this) + else dialogManager.dismissDialog() + } + + associationViewModel.operateMemberExchangeLiveData.observe(this) { + if (it == "0") { + toast(getString(R.string.gold_exchange_permission_of_the_user_has_been_disabled)) + } else if (it == "1") { + toast(getString(R.string.gold_exchange_permission_of_the_user_has_been_enabled)) + } + associationViewModel.getMemberExchangeList() + } + + associationViewModel.memberExchangeLiveData.observe(this) { list -> + list?.let { memberExchangeInfo -> + val noList = memberExchangeInfo.filter { it.exchangeAuthStatus == 0 } + .sortedByDescending { it.golds } + val enableList = memberExchangeInfo.filter { it.exchangeAuthStatus == 1 } + .sortedByDescending { it.golds } + mNoExchangeAdapter.setNewData(noList) + mEnableExchangeAdapter.setNewData(enableList) + binding.group.visibility = View.VISIBLE + } + } + + associationViewModel.getMemberExchangeList() + } + + override fun needSteepStateBar(): Boolean { + return true + } + + override fun setStatusBar() { + super.setStatusBar() + StatusBarUtil.transparencyBar(this) + StatusBarUtil.StatusBarLightMode(this) + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallMemberListActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallMemberListActivity.java new file mode 100644 index 0000000..98c4bc9 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallMemberListActivity.java @@ -0,0 +1,97 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.Intent; + +import androidx.recyclerview.widget.LinearLayoutManager; + +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseViewBindingActivity; +import com.chwl.app.common.EmptyViewHelper; +import com.chwl.app.databinding.ActivityHallMemberListBinding; +import com.chwl.app.module_hall.hall.adapter.GroupMemberListAdapter; +import com.chwl.app.module_hall.hall.presenter.AdminListPresenter; +import com.chwl.app.ui.user.activity.UserInfoActivity; +import com.chwl.app.ui.utils.RVDelegate; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ResUtil; + +@CreatePresenter(AdminListPresenter.class) +public class HallMemberListActivity extends BaseViewBindingActivity { + + private GroupMemberListAdapter mGroupMemberListAdapter; + + private RVDelegate rvDelegate; + + private static final String KEY_HALL_NAME = "hallName"; + private static final String KEY_HALL_ID = "hallId"; + + private String hallName; + private long hallId; + + private int page = 1; + private final int pageSize = 20; + + + public static void start(Context context, String hallName, long hallId) { + Intent intent = new Intent(context, HallMemberListActivity.class); + intent.putExtra(KEY_HALL_NAME, hallName); + intent.putExtra(KEY_HALL_ID, hallId); + context.startActivity(intent); + } + + @Override + public void init() { + hallName = getIntent().getStringExtra(KEY_HALL_NAME); + hallId = getIntent().getLongExtra(KEY_HALL_ID, 0); + initWhiteTitleBar(hallName); + rvDelegate = new RVDelegate.Builder() + .setAdapter(mGroupMemberListAdapter = new GroupMemberListAdapter(this, null)) + .setLayoutManager(new LinearLayoutManager(this)) + .setPageSize(pageSize) + .setEmptyView(EmptyViewHelper.createEmptyTextView(context, ResUtil.getString(R.string.hall_activity_hallmemberlistactivity_01))) + .setRefreshLayout(binding.refreshLayout) + .setRecyclerView(binding.recyclerView) + .build(); + mGroupMemberListAdapter.setOnItemChildClickListener((adapter, view, position) -> { + MemberInfo memberInfo = mGroupMemberListAdapter.getItem(position); + if (memberInfo != null) { + UserInfoActivity.Companion.start(context, memberInfo.getUid()); + } + }); + mGroupMemberListAdapter.setOnLoadMoreListener(() -> loadData(false), binding.recyclerView); + binding.refreshLayout.setOnRefreshListener(() -> loadData(true)); + loadData(true); + } + + @SuppressLint("CheckResult") + private void loadData(boolean refresh) { + + page = refresh ? 1 : (page + 1); + + HallModel.get().getAllMembers(hallId, page, pageSize) + .compose(bindToLifecycle()) + .doOnError(e -> rvDelegate.loadErr(refresh)) + .subscribe(listMemberInfo -> { + binding.tvHallMemberNum.setText(String.valueOf(listMemberInfo.getCount())); + rvDelegate.loadData(listMemberInfo.getMembers(), refresh); + }); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallNameSettingActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallNameSettingActivity.java new file mode 100644 index 0000000..b813bfb --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallNameSettingActivity.java @@ -0,0 +1,123 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.View; + +import androidx.core.content.ContextCompat; + +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.base.TitleBar; +import com.chwl.app.common.widget.LimitEditText; +import com.chwl.app.module_hall.hall.presenter.HallNamePresenter; +import com.chwl.app.module_hall.hall.view.IHallNameView; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; + +@CreatePresenter(HallNamePresenter.class) +public class HallNameSettingActivity extends BaseMvpActivity + implements IHallNameView, View.OnClickListener { + + private LimitEditText etHallName; + + /** + * 厅名限制字符数 + */ + private final static int MAX_HALL_NAME_LIMIT = 15; + + private long hallId; + + public static void start(Context context, String hallName, long hallId) { + Intent intent = new Intent(context, HallNameSettingActivity.class); + intent.putExtra("hallName", hallName); + intent.putExtra("hallId", hallId); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_hall_name); + findView(); + initListener(); + + initWhiteTitleBar(ResUtil.getString(R.string.hall_activity_hallnamesettingactivity_01)); + + setRightOption(); + hallId = getIntent().getLongExtra("hallId", 0); + String hallName = getIntent().getStringExtra("hallName"); + if (!TextUtils.isEmpty(hallName)) { + etHallName.setTextAutoCursor(hallName); + } + + } + + private void findView() { + etHallName = findViewById(R.id.et_hall_name); + } + + private void initListener() { + etHallName.setOnClickListener(this); + } + + @Override + public void onClick(View view) { + if (view.getId() == R.id.iv_edit_clear) { + etHallName.setText(""); + } + } + + private void setRightOption() { + mTitleBar.setActionTextColor(ContextCompat.getColor(this, R.color.appColor)); + mTitleBar.addAction(new TitleBar.TextAction(ResUtil.getString(R.string.hall_activity_hallnamesettingactivity_02)) { + @Override + public void performAction(View view) { + commit(etHallName.getText().toString().trim()); + } + }); + } + + private void commit(String hallName) { + if (TextUtils.isEmpty(hallName)) { + SingleToastUtil.showToastShort(ResUtil.getString(R.string.hall_activity_hallnamesettingactivity_03)); + return; + } + + + if (hallName.length() > MAX_HALL_NAME_LIMIT) { + SingleToastUtil.showToastShort(ResUtil.getString(R.string.hall_activity_hallnamesettingactivity_04)); + return; + } + + getMvpPresenter().updateHallName(hallName, hallId); + } + + @Override + public void updateHallNameSuccess(String newHallName) { + SingleToastUtil.showToastShort(ResUtil.getString(R.string.hall_activity_hallnamesettingactivity_05)); + finish(); + } + + @Override + public void updateHallNameFail(String message) { + toast(message); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallSearchActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallSearchActivity.java new file mode 100644 index 0000000..f6b71f4 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/HallSearchActivity.java @@ -0,0 +1,32 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; + +import com.chwl.app.R; +import com.chwl.app.friend.action.AbstractSelectFriendAction; +import com.chwl.app.ui.search.SearchHallActivity; +import com.chwl.library.utils.ResUtil; + +/** + * 模厅搜索 + * Created by lvzebiao on 2019/1/8. + */ + +public class HallSearchActivity extends SearchHallActivity { + + public static void start(Context context,long hallId, int type) { + Intent intent = new Intent(context, HallSearchActivity.class); + intent.putExtra(AbstractSelectFriendAction.KEY_TYPE, type); + intent.putExtra("hallId", hallId); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + searchEdit.setHint(ResUtil.getString(R.string.hall_activity_hallsearchactivity_01)); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/IncomeStatisticsActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/IncomeStatisticsActivity.java new file mode 100644 index 0000000..161f932 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/IncomeStatisticsActivity.java @@ -0,0 +1,388 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; + +import com.jzxiang.pickerview.data.Type; +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.module_hall.hall.view.dialog.TimePickerDialog; +import com.chwl.app.module_hall.hall.view.indicator.StatisticsIndicatorAdapter; +import com.chwl.app.module_hall.income.DayIncomeFragment; +import com.chwl.app.module_hall.income.GoldRecordFragment; +import com.chwl.app.module_hall.income.presenter.IncomeStatisticsPresenter; +import com.chwl.app.module_hall.income.view.IIncomeStatisticsView; +import com.chwl.app.ui.widget.magicindicator.MagicIndicator; +import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper; +import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.CommonUtils; +import com.chwl.library.utils.ResUtil; + +import java.util.ArrayList; +import java.util.List; + +/** + * 收入统计界面 + * Created by lvzebiao on 2018/12/27. + */ + +@CreatePresenter(IncomeStatisticsPresenter.class) +public class IncomeStatisticsActivity extends BaseMvpActivity + implements IIncomeStatisticsView, TimePickerDialog.TimePickerListener, + DayIncomeFragment.DayIncomeFragmentListener, GoldRecordFragment.DayIncomeFragmentListener, + View.OnClickListener{ + + private static final int TYPE_DAY = 0; + private static final int TYPE_WEEK = 1; + private static final int TYPE_GOLD = 2; + + List list = new ArrayList<>(); + + private ViewPager viewPager; + private MagicIndicator indicator; + private TextView tvMonthDayStart; + private TextView tvMonthDayEnd; + private TextView tvYear; + private TextView tvTotal; + private LinearLayout llDayList; + private LinearLayout llGoldList; + private ImageView iv_diamond_top; + private ImageView iv_diamond_bottom; + private ImageView iv_gold_top; + private ImageView iv_gold_bottom; + private ImageView iv_date_arrow; + private LinearLayout ll_day_group; + private TextView tv_diamond_arrow; + private TextView tv_gold_arrow; + private LinearLayout ll_diamond_arrow; + private LinearLayout ll_gold_arrow; + + private long hallId; + + private boolean mDiamondArrow = false; + private boolean mGoldArrow = false; + + public static void start(Context context, long hallId) { + Intent intent = new Intent(context, IncomeStatisticsActivity.class); + intent.putExtra("hallId", hallId); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_income_statistics); + findView(); + initListener(); + hallId = getIntent().getLongExtra("hallId", 0); + initWhiteTitleBar(ResUtil.getString(R.string.hall_activity_incomestatisticsactivity_02)); + initIndicator(); + + DayIncomeFragment fragment = DayIncomeFragment.getInstance(hallId, DayIncomeFragment.TYPE_DAY); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + + fragment = DayIncomeFragment.getInstance(hallId, DayIncomeFragment.TYPE_WEEK); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + +// GoldRecordFragment goldRecordFragment = GoldRecordFragment.getInstance(hallId); +// goldRecordFragment.setmDayIncomeFragmentListener(this); +// list.add(goldRecordFragment); + + viewPager.setOffscreenPageLimit(3); + viewPager.setAdapter(adapter); + + } + + private void findView() { + viewPager = findViewById(R.id.view_pager); + indicator = findViewById(R.id.indicator); + tvMonthDayStart = findViewById(R.id.tv_month_day_start); + tvMonthDayEnd = findViewById(R.id.tv_month_day_end); + tvYear = findViewById(R.id.tv_year); + tvTotal = findViewById(R.id.tv_total); + llDayList = findViewById(R.id.ll_day_list); + llGoldList = findViewById(R.id.ll_gold_list); + iv_diamond_top = findViewById(R.id.iv_diamond_top); + iv_diamond_bottom = findViewById(R.id.iv_diamond_bottom); + iv_gold_top = findViewById(R.id.iv_gold_top); + iv_gold_bottom = findViewById(R.id.iv_gold_bottom); + iv_date_arrow = findViewById(R.id.iv_date_arrow); + ll_day_group = findViewById(R.id.ll_day_group); + tv_diamond_arrow = findViewById(R.id.tv_diamond_arrow); + tv_gold_arrow = findViewById(R.id.tv_gold_arrow); + ll_diamond_arrow = findViewById(R.id.ll_diamond_arrow); + ll_gold_arrow = findViewById(R.id.ll_gold_arrow); + } + + private void initListener() { + iv_date_arrow.setOnClickListener(this); + ll_day_group.setOnClickListener(this); + tv_diamond_arrow.setOnClickListener(this); + tv_gold_arrow.setOnClickListener(this); + ll_diamond_arrow.setOnClickListener(this); + ll_gold_arrow.setOnClickListener(this); + } + + private boolean mHasInit = false; + + @Override + protected void onResume() { + super.onResume(); + + if (!mHasInit) { + mHasInit = true; + initDay(); + } + } + + /** + * 初始化当前日,周 + */ + private void initDay() { + + IncomeStatisticsPresenter presenter = getMvpPresenter(); + presenter.initCurrentDay(); + + String first = presenter.getmStartTimeStr(); + String last = presenter.getmEndTimeStr(); + + getIncomeTotal(presenter.getDayFormat(), first, last); + } + + private void initIndicator() { + List tagList = new ArrayList<>(); + tagList.add(ResUtil.getString(R.string.hall_activity_incomestatisticsactivity_03)); + tagList.add(ResUtil.getString(R.string.hall_activity_incomestatisticsactivity_04)); +// tagList.add(ResUtil.getString(R.string.gold_detail)); + StatisticsIndicatorAdapter adapter = new StatisticsIndicatorAdapter(tagList, 5); + adapter.setOnItemSelectListener(position -> viewPager.setCurrentItem(position)); + CommonNavigator navigator = new CommonNavigator(this); + navigator.setAdapter(adapter); + navigator.setAdjustMode(true); + indicator.setNavigator(navigator); + ViewPagerHelper.bind(indicator, viewPager); + + mCurrentType = TYPE_DAY; + + viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + + } + + @Override + public void onPageSelected(int position) { + if (position != 2) { + llDayList.setVisibility(View.VISIBLE); + llGoldList.setVisibility(View.GONE); + // 切换日,周 + mCurrentType = position; + IncomeStatisticsPresenter presenter = getMvpPresenter(); + String day; + + if (mCurrentType == TYPE_WEEK) { + day = presenter.getWeekChooseDayFormat(); + getIncomeTotal(day, presenter.getWeekFirstDay(), presenter.getWeekLastDay()); + } else if (mCurrentType == TYPE_DAY) { + day = presenter.getDayFormat(); + getIncomeTotal(day, presenter.getmStartTimeStr(), presenter.getmEndTimeStr()); + } + } else { + llDayList.setVisibility(View.GONE); + llGoldList.setVisibility(View.VISIBLE); + + mCurrentType = position; + IncomeStatisticsPresenter presenter = getMvpPresenter(); + String day; + + day = presenter.getWeekChooseDayFormat(); + getIncomeTotal(day, presenter.getWeekFirstDay(), presenter.getWeekLastDay()); + } + } + + @Override + public void onPageScrollStateChanged(int state) { + + } + }); + + } + + FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(getSupportFragmentManager()) { + @Override + public Fragment getItem(int position) { + return list.get(position); + } + + @Override + public int getCount() { + return list.size(); + } + }; + + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.ll_diamond_arrow: + case R.id.tv_diamond_arrow: + if (!mDiamondArrow) { + mDiamondArrow = true; + iv_diamond_top.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_black_top)); + iv_diamond_bottom.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_gray_bottom)); + GoldRecordFragment goldRecordFragment = (GoldRecordFragment) list.get(2); + goldRecordFragment.setDiamondSort(true); + } else { + mDiamondArrow = false; + iv_diamond_top.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_gray_top)); + iv_diamond_bottom.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_black_bottom)); + GoldRecordFragment goldRecordFragment = (GoldRecordFragment) list.get(2); + goldRecordFragment.setDiamondSort(false); + } + break; + case R.id.ll_gold_arrow: + case R.id.tv_gold_arrow: + if (!mGoldArrow) { + mGoldArrow = true; + iv_gold_top.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_black_top)); + iv_gold_bottom.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_gray_bottom)); + GoldRecordFragment goldRecordFragment = (GoldRecordFragment) list.get(2); + goldRecordFragment.setRemainSort(true); + } else { + mGoldArrow = false; + iv_gold_top.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_gray_top)); + iv_gold_bottom.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_black_bottom)); + GoldRecordFragment goldRecordFragment = (GoldRecordFragment) list.get(2); + goldRecordFragment.setRemainSort(false); + } + break; + case R.id.iv_date_arrow: + case R.id.ll_day_group: + if (CommonUtils.isFastDoubleClick(500)) return; + IncomeStatisticsPresenter presenter = getMvpPresenter(); + boolean isWeek = mCurrentType == TYPE_WEEK || mCurrentType == TYPE_GOLD; + boolean isMonth = false; + TimePickerDialog.Builder builder = new TimePickerDialog.Builder() + .setType(Type.YEAR_MONTH_DAY) + .setTitleStringId("") + .setThemeColor(getResources().getColor(R.color.line_color)) + .setWheelItemTextNormalColor(getResources().getColor(R.color + .timetimepicker_default_text_color)) + .setWheelItemTextSelectorColor(getResources().getColor(R.color.black)) + // 根据上一次选中时间初始化日期控件 + .setCurrentMillseconds(isWeek ? presenter.getmWeekChooseDay() : presenter.getmDay()) + .setmIsWeek(isWeek) + .setIsMonth(isMonth); + + TimePickerDialog dialog = builder.build(); + dialog.setmTimePickerListener(this); + dialog.show(getSupportFragmentManager(), "year_month_day"); + break; + } + } + + private int mCurrentType; + + @Override + public void getTime(long chooseTime, String weekFirstDay, String weekLastDay) { + if (mCurrentType == TYPE_GOLD) { + reverseStatus(); + } + + IncomeStatisticsPresenter presenter = getMvpPresenter(); + + if (mCurrentType == TYPE_DAY) { + presenter.setmDayStr(chooseTime); + getIncomeTotal(presenter.getDayFormat(), "", ""); + + } else if (mCurrentType == TYPE_WEEK) { + presenter.setmWeekChooseDay(chooseTime); + presenter.setWeekFirstDay(weekFirstDay); + presenter.setWeekLastDay(weekLastDay); + getIncomeTotal("", weekFirstDay, weekLastDay); + } else if (mCurrentType == TYPE_GOLD) { + presenter.setmWeekChooseDay(chooseTime); + presenter.setWeekFirstDay(weekFirstDay); + presenter.setWeekLastDay(weekLastDay); + getIncomeTotal("", weekFirstDay, weekLastDay); + } + + } + + private void reverseStatus() { + mDiamondArrow = false; + mGoldArrow = false; + iv_diamond_top.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_gray_top)); + iv_diamond_bottom.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_black_bottom)); + iv_gold_top.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_gray_top)); + iv_gold_bottom.setImageDrawable(ContextCompat.getDrawable(context, R.mipmap.ic_arrow_black_bottom)); + } + + private void getIncomeTotal(String day, String weekFirstDay, String weekLastDay) { + + if (mCurrentType == TYPE_DAY) { + String[] dayArray = day.split("-"); + tvYear.setText(String.format(getString(R.string.format_year), dayArray[0])); + + tvMonthDayEnd.setVisibility(View.GONE); + + tvMonthDayStart.setText(String.format(getString(R.string.format_month_day), dayArray[1], dayArray[2])); + DayIncomeFragment dayIncomeFragment = (DayIncomeFragment) list.get(0); + dayIncomeFragment.getIncomeTotal(hallId, day, ""); + + } else if (mCurrentType == TYPE_WEEK) { + String[] weekFirstArray = weekFirstDay.split("-"); + String[] weekLastArray = weekLastDay.split("-"); + + tvYear.setText(String.format(getString(R.string.format_year), weekFirstArray[0])); + + tvMonthDayEnd.setVisibility(View.VISIBLE); + tvMonthDayStart.setText(String.format(getString(R.string.format_month_day), weekFirstArray[1], weekFirstArray[2])); + tvMonthDayEnd.setText(String.format(getString(R.string.format_month_day), weekLastArray[1], weekLastArray[2])); + DayIncomeFragment dayIncomeFragment = (DayIncomeFragment) list.get(1); + dayIncomeFragment.getIncomeTotal(hallId, weekFirstDay, weekLastDay); + } else if (mCurrentType == TYPE_GOLD) { + String[] weekFirstArray = weekFirstDay.split("-"); + String[] weekLastArray = weekLastDay.split("-"); + + tvYear.setText(String.format(getString(R.string.format_year), weekFirstArray[0])); + + tvMonthDayEnd.setVisibility(View.VISIBLE); + tvMonthDayStart.setText(String.format(getString(R.string.format_month_day), weekFirstArray[1], weekFirstArray[2])); + tvMonthDayEnd.setText(String.format(getString(R.string.format_month_day), weekLastArray[1], weekLastArray[2])); + GoldRecordFragment goldRecordFragment = (GoldRecordFragment) list.get(2); + goldRecordFragment.getIncomeTotal(hallId, weekFirstDay, weekLastDay); + } + } + + @Override + public void setTotal(long total) { + tvTotal.setText(getMvpPresenter().setTotal(total)); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/MemberSearchActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/MemberSearchActivity.java new file mode 100644 index 0000000..a416f50 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/MemberSearchActivity.java @@ -0,0 +1,110 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.Intent; +import android.text.TextUtils; +import android.view.View; + +import androidx.recyclerview.widget.LinearLayoutManager; + +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.UIHelper; +import com.chwl.app.base.BaseViewBindingActivity; +import com.chwl.app.common.EmptyViewHelper; +import com.chwl.app.databinding.ActivityAddMemberBinding; +import com.chwl.app.module_hall.hall.adapter.GroupMemberListAdapter; +import com.chwl.app.ui.utils.RVDelegate; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.library.utils.ResUtil; + +import java.util.ArrayList; +import java.util.List; + +public class MemberSearchActivity extends BaseViewBindingActivity implements View.OnClickListener { + + private GroupMemberListAdapter mGroupMemberListAdapter; + private List mMemberInfoList = new ArrayList<>(); + + private RVDelegate rvDelegate; + + private String queryString; + + private int page = 1; + private final int pageSize = 20; + + public static void start(Context context) { + Intent intent = new Intent(context, MemberSearchActivity.class); + context.startActivity(intent); + } + + @Override + public void init() { + initListener(); + + mGroupMemberListAdapter = new GroupMemberListAdapter(this, null); + + rvDelegate = new RVDelegate.Builder() + .setAdapter(mGroupMemberListAdapter) + .setLayoutManager(new LinearLayoutManager(this)) + .setPageSize(pageSize) + .setEmptyView(EmptyViewHelper.createEmptyTextView(context, ResUtil.getString(R.string.hall_activity_membersearchactivity_01))) + .setRecyclerView(binding.recyclerView) + .build(); + mGroupMemberListAdapter.setmType(GroupMemberListAdapter.TYPE_SEARCH); + mGroupMemberListAdapter.setOnItemChildClickListener((adapter, view, position) -> { + if (mMemberInfoList != null && mMemberInfoList.size() > 0) { + MemberInfo memberInfo = mMemberInfoList.get(position); + UIHelper.showUserInfoAct(MemberSearchActivity.this, memberInfo.getUid()); + } + }); + + mGroupMemberListAdapter.setOnLoadMoreListener(() -> loadData(queryString, false), binding.recyclerView); + } + + private void initListener() { + binding.tvSearch.setOnClickListener(this); + binding.ivBack.setOnClickListener(this); + } + + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.tv_search: + queryString = binding.etSearch.getText().toString().trim(); + if (!TextUtils.isEmpty(queryString)) { + loadData(queryString, true); + } else { + toast(ResUtil.getString(R.string.hall_activity_membersearchactivity_02)); + } + break; + case R.id.iv_back: + finish(); + break; + } + } + + @SuppressLint("CheckResult") + private void loadData(String queryString, boolean refresh) { + page = refresh ? 1 : (page + 1); + HallModel.get().queryMembers(queryString, page, pageSize) + .compose(bindToLifecycle()) + .doOnError(e -> rvDelegate.loadErr(refresh)) + .subscribe(listMemberInfo -> rvDelegate.loadData(listMemberInfo.getMembers(), refresh)); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ModuleClanActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ModuleClanActivity.java new file mode 100644 index 0000000..bef5049 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ModuleClanActivity.java @@ -0,0 +1,282 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; + +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; + +import com.netease.nim.uikit.StatusBarUtil; +import com.netease.nim.uikit.common.util.sys.ScreenUtil; +import com.orhanobut.logger.Logger; +import com.chwl.app.R; +import com.chwl.app.UIHelper; +import com.chwl.app.base.BaseActivity; +import com.chwl.app.databinding.ActivityModuleClanBinding; +import com.chwl.app.module_hall.HallDataManager; +import com.chwl.app.module_hall.hall.adapter.GroupMemberListAdapter; +import com.chwl.app.module_hall.hall.adapter.HallListAdapter; +import com.chwl.app.ui.user.activity.UserInfoActivity; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.utils.RVDelegate; +import com.chwl.core.auth.AuthModel; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.ClanInfo; +import com.chwl.core.module_hall.hall.bean.HallInfo; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.core.utils.net.RxHelper; +import com.chwl.library.utils.ListUtils; +import com.chwl.library.utils.ResUtil; + +import org.greenrobot.eventbus.EventBus; + +import java.util.ArrayList; +import java.util.List; + +/** + * 模厅界面 + */ +public class ModuleClanActivity extends BaseActivity implements View.OnClickListener { + + private final static String KEY_OTHER_UID = "key_other_uid"; + private final int pageSize = 20; + private GroupMemberListAdapter mGroupMemberListAdapter; + private HallListAdapter hallListAdapter; + private RVDelegate rvDelegate; + @Nullable + private ClanInfo clanInfo; + private int page = 100; + private boolean isLoading; + private boolean isSelfClan; + private long otherUid; + + private ActivityModuleClanBinding binding; + + public static void start(Context context, long uid) { + Intent intent = new Intent(context, ModuleClanActivity.class); + intent.putExtra(KEY_OTHER_UID, uid); + context.startActivity(intent); + } + + public static void start(Context context) { + start(context, AuthModel.get().getCurrentUid()); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + binding = ActivityModuleClanBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); + + + + binding.ivBack.setOnClickListener(this); + binding.tvHallAdmin.setOnClickListener(this); + binding.tvHallIncome.setOnClickListener(this); + binding.tvSingleRoomIncome.setOnClickListener(this); + binding.ivHallMemberSearch.setOnClickListener(this); + binding.tvHallExchange.setOnClickListener(this); + otherUid = getIntent().getLongExtra(KEY_OTHER_UID, AuthModel.get().getCurrentUid()); + isSelfClan = otherUid == AuthModel.get().getCurrentUid(); + binding.ivHallMemberSearch.setVisibility(isSelfClan ? View.VISIBLE : View.GONE); + binding.recyclerView.setLayoutManager(new LinearLayoutManager(this)); + binding.srlGroup.setOnRefreshListener(() -> { + if (isLoading) { + return; + } + loadMembers(true); + }); + binding.recyclerView.setFocusable(false); + binding.recyclerView.setLayoutManager(new LinearLayoutManager(this)); + mGroupMemberListAdapter = new GroupMemberListAdapter(this, null); + mGroupMemberListAdapter.setOnItemChildClickListener((adapter, view, position) -> { + List memberInfoList = mGroupMemberListAdapter.getData(); + if (memberInfoList.size() > 0) { + MemberInfo memberInfo = memberInfoList.get(position); + UIHelper.showUserInfoAct(ModuleClanActivity.this, memberInfo.getUid()); + } + }); + mGroupMemberListAdapter.setOnLoadMoreListener(() -> loadMembers(false), binding.recyclerView); + binding.recyclerView.setAdapter(mGroupMemberListAdapter); + setTvCount(0); + if (isSelfClan && HallDataManager.get().isClanElder()) { + binding.llOption.setVisibility(View.VISIBLE); + } + EventBus.getDefault().register(this); + binding.nsvHall.setNestedScrollingEnabled(false); + + } + + @Override + protected void onResume() { + super.onResume(); + initClanAndHall(); + loadMembers(true); + } + + @SuppressLint({"CheckResult", "SetTextI18n"}) + private void initClanAndHall() { + //没有家族才更新顶部公会名,有的话重新加载公会列表 + HallModel.get().getUserHallAndClan(otherUid) + .compose(bindToLifecycle()) + .subscribe(clanAndHallInfo -> { + if (isSelfClan) { + HallDataManager.get().updateHallInfo(clanAndHallInfo); + } + clanInfo = clanAndHallInfo.getClan(); + if (clanInfo != null && clanInfo.getId() != 0) { + binding.clClan.setVisibility(View.VISIBLE); + binding.clClan.setOnClickListener(v -> UserInfoActivity.Companion.start(context, clanInfo.getElderUid())); + binding.tvClanOwnerId.setText(ResUtil.getString(R.string.hall_activity_moduleclanactivity_02) + clanInfo.getElderErbanNo()); + binding.tvClanOwnerName.setText(clanInfo.getElderName()); + binding.tvTitle.setText(clanInfo.getName()); + ImageLoadUtils.loadRectImage(context, clanInfo.getAvatar(), binding.ivClanAvatar, R.drawable.default_avatar, ScreenUtil.dip2px(8)); + ImageLoadUtils.loadImage(context, clanInfo.getLevelIcon(), binding.ivClanLevel); + loadHallList(); + } else { + binding.clClan.setVisibility(View.GONE); + } + + }); + } + + @SuppressLint({"CheckResult", "SetTextI18n"}) + private void loadHallList() { + if (clanInfo == null) return; + HallModel.get().getClanHallList(clanInfo.getId()) + .compose(bindToLifecycle()) + .subscribe(hallInfos -> { + if (ListUtils.isListEmpty(hallInfos)) { + binding.llHallList.setVisibility(View.GONE); + return; + } + if (rvDelegate == null) { + rvDelegate = new RVDelegate.Builder() + .setAdapter(hallListAdapter = new HallListAdapter()) + .setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)) + .setRecyclerView(binding.rvHall) + .build(); + hallListAdapter.setOnItemClickListener((adapter, view, position) -> { + HallInfo hallInfo = hallListAdapter.getItem(position); + if (hallInfo != null) { + ModuleHallActivity.start(context, hallInfo.getHallId(), hallInfo.getOwnerUid()); + } + }); + } + binding.llHallList.setVisibility(View.VISIBLE); + binding.tvClanMemberCount.setText(ResUtil.getString(R.string.hall_activity_moduleclanactivity_03) + hallInfos.size() + ")"); + binding.tvClanRoomNum.setText(ResUtil.getString(R.string.hall_activity_moduleclanactivity_04) + hallInfos.size()); + rvDelegate.setNewData(hallInfos); + }); + } + + @SuppressLint("CheckResult") + private void loadMembers(boolean refresh) { + page = refresh ? 1 : (page + 1); + isLoading = true; + HallModel.get().getClanAllMembers(otherUid, page, pageSize) + .compose(RxHelper.bindActivity(this)) + .subscribe((listMemberInfo, throwable) -> { + binding.srlGroup.setRefreshing(false); + isLoading = false; + if (throwable != null) { + Logger.i(ResUtil.getString(R.string.hall_activity_moduleclanactivity_05)); + if (refresh) { + showNetworkErr(); + } + } else { + int count = listMemberInfo.getCount(); + setTvCount(count); + List list = listMemberInfo.getMembers(); + if (list == null) { + list = new ArrayList<>(); + } + if (list.size() == 0) { + if (refresh) { + showNoData(); + } else { + mGroupMemberListAdapter.loadMoreEnd(); + } + } else { + hideStatus(); + if (refresh) { + mGroupMemberListAdapter.setNewData(list); + mGroupMemberListAdapter.disableLoadMoreIfNotFullPage(); + } else { + mGroupMemberListAdapter.addData(list); + } + if (list.size() < 20) { + mGroupMemberListAdapter.loadMoreEnd(); + } else { + mGroupMemberListAdapter.loadMoreComplete(); + } + } + } + }); + + } + + private void setTvCount(int count) { + binding.tvCount.setText(ResUtil.getString(R.string.hall_activity_moduleclanactivity_06) + count + ")"); + } + + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.iv_back: + finish(); + break; + case R.id.tv_hall_income: + if (clanInfo != null) { + ClanIncomeActivity.start(this, clanInfo.getId()); + } else { + toast(ResUtil.getString(R.string.hall_activity_moduleclanactivity_07)); + } + break; + case R.id.tv_hall_admin: + if (clanInfo != null) { + SuperAdminManageActivity.start(this, clanInfo.getId()); + } else { + toast(ResUtil.getString(R.string.hall_activity_moduleclanactivity_08)); + } + break; + case R.id.tv_single_room_income: + if (clanInfo != null) { + SingleRoomIncomeActivity.start(this, clanInfo.getId(), 0); + } else { + toast(ResUtil.getString(R.string.hall_activity_moduleclanactivity_09)); + } + break; + case R.id.iv_hall_member_search: + MemberSearchActivity.start(this); + break; + case R.id.tv_hall_exchange: + ExchangePermissionActivity.start(this); + break; + default: + break; + } + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ModuleHallActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ModuleHallActivity.java new file mode 100644 index 0000000..afbeabb --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/ModuleHallActivity.java @@ -0,0 +1,563 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.text.SpannableString; +import android.view.View; + +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.LinearLayoutManager; + +import com.netease.nim.uikit.StatusBarUtil; +import com.netease.nim.uikit.support.glide.GlideApp; +import com.orhanobut.logger.Logger; +import com.chwl.app.R; +import com.chwl.app.UIHelper; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.common.widget.dialog.DialogManager; +import com.chwl.app.databinding.ActivityModuleHallBinding; +import com.chwl.app.friend.action.AbstractSelectFriendAction; +import com.chwl.app.home.activity.AssociationActivity; +import com.chwl.app.module_hall.HallDataManager; +import com.chwl.app.module_hall.hall.adapter.GroupMemberListAdapter; +import com.chwl.app.module_hall.hall.presenter.ModuleHallPresenter; +import com.chwl.app.module_hall.hall.view.IModuleHallView; +import com.chwl.app.ui.im.avtivity.NimP2PMessageActivity; +import com.chwl.app.ui.user.activity.UserInfoActivity; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.widget.ButtonItem; +import com.chwl.core.auth.AuthModel; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.AuthInfo; +import com.chwl.core.module_hall.hall.bean.ClanInfo; +import com.chwl.core.module_hall.hall.bean.HallInfo; +import com.chwl.core.module_hall.hall.bean.JoinRoomInfo; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.core.module_hall.hall.bean.RoleType; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.core.utils.net.RxHelper; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ResUtil; + +import org.greenrobot.eventbus.EventBus; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 模厅界面 + */ +@CreatePresenter(ModuleHallPresenter.class) +public class ModuleHallActivity extends BaseMvpActivity + implements IModuleHallView, View.OnClickListener { + + private final static String KEY_HALL_ID = "key_hall_id"; + private final static String KEY_OWNER_UID = "key_owner_uid"; + private final static String KEY_OTHER_UID = "key_other_uid"; + private final int pageSize = 20; + private GroupMemberListAdapter mGroupMemberListAdapter; + private List mAuthInfoList; + private int page = 100; + private boolean isLoading; + private long lastClickTime; + private boolean isSelfHall; + private long hallId; + private long ownerUid; + + @Nullable + private HallInfo hallInfo; + private ClanInfo clanInfo; + + private ActivityModuleHallBinding binding; + private long mTargetUid; + private int mCount; + + private JoinRoomInfo joinRoomInfo; + + public static void start(Context context, long hallId, long ownerUid) { + Intent intent = new Intent(context, ModuleHallActivity.class); + intent.putExtra(KEY_HALL_ID, hallId); + intent.putExtra(KEY_OWNER_UID, ownerUid); + context.startActivity(intent); + } + + public static void start(Context context) { + start(context, HallModel.get().getHallId(), AuthModel.get().getCurrentUid()); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + binding = ActivityModuleHallBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); + binding.ivHallMemberSearch.setOnClickListener(this); + binding.ivHallMemberMore.setOnClickListener(this); + binding.ivBack.setOnClickListener(this); + binding.ivSetting.setOnClickListener(this); + binding.tvExit.setOnClickListener(this); + binding.tvCheckStream.setOnClickListener(this); + binding.tvMemberIncome.setOnClickListener(this); + binding.tvManageSetup.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(); + binding.recyclerView.setLayoutManager(new LinearLayoutManager(this)); + binding.recyclerView.setFocusable(false); + binding.ivHallMemberSearch.setVisibility(isSelfHall ? View.VISIBLE : View.GONE); + binding.srlGroup.setOnRefreshListener(() -> { + if (isLoading) { + return; + } + loadMembers(true); + }); + binding.recyclerView.setLayoutManager(new LinearLayoutManager(this)); + mGroupMemberListAdapter = new GroupMemberListAdapter(this, null); + mGroupMemberListAdapter.setOnItemChildClickListener((adapter, view, position) -> { + List memberInfoList = mGroupMemberListAdapter.getData(); + if (memberInfoList.size() > 0) { + MemberInfo memberInfo = memberInfoList.get(position); + + int type = mGroupMemberListAdapter.getmType(); + if (type == GroupMemberListAdapter.TYPE_REMOVE) { + if (view.getId() == R.id.iv_remove) { + showRemoveDialog(memberInfo.getUid(), memberInfo.getRoleType(), memberInfo.getNick()); + } + } else { + UIHelper.showUserInfoAct(ModuleHallActivity.this, memberInfo.getUid()); + } + } + }); + mGroupMemberListAdapter.setOnLoadMoreListener(() -> loadMembers(false), binding.recyclerView); + binding.recyclerView.setAdapter(mGroupMemberListAdapter); + setTvCount(0); + EventBus.getDefault().register(this); + binding.nsvHall.setNestedScrollingEnabled(false); + + binding.tvJoinRoom.setOnClickListener(view -> { + if(joinRoomInfo != null) { + if (joinRoomInfo.getHallBtnStatus() == 3) { + NimP2PMessageActivity.startRecord(this, String.valueOf(joinRoomInfo.getHallMessageUid()), String.valueOf(joinRoomInfo.getRecordId())); + } else if (joinRoomInfo.getHallBtnStatus() == 1) { + getDialogManager().showProgressDialog(context); + HallModel.get().applyJoinHall(hallId) + .compose(bindToLifecycle()) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + getDialogManager().dismissDialog(); + toast(error); + } + + @Override + public void onSuccess(String s) { + getDialogManager().dismissDialog(); + joinRoomInfo.setHallBtnStatus(2); + binding.tvJoinRoom.setCompoundDrawablePadding(0); + binding.tvJoinRoom.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); + binding.tvJoinRoom.setTextColor(ContextCompat.getColor(ModuleHallActivity.this, R.color.color_6D6B89)); + binding.tvJoinRoom.setBackgroundResource(R.drawable.bg_e6e6f0_15); + binding.tvJoinRoom.setText(getString(R.string.delay_to_audit)); + toast(getString(R.string.apply_success_wait_to_join_room)); + } + }); + } + } + }); + } + + @Override + protected void onResume() { + super.onResume(); + initJoinRoom(); + initClanAndHall(); + loadMembers(true); + } + + @SuppressLint("CheckResult") + private void initJoinRoom() { + HallModel.get().getJoinRoom(hallId) + .compose(bindToLifecycle()) + .subscribe(joinRoomInfo -> { + if (joinRoomInfo != null) { + this.joinRoomInfo = joinRoomInfo; + if (joinRoomInfo.getHallBtnStatus() == 0) { + binding.tvJoinRoom.setVisibility(View.GONE); + } else if (joinRoomInfo.getHallBtnStatus() == 1) { + binding.tvJoinRoom.setVisibility(View.VISIBLE); + binding.tvJoinRoom.setCompoundDrawablePadding(2); + binding.tvJoinRoom.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(this, R.drawable.ic_hall_add), null, null, null); + binding.tvJoinRoom.setTextColor(ContextCompat.getColor(this, R.color.base_color_theme_text)); + binding.tvJoinRoom.setBackgroundResource(R.drawable.base_shape_theme_30dp); + binding.tvJoinRoom.setText(getString(R.string.join_room)); + } else if (joinRoomInfo.getHallBtnStatus() == 2) { + binding.tvJoinRoom.setVisibility(View.VISIBLE); + binding.tvJoinRoom.setCompoundDrawablePadding(0); + binding.tvJoinRoom.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); + binding.tvJoinRoom.setTextColor(ContextCompat.getColor(this, R.color.color_6D6B89)); + binding.tvJoinRoom.setBackgroundResource(R.drawable.bg_e6e6f0_30); + binding.tvJoinRoom.setText(getString(R.string.delay_to_audit)); + } else if (joinRoomInfo.getHallBtnStatus() == 3) { + binding.tvJoinRoom.setVisibility(View.VISIBLE); + binding.tvJoinRoom.setCompoundDrawablePadding(0); + binding.tvJoinRoom.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); + binding.tvJoinRoom.setTextColor(ContextCompat.getColor(this, R.color.color_white)); + binding.tvJoinRoom.setBackgroundResource(R.drawable.bg_ffbc51_30); + binding.tvJoinRoom.setText(getString(R.string.by_invitation)); + } + } + }); + } + + @SuppressLint({"CheckResult", "SetTextI18n"}) + private void initClanAndHall() { + HallModel.get().getUserHallAndClan(ownerUid) + .compose(bindToLifecycle()) + .subscribe(clanAndHallInfo -> { + HallInfo hallInfo = clanAndHallInfo.getHall(); + clanInfo = clanAndHallInfo.getClan(); + setManegeOption((HallDataManager.get().isManager() && isSelfHall) || clanAndHallInfo.isManageHall()); + int roleType = 0; + if (hallInfo != null) { + roleType = hallInfo.getRoleType(); + } + binding.tvManageSetup.setVisibility(roleType == RoleType.OWNER ? View.VISIBLE : View.INVISIBLE); + //高管是没有修改公会名称权限的,只有房主和超管才有 + setSettingOption((HallDataManager.get().getRoleType() == RoleType.OWNER && isSelfHall) || clanAndHallInfo.isManageHall()); + if (hallInfo != null && hallInfo.getHallId() != 0) { + this.hallInfo = hallInfo; + binding.clHall.setVisibility(View.VISIBLE); + binding.clHall.setOnClickListener(v -> UserInfoActivity.Companion.start(context, hallInfo.getOwnerUid())); + binding.tvHallId.setText(ResUtil.getString(R.string.hall_activity_modulehallactivity_02) + hallInfo.getOwnerErbanNo()); + binding.tvTitle.setText(hallInfo.getHallName()); + + ImageLoadUtils.loadAvatar(hallInfo.getOwnerAvatar(),binding.ivHallAvatar); + + ImageLoadUtils.loadImageWithBlur(context, hallInfo.getOwnerAvatar(), binding.ivAvatarBg, 20, 1); + } else { + binding.clHall.setVisibility(View.GONE); + } + }); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + /** + * 设置权限, 房主才展示 + * + * @param visible true:显示 + */ + private void setManegeOption(boolean visible) { + if (visible) { + getMvpPresenter().getHallAuths(hallId); + binding.ivHallMemberMore.setVisibility(View.VISIBLE); + binding.llOption.setVisibility(View.VISIBLE); + } else { + binding.ivHallMemberMore.setVisibility(View.GONE); + binding.llOption.setVisibility(View.GONE); + } + } + + /** + * 设置公会名权限, 房主才展示 + * + * @param visible true:显示 + */ + private void setSettingOption(boolean visible) { + if (visible) { + binding.ivSetting.setVisibility(View.VISIBLE); + binding.tvExit.setVisibility(View.GONE); + } else { + binding.ivSetting.setVisibility(View.GONE); + if (isSelfHall) binding.tvExit.setVisibility(View.VISIBLE); + } + } + + private void showRemoveDialog(long targetUid, int targetRoleType, String targetNick) { + mTargetUid = targetUid; + SpannableString spannableString = getMvpPresenter().getRemoveTips(this, targetRoleType, targetNick); + + getDialogManager().showOkCancelWithTitleDialog(ResUtil.getString(R.string.hall_activity_modulehallactivity_03), spannableString, ResUtil.getString(R.string.hall_activity_modulehallactivity_04), ResUtil.getString(R.string.hall_activity_modulehallactivity_05), new DialogManager.OkCancelDialogListener() { + @Override + public void onCancel() { + mTargetUid = -1; + statusNone(); + } + + @Override + public void onOk() { + getMvpPresenter().remove(hallId, targetUid); + } + }); + } + + private void statusNone() { + mGroupMemberListAdapter.setmType(GroupMemberListAdapter.TYPE_NONE); + mGroupMemberListAdapter.notifyDataSetChanged(); + } + + @SuppressLint("CheckResult") + private void loadMembers(boolean refresh) { + page = refresh ? 1 : (page + 1); + isLoading = true; + HallModel.get().getAllMembers(hallId, page, pageSize) + .compose(RxHelper.bindActivity(this)) + .subscribe((listMemberInfo, throwable) -> { + binding.srlGroup.setRefreshing(false); + isLoading = false; + if (throwable != null) { + Logger.i(ResUtil.getString(R.string.hall_activity_modulehallactivity_06)); + if (refresh) { + showNetworkErr(); + } + } else { + int count = listMemberInfo.getCount(); + setTvCount(count); + List list = listMemberInfo.getMembers(); + if (list == null) { + list = new ArrayList<>(); + } + if (list.size() == 0) { + if (refresh) { + showNoData(); + } else { + mGroupMemberListAdapter.loadMoreEnd(); + } + } else { + hideStatus(); + if (refresh) { + mGroupMemberListAdapter.setNewData(list); + mGroupMemberListAdapter.disableLoadMoreIfNotFullPage(); + } else { + mGroupMemberListAdapter.addData(list); + } + if (list.size() < 20) { + mGroupMemberListAdapter.loadMoreEnd(); + } else { + mGroupMemberListAdapter.loadMoreComplete(); + } + } + } + }); + + } + + private void setTvCount(int count) { + mCount = count; + binding.tvCount.setText(ResUtil.getString(R.string.hall_activity_modulehallactivity_07) + mCount + ResUtil.getString(R.string.hall_activity_modulehallactivity_08)); + } + + @Override + public void getHallAuthsSuccess(List authInfoList) { + mAuthInfoList = authInfoList; + } + + @Override + public void getHallAuthsFail(String message) { + + } + + @Override + public void quitSuccess(String message) { + toast(message); + } + + @Override + public void quitFail(String message) { + toast(message); + } + + @Override + public void getAllMembersSuccess(List memberInfoList) { + hideStatus(); + mGroupMemberListAdapter.setNewData(memberInfoList); + } + + @Override + public void getAllMembersFail(String message) { + hideStatus(); + showNoData(); + } + + @Override + public void removeSuccess(String message) { + if (mTargetUid == -1) + return; + + List memberInfoList = mGroupMemberListAdapter.getData(); + if (memberInfoList.size() > 0) { + for (MemberInfo memberInfo : memberInfoList) { + if (memberInfo.getUid() == mTargetUid) { + memberInfoList.remove(memberInfo); + if (mCount > 0) { + mCount--; + setTvCount(mCount); + } + break; + } + } + } + + statusNone(); + mTargetUid = -1; + } + + @Override + public void removeFail(String message) { + mTargetUid = -1; + toast(message); + } + + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.tv_check_stream: + if (hallInfo != null) { + RoomIncomeActivity.start(ModuleHallActivity.this, hallId); + } else { + toast(R.string.loading_data_please_wait); + } + break; + case R.id.tv_member_income: + IncomeStatisticsActivity.start(ModuleHallActivity.this, hallId); + break; + case R.id.tv_manage_setup: + AdminListActivity.start(ModuleHallActivity.this, hallId); + break; + case R.id.iv_hall_member_search: + MemberSearchActivity.start(ModuleHallActivity.this); + break; + case R.id.iv_hall_member_more: + //防双击 + long currTime = System.currentTimeMillis(); + if (currTime - lastClickTime < 1000) { + return; + } + lastClickTime = currTime; + moreOption(mAuthInfoList); + break; + case R.id.iv_back: + finish(); + break; + case R.id.iv_setting: + if (hallInfo != null) { + HallNameSettingActivity.start(ModuleHallActivity.this, hallInfo.getHallName(), hallId); + } else { + toast(ResUtil.getString(R.string.hall_activity_modulehallactivity_09)); + } + break; + case R.id.tv_exit: + showExitDialog(); + break; + } + } + + private void moreOption(List authInfoList) { + if (authInfoList != null && authInfoList.size() > 0) { + List list_adapter = new ArrayList<>(); + if (hallInfo != null) { + if (HallDataManager.get().getRoleType() == RoleType.OWNER && isSelfHall && clanInfo != null && clanInfo.getElderUid() <= 0) { + ButtonItem item = new ButtonItem(getString(R.string.join_clan), () -> { + jumpCode(AuthInfo.AUTH_MEMBER_JOIN_CLAN); + }); + list_adapter.add(item); + } + } + for (AuthInfo authInfo : authInfoList) { + if (authInfo.getCode().equals(AuthInfo.AUTH_APPLY_HALL_EXIT)) { + continue; + } + if (authInfo.getName().equals(getString(R.string.member_income)) || authInfo.getName().equals(getString(R.string.management_setup))) { + continue; + } + if (authInfo.isOwnAuth()) { + ButtonItem item = new ButtonItem(authInfo.getName(), () -> { + jumpCode(authInfo.getCode()); + }); + list_adapter.add(item); + } + } + getDialogManager().showCommonPopupDialog(list_adapter, ResUtil.getString(R.string.hall_activity_modulehallactivity_010)); + + } else { + toast(ResUtil.getString(R.string.hall_activity_modulehallactivity_011)); + } + } + + private void jumpCode(String code) { + switch (code) { + case AuthInfo.AUTH_MEMBER_JOIN_CLAN: + AssociationActivity.start(this); + break; + + case AuthInfo.AUTH_APPLY_HALL_EXIT: + showExitDialog(); + break; + + case AuthInfo.AUTH_MEMBER_JOIN_MANAGER: + HallSearchActivity.start(context, hallId, AbstractSelectFriendAction.TYPE_MODULE_HALL); + break; + + case AuthInfo.AUTH_MEMBER_EXIT_MANAGER: + RemoveMemberListActivity.start(hallId, ModuleHallActivity.this); + break; + + case AuthInfo.AUTH_HALL_MANAGER_SET: + AdminListActivity.start(ModuleHallActivity.this, hallId); + break; + + case AuthInfo.AUTH_LOOK_HALL_INCOME: + IncomeStatisticsActivity.start(ModuleHallActivity.this, hallId); + break; + + case AuthInfo.AUTH_SINGLE_ROOM_INCOME: + SingleRoomIncomeActivity.start(ModuleHallActivity.this, 0, hallId); + break; + + case AuthInfo.AUTH_HALL_NAME_SET: + if (hallInfo != null) { + HallNameSettingActivity.start(ModuleHallActivity.this, hallInfo.getHallName(), hallId); + } else { + toast(ResUtil.getString(R.string.hall_activity_modulehallactivity_012)); + } + break; + default: + Logger.e(ResUtil.getString(R.string.hall_activity_modulehallactivity_013)); + break; + } + } + + private void showExitDialog() { + CharSequence text = getMvpPresenter().getExitTips(this); + getDialogManager().showOkCancelDialog(text, new DialogManager.OkCancelDialogListener() { + @Override + public void onCancel() { + + } + + @Override + public void onOk() { + getMvpPresenter().quit(); + } + }); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/RemoveMemberListActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/RemoveMemberListActivity.java new file mode 100644 index 0000000..25b8d8a --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/RemoveMemberListActivity.java @@ -0,0 +1,271 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.text.Editable; +import android.text.SpannableString; +import android.text.TextUtils; +import android.view.View; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.netease.nim.uikit.StatusBarUtil; +import com.orhanobut.logger.Logger; +import com.chwl.app.R; +import com.chwl.app.UIHelper; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.common.EmptyViewHelper; +import com.chwl.app.common.widget.dialog.DialogManager; +import com.chwl.app.module_hall.hall.adapter.GroupMemberListAdapter; +import com.chwl.app.module_hall.hall.presenter.RemoveMemberPresenter; +import com.chwl.app.module_hall.hall.view.IRemoveMemberView; +import com.chwl.app.ui.utils.RVDelegate; +import com.chwl.app.ui.widget.TextWatcherSimple; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.core.module_hall.hall.bean.RoleType; +import com.chwl.core.module_hall.income.event.UpdateMemberListEvent; +import com.chwl.core.utils.net.RxHelper; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ListUtils; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +@CreatePresenter(RemoveMemberPresenter.class) +public class RemoveMemberListActivity extends BaseMvpActivity + implements IRemoveMemberView, View.OnClickListener{ + + private RecyclerView recyclerView; + private EditText etSearch; + private TextView tv_search; + private ImageView iv_back; + + private GroupMemberListAdapter mGroupMemberListAdapter; + private final List searchList = new ArrayList<>(); + private final List orignalList = new ArrayList<>(); + + private RVDelegate rvDelegate; + + private int page = 1; + + private final int pageSize = 20; + + private CharSequence searchStr; + + private long mTargetUid; + + private long hallId; + + public static void start(long hallId, Context context) { + Intent intent = new Intent(context, RemoveMemberListActivity.class); + intent.putExtra("hallId", hallId); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_remove_member); + + findView(); + initListener(); + + hallId = getIntent().getLongExtra("hallId", 0); + etSearch.addTextChangedListener(new TextWatcherSimple() { + @Override + public void afterTextChanged(Editable s) { + searchStr = s; + } + }); + mGroupMemberListAdapter = new GroupMemberListAdapter(this, null); + mGroupMemberListAdapter.setmType(GroupMemberListAdapter.TYPE_REMOVE); + rvDelegate = new RVDelegate.Builder() + .setAdapter(mGroupMemberListAdapter) + .setLayoutManager(new LinearLayoutManager(this)) + .setPageSize(pageSize) + .setEmptyView(EmptyViewHelper.createEmptyTextView(context, ResUtil.getString(R.string.hall_activity_removememberlistactivity_01))) + .setRecyclerView(recyclerView) + .build(); + mGroupMemberListAdapter.setOnLoadMoreListener(() -> loadMembers(false), recyclerView); + mGroupMemberListAdapter.setOnItemChildClickListener((adapter, view, position) -> { + MemberInfo memberInfo = mGroupMemberListAdapter.getItem(position); + if (memberInfo == null) return; + if (view.getId() == R.id.iv_remove) { + showRemoveDialog(memberInfo.getUid(), memberInfo.getRoleType(), memberInfo.getNick()); + } else { + UIHelper.showUserInfoAct(RemoveMemberListActivity.this, memberInfo.getUid()); + } + }); + loadMembers(true); + EventBus.getDefault().register(this); + } + + private void findView() { + recyclerView = findViewById(R.id.recycler_view); + etSearch = findViewById(R.id.et_search); + tv_search = findViewById(R.id.tv_search); + iv_back = findViewById(R.id.iv_back); + } + + private void initListener() { + tv_search.setOnClickListener(this); + iv_back.setOnClickListener(this); + } + + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.iv_back: + finish(); + break; + case R.id.tv_search: + doSearch(searchStr); + break; + } + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void displayNotEmptyQueuingMic(UpdateMemberListEvent event) { + onReloadDate(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + @Override + public void onReloadDate() { + loadMembers(true); + } + + @SuppressLint("CheckResult") + private void loadMembers(boolean refresh) { + page = refresh ? 1 : (page + 1); + HallModel.get().getAllMembers(hallId, page, pageSize) + .compose(RxHelper.bindActivity(this)) + .subscribe((listMemberInfo, throwable) -> { + if (throwable != null) { + Logger.i(ResUtil.getString(R.string.hall_activity_removememberlistactivity_02)); + rvDelegate.loadErr(refresh); + } else { + List memberInfoList = listMemberInfo.getMembers(); + if (!ListUtils.isListEmpty(memberInfoList)) { + Iterator iterator = memberInfoList.iterator(); + while (iterator.hasNext()) { + if (iterator.next().getRoleType() == RoleType.CLAN_SUPER_ADMIN) { + iterator.remove(); + } + } + } + rvDelegate.loadData(listMemberInfo.getMembers(), refresh); + orignalList.clear(); + orignalList.addAll(mGroupMemberListAdapter.getData()); + } + }); + + } + + private void showRemoveDialog(long targetUid, int targetRoleType, String targetNick) { + mTargetUid = targetUid; + SpannableString spannableString = getMvpPresenter().getRemoveTips(this, targetRoleType, targetNick); + + getDialogManager().showOkCancelWithTitleDialog(ResUtil.getString(R.string.hall_activity_removememberlistactivity_03), spannableString, ResUtil.getString(R.string.hall_activity_removememberlistactivity_04), ResUtil.getString(R.string.hall_activity_removememberlistactivity_05), new DialogManager.OkCancelDialogListener() { + @Override + public void onCancel() { + mTargetUid = -1; + } + + @Override + public void onOk() { + getMvpPresenter().remove(hallId, targetUid); + } + }); + + } + + @Override + protected void onLeftClickListener() { + onBackPressed(); + } + + @Override + public void removeSuccess(String message) { + if (mTargetUid == -1) + return; + + List memberInfoList = mGroupMemberListAdapter.getData(); + if (memberInfoList.size() > 0) { + for (int i = 0; i < memberInfoList.size(); i++) { + MemberInfo memberInfo = memberInfoList.get(i); + if (memberInfo.getUid() == mTargetUid) { + mGroupMemberListAdapter.remove(i); + orignalList.remove(memberInfo); + break; + } + } + } + mTargetUid = -1; + } + + @Override + public void removeFail(String message) { + mTargetUid = -1; + toast(message); + } + + + private void doSearch(CharSequence str) { + if (TextUtils.isEmpty(str)) { + SingleToastUtil.showToast(ResUtil.getString(R.string.hall_activity_removememberlistactivity_06)); + return; + } + ArrayList mTempBeansList = new ArrayList<>(); + // 如果需要排序考虑 Pair + for (int i = 0; i < orignalList.size(); i++) { + if (orignalList.get(i).getNick().contains(str) + || String.valueOf(orignalList.get(i).getErbanNo()).contains(str)) { + mTempBeansList.add(orignalList.get(i)); + } + } + searchList.clear(); + if (!ListUtils.isListEmpty(mTempBeansList)) { + searchList.addAll(mTempBeansList); + } else { + searchList.addAll(orignalList); + } + mGroupMemberListAdapter.setNewData(searchList); + mGroupMemberListAdapter.loadMoreEnd(true); + mTempBeansList.clear(); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} + + diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/RoomIncomeActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/RoomIncomeActivity.java new file mode 100644 index 0000000..fe3b27e --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/RoomIncomeActivity.java @@ -0,0 +1,289 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.appcompat.widget.AppCompatImageView; +import androidx.appcompat.widget.AppCompatTextView; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; + +import com.chwl.library.utils.ResUtil; +import com.jzxiang.pickerview.data.Type; +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.common.widget.CircleImageView; +import com.chwl.app.module_hall.hall.view.dialog.TimePickerDialog; +import com.chwl.app.module_hall.hall.view.indicator.StatisticsIndicatorAdapter; +import com.chwl.app.module_hall.income.HallIncomeFragment; +import com.chwl.app.module_hall.income.presenter.RoomIncomePresenter; +import com.chwl.app.module_hall.income.view.IIncomeStatisticsView; +import com.chwl.app.ui.utils.ImageLoadUtilsV2; +import com.chwl.app.ui.widget.magicindicator.MagicIndicator; +import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper; +import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.CommonUtils; +import com.chwl.library.utils.TimeUtils; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +/** + * 公会的收入统计 + * Created by lvzebiao on 2023/07/31. + */ +@CreatePresenter(RoomIncomePresenter.class) +public class RoomIncomeActivity extends BaseMvpActivity + implements IIncomeStatisticsView, TimePickerDialog.TimePickerListener, HallIncomeFragment.DayIncomeFragmentListener, View.OnClickListener { + + private static final int TYPE_DAY = 0; + private static final int TYPE_WEEK = 1; + private static final int TYPE_MONTH = 2; + List list = new ArrayList<>(); + private ViewPager viewPager; + private MagicIndicator indicator; + private TextView tvMonthDayStart; + private TextView tvMonthDayEnd; + private TextView tvTotal; + private AppCompatTextView tvTip; + private LinearLayout llDayGroup; + private AppCompatImageView ivDateArrow; + + FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(getSupportFragmentManager()) { + @Override + public Fragment getItem(int position) { + return list.get(position); + } + + @Override + public int getCount() { + return list.size(); + } + }; + private boolean mHasInit = false; + private int mCurrentType; + private long mDayFirstTime = System.currentTimeMillis(); + private long mDayLastTime = mDayFirstTime; + + public static void start(Context context, long id) { + Intent intent = new Intent(context, RoomIncomeActivity.class); + intent.putExtra(HallIncomeFragment.FLAG_HALL_ID, id); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_room_income); + initFindView(); + initIndicator(); + long id = getIntent().getLongExtra(HallIncomeFragment.FLAG_HALL_ID, 0); + initWhiteTitleBar(ResUtil.getString(R.string.income_statistics)); + + HallIncomeFragment fragment = HallIncomeFragment.getInstance(id); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + + fragment = HallIncomeFragment.getInstance(id); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + + fragment = HallIncomeFragment.getInstance(id); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + + viewPager.setAdapter(adapter); + } + + private void initFindView() { + viewPager = findViewById(R.id.view_pager); + indicator = findViewById(R.id.indicator); + tvMonthDayStart = findViewById(R.id.tv_month_day_start); + tvMonthDayEnd = findViewById(R.id.tv_month_day_end); + tvTotal = findViewById(R.id.tv_total); + tvTip = findViewById(R.id.tv_tip); + llDayGroup = findViewById(R.id.ll_day_group); + ivDateArrow = findViewById(R.id.iv_date_arrow); + + ivDateArrow.setOnClickListener(this); + llDayGroup.setOnClickListener(this); + } + + @Override + protected void onResume() { + super.onResume(); + + if (!mHasInit) { + mHasInit = true; + initDay(); + } + } + + /** + * 初始化当前日,周 + */ + private void initDay() { + RoomIncomePresenter presenter = getMvpPresenter(); + presenter.initCurrentDay(); + getDayIncomeTotal(getDayFormat(mDayFirstTime), getDayFormat(mDayLastTime)); + } + + private void initIndicator() { + List tagList = new ArrayList<>(); + tagList.add(getString(R.string.room_income_01)); + tagList.add(getString(R.string.room_income_02)); + tagList.add(getString(R.string.room_income_03)); + StatisticsIndicatorAdapter adapter = new StatisticsIndicatorAdapter(tagList, 5); + adapter.setOnItemSelectListener(position -> viewPager.setCurrentItem(position)); + CommonNavigator navigator = new CommonNavigator(this); + navigator.setAdapter(adapter); + navigator.setAdjustMode(true); + indicator.setNavigator(navigator); + ViewPagerHelper.bind(indicator, viewPager); + + mCurrentType = TYPE_DAY; + + viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + + } + + @Override + public void onPageSelected(int position) { + // 切换日,周 + mCurrentType = position; + RoomIncomePresenter presenter = getMvpPresenter(); + + if (mCurrentType == TYPE_WEEK) { + getWeekIncomeTotal(presenter.getWeekFirstDay(), presenter.getWeekLastDay()); + } else if (mCurrentType == TYPE_DAY) { + getDayIncomeTotal(getDayFormat(mDayFirstTime), getDayFormat(mDayLastTime)); + } else { + getMonthIncomeTotal(presenter.getmStartTimeStr(), presenter.getmEndTimeStr()); + } + + } + + @Override + public void onPageScrollStateChanged(int state) { + + } + }); + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.iv_date_arrow: + case R.id.ll_day_group: + if (CommonUtils.isFastDoubleClick(500)) return; + RoomIncomePresenter presenter = getMvpPresenter(); + boolean isWeek = mCurrentType == TYPE_WEEK; + boolean isMonth = mCurrentType == TYPE_MONTH; + boolean isDay = mCurrentType == TYPE_DAY; + + TimePickerDialog.Builder builder = new TimePickerDialog.Builder() + .setType(Type.YEAR_MONTH_DAY) + .setTitleStringId("") + .setThemeColor(getResources().getColor(R.color.line_color)) + .setWheelItemTextNormalColor(getResources().getColor(R.color + .timetimepicker_default_text_color)) + .setWheelItemTextSelectorColor(getResources().getColor(R.color.black)) + // 根据上一次选中时间初始化日期控件 + .setCurrentMillseconds(isDay ? mDayFirstTime : (isWeek ? presenter.getmWeekChooseDay() : presenter.getmDay())) + .setmIsWeek(isWeek) + .setIsMonth(isMonth) + .setIsDay(isDay) + .setDayFirstTime(mDayFirstTime) + .setDayLastTime(mDayLastTime); + + TimePickerDialog dialog = builder.build(); + dialog.setmTimePickerListener(this); + dialog.show(getSupportFragmentManager(), "year_month_day"); + break; + } + } + + @Override + public void getTime(long chooseTime, String weekFirstDay, String weekLastDay) { + RoomIncomePresenter presenter = getMvpPresenter(); + + if (mCurrentType == TYPE_DAY) { + mDayFirstTime = TimeUtils.getTimeMillis(weekFirstDay, TimeUtils.DATE_FORMAT); + mDayLastTime = TimeUtils.getTimeMillis(weekLastDay, TimeUtils.DATE_FORMAT); + getDayIncomeTotal(weekFirstDay, weekLastDay); + + } else if (mCurrentType == TYPE_WEEK) { + presenter.setmWeekChooseDay(chooseTime); + presenter.setWeekFirstDay(weekFirstDay); + presenter.setWeekLastDay(weekLastDay); + getWeekIncomeTotal(weekFirstDay, weekLastDay); + } else { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); + String time = format.format(chooseTime); + String startTimeStr = TimeUtils.getFirstDayOfMonth(time); + String endTimeStr = TimeUtils.getLastDayOfMonth(time); + presenter.setmDayStr(chooseTime); + presenter.setmStartTimeStr(startTimeStr); + presenter.setmEndTimeStr(endTimeStr); + getMonthIncomeTotal(startTimeStr, endTimeStr); + } + + } + + private void getDayIncomeTotal(String startTimeStr, String endTimeStr) { + tvTip.setVisibility(View.VISIBLE); + tvMonthDayStart.setText(startTimeStr); + tvMonthDayEnd.setVisibility(View.VISIBLE); + tvMonthDayEnd.setText(endTimeStr); + list.get(0).getIncomeTotal(startTimeStr, endTimeStr); + } + + private void getWeekIncomeTotal(String startTimeStr, String endTimeStr) { + tvTip.setVisibility(View.VISIBLE); + tvMonthDayEnd.setVisibility(View.VISIBLE); + tvMonthDayStart.setText(startTimeStr); + tvMonthDayEnd.setText(endTimeStr); + list.get(1).getIncomeTotal(startTimeStr, endTimeStr); + + } + + private void getMonthIncomeTotal(String startTimeStr, String endTimeStr) { + tvTip.setVisibility(View.GONE); + String[] startArray = startTimeStr.split("-"); + tvMonthDayEnd.setVisibility(View.GONE); + tvMonthDayStart.setText(String.format(getString(R.string.format_year_month_hall), startArray[0], startArray[1])); + list.get(2).getIncomeTotal(startTimeStr, endTimeStr); + } + + @Override + public void setTotal(double total) { + tvTotal.setText(getMvpPresenter().setTotal(total)); + } + + private String getDayFormat(long time) { + return TimeUtils.getDateTimeString(time, TimeUtils.DATE_FORMAT); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SingleRoomIncomeActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SingleRoomIncomeActivity.java new file mode 100644 index 0000000..1eda292 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SingleRoomIncomeActivity.java @@ -0,0 +1,287 @@ +package com.chwl.app.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; + +import com.jzxiang.pickerview.data.Type; +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.app.module_hall.hall.view.dialog.TimePickerDialog; +import com.chwl.app.module_hall.hall.view.indicator.StatisticsIndicatorAdapter; +import com.chwl.app.module_hall.income.SingleRoomIncomeFragment; +import com.chwl.app.module_hall.income.presenter.SingleRoomIncomePresenter; +import com.chwl.app.module_hall.income.view.IIncomeStatisticsView; +import com.chwl.app.ui.widget.magicindicator.MagicIndicator; +import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper; +import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.CommonUtils; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.TimeUtils; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +/** + * 家族所有个人主播的收入统计 + * Created by lvzebiao on 2018/12/27. + */ + +@CreatePresenter(SingleRoomIncomePresenter.class) +public class SingleRoomIncomeActivity extends BaseMvpActivity + implements IIncomeStatisticsView, TimePickerDialog.TimePickerListener, + SingleRoomIncomeFragment.DayIncomeFragmentListener, View.OnClickListener { + + private static final int TYPE_DAY = 0; + private static final int TYPE_WEEK = 1; + private static final int TYPE_MONTH = 2; + + List list = new ArrayList<>(); + + private ViewPager viewPager; + private MagicIndicator indicator; + private TextView tvMonthDayStart; + private TextView tvMonthDayEnd; + private TextView tvYear; + private TextView tvTotal; + private ImageView iv_date_arrow; + private LinearLayout ll_day_group; + + FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(getSupportFragmentManager()) { + @Override + public Fragment getItem(int position) { + return list.get(position); + } + + @Override + public int getCount() { + return list.size(); + } + }; + + private boolean mHasInit = false; + private int mCurrentType; + + public static void start(Context context, long clanId, long hallId) { + Intent intent = new Intent(context, SingleRoomIncomeActivity.class); + intent.putExtra(SingleRoomIncomeFragment.FLAG_CLAN_ID, clanId); + intent.putExtra(SingleRoomIncomeFragment.FLAG_HALL_ID, hallId); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_single_room_income); + + findView(); + initListener(); + + initTitleBar(ResUtil.getString(R.string.hall_activity_singleroomincomeactivity_01)); + initIndicator(); + long clanId = getIntent().getLongExtra(SingleRoomIncomeFragment.FLAG_CLAN_ID, 0); + long hallId = getIntent().getLongExtra(SingleRoomIncomeFragment.FLAG_HALL_ID, 0); + SingleRoomIncomeFragment fragment = SingleRoomIncomeFragment.getInstance(SingleRoomIncomeFragment.TYPE_DAY, clanId, hallId); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + + fragment = SingleRoomIncomeFragment.getInstance(SingleRoomIncomeFragment.TYPE_WEEK, clanId, hallId); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + + viewPager.setAdapter(adapter); + + } + + private void findView() { + viewPager = findViewById(R.id.view_pager); + indicator = findViewById(R.id.indicator); + tvMonthDayStart = findViewById(R.id.tv_month_day_start); + tvMonthDayEnd = findViewById(R.id.tv_month_day_end); + tvYear = findViewById(R.id.tv_year); + tvTotal = findViewById(R.id.tv_total); + iv_date_arrow = findViewById(R.id.iv_date_arrow); + ll_day_group = findViewById(R.id.ll_day_group); + } + + private void initListener() { + iv_date_arrow.setOnClickListener(this); + ll_day_group.setOnClickListener(this); + } + + @Override + protected void onResume() { + super.onResume(); + if (!mHasInit) { + mHasInit = true; + initDay(); + } + } + + /** + * 初始化当前日,周 + */ + private void initDay() { + SingleRoomIncomePresenter presenter = getMvpPresenter(); + presenter.initCurrentDay(); + getDayIncomeTotal(presenter.getDayFormat(), presenter.getDayFormat()); + + } + + private void initIndicator() { + List tagList = new ArrayList<>(); + tagList.add(ResUtil.getString(R.string.hall_activity_singleroomincomeactivity_02)); + tagList.add(ResUtil.getString(R.string.hall_activity_singleroomincomeactivity_03)); + StatisticsIndicatorAdapter adapter = new StatisticsIndicatorAdapter(tagList, 5); + adapter.setOnItemSelectListener(position -> viewPager.setCurrentItem(position)); + CommonNavigator navigator = new CommonNavigator(this); + navigator.setAdapter(adapter); + navigator.setAdjustMode(true); + indicator.setNavigator(navigator); + ViewPagerHelper.bind(indicator, viewPager); + + mCurrentType = TYPE_DAY; + + viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + + } + + @Override + public void onPageSelected(int position) { + // 切换日,周 + mCurrentType = position; + SingleRoomIncomePresenter presenter = getMvpPresenter(); + + if (mCurrentType == TYPE_WEEK) { + getWeekIncomeTotal(presenter.getWeekFirstDay(), presenter.getWeekLastDay()); + } else if (mCurrentType == TYPE_DAY) { + getDayIncomeTotal(presenter.getDayFormat(), presenter.getDayFormat()); + } else { + getMonthIncomeTotal(presenter.getmStartTimeStr(), presenter.getmEndTimeStr()); + } + + } + + @Override + public void onPageScrollStateChanged(int state) { + + } + }); + + } + + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.iv_date_arrow: + case R.id.ll_day_group: + if (CommonUtils.isFastDoubleClick(500)) return; + SingleRoomIncomePresenter presenter = getMvpPresenter(); + boolean isWeek = mCurrentType == TYPE_WEEK; + boolean isMonth = mCurrentType == TYPE_MONTH; + + TimePickerDialog.Builder builder = new TimePickerDialog.Builder() + .setType(Type.YEAR_MONTH_DAY) + .setTitleStringId("") + .setThemeColor(getResources().getColor(R.color.line_color)) + .setWheelItemTextNormalColor(getResources().getColor(R.color + .timetimepicker_default_text_color)) + .setWheelItemTextSelectorColor(getResources().getColor(R.color.black)) + // 根据上一次选中时间初始化日期控件 + .setCurrentMillseconds(isWeek ? presenter.getmWeekChooseDay() : presenter.getmDay()) + .setmIsWeek(isWeek) + .setIsMonth(isMonth); + + TimePickerDialog dialog = builder.build(); + dialog.setmTimePickerListener(this); + dialog.show(getSupportFragmentManager(), "year_month_day"); + break; + } + } + + @Override + public void getTime(long chooseTime, String weekFirstDay, String weekLastDay) { + SingleRoomIncomePresenter presenter = getMvpPresenter(); + + if (mCurrentType == TYPE_DAY) { + presenter.setmDayStr(chooseTime); + getDayIncomeTotal(presenter.getDayFormat(), presenter.getDayFormat()); + + } else if (mCurrentType == TYPE_WEEK) { + presenter.setmWeekChooseDay(chooseTime); + presenter.setWeekFirstDay(weekFirstDay); + presenter.setWeekLastDay(weekLastDay); + + getWeekIncomeTotal(weekFirstDay, weekLastDay); + } else { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); + String time = format.format(chooseTime); + String startTimeStr = TimeUtils.getFirstDayOfMonth(time); + String endTimeStr = TimeUtils.getLastDayOfMonth(time); + presenter.setmDayStr(chooseTime); + presenter.setmStartTimeStr(startTimeStr); + presenter.setmEndTimeStr(endTimeStr); + getMonthIncomeTotal(startTimeStr, endTimeStr); + } + + } + + private void getDayIncomeTotal(String startTimeStr, String endTimeStr) { + String[] dayArray = startTimeStr.split("-"); + tvYear.setText(String.format(getString(R.string.format_year), dayArray[0])); + tvMonthDayEnd.setVisibility(View.GONE); + tvMonthDayStart.setText(String.format(getString(R.string.format_month_day), dayArray[1], dayArray[2])); + list.get(0).getIncomeTotal(startTimeStr, endTimeStr); + } + + private void getWeekIncomeTotal(String startTimeStr, String endTimeStr) { + + String[] weekFirstArray = startTimeStr.split("-"); + String[] weekLastArray = endTimeStr.split("-"); + tvYear.setText(String.format(getString(R.string.format_year), weekFirstArray[0])); + tvMonthDayEnd.setVisibility(View.VISIBLE); + tvMonthDayStart.setText(String.format(getString(R.string.format_month_day), weekFirstArray[1], weekFirstArray[2])); + tvMonthDayEnd.setText(String.format(getString(R.string.format_month_day), weekLastArray[1], weekLastArray[2])); + list.get(1).getIncomeTotal(startTimeStr, endTimeStr); + + } + + private void getMonthIncomeTotal(String startTimeStr, String endTimeStr) { + String[] startArray = startTimeStr.split("-"); + tvYear.setText(String.format(getString(R.string.format_year), startArray[0])); + tvMonthDayEnd.setVisibility(View.GONE); + tvMonthDayStart.setText(String.format(getString(R.string.format_month), startArray[1])); + list.get(2).getIncomeTotal(startTimeStr, endTimeStr); + } + + @Override + public void setTotal(double total) { + tvTotal.setText(getMvpPresenter().setTotal(total)); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminAddActivity.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminAddActivity.kt new file mode 100644 index 0000000..065ecc4 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminAddActivity.kt @@ -0,0 +1,101 @@ +package com.chwl.app.module_hall.hall.activity + +import android.annotation.SuppressLint +import android.content.Context +import android.content.Intent +import androidx.recyclerview.widget.LinearLayoutManager +import com.netease.nim.uikit.StatusBarUtil +import com.chwl.app.R +import com.chwl.app.base.BaseViewBindingActivity +import com.chwl.app.common.EmptyViewHelper +import com.chwl.app.databinding.ActivitySuperAdminAddBinding +import com.chwl.app.module_hall.hall.adapter.SearchAdminAdapter +import com.chwl.app.ui.utils.RVDelegate +import com.chwl.core.module_hall.hall.HallModel +import com.chwl.core.module_hall.hall.bean.SuperAdminInfo +import com.chwl.core.utils.extension.toast +import com.chwl.library.utils.ResUtil + +class SuperAdminAddActivity : BaseViewBindingActivity() { + + companion object { + + @JvmStatic + fun start(context: Context, clanId: Long) { + val starter = Intent(context, SuperAdminAddActivity::class.java) + starter.putExtra("clanId", clanId) + context.startActivity(starter) + } + } + + private val adminAdapter = SearchAdminAdapter() + private lateinit var rvDelegate: RVDelegate + private val clanId by lazy { intent.getLongExtra("clanId", 0) } + private var searchId = 0L + override fun init() { + + rvDelegate = RVDelegate.Builder() + .setLayoutManager(LinearLayoutManager(context)) + .setRecyclerView(binding.recyclerView) + .setEmptyView(EmptyViewHelper.createEmptyTextView(context, ResUtil.getString(R.string.hall_activity_superadminaddactivity_01))) + .setAdapter(adminAdapter) + .build() + + adminAdapter.setOnItemChildClickListener { _, view, position -> + if (view.id == R.id.tv_set) { + adminAdapter.getItem(position)?.let { + dialogManager.showOkCancelDialog( + "${getString(R.string.super_admin_manager_tips_04)} ${it.nick} (MoliStarID:${it.erbanNo})${getString(R.string.super_admin_manager_tips_05)}", + true + ) { + SuperAdminRoomSetActivity.start(this, clanId, it.uid) + } + + } + } + } + + binding.tvSearch.setOnClickListener { + val id = binding.searchEdit.text?.toString()?.toLongOrNull() + if (id == null) { + getString(R.string.layout_activity_room_pk_search_01).toast() + } else { + searchId = id + loadData() + } + } + + binding.ivBack.setOnClickListener { + finish() + } + binding.ivClearText.setOnClickListener { + binding.searchEdit.setText("") + } + + } + + override fun onResume() { + super.onResume() + loadData() + } + + @SuppressLint("CheckResult") + private fun loadData() { + if (searchId == 0L) return + HallModel.get().searchSuperAdminInfo(searchId) + .compose(bindToLifecycle()) + .subscribe({ + rvDelegate.setNewData(listOf(it).filter {data -> data.erbanNo?.isNotEmpty() == true }) + }, { + it.message.toast() + }) + } + + override fun needSteepStateBar() = true + + override fun setStatusBar() { + super.setStatusBar() + StatusBarUtil.transparencyBar(this) + StatusBarUtil.StatusBarLightMode(this) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminManageActivity.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminManageActivity.kt new file mode 100644 index 0000000..d2c7c44 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminManageActivity.kt @@ -0,0 +1,131 @@ +package com.chwl.app.module_hall.hall.activity + +import android.annotation.SuppressLint +import android.content.Context +import android.content.Intent +import android.graphics.Color +import android.graphics.drawable.ColorDrawable +import android.view.Gravity +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.PopupWindow +import androidx.recyclerview.widget.LinearLayoutManager +import com.netease.nim.uikit.StatusBarUtil +import com.netease.nim.uikit.common.util.sys.ScreenUtil +import com.chwl.app.R +import com.chwl.app.base.BaseViewBindingActivity +import com.chwl.app.common.EmptyViewHelper +import com.chwl.app.databinding.ActivitySuperAdminManegeBinding +import com.chwl.app.module_hall.hall.adapter.ManageSuperAdminAdapter +import com.chwl.app.ui.utils.RVDelegate +import com.chwl.core.module_hall.hall.HallModel +import com.chwl.core.module_hall.hall.bean.SuperAdminInfo +import com.chwl.core.utils.extension.toast +import com.chwl.library.utils.ResUtil + +class SuperAdminManageActivity : BaseViewBindingActivity() { + + companion object { + + @JvmStatic + fun start(context: Context, clanId: Long) { + val starter = Intent(context, SuperAdminManageActivity::class.java) + starter.putExtra("clanId", clanId) + context.startActivity(starter) + } + } + + private val adminAdapter = ManageSuperAdminAdapter() + private lateinit var rvDelegate: RVDelegate + private val pageSize = 20 + private val clanId by lazy { intent.getLongExtra("clanId", 0) } + + private lateinit var popupWindow: PopupWindow + + override fun init() { + + initWhiteTitleBar(ResUtil.getString(R.string.hall_activity_superadminmanageactivity_01)) + rvDelegate = RVDelegate.Builder() + .setLayoutManager(LinearLayoutManager(context)) + .setRecyclerView(binding.recyclerView) + .setPageSize(pageSize) + .setEmptyView(EmptyViewHelper.createEmptyTextView(context, ResUtil.getString(R.string.hall_activity_superadminmanageactivity_02))) + .setAdapter(adminAdapter) + .build() + + binding.tvAddSuperAdmin.setOnClickListener { + SuperAdminAddActivity.start(this, clanId) + } + + adminAdapter.setOnItemChildClickListener { _, view, position -> + if (view.id == R.id.iv_more) { + showManagePopup(view, adminAdapter.getItem(position), position) + } + } + + } + + @SuppressLint("CheckResult") + override fun onResume() { + super.onResume() + HallModel.get().getClanSuperAdminList(clanId) + .compose(bindToLifecycle()) + .subscribe({ + rvDelegate.setNewData(it) + }, { + rvDelegate.loadErr(true) + }) + } + + private fun showManagePopup(parent: View?, superAdminInfo: SuperAdminInfo?, position: Int) { + if (parent == null || superAdminInfo == null) return + + val contentView: View + if (!this::popupWindow.isInitialized) { + contentView = + LayoutInflater.from(this).inflate(R.layout.popup_admin_more, null) + popupWindow = + PopupWindow(contentView, ScreenUtil.dip2px(120f), ViewGroup.LayoutParams.WRAP_CONTENT) + popupWindow.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) + popupWindow.isFocusable = true + } else { + contentView = popupWindow.contentView + } + contentView.findViewById(R.id.tv_set_room).setOnClickListener { + SuperAdminRoomSetActivity.start(this, clanId, superAdminInfo.uid) + popupWindow.dismiss() + } + contentView.findViewById(R.id.tv_remove).setOnClickListener { + dialogManager.showOkCancelDialog("${getString(R.string.super_admin_manager_tips_01)} ${superAdminInfo.nick} ${getString(R.string.super_admin_manager_tips_02)}",true) { + popupWindow.dismiss() + HallModel.get().removeSuperAdmin(superAdminInfo.uid) + .compose(bindToLifecycle()) + .subscribe({ + adminAdapter.remove(position) + getString(R.string.super_admin_manager_tips_03).toast() + }, { + it.message.toast() + }) + } + + } + val vLoc = IntArray(2) + parent.getLocationInWindow(vLoc) + popupWindow.showAsDropDown( + parent, + 0, + 0, + Gravity.END + ) + } + + + override fun needSteepStateBar() = true + + override fun setStatusBar() { + super.setStatusBar() + StatusBarUtil.transparencyBar(this) + StatusBarUtil.StatusBarLightMode(this) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminRoomSetActivity.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminRoomSetActivity.kt new file mode 100644 index 0000000..939de5c --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/activity/SuperAdminRoomSetActivity.kt @@ -0,0 +1,112 @@ +package com.chwl.app.module_hall.hall.activity + +import android.annotation.SuppressLint +import android.content.Context +import android.content.Intent +import androidx.recyclerview.widget.LinearLayoutManager +import com.netease.nim.uikit.StatusBarUtil +import com.chwl.app.R +import com.chwl.app.base.BaseViewBindingActivity +import com.chwl.app.common.EmptyViewHelper +import com.chwl.app.databinding.ActivitySuperAdminRoomSetBinding +import com.chwl.app.module_hall.hall.adapter.ManageRoomSetAdapter +import com.chwl.app.ui.utils.RVDelegate +import com.chwl.core.module_hall.hall.HallModel +import com.chwl.core.module_hall.hall.bean.SuperAdminHall +import com.chwl.core.utils.extension.toast +import com.chwl.library.utils.ResUtil + +class SuperAdminRoomSetActivity : BaseViewBindingActivity() { + + companion object { + + @JvmStatic + fun start(context: Context, clanId: Long, uid: Long, add: Boolean = true) { + val starter = Intent(context, SuperAdminRoomSetActivity::class.java) + starter.putExtra("clanId", clanId) + starter.putExtra("uid", uid) + starter.putExtra("add", add) + context.startActivity(starter) + } + } + + private val adminAdapter = ManageRoomSetAdapter() + private lateinit var rvDelegate: RVDelegate + private val clanId by lazy { intent.getLongExtra("clanId", 0) } + private val uid by lazy { intent.getLongExtra("uid", 0) } + private val add by lazy { intent.getBooleanExtra("add", true) } + + @SuppressLint("CheckResult") + override fun init() { + initWhiteTitleBar(ResUtil.getString(R.string.hall_activity_superadminroomsetactivity_01)) + mTitleBar.setLeftClickListener { + onBackPressed() + } + rvDelegate = RVDelegate.Builder() + .setLayoutManager(LinearLayoutManager(context)) + .setRecyclerView(binding.recyclerView) + .setEmptyView(EmptyViewHelper.createEmptyTextView(context, ResUtil.getString(R.string.hall_activity_superadminroomsetactivity_02))) + .setAdapter(adminAdapter) + .build() + binding.recyclerView.itemAnimator = null + adminAdapter.setOnItemChildClickListener { _, view, position -> + if (view.id == R.id.iv_check) { + adminAdapter.getItem(position)?.let { + it.hasManage = !it.hasManage + } + adminAdapter.notifyItemChanged(position) + } + } + + HallModel.get().getSuperAdminHallList(clanId, uid) + .compose(bindToLifecycle()) + .subscribe({ + rvDelegate.setNewData(it) + }, { + rvDelegate.loadErr(true) + }) + + binding.tvAddSuperAdmin.setOnClickListener { + var roomUids = "" + adminAdapter.data.forEach { + if (it.hasManage) { + roomUids += "${it.hallRoomUid}," + } + } + + if (roomUids.isNotEmpty()) { + HallModel.get().setSuperAdmin(roomUids.substring(0, roomUids.length - 1), uid) + .compose(bindToLifecycle()) + .subscribe({ + ResUtil.getString(R.string.hall_activity_superadminroomsetactivity_03).toast() + finish() + }, { + it.message.toast() + }) + } else { + ResUtil.getString(R.string.hall_activity_superadminroomsetactivity_04).toast() + } + } + } + + override fun onBackPressed() { + if (add) { + dialogManager.showOkCancelDialog( + ResUtil.getString(R.string.hall_activity_superadminroomsetactivity_05), + true + ) { + super.onBackPressed() + } + } else { + super.onBackPressed() + } + } + + override fun needSteepStateBar() = true + + override fun setStatusBar() { + super.setStatusBar() + StatusBarUtil.transparencyBar(this) + StatusBarUtil.StatusBarLightMode(this) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AssociationAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AssociationAdapter.java new file mode 100644 index 0000000..22010a6 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AssociationAdapter.java @@ -0,0 +1,64 @@ +package com.chwl.app.module_hall.hall.adapter; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.utils.ImageLoadUtilsV2; +import com.chwl.core.association.bean.ClanListInfo; + +/** + * Created by yudi + * on 2018/3/2. + */ +public class AssociationAdapter extends BaseQuickAdapter { + + public AssociationAdapter() { + super(R.layout.item_association); + } + + @Override + protected void convert(BaseViewHolder helper, ClanListInfo item) { + if (helper.getAdapterPosition() == 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) { + 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) { + 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)); + } + + ImageLoadUtils.loadAvatar( item.getAvatar(),helper.getView(R.id.iv_guild_icon)); + helper.setText(R.id.tv_name, item.getName()); + ImageView iv_guild_image = helper.getView(R.id.iv_guild_image); + ImageLoadUtilsV2.loadImage(iv_guild_image, item.getLevelIcon()); + + 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); + + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AssociationRoomAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AssociationRoomAdapter.java new file mode 100644 index 0000000..e5d42fa --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AssociationRoomAdapter.java @@ -0,0 +1,74 @@ +package com.chwl.app.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.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.utils.ImageLoadUtilsV2; +import com.chwl.core.association.bean.HallListInfo; + +/** + * Created by yudi + * on 2018/3/2. + */ +public class AssociationRoomAdapter extends BaseQuickAdapter { + + public AssociationRoomAdapter() { + super(R.layout.item_association_room); + + } + + @Override + protected void convert(BaseViewHolder helper, HallListInfo item) { + 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.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.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.getLayoutPosition() + 1)); + } + + ImageLoadUtils.loadAvatar( item.getOwnerAvatar(),helper.getView(R.id.iv_guild_icon)); + 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.getHallBtnStatus() == 0) { + tvApply.setVisibility(View.GONE); + } else if (item.getHallBtnStatus() == 1) { + tvApply.setVisibility(View.VISIBLE); + tvApply.setTextColor(ContextCompat.getColor(mContext,R.color.base_color_theme_text)); + tvApply.setBackgroundResource(R.drawable.base_shape_theme_15dp); + tvApply.setText(mContext.getString(R.string.apply_join)); + } else if (item.getHallBtnStatus() == 2) { + tvApply.setVisibility(View.VISIBLE); + tvApply.setSelected(false); + 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); + + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AuthSettingAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AuthSettingAdapter.java new file mode 100644 index 0000000..fcc8319 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/AuthSettingAdapter.java @@ -0,0 +1,70 @@ +package com.chwl.app.module_hall.hall.adapter; + +import android.content.Context; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.chwl.app.R; +import com.chwl.core.module_hall.hall.bean.AuthInfo; +import com.chwl.library.widget.IOSSwitchView; + +public class AuthSettingAdapter { + + private View root; + private AuthInfo mAuthInfo; + + private TextView tvAuthName; + private TextView tvAuthDesc; + private IOSSwitchView isvCheck; + + public AuthSettingAdapter(Context context, ViewGroup parent, AuthInfo authInfo) { + + root = LayoutInflater.from(context).inflate(R.layout.item_auth_setting, parent, false); + tvAuthName = root.findViewById(R.id.tv_auth_name); + tvAuthDesc = root.findViewById(R.id.tv_auth_desc); + isvCheck = root.findViewById(R.id.isv_check); + + mAuthInfo = authInfo; + if (mAuthInfo != null) { + tvAuthName.setText(mAuthInfo.getName()); + + String desc = mAuthInfo.getDescription(); + if (!TextUtils.isEmpty(desc)){ + tvAuthDesc.setText(desc); + tvAuthDesc.setVisibility(View.VISIBLE); + } else + tvAuthDesc.setVisibility(View.GONE); + + isvCheck.setOn(mAuthInfo.isOwnAuth()); + isvCheck.setOnSwitchStateChangeListener(isOn -> { + }); + + } + + } + + public View getRoot() { + return root; + } + + /** + * + * @return + * 非空打开,空关闭 + */ + public String getOnCode() { + return isvCheck.isOn() ? mAuthInfo.getCode() : ""; + } + + public String getCode() { + return mAuthInfo.getCode(); + } + + public int getViewStatus() { + return isvCheck.isOn() ? 1 : 0; + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/EnableExchangeAdapter.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/EnableExchangeAdapter.kt new file mode 100644 index 0000000..168ad9c --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/EnableExchangeAdapter.kt @@ -0,0 +1,50 @@ +package com.chwl.app.module_hall.hall.adapter + +import androidx.appcompat.widget.AppCompatTextView +import androidx.core.content.ContextCompat +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.chwl.app.R +import com.chwl.app.ui.utils.ImageLoadUtils +import com.chwl.core.association.bean.MemberExchangeInfo + +/** + * 可兑换 + * Created by wushaocheng on 2023/2/13. + */ +class EnableExchangeAdapter : + BaseQuickAdapter(R.layout.item_hall_exchange) { + + override fun convert(helper: BaseViewHolder, item: MemberExchangeInfo) { + + ImageLoadUtils.loadAvatar(item.avatar, helper.getView(R.id.iv_avatar)) + ImageLoadUtils.loadImage( + mContext, + item.userLevelVo?.experUrl, + helper.getView(R.id.iv_user_level) + ) + ImageLoadUtils.loadImage( + mContext, + item.userLevelVo?.charmUrl, + helper.getView(R.id.iv_user_charm) + ) + helper.getView(R.id.tv_confirm).background = ContextCompat.getDrawable( + mContext, + R.drawable.base_shape_e6e6e6_15dp + ) + helper.setText(R.id.tv_confirm, mContext.getString(R.string.close_exchange)) + .setTextColor(R.id.tv_confirm, ContextCompat.getColor(mContext, R.color.color_B3B3C3)) + .setText(R.id.tv_nickname, item.nick) + .setImageResource( + R.id.iv_gender, + if (item.gender == 1) R.drawable.ic_gender_male else R.drawable.ic_gender_female + ) + .setText(R.id.tv_id, mContext.getString(R.string.text_user_id, item.erbanNo.toString())) + .setText(R.id.tv_room_name, item.hallName) + .setText( + R.id.tv_gold_balance, + mContext.getString(R.string.gold_coin_balance, item.golds.toString()) + ) + .addOnClickListener(R.id.tv_confirm) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/GroupListAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/GroupListAdapter.java new file mode 100644 index 0000000..adcaabf --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/GroupListAdapter.java @@ -0,0 +1,22 @@ +package com.chwl.app.module_hall.hall.adapter; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.core.module_hall.hall.bean.HTeamInfo; + +public class GroupListAdapter extends BaseQuickAdapter { + + public GroupListAdapter(int layoutResId) { + super(layoutResId); + } + + @Override + protected void convert(BaseViewHolder helper, HTeamInfo item) { + ImageLoadUtils.loadAvatar(item.getIcon(), helper.getView(R.id.riv_group_image)); + helper.setText(R.id.tv_group_name, item.getName()); + helper.setVisible(R.id.tv_join, !item.isInChat()); + helper.addOnClickListener(R.id.tv_join); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/GroupMemberListAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/GroupMemberListAdapter.java new file mode 100644 index 0000000..dfe336f --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/GroupMemberListAdapter.java @@ -0,0 +1,168 @@ +package com.chwl.app.module_hall.hall.adapter; + +import android.content.Context; +import android.text.TextUtils; +import android.widget.ImageView; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.utils.RegexUtil; +import com.chwl.core.level.UserLevelVo; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.core.module_hall.hall.bean.RoleType; + +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class GroupMemberListAdapter extends BaseQuickAdapter { + // 当前页不展示右侧按钮 + + public static final int TYPE_NONE = 0; + // 当前页展示移除按钮 + public static final int TYPE_REMOVE = 1; + // 当前页展示箭头按钮 + public static final int TYPE_NEXT = 2; + // 当前页展示选中按钮 + public static final int TYPE_CHECK = 3; + // 当前页面为搜索按钮 + public static final int TYPE_SEARCH = 4; + + private Context context; + private int mType = 0; + + public GroupMemberListAdapter(Context context, List homeRoomList) { + super(R.layout.item_member); + this.context = context; + } + + public void setmType(int mType) { + this.mType = mType; + } + + public int getmType() { + return mType; + } + + @Override + protected void convert(@NotNull BaseViewHolder holder, MemberInfo item) { + + holder.setGone(R.id.tv_in_hall_name, !TextUtils.isEmpty(item.getHallName())) + .setText(R.id.tv_in_hall_name, item.getHallName()); + String nick = item.getNick() != null ? item.getNick().replaceAll(RegexUtil.getNotPrintableStringReg(), "?") : ""; + + if (!TextUtils.isEmpty(nick) && nick.length() > 8) + nick = nick.substring(0, 8) + "..."; + holder.setText(R.id.user_name, nick); + + ImageView avatar = holder.getView(R.id.iv_avatar); + ImageLoadUtils.loadAvatar(mContext, item.getAvatar(), avatar); + + if (item.getRoleType() == RoleType.OWNER) { + holder.setVisible(R.id.iv_type, true); + holder.setImageResource(R.id.iv_type, R.drawable.bg_hall_owner); + } else if (item.getRoleType() == RoleType.ADMIN) { + holder.setVisible(R.id.iv_type, true); + holder.setImageResource(R.id.iv_type, R.drawable.bg_hall_manager); + } else if (item.getRoleType() == RoleType.CLAN_OWNER) { + holder.setVisible(R.id.iv_type, true); + holder.setImageResource(R.id.iv_type, R.drawable.bg_clan_owner); + } else if (item.getRoleType() == RoleType.CLAN_HALL_OWNER) { + holder.setVisible(R.id.iv_type, true); + holder.setImageResource(R.id.iv_type, R.drawable.bg_clan_and_hall_owner); + } else if (item.getRoleType() == RoleType.CLAN_SUPER_ADMIN) { + holder.setVisible(R.id.iv_type, true); + holder.setImageResource(R.id.iv_type, R.drawable.bg_clan_super_admin); + } else { + holder.setVisible(R.id.iv_type, false); + } + + holder.setText(R.id.erban_no, context.getString(R.string.label_id_format, item.getErbanNo())); + if (item.getGender() == 1) { + holder.setVisible(R.id.sex, true); + holder.setImageResource(R.id.sex, R.drawable.ic_gender_male); + } else if (item.getGender() == 2) { + holder.setVisible(R.id.sex, true); + holder.setImageResource(R.id.sex, R.drawable.ic_gender_female); + } else { + holder.setVisible(R.id.sex, false); + } + holder.setVisible(R.id.iv_user_level, false); + UserLevelVo userLevelVo = item.getUserLevelVo(); + if (userLevelVo != null && !TextUtils.isEmpty(userLevelVo.getExperUrl())) { + holder.setVisible(R.id.iv_user_level, true); + ImageView imageView = holder.getView(R.id.iv_user_level); + ImageLoadUtils.loadImage(context, userLevelVo.getExperUrl(), imageView); + + if (!TextUtils.isEmpty(userLevelVo.getCharmUrl())) { + holder.setVisible(R.id.iv_user_charm_level, true); + ImageView charmLevel = holder.getView(R.id.iv_user_charm_level); + ImageLoadUtils.loadImage(context, userLevelVo.getCharmUrl(), charmLevel); + } else + holder.setVisible(R.id.iv_user_charm_level, false); + } else { + holder.setVisible(R.id.iv_user_level, false); + holder.setVisible(R.id.iv_user_charm_level, false); + } + + holder.setVisible(R.id.iv_remove, mType == TYPE_REMOVE); + holder.addOnClickListener(R.id.iv_remove); + + if (mType == TYPE_REMOVE) { + setRemove(holder, item.getRoleType() == 0 || + item.getRoleType() == 3 || + item.getRoleType() == RoleType.ADMIN); + holder.addOnClickListener(R.id.container); + } else if (mType == TYPE_NEXT) { + setNext(holder, true); + } else if (mType == TYPE_CHECK) { + setCheck(holder, item.getRoleType() != 1, item.getRoleType() == 2); + } else if (mType == TYPE_SEARCH) { + holder.addOnClickListener(R.id.container); + setRemove(holder, false); + setNext(holder, false); + setCheck(holder, false, false); + } else { + holder.addOnClickListener(R.id.container); + setRemove(holder, false); + setNext(holder, false); + setCheck(holder, false, false); + } + } + + /** + * @param isRemove true 当前页展示移除按钮 + */ + private void setRemove(BaseViewHolder holder, boolean isRemove) { + holder.setVisible(R.id.iv_remove, isRemove); + if (isRemove) + holder.addOnClickListener(R.id.iv_remove); + + } + + /** + * @param isNext true 当前页展示 箭头按钮 + */ + private void setNext(BaseViewHolder holder, boolean isNext) { + holder.setVisible(R.id.iv_arrow, isNext); + if (isNext) + holder.addOnClickListener(R.id.iv_arrow); + } + + /** + * @param isCheck true 当前页展示是否选中按钮 + * @param isChecked true 选中,false 未选中 + */ + private void setCheck(BaseViewHolder holder, boolean isCheck, boolean isChecked) { + holder.setVisible(R.id.iv_check, isCheck); + + if (isCheck) { + holder.addOnClickListener(R.id.iv_check); + holder.setImageResource(R.id.iv_check, isChecked ? R.drawable.ic_hall_member_checked : R.drawable.ic_hall_member_unchecked); + } + + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/HallListAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/HallListAdapter.java new file mode 100644 index 0000000..d9039e4 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/HallListAdapter.java @@ -0,0 +1,20 @@ +package com.chwl.app.module_hall.hall.adapter; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.netease.nim.uikit.common.util.sys.ScreenUtil; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.core.module_hall.hall.bean.HallInfo; + +public class HallListAdapter extends BaseQuickAdapter { + public HallListAdapter() { + super(R.layout.item_hall); + } + + @Override + protected void convert(BaseViewHolder helper, HallInfo item) { + ImageLoadUtils.loadRectImage(mContext,item.getOwnerAvatar(),helper.getView(R.id.iv_hall_avatar),R.drawable.default_cover, ScreenUtil.dip2px(8)); + helper.setText(R.id.tv_hall_name,item.getHallName()); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageRoomAdapter.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageRoomAdapter.kt new file mode 100644 index 0000000..4ef573e --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageRoomAdapter.kt @@ -0,0 +1,24 @@ +package com.chwl.app.module_hall.hall.adapter + +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.netease.nim.uikit.common.util.sys.ScreenUtil +import com.chwl.app.R +import com.chwl.app.ui.utils.ImageLoadUtils +import com.chwl.core.module_hall.hall.bean.SuperAdminHall + +class ManageRoomAdapter : + BaseQuickAdapter(R.layout.item_manage_room) { + + override fun convert(helper: BaseViewHolder, item: SuperAdminHall) { + + ImageLoadUtils.loadRectImage( + mContext, + item.hallAvatar, + helper.getView(R.id.iv_room_avatar), + R.drawable.default_cover, + ScreenUtil.dip2px(5f) + ) + helper.setText(R.id.tv_room_name, item.hallName) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageRoomSetAdapter.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageRoomSetAdapter.kt new file mode 100644 index 0000000..6c1bcb2 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageRoomSetAdapter.kt @@ -0,0 +1,22 @@ +package com.chwl.app.module_hall.hall.adapter + +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.chwl.app.R +import com.chwl.app.ui.utils.ImageLoadUtils +import com.chwl.core.module_hall.hall.bean.SuperAdminHall + +class ManageRoomSetAdapter : + BaseQuickAdapter(R.layout.item_manage_room_set) { + + override fun convert(helper: BaseViewHolder, item: SuperAdminHall) { + ImageLoadUtils.loadAvatar(item.hallAvatar, helper.getView(R.id.iv_avatar)) + helper.setText(R.id.tv_nickname, item.hallName) + .setText(R.id.tv_id, item.hallRoomId) + .setImageResource( + R.id.iv_check, + if (item.hasManage) R.mipmap.common_ic_checked else R.mipmap.common_ic_unchecked + ) + .addOnClickListener(R.id.iv_check) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageSuperAdminAdapter.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageSuperAdminAdapter.kt new file mode 100644 index 0000000..040515e --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/ManageSuperAdminAdapter.kt @@ -0,0 +1,41 @@ +package com.chwl.app.module_hall.hall.adapter + +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.chwl.app.R +import com.chwl.app.common.EmptyViewHelper +import com.chwl.app.ui.utils.ImageLoadUtils +import com.chwl.app.ui.utils.RVDelegate +import com.chwl.core.module_hall.hall.bean.SuperAdminHall +import com.chwl.core.module_hall.hall.bean.SuperAdminInfo + +class ManageSuperAdminAdapter : + BaseQuickAdapter(R.layout.item_manage_super_admin) { + + override fun convert(helper: BaseViewHolder, item: SuperAdminInfo) { + ImageLoadUtils.loadAvatar(item.avatar, helper.getView(R.id.iv_avatar)) + + helper.setText(R.id.tv_nickname,item.nick) + .setText(R.id.tv_id,"ID:${item.erbanNo}") + .addOnClickListener(R.id.iv_more) + + val rvRoom = helper.getView(R.id.rv_room) + if (rvRoom.adapter == null) { + RVDelegate.Builder() + .setLayoutManager( + LinearLayoutManager( + mContext, + LinearLayoutManager.HORIZONTAL, + false + ) + ) + .setRecyclerView(rvRoom) + .setEmptyView(EmptyViewHelper.createEmptyTextView(mContext, "暫無管理的房間")) + .setAdapter(ManageRoomAdapter()) + .build() + } + (rvRoom.adapter as BaseQuickAdapter).setNewData(item.roomList) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/MemberViewHolder.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/MemberViewHolder.java new file mode 100644 index 0000000..299238b --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/MemberViewHolder.java @@ -0,0 +1,47 @@ +package com.chwl.app.module_hall.hall.adapter; + +import android.view.View; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.appcompat.widget.AppCompatImageView; + +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; + +public class MemberViewHolder extends BaseViewHolder { + TextView userName; + TextView tvSend; + TextView roomTitle; + TextView erbanNo; + RelativeLayout container; + ImageView mIvGoodNumber; + ImageView mIvAvatar; + AppCompatImageView mIvNobleLevel; + AppCompatImageView mIvUserLevel; + ImageView mIvSex; + + ImageView ivRemove; + ImageView ivType; + ImageView ivArrow; + ImageView ivCheck; + + public MemberViewHolder(View itemView) { + super(itemView); + userName = itemView.findViewById(R.id.user_name); + roomTitle = itemView.findViewById(R.id.room_title); + tvSend = itemView.findViewById(R.id.tv_send); + erbanNo = itemView.findViewById(R.id.erban_no); + container = itemView.findViewById(R.id.container); + mIvGoodNumber = itemView.findViewById(R.id.iv_good_number); + mIvAvatar = itemView.findViewById(R.id.iv_avatar); + mIvNobleLevel = itemView.findViewById(R.id.iv_noble_level); + mIvSex = itemView.findViewById(R.id.sex); + mIvUserLevel = itemView.findViewById(R.id.iv_user_level); + ivRemove = itemView.findViewById(R.id.iv_remove); + ivType = itemView.findViewById(R.id.iv_type); + ivArrow = itemView.findViewById(R.id.iv_arrow); + ivCheck = itemView.findViewById(R.id.iv_check); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/NoExchangeAdapter.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/NoExchangeAdapter.kt new file mode 100644 index 0000000..c258033 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/NoExchangeAdapter.kt @@ -0,0 +1,33 @@ +package com.chwl.app.module_hall.hall.adapter + +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.chwl.app.R +import com.chwl.app.ui.utils.ImageLoadUtils +import com.chwl.core.association.bean.MemberExchangeInfo + +/** + * 不可兑换 + * Created by wushaocheng on 2023/2/13. + */ +class NoExchangeAdapter : + BaseQuickAdapter(R.layout.item_hall_exchange) { + + override fun convert(helper: BaseViewHolder, item: MemberExchangeInfo) { + ImageLoadUtils.loadAvatar(item.avatar, helper.getView(R.id.iv_avatar)) + ImageLoadUtils.loadImage(mContext, item.userLevelVo?.experUrl, helper.getView(R.id.iv_user_level)) + ImageLoadUtils.loadImage(mContext, item.userLevelVo?.charmUrl, helper.getView(R.id.iv_user_charm)) + helper.setText(R.id.tv_nickname, item.nick) + .setImageResource( + R.id.iv_gender, + if (item.gender == 1) R.drawable.ic_gender_male else R.drawable.ic_gender_female + ) + .setText(R.id.tv_id, mContext.getString(R.string.text_user_id, item.erbanNo.toString())) + .setText(R.id.tv_room_name, item.hallName) + .setText( + R.id.tv_gold_balance, + mContext.getString(R.string.gold_coin_balance, item.golds.toString()) + ) + .addOnClickListener(R.id.tv_confirm) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/OptionAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/OptionAdapter.java new file mode 100644 index 0000000..af55a70 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/OptionAdapter.java @@ -0,0 +1,37 @@ +package com.chwl.app.module_hall.hall.adapter; + +import android.content.Context; +import android.widget.ImageView; + +import androidx.annotation.Nullable; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.netease.nim.uikit.support.glide.GlideApp; +import com.chwl.app.R; +import com.chwl.core.module_hall.hall.bean.OptionInfo; + +import java.util.List; + +public class OptionAdapter extends BaseQuickAdapter { + private Context mContext; + + private boolean isSmall = false; + + public OptionAdapter(Context context, @Nullable List data) { + super(data != null && data.size() > 2 ? R.layout.item_tab_small : R.layout.item_tab_big, data); + + if (data != null && data.size() > 2) + isSmall = true; + + mContext = context; + } + + @Override + protected void convert(BaseViewHolder helper, OptionInfo item) { + ImageView optionView = helper.getView(R.id.iv_bg_item); + String imageUrl = isSmall ? item.getMinImage() : item.getMaxImage(); + GlideApp.with(mContext).load(imageUrl).dontAnimate().into(optionView); + helper.addOnClickListener(R.id.iv_bg_item); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/SearchAdminAdapter.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/SearchAdminAdapter.kt new file mode 100644 index 0000000..149afcc --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/adapter/SearchAdminAdapter.kt @@ -0,0 +1,26 @@ +package com.chwl.app.module_hall.hall.adapter + +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.BaseViewHolder +import com.chwl.app.R +import com.chwl.app.ui.utils.ImageLoadUtils +import com.chwl.core.module_hall.hall.bean.SuperAdminInfo +import com.chwl.library.utils.ResUtil + +class SearchAdminAdapter : + BaseQuickAdapter(R.layout.item_search_admin) { + + override fun convert(helper: BaseViewHolder, item: SuperAdminInfo) { + + ImageLoadUtils.loadAvatar(item.avatar, helper.getView(R.id.iv_avatar)) + helper.setText(R.id.tv_nickname, item.nick) + .setText(R.id.tv_id, item.erbanNo) + .setText(R.id.tv_set, if (item.hasSet) ResUtil.getString(R.string.hall_adapter_searchadminadapter_01) else ResUtil.getString(R.string.hall_adapter_searchadminadapter_02)) + .setEnabled(R.id.tv_set, !item.hasSet) + .setImageResource( + R.id.iv_gender, + if (item.gender == 1) R.drawable.ic_gender_male else R.drawable.ic_gender_female + ) + .addOnClickListener(R.id.tv_set) + } +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/fragment/AssociationFragment.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/fragment/AssociationFragment.kt new file mode 100644 index 0000000..9f64779 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/fragment/AssociationFragment.kt @@ -0,0 +1,95 @@ +package com.chwl.app.module_hall.hall.fragment + +import android.os.Bundle +import android.view.View +import androidx.fragment.app.viewModels +import androidx.recyclerview.widget.LinearLayoutManager +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chwl.app.R +import com.chwl.app.module_hall.viewmodel.AssociationViewModel +import com.chwl.app.module_hall.hall.adapter.AssociationAdapter +import com.chwl.app.base.BaseViewBindingFragment +import com.chwl.app.common.EmptyViewHelper +import com.chwl.app.databinding.FragmentAssociationBinding +import com.chwl.app.module_hall.hall.activity.ModuleClanActivity +import com.chwl.app.ui.utils.RVDelegate +import com.chwl.core.association.bean.ClanListInfo +import com.chwl.core.module_hall.hall.HallModel +import com.chwl.core.utils.net.BeanObserver +import com.chwl.core.utils.net.RxHelper +import com.chwl.library.utils.ResUtil + +/** + * 公会榜单 + */ +class AssociationFragment : BaseViewBindingFragment() { + + companion object { + fun newInstance(): AssociationFragment { + val args = Bundle() + val fragment = AssociationFragment() + fragment.arguments = args + return fragment + } + } + + private lateinit var associationAdapter: AssociationAdapter + private lateinit var rvDelegate: RVDelegate + + private val associationViewModel: AssociationViewModel by viewModels() + + override fun init() { + associationAdapter = + AssociationAdapter() + associationAdapter.onItemClickListener = + BaseQuickAdapter.OnItemClickListener { _: BaseQuickAdapter<*, *>?, _: View?, position: Int -> + val info = associationAdapter.getItem(position) + if (info != null && info.clanElderUid != 0L) { + ModuleClanActivity.start(context, info.clanElderUid) + } + } + associationAdapter.setOnItemChildClickListener { _, _, position -> + val bean = associationAdapter.getItem(position) + bean?.let { + if(it.applyBtnStatus == 2){ + toast(getString(R.string.can_not_apply_3_day)) + return@let + } + dialogManager.showProgressDialog(context) + HallModel.get().applyJoinClan(it.clanId.toLong()) + .compose(RxHelper.bindFragment(this)) + .subscribe(object : BeanObserver() { + override fun onErrorMsg(error: String) { + dialogManager.dismissDialog() + toast(error) + } + + override fun onSuccess(s: String) { + dialogManager.dismissDialog() + it.applyBtnStatus = 2 + associationAdapter.notifyItemChanged(position) + toast(s) + } + }) + } + } + rvDelegate = RVDelegate.Builder() + .setLayoutManager(LinearLayoutManager(context)) + .setRecyclerView(binding.recyclerView) + .setEmptyView( + EmptyViewHelper.createEmptyTextView( + context, + ResUtil.getString(R.string.association_list_empty) + ) + ) + .setAdapter(associationAdapter) + .build() + + associationViewModel.clanListLiveData.observe(viewLifecycleOwner) { + rvDelegate.setNewData(it) + } + + associationViewModel.getClanList() + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/fragment/AssociationRoomFragment.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/fragment/AssociationRoomFragment.kt new file mode 100644 index 0000000..7a9e2e7 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/fragment/AssociationRoomFragment.kt @@ -0,0 +1,200 @@ +package com.chwl.app.module_hall.hall.fragment + +import android.content.Context +import android.os.Bundle +import android.text.Editable +import android.text.SpannableString +import android.text.TextUtils +import android.text.TextWatcher +import android.view.KeyEvent +import android.view.View +import android.view.inputmethod.EditorInfo +import android.view.inputmethod.InputMethodManager +import android.widget.TextView +import androidx.fragment.app.viewModels +import androidx.recyclerview.widget.LinearLayoutManager +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chwl.app.R +import com.chwl.app.base.BaseViewBindingFragment +import com.chwl.app.common.EmptyViewHelper +import com.chwl.app.common.widget.dialog.DialogManager +import com.chwl.app.databinding.FragmentAssociationRoomBinding +import com.chwl.app.module_hall.hall.activity.ModuleHallActivity +import com.chwl.app.module_hall.hall.adapter.AssociationRoomAdapter +import com.chwl.app.module_hall.viewmodel.AssociationViewModel +import com.chwl.app.ui.im.avtivity.NimP2PMessageActivity +import com.chwl.app.ui.utils.RVDelegate +import com.chwl.core.association.bean.HallListInfo +import com.chwl.core.module_hall.hall.HallModel +import com.chwl.core.utils.net.BeanObserver +import com.chwl.core.utils.net.RxHelper +import com.chwl.library.utils.ResUtil + +class AssociationRoomFragment : BaseViewBindingFragment() { + + companion object { + fun newInstance(): AssociationRoomFragment { + val args = Bundle() + val fragment = AssociationRoomFragment() + fragment.arguments = args + return fragment + } + } + + private var associationRoomAdapter: AssociationRoomAdapter? = null + private var rvDelegate: RVDelegate? = null + + private var list: MutableList = ArrayList() + + private val associationViewModel: AssociationViewModel by viewModels() + + override fun init() { + binding.mTvSearch.setOnClickListener { + if (!TextUtils.isEmpty(binding.etSearch.text.toString())) { + val hallList = list + val list = hallList.filter { + (it.hallName != null && it.hallName.contains(binding.etSearch.text.toString())) || it.ownerErbanNo.toString() + .contains(binding.etSearch.text.toString()) + } + if (list.isEmpty()) { + rvDelegate?.adapter?.emptyView?.findViewById(R.id.tv_hint)?.text = + getString(R.string.no_search_room) + } + rvDelegate?.setNewData(list) + } else { + rvDelegate?.adapter?.emptyView?.findViewById(R.id.tv_hint)?.text = + getString(R.string.association_hall_list_empty) + rvDelegate?.setNewData(list) + } + hideSoftInput() + } + binding.etSearch.addTextChangedListener(object : TextWatcher { + override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} + override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { + } + + override fun afterTextChanged(s: Editable) { + if (s.toString() == "") { + rvDelegate?.adapter?.emptyView?.findViewById(R.id.tv_hint)?.text = + getString(R.string.association_hall_list_empty) + rvDelegate?.setNewData(list) + } + } + }) + binding.etSearch.setOnEditorActionListener(TextView.OnEditorActionListener { _, actionId, event -> //以下方法防止两次发送请求 + if (actionId == EditorInfo.IME_ACTION_SEARCH && event != null || event != null && event.keyCode == KeyEvent.KEYCODE_ENTER) { + if (event.action == KeyEvent.ACTION_UP) { //发送请求 + val newStr: String = binding.etSearch.text.toString().trim { it <= ' ' } + if (!TextUtils.isEmpty(newStr)) { + val hallList = list + val list = hallList.filter { + (it.hallName != null && it.hallName.contains(binding.etSearch.text.toString())) || it.ownerErbanNo.toString() + .contains(binding.etSearch.text.toString()) + } + if (list.isEmpty()) { + rvDelegate?.adapter?.emptyView?.findViewById(R.id.tv_hint)?.text = + getString(R.string.no_search_room) + } + rvDelegate?.setNewData(list) + } else { + rvDelegate?.adapter?.emptyView?.findViewById(R.id.tv_hint)?.text = + getString(R.string.association_hall_list_empty) + rvDelegate?.setNewData(list) + } + hideSoftInput() + return@OnEditorActionListener true //自己消费 + } + return@OnEditorActionListener true + } + false + }) + associationRoomAdapter = + AssociationRoomAdapter() + associationRoomAdapter?.onItemClickListener = + BaseQuickAdapter.OnItemClickListener { _: BaseQuickAdapter<*, *>?, _: View?, position: Int -> + val info = associationRoomAdapter?.getItem(position) + ModuleHallActivity.start( + context, + info?.hallId ?: 0L, + info?.ownerUid ?: 0L + ) + } + associationRoomAdapter?.setOnItemChildClickListener { _, _, position -> + val bean = associationRoomAdapter?.getItem(position) + bean?.let { + if (it.hallBtnStatus == 2) { + return@let + } + if (it.hallBtnStatus == 3) { + NimP2PMessageActivity.startRecord( + mContext, it.hallMessageUid.toString(), + it.hallRecordId.toString() + ) + return@let + } + dialogManager.showOkCancelWithTitleDialog(ResUtil.getString(R.string.join_organization_tips), + it.hallName ?: "", + ResUtil.getString(R.string.join_organization_ok), + ResUtil.getString(R.string.join_organization_no), + object : DialogManager.OkCancelDialogListener { + override fun onCancel() {} + override fun onOk() { + applyJoin(it, position) + } + }) + } + } + rvDelegate = RVDelegate.Builder() + .setAdapter(associationRoomAdapter) + .setRecyclerView(binding.recyclerView) + .setEmptyView( + EmptyViewHelper.createEmptyTextView( + context, + ResUtil.getString(R.string.association_hall_list_empty) + ) + ) + .setLayoutManager(LinearLayoutManager(mContext)) + .build() + + associationViewModel.hallListLiveData.observe(this) { + list = it as MutableList + rvDelegate?.setNewData(it) + } + + associationViewModel.getHallList() + } + + private fun applyJoin(item: HallListInfo, position: Int) { + dialogManager.showProgressDialog(context) + HallModel.get().applyJoinHall(item.hallId) + .compose(RxHelper.bindFragment(this)) + .subscribe(object : BeanObserver() { + override fun onErrorMsg(error: String) { + dialogManager.dismissDialog() + toast(error) + } + + override fun onSuccess(s: String) { + dialogManager.dismissDialog() + item.hallBtnStatus = 2 + associationRoomAdapter?.notifyItemChanged(position) + toast(getString(R.string.apply_success_wait_to_join_room)) + } + }) + } + + private fun hideSoftInput() { + val imm = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager + imm.hideSoftInputFromWindow( + binding.etSearch.windowToken, + InputMethodManager.HIDE_NOT_ALWAYS + ) + } + + override fun onDestroyView() { + super.onDestroyView() + list.clear() + dialogManager.dismissDialog() + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AddMemberPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AddMemberPresenter.java new file mode 100644 index 0000000..2df7884 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AddMemberPresenter.java @@ -0,0 +1,7 @@ +package com.chwl.app.module_hall.hall.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.hall.view.IAddMemberView; + +public class AddMemberPresenter extends BaseMvpPresenter { +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AdminAddPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AdminAddPresenter.java new file mode 100644 index 0000000..bb8877f --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AdminAddPresenter.java @@ -0,0 +1,57 @@ +package com.chwl.app.module_hall.hall.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.hall.view.IAdminAddView; +import com.chwl.core.module_hall.hall.HallModel; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class AdminAddPresenter extends BaseMvpPresenter { + + public void setManager(Long targetUid,long hallId) { + HallModel.get().setManager(targetUid, hallId) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(String s) { + getMvpView().setManagerSuccess(s); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) + return; + getMvpView().setManagerFail(e.getMessage()); + } + }); + } + + public void removeManager(long targetUid,long hallId) { + HallModel.get().removeManager(targetUid, hallId) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(String s) { + getMvpView().removeManagerSuccess(s); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) + return; + getMvpView().removeManagerFail(e.getMessage()); + } + }); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AdminListPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AdminListPresenter.java new file mode 100644 index 0000000..1587173 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AdminListPresenter.java @@ -0,0 +1,34 @@ +package com.chwl.app.module_hall.hall.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.hall.view.IAdminListView; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.ListMemberInfo; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.library.utils.ListUtils; + +public class AdminListPresenter extends BaseMvpPresenter { + + public void getHallManager(long hallId) { + HallModel.get().getHallManager(hallId) + .compose(bindToLifecycle()) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + if (getMvpView() == null) + return; + getMvpView().getHallManagerFail(error); + } + + @Override + public void onSuccess(ListMemberInfo listMemberInfo) { + if (!ListUtils.isListEmpty(listMemberInfo.getMembers())) { + getMvpView().getHallManagerSuccess(listMemberInfo.getMembers()); + } else + getMvpView().getHallManagerFail("no data"); + + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AuthSettingPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AuthSettingPresenter.java new file mode 100644 index 0000000..2935df9 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/AuthSettingPresenter.java @@ -0,0 +1,62 @@ +package com.chwl.app.module_hall.hall.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.hall.view.IAuthSettingView; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.AuthInfo; + +import java.util.List; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class AuthSettingPresenter extends BaseMvpPresenter { + + public void getHallManagerAuths(long managerUid) { + HallModel.get().getHallManagerAuths(managerUid) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver>() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(List authInfoList) { + getMvpView().getHallManagerAuthsSuccess(authInfoList); + + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) + return; + getMvpView().getHallManagerAuthsFail(e.getMessage()); + } + }); + } + + public void setHallManagerAuths(long managerUid,long hallId, String authStr) { + HallModel.get().setHallManagerAuths(managerUid, hallId, authStr) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(String s) { + getMvpView().setAuthSuccess(); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) + return; + getMvpView().setAuthFail(e.getMessage()); + } + }); + + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/HallNamePresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/HallNamePresenter.java new file mode 100644 index 0000000..2234dda --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/HallNamePresenter.java @@ -0,0 +1,35 @@ +package com.chwl.app.module_hall.hall.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.hall.view.IHallNameView; +import com.chwl.core.module_hall.hall.HallNameModel; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class HallNamePresenter extends BaseMvpPresenter { + + public void updateHallName(String hallName,long hallId) { + HallNameModel.get().updateHallName(hallName,hallId) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(String s) { + getMvpView().updateHallNameSuccess(s); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) + return; + getMvpView().updateHallNameFail(e.getMessage()); + + } + }); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/ModuleHallPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/ModuleHallPresenter.java new file mode 100644 index 0000000..8cc3807 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/ModuleHallPresenter.java @@ -0,0 +1,160 @@ +package com.chwl.app.module_hall.hall.presenter; + +import android.content.Context; +import android.text.SpannableString; +import android.text.Spanned; +import android.text.style.ForegroundColorSpan; + +import androidx.core.content.ContextCompat; + +import com.chwl.app.R; +import com.chwl.app.avroom.widget.MessageView; +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.HallDataManager; +import com.chwl.app.module_hall.hall.view.IModuleHallView; +import com.chwl.app.ui.widget.TextSpannableBuilder; +import com.chwl.core.auth.AuthModel; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.AuthInfo; +import com.chwl.library.utils.ResUtil; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +/** + * Created by lvzebiao on 2018/12/27. + */ + +public class ModuleHallPresenter extends BaseMvpPresenter { + + /** + * 成员列表 + */ + public void getHallAuths(long hallId) { + + HallModel.get().getHallAuths(AuthModel.get().getCurrentUid(), hallId, + HallDataManager.get().getRoleType()) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver>() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(List authInfos) { + //对权限处理下 + List showList = new ArrayList<>(); + List canHandle = AuthInfo.canHandleAuth(); + for (AuthInfo info : authInfos) { + if (info == null) { + continue; + } + if (canHandle.contains(info.getCode()) && info.isOwnAuth()) { + showList.add(info); + } + } + getMvpView().getHallAuthsSuccess(showList); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) + return; + getMvpView().getHallAuthsFail(e.getMessage()); + } + }); + + } + + public void quit() { + HallModel.get().quit(AuthModel.get().getCurrentUid()) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(String s) { + getMvpView().quitSuccess(s); + + } + + @Override + public void onError(Throwable e) { + getMvpView().quitFail(e.getMessage()); + + } + }); + } + + public void remove(long hallId, long targetUid) { + HallModel.get().removeFromHall(hallId, targetUid) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(String s) { + getMvpView().removeSuccess(s); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) { + return; + } + getMvpView().removeFail(e.getMessage()); + } + }); + } + + public CharSequence getExitTips(Context context) { + TextSpannableBuilder builder = new TextSpannableBuilder(null); + builder.append(ResUtil.getString(R.string.hall_presenter_modulehallpresenter_01)) + .append(ResUtil.getString(R.string.hall_presenter_modulehallpresenter_02), new ForegroundColorSpan( + ContextCompat.getColor(context, R.color.appColor))) + .append(ResUtil.getString(R.string.hall_presenter_modulehallpresenter_03)) + .append(ResUtil.getString(R.string.hall_presenter_modulehallpresenter_04), new ForegroundColorSpan( + ContextCompat.getColor(context, R.color.appColor))) + .append(ResUtil.getString(R.string.hall_presenter_modulehallpresenter_05)); + return builder.build(); + } + + public SpannableString getRemoveTips(Context context, int targetRoleType, String targetNick) { + String message; + + if (targetRoleType == 2) { + message = targetNick + ResUtil.getString(R.string.hall_presenter_modulehallpresenter_06); + } else if (targetRoleType == 3) { + message = ResUtil.getString(R.string.hall_presenter_modulehallpresenter_07) + targetNick + ResUtil.getString(R.string.hall_presenter_modulehallpresenter_08); + } else { + message = ""; + } + + SpannableString spannableString = new SpannableString(message); + + ForegroundColorSpan colorSpan = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_333333)); + ForegroundColorSpan colorSpan1 = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.appColor)); + + if (targetRoleType == 2) { + spannableString.setSpan(colorSpan1, 0, targetNick.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(colorSpan, targetNick.length(), message.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + + } else if (targetRoleType == 3) { + spannableString.setSpan(colorSpan, 0, 2, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(colorSpan1, 2, 2 + targetNick.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(colorSpan, 2 + targetNick.length(), message.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + + return spannableString; + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/RemoveMemberPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/RemoveMemberPresenter.java new file mode 100644 index 0000000..db886ad --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/presenter/RemoveMemberPresenter.java @@ -0,0 +1,77 @@ +package com.chwl.app.module_hall.hall.presenter; + +import android.content.Context; +import android.text.SpannableString; +import android.text.Spanned; +import android.text.style.ForegroundColorSpan; + +import androidx.core.content.ContextCompat; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.hall.view.IRemoveMemberView; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class RemoveMemberPresenter extends BaseMvpPresenter { + + + public void remove(long hallId,long targetUid) { + HallModel.get().removeFromHall(hallId,targetUid) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(String s) { + getMvpView().removeSuccess(s); + SingleToastUtil.showToast(ResUtil.getString(R.string.hall_presenter_removememberpresenter_01)); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) { + return; + } + getMvpView().removeFail(e.getMessage()); + } + }); + } + + + public SpannableString getRemoveTips(Context context, int targetRoleType, String targetNick) { + String message; + + if (targetRoleType == 2) { + message = targetNick + ResUtil.getString(R.string.hall_presenter_removememberpresenter_02); + } else if (targetRoleType == 3) { + message = ResUtil.getString(R.string.hall_presenter_removememberpresenter_03) + targetNick + ResUtil.getString(R.string.hall_presenter_removememberpresenter_04); + } else { + message = ""; + } + + SpannableString spannableString = new SpannableString(message); + + ForegroundColorSpan colorSpan = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_333333)); + ForegroundColorSpan colorSpan1 = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.appColor)); + + if (targetRoleType == 2) { + spannableString.setSpan(colorSpan1, 0, targetNick.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(colorSpan, targetNick.length(), message.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + + } else if (targetRoleType == 3) { + spannableString.setSpan(colorSpan, 0, 2, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(colorSpan1, 2, 2 + targetNick.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(colorSpan, 2 + targetNick.length(), message.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + + return spannableString; + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAddMemberView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAddMemberView.java new file mode 100644 index 0000000..e79e948 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAddMemberView.java @@ -0,0 +1,6 @@ +package com.chwl.app.module_hall.hall.view; + +import com.chwl.library.base.IMvpBaseView; + +public interface IAddMemberView extends IMvpBaseView { +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAdminAddView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAdminAddView.java new file mode 100644 index 0000000..07a5913 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAdminAddView.java @@ -0,0 +1,18 @@ +package com.chwl.app.module_hall.hall.view; + +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.library.base.IMvpBaseView; + +import java.util.List; + +public interface IAdminAddView extends IMvpBaseView { + + void getAllMembersSuccess(List memberInfoList); + void getAllMembersFail(String message); + + void setManagerSuccess(String message); + void setManagerFail(String message); + + void removeManagerSuccess(String message); + void removeManagerFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAdminListView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAdminListView.java new file mode 100644 index 0000000..51cc0c7 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAdminListView.java @@ -0,0 +1,12 @@ +package com.chwl.app.module_hall.hall.view; + +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.library.base.IMvpBaseView; + +import java.util.List; + +public interface IAdminListView extends IMvpBaseView { + + void getHallManagerSuccess(List memberInfoList); + void getHallManagerFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAuthSettingView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAuthSettingView.java new file mode 100644 index 0000000..4c15cc1 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IAuthSettingView.java @@ -0,0 +1,14 @@ +package com.chwl.app.module_hall.hall.view; + +import com.chwl.core.module_hall.hall.bean.AuthInfo; +import com.chwl.library.base.IMvpBaseView; + +import java.util.List; + +public interface IAuthSettingView extends IMvpBaseView { + void getHallManagerAuthsSuccess(List authInfoList); + void getHallManagerAuthsFail(String message); + + void setAuthSuccess(); + void setAuthFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IHallNameView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IHallNameView.java new file mode 100644 index 0000000..f850a72 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IHallNameView.java @@ -0,0 +1,8 @@ +package com.chwl.app.module_hall.hall.view; + +import com.chwl.library.base.IMvpBaseView; + +public interface IHallNameView extends IMvpBaseView { + void updateHallNameSuccess(String message); + void updateHallNameFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IMemberSearchView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IMemberSearchView.java new file mode 100644 index 0000000..f0931f1 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IMemberSearchView.java @@ -0,0 +1,12 @@ +package com.chwl.app.module_hall.hall.view; + +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.library.base.IMvpBaseView; + +import java.util.List; + +public interface IMemberSearchView extends IMvpBaseView { + + void queryMembersSuccess(List memberInfoList); + void queryMembersFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IModuleHallView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IModuleHallView.java new file mode 100644 index 0000000..b2a6dbc --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IModuleHallView.java @@ -0,0 +1,27 @@ +package com.chwl.app.module_hall.hall.view; + +import com.chwl.core.module_hall.hall.bean.AuthInfo; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.library.base.IMvpBaseView; + +import java.util.List; + +/** + * Created by lvzebiao on 2018/12/27. + */ + +public interface IModuleHallView extends IMvpBaseView{ + + //成员列表 + void getHallAuthsSuccess(List authInfoList); + void getHallAuthsFail(String message); + + void quitSuccess(String message); + void quitFail(String message); + + void getAllMembersSuccess(List memberInfoList); + void getAllMembersFail(String message); + + void removeSuccess(String message); + void removeFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IRemoveMemberView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IRemoveMemberView.java new file mode 100644 index 0000000..2410571 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/IRemoveMemberView.java @@ -0,0 +1,8 @@ +package com.chwl.app.module_hall.hall.view; + +import com.chwl.library.base.IMvpBaseView; + +public interface IRemoveMemberView extends IMvpBaseView { + void removeSuccess(String message); + void removeFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/CloseExchangeTipDialog.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/CloseExchangeTipDialog.java new file mode 100644 index 0000000..f418f24 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/CloseExchangeTipDialog.java @@ -0,0 +1,97 @@ +package com.chwl.app.module_hall.hall.view.dialog; + +import android.content.Context; +import android.os.Bundle; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.style.ForegroundColorSpan; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; + +import com.chwl.app.R; +import com.chwl.app.ui.widget.dialog.BaseDialog; + +/** + * @author wushaocheng + * @Description 关闭兑换弹窗 + * @Date 2013/2/14 + */ +public class CloseExchangeTipDialog extends BaseDialog { + + private String name = ""; + + public CloseExchangeTipDialog(Context context) { + super(context, R.style.dialog); + init(); + } + + private void init() { + this.setCancelable(true); + this.setCanceledOnTouchOutside(true); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.layout_close_exchange_dialog); + + TextView tvName = findViewById(R.id.tv_sure_close_tip); + if (tvName != null) { + String tip = getContext().getString(R.string.sure_to_close_exchange, name); + SpannableStringBuilder builder = new SpannableStringBuilder(tip); + builder.setSpan( + new ForegroundColorSpan(ContextCompat.getColor(getContext(),R.color.color_9168FA)), 4, + 4 + name.length(), + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE + ); + tvName.setText(builder); + } + + ImageView close = findViewById(R.id.iv_close); + if (close != null) { + close.setOnClickListener(view -> { + this.dismiss(); + }); + } + + TextView ok = findViewById(R.id.btn_ok); + if (ok != null) { + ok.setOnClickListener(v -> { + this.dismiss(); + if (l != null) { + l.onOk(); + } + }); + } + TextView cancel = findViewById(R.id.btn_cancel); + if (cancel != null) { + cancel.setOnClickListener(v -> { + this.dismiss(); + if (l != null) { + l.onCancel(); + } + }); + } + } + + public void setName(String name) { + this.name = name; + } + + private OnActionListener l; + + public void setOnActionListener(OnActionListener l) { + this.l = l; + } + + public interface OnActionListener { + default void onOk() { + } + + default void onCancel() { + } + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/CustomizeWheelAdapter.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/CustomizeWheelAdapter.kt new file mode 100644 index 0000000..28fe492 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/CustomizeWheelAdapter.kt @@ -0,0 +1,74 @@ +package com.chwl.app.module_hall.hall.view.dialog + +import android.content.Context +import android.text.TextUtils +import android.widget.TextView +import com.jzxiang.pickerview.adapters.NumericWheelAdapter +import java.util.Locale + +class CustomizeWheelAdapter : NumericWheelAdapter { + + var mTextSize = 13f + + // Values + private var minValue = 0 + private var maxValue = 0 + + // format + private var format: String? = null + + //unit + private var unit: String? = null + + constructor(context: Context?) : super(context) + constructor(context: Context?, minValue: Int, maxValue: Int) : super( + context, + minValue, + maxValue + ){ + this.minValue = minValue + this.maxValue = maxValue + } + + constructor(context: Context?, minValue: Int, maxValue: Int, format: String?) : super( + context, + minValue, + maxValue, + format + ){ + this.minValue = minValue + this.maxValue = maxValue + this.format = format + } + + constructor( + context: Context?, + minValue: Int, + maxValue: Int, + format: String?, + unit: String? + ) : super(context, minValue, maxValue, format, unit){ + + this.minValue = minValue + this.maxValue = maxValue + this.format = format + this.unit = unit + } + + override fun configureTextView(view: TextView?) { + super.configureTextView(view) + view?.textSize = mTextSize + } + + override fun getItemText(index: Int): CharSequence? { + if (index >= 0 && index < itemsCount) { + val value = minValue + index + var text = if (!TextUtils.isEmpty(format)) String.format(Locale.ENGLISH,format!!, value) else value.toString() + text = if (TextUtils.isEmpty(unit)) text else text + unit + + return text + } + return null + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/HallMenuDialog.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/HallMenuDialog.java new file mode 100644 index 0000000..9ed8d36 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/HallMenuDialog.java @@ -0,0 +1,161 @@ +package com.chwl.app.module_hall.hall.view.dialog; + +import android.app.Dialog; +import android.content.Context; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.chwl.app.R; +import com.chwl.core.module_hall.hall.bean.AuthInfo; +import com.chwl.library.utils.SizeUtils; + +import java.util.List; + +public class HallMenuDialog extends Dialog implements View.OnClickListener { + + private Context mContext; + private List mAuthInfoList; + + private ImageView ivTopArrow; + private boolean mIsTopRight; + + public HallMenuDialog(@NonNull Context context, List authInfoList, boolean isTopRight) { + super(context, R.style.hall_dialog); +// super(context, R.style.dialog); + mContext = context; + mIsTopRight = isTopRight; + init(null, authInfoList); + } + + public HallMenuDialog(@NonNull Context context, View attachView, List authInfoList, boolean isTopRight) { + super(context, R.style.hall_dialog); +// super(context, R.style.dialog); + mContext = context; + mIsTopRight = isTopRight; + init(attachView, authInfoList); + } + + private void init(View attachView, List authInfoList) { + Window window = getWindow(); + WindowManager.LayoutParams lp = window.getAttributes(); + lp.gravity = Gravity.TOP | Gravity.END; + if (attachView != null) { +// lp.x = attachView.getWidth() / 2 - SizeUtils.dp2px(mContext, 9); + lp.x = attachView.getWidth() / 2 - SizeUtils.dp2px(mContext, 4); +// lp.y = attachView.getHeight() + SizeUtils.dp2px(mContext, 10); + lp.y = attachView.getHeight() + SizeUtils.dp2px(mContext, 15); + } + + window.setAttributes(lp); + + setContentView(R.layout.dialog_hall_menu); + setCanceledOnTouchOutside(true); + + ivTopArrow = findViewById(R.id.iv_top_arrow); + mLlMenu = findViewById(R.id.ll_menu); + + mAuthInfoList = authInfoList; + addMenu(mAuthInfoList); + + if (mLlMenu != null) { + mLlMenu.setBackgroundResource(mIsTopRight ? R.drawable.bg_hall_menu_img_righ : R.drawable.bg_hall_menu_img); + } + } + + private LinearLayout mLlMenu; + + private void addMenu(List authInfoList) { + if (authInfoList != null && authInfoList.size() > 0 && mLlMenu != null) { + mLlMenu.removeAllViews(); + + for (AuthInfo authInfo : authInfoList) { + + if (authInfo.isOwnAuth()) { + View vItemAuth = LayoutInflater.from(mContext).inflate(R.layout.item_auth_menu, mLlMenu, false); + + TextView tvMenu = vItemAuth.findViewById(R.id.tv_menu); + tvMenu.setText(authInfo.getName()); + + ImageView ivMenu = vItemAuth.findViewById(R.id.iv_menu); + switchIcon(ivMenu, ivTopArrow, authInfo.getCode()); + + mLlMenu.addView(vItemAuth); + + vItemAuth.setTag(authInfo.getCode()); + vItemAuth.setOnClickListener(this); + + } + + } + + } + } + + private void switchIcon(ImageView ivMenu, ImageView ivTopArrow, String code) { + switch (code) { + case AuthInfo.AUTH_HALL_NAME_SET: + LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); + layoutParams.setMargins(0, 0, SizeUtils.dp2px(mContext, 15), 0); + layoutParams.gravity = Gravity.END; + ivTopArrow.setLayoutParams(layoutParams); + + ivMenu.setImageResource(R.drawable.ic_hall_name_set); + break; + + case AuthInfo.AUTH_APPLY_HALL_EXIT: + LinearLayout.LayoutParams exitLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); + exitLayoutParams.setMargins(0, 0, SizeUtils.dp2px(mContext, 15), 0); + exitLayoutParams.gravity = Gravity.END; + ivTopArrow.setLayoutParams(exitLayoutParams); + ivMenu.setImageResource(R.drawable.ic_exit); + break; + + case AuthInfo.AUTH_MEMBER_JOIN_MANAGER: + ivMenu.setImageResource(R.drawable.ic_add_member); + break; + + case AuthInfo.AUTH_MEMBER_EXIT_MANAGER: + ivMenu.setImageResource(R.drawable.ic_remove_member); + break; + + case AuthInfo.AUTH_HALL_MANAGER_SET: + ivMenu.setImageResource(R.drawable.ic_set_admin); + break; + case AuthInfo.AUTH_HALL_CLAN_INCOME: + LinearLayout.LayoutParams clanLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); + clanLayoutParams.setMargins(0, 0, SizeUtils.dp2px(mContext, 15), 0); + clanLayoutParams.gravity = Gravity.END; + ivTopArrow.setLayoutParams(clanLayoutParams); + + ivMenu.setImageResource(R.drawable.ic_hall_income); + break; + } + } + + private OnMenuClickListener onMenuClickListener; + public void setOnMenuClickListener(OnMenuClickListener listener){ + this.onMenuClickListener = listener; + } + + @Override + public void onClick(View v) { + if (onMenuClickListener == null) + return; + + onMenuClickListener.callback((String) v.getTag()); + dismiss(); + } + + public interface OnMenuClickListener{ + void callback(String code); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerClanDialog.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerClanDialog.java new file mode 100644 index 0000000..ce0f1d7 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerClanDialog.java @@ -0,0 +1,546 @@ +package com.chwl.app.module_hall.hall.view.dialog; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +import com.jzxiang.pickerview.config.PickerConfig; +import com.jzxiang.pickerview.data.Type; +import com.jzxiang.pickerview.data.WheelCalendar; +import com.jzxiang.pickerview.listener.OnDateSetListener; +import com.chwl.app.R; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; +import com.chwl.library.utils.TimeUtils; + +import java.util.Calendar; + +/** + * Created by jzxiang on 16/4/19. + */ +public class TimePickerClanDialog extends DialogFragment implements View.OnClickListener { + PickerConfig mPickerConfig; + RelativeLayout rlWeekGroup; + TextView tvWeekFirstDay; + TextView tvWeekLastDay; + TextView tvDay; + TextView tvWeek; + TextView tvMonth; + private TimeWheel mTimeWheel; + private long mCurrentMillSeconds; + private long mFirstMs; + private TimePickerListener mTimePickerListener; + private String mWeekFirstDay; + private String mWeekLastDay; + + private long mDayFirstTime; + private long mDayLastTime; + private final String defDayEndText = ResUtil.getString(R.string.view_dialog_timepickerdialog_01); + + private static final int TYPE_DAY = 0; + private static final int TYPE_WEEK = 1; + private static final int TYPE_MONTH = 2; + + /** + * 显示周区间 + */ + private boolean isDay; + private boolean isWeek; + private boolean isMonth; + private int mCurrentType; + + private View view; + + private static TimePickerClanDialog newInstance(PickerConfig pickerConfig, long firstMs, boolean isWeek, boolean isMonth, boolean isDay, long dayFirstTime, long dayLastTime) { + TimePickerClanDialog timePickerDialog = new TimePickerClanDialog(); + timePickerDialog.initialize(pickerConfig, firstMs, isWeek, isMonth, isDay, dayFirstTime, dayLastTime); + return timePickerDialog; + } + + public void setmTimePickerListener(TimePickerListener mTimePickerListener) { + this.mTimePickerListener = mTimePickerListener; + } + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + Activity activity = getActivity(); + activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); + + } + + @Override + public void onResume() { + super.onResume(); + + Window window = getDialog().getWindow(); + window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);//Here! + window.setGravity(Gravity.BOTTOM); + } + + private void initialize(PickerConfig pickerConfig, long firstMs, boolean isWeek, boolean isMonth, boolean isDay, long dayFirstTime, long dayLastTime) { + mPickerConfig = pickerConfig; + mFirstMs = firstMs; + this.isWeek = isWeek; + this.isMonth = isMonth; + this.isDay = isDay; + this.mDayFirstTime = dayFirstTime; + this.mDayLastTime = dayLastTime; + } + + @NonNull + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + Dialog dialog = new Dialog(getActivity(), R.style.Dialog_NoTitle); + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + dialog.setCancelable(true); + dialog.setCanceledOnTouchOutside(true); + dialog.setContentView(initView()); + return dialog; + } + + View initView() { + LayoutInflater inflater = LayoutInflater.from(getContext()); + view = inflater.inflate(R.layout.dialog_clan_time_picker, null); + Context context = view.getContext(); + TextView cancel = view.findViewById(R.id.tv_cancel); + cancel.setOnClickListener(this); + cancel.setTextColor(context.getResources().getColor(R.color.color_b3b3b3)); + TextView sure = view.findViewById(R.id.tv_sure); + sure.setOnClickListener(this); + sure.setTextColor(context.getResources().getColor(R.color.color_1F1A4E)); + TextView title = view.findViewById(R.id.tv_title); + View toolbar = view.findViewById(R.id.toolbar); + + rlWeekGroup = view.findViewById(R.id.rl_week_group); + tvWeekFirstDay = view.findViewById(R.id.tv_week_first_day); + tvWeekLastDay = view.findViewById(R.id.tv_week_last_day); + tvWeekFirstDay.setSelected(true); + tvWeekLastDay.setSelected(isWeek); + rlWeekGroup.setVisibility(isWeek || isDay ? View.VISIBLE : View.GONE); + + tvDay = view.findViewById(R.id.tvDay); + tvWeek = view.findViewById(R.id.tvWeek); + tvMonth = view.findViewById(R.id.tvMonth); + tvDay.setOnClickListener(this); + tvWeek.setOnClickListener(this); + tvMonth.setOnClickListener(this); + + showSelectButton(isDay,isWeek,isMonth); + + if (isDay) { + if (mDayFirstTime != mDayLastTime) { + tvWeekLastDay.setText(TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + } else { + tvWeekLastDay.setText(defDayEndText); + } + tvWeekFirstDay.setOnClickListener(v -> { + tvWeekFirstDay.setSelected(true); + tvWeekLastDay.setSelected(false); + }); + tvWeekLastDay.setOnClickListener(v -> { + tvWeekFirstDay.setSelected(false); + tvWeekLastDay.setSelected(true); + }); + } + title.setText(mPickerConfig.mTitleString); + title.setTextColor(context.getResources().getColor(R.color.color_333333)); + cancel.setText(mPickerConfig.mCancelString); + sure.setText(mPickerConfig.mSureString); + + if (isMonth) { + mPickerConfig.mType = Type.YEAR_MONTH; + } + toolbar.setBackgroundResource(R.drawable.shape_white_top_18dp); + + mTimeWheel = new TimeWheel(view, mPickerConfig); + Calendar currCalendar = Calendar.getInstance(); + if (mFirstMs <= 0) { + mFirstMs = System.currentTimeMillis(); + } + currCalendar.setTimeInMillis(mFirstMs); + setWeekView(currCalendar); + Calendar calendar = Calendar.getInstance(); + mTimeWheel.setOnTimeChangeListener(() -> { + int year = mTimeWheel.getCurrentYear(); + int month = mTimeWheel.getCurrentMonth(); + int day = mTimeWheel.getCurrentDay(); + calendar.set(Calendar.YEAR, year); + calendar.set(Calendar.MONTH, month - 1); + calendar.set(Calendar.DAY_OF_MONTH, day); + setWeekView(calendar); + }); + + return view; + } + + private void showSelectButton(boolean isDay, boolean isWeek, boolean isMonth) { + tvDay.setSelected(isDay); + tvWeek.setSelected(isWeek); + tvMonth.setSelected(isMonth); + if(isDay) { + mCurrentType = TYPE_DAY; + }else if(isWeek){ + mCurrentType = TYPE_WEEK; + }else if(isMonth){ + mCurrentType = TYPE_MONTH; + } + } + + private void setWeekView(Calendar calendar) { + long firstDayTime; + + if (isDay) { + if (tvWeekFirstDay.isSelected()) { + mDayFirstTime = calendar.getTimeInMillis(); + tvWeekFirstDay.setText(TimeUtils.getDateTimeString(mDayFirstTime, TimeUtils.DATE_FORMAT)); + } else { + mDayLastTime = calendar.getTimeInMillis(); + tvWeekLastDay.setText(TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + } + } else { + //获取周几 1-7 + int currweekDay = calendar.get(Calendar.DAY_OF_WEEK); + if (currweekDay == 1) {//周日 + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (7 - currweekDay)); + } else { + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (currweekDay - 2)); + } + + String first = TimeUtils.getDateTimeString(firstDayTime, TimeUtils.DATE_FORMAT); + mWeekFirstDay = first; + tvWeekFirstDay.setText(first); + + //周日 + long lastDayTime = firstDayTime + (TimeUtils.MILLIS_OF_A_DAY * 6); + String last = TimeUtils.getDateTimeString(lastDayTime, TimeUtils.DATE_FORMAT); + mWeekLastDay = last; + tvWeekLastDay.setText(last); + } + } + + @Override + public void onClick(View v) { + int i = v.getId(); + if (i == R.id.tv_cancel) { + dismiss(); + } else if (i == R.id.tv_sure) { + sureClicked(); + }else if(i == R.id.tvDay) { + tvDay.setSelected(true); + tvWeek.setSelected(false); + tvMonth.setSelected(false); + this.isDay = true; + this.isWeek = false; + this.isMonth = false; + mCurrentType = TYPE_DAY; + if (mFirstMs <= 0) { + mFirstMs = System.currentTimeMillis(); + } + mPickerConfig.mType = Type.YEAR_MONTH_DAY; + mPickerConfig.mCurrentCalendar = new WheelCalendar(mFirstMs); + tvWeekLastDay.setSelected(false); + rlWeekGroup.setVisibility(View.VISIBLE); + if (mDayFirstTime != mDayLastTime) { + tvWeekLastDay.setText(TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + } else { + tvWeekLastDay.setText(defDayEndText); + } + tvWeekFirstDay.setOnClickListener(view -> { + tvWeekFirstDay.setSelected(true); + tvWeekLastDay.setSelected(false); + }); + tvWeekLastDay.setOnClickListener(view -> { + tvWeekFirstDay.setSelected(false); + tvWeekLastDay.setSelected(true); + }); + mTimeWheel = new TimeWheel(view, mPickerConfig); + Calendar currCalendar = Calendar.getInstance(); + currCalendar.setTimeInMillis(mFirstMs); + setWeekView(currCalendar); + Calendar calendar = Calendar.getInstance(); + mTimeWheel.setOnTimeChangeListener(() -> { + int year = mTimeWheel.getCurrentYear(); + int month = mTimeWheel.getCurrentMonth(); + int day = mTimeWheel.getCurrentDay(); + calendar.set(Calendar.YEAR, year); + calendar.set(Calendar.MONTH, month - 1); + calendar.set(Calendar.DAY_OF_MONTH, day); + setWeekView(calendar); + }); + }else if(i == R.id.tvWeek) { + tvDay.setSelected(false); + tvWeek.setSelected(true); + tvMonth.setSelected(false); + this.isDay = false; + this.isWeek = true; + this.isMonth = false; + mCurrentType = TYPE_WEEK; + if (mFirstMs <= 0) { + mFirstMs = System.currentTimeMillis(); + } + mPickerConfig.mType = Type.YEAR_MONTH_DAY; + mPickerConfig.mCurrentCalendar = new WheelCalendar(mFirstMs); + tvWeekFirstDay.setSelected(true); + tvWeekLastDay.setSelected(true); + rlWeekGroup.setVisibility(View.VISIBLE); + mTimeWheel = new TimeWheel(view, mPickerConfig); + Calendar currCalendar = Calendar.getInstance(); + currCalendar.setTimeInMillis(mFirstMs); + setWeekView(currCalendar); + Calendar calendar = Calendar.getInstance(); + mTimeWheel.setOnTimeChangeListener(() -> { + int year = mTimeWheel.getCurrentYear(); + int month = mTimeWheel.getCurrentMonth(); + int day = mTimeWheel.getCurrentDay(); + calendar.set(Calendar.YEAR, year); + calendar.set(Calendar.MONTH, month - 1); + calendar.set(Calendar.DAY_OF_MONTH, day); + setWeekView(calendar); + }); + }else if(i == R.id.tvMonth) { + tvDay.setSelected(false); + tvWeek.setSelected(false); + tvMonth.setSelected(true); + this.isDay = false; + this.isWeek = false; + this.isMonth = true; + mCurrentType = TYPE_MONTH; + rlWeekGroup.setVisibility(View.GONE); + if (mFirstMs <= 0) { + mFirstMs = System.currentTimeMillis(); + } + mPickerConfig.mType = Type.YEAR_MONTH; + mPickerConfig.mCurrentCalendar = new WheelCalendar(mFirstMs); + mTimeWheel = new TimeWheel(view, mPickerConfig); + Calendar currCalendar = Calendar.getInstance(); + currCalendar.setTimeInMillis(mFirstMs); + setWeekView(currCalendar); + Calendar calendar = Calendar.getInstance(); + mTimeWheel.setOnTimeChangeListener(() -> { + int year = mTimeWheel.getCurrentYear(); + int month = mTimeWheel.getCurrentMonth(); + int day = mTimeWheel.getCurrentDay(); + calendar.set(Calendar.YEAR, year); + calendar.set(Calendar.MONTH, month - 1); + calendar.set(Calendar.DAY_OF_MONTH, day); + setWeekView(calendar); + }); + } + } + + /* + * @desc This method returns the current milliseconds. If current milliseconds is not set, + * this will return the system milliseconds. + * @param none + * @return long - the current milliseconds. + */ + public long getCurrentMillSeconds() { + if (mCurrentMillSeconds == 0) + return System.currentTimeMillis(); + + return mCurrentMillSeconds; + } + + /* + * @desc This method is called when onClick method is invoked by sure button. A Calendar instance is created and + * initialized. + * @param none + * @return none + */ + void sureClicked() { + Calendar calendar = Calendar.getInstance(); + calendar.clear(); + + calendar.set(Calendar.YEAR, mTimeWheel.getCurrentYear()); + calendar.set(Calendar.MONTH, mTimeWheel.getCurrentMonth() - 1); + calendar.set(Calendar.DAY_OF_MONTH, mTimeWheel.getCurrentDay()); + calendar.set(Calendar.HOUR_OF_DAY, mTimeWheel.getCurrentHour()); + calendar.set(Calendar.MINUTE, mTimeWheel.getCurrentMinute()); + + mCurrentMillSeconds = calendar.getTimeInMillis(); + + if (mTimePickerListener != null) { + if (isDay) { + if (defDayEndText.equals(tvWeekLastDay.getText().toString())) { + mDayLastTime = mDayFirstTime; + } + if (mDayFirstTime > mDayLastTime) { + SingleToastUtil.showToast(ResUtil.getString(R.string.view_dialog_timepickerdialog_02)); + return; + } + if (mDayLastTime - mDayFirstTime > 180 * TimeUtils.MILLIS_OF_A_DAY) { + SingleToastUtil.showToast(ResUtil.getString(R.string.view_dialog_timepickerdialog_03)); + return; + } + mTimePickerListener.getTime(mCurrentMillSeconds, + TimeUtils.getDateTimeString(mDayFirstTime, TimeUtils.DATE_FORMAT), + TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT), mCurrentType); + + } else { + mTimePickerListener.getTime(mCurrentMillSeconds, mWeekFirstDay, mWeekLastDay, mCurrentType); + } + } + + dismiss(); + } + + public interface TimePickerListener { + void getTime(long chooseTime, String weekFirstDay, String weekLastDay, int mCurrentType); + } + + public static class Builder { + PickerConfig mPickerConfig; + long firstMs; + boolean isWeek; + boolean isMonth; + boolean isDay; + private long mDayFirstTime; + private long mDayLastTime; + + public Builder() { + mPickerConfig = new PickerConfig(); + } + + public Builder setType(Type type) { + mPickerConfig.mType = type; + return this; + } + + public Builder setThemeColor(int color) { + mPickerConfig.mThemeColor = color; + return this; + } + + public Builder setCancelStringId(String left) { + mPickerConfig.mCancelString = left; + return this; + } + + public Builder setSureStringId(String right) { + mPickerConfig.mSureString = right; + return this; + } + + public Builder setTitleStringId(String title) { + mPickerConfig.mTitleString = title; + return this; + } + + public Builder setToolBarTextColor(int color) { + mPickerConfig.mToolBarTVColor = color; + return this; + } + + public Builder setWheelItemTextNormalColor(int color) { + mPickerConfig.mWheelTVNormalColor = color; + return this; + } + + public Builder setWheelItemTextSelectorColor(int color) { + mPickerConfig.mWheelTVSelectorColor = color; + return this; + } + + public Builder setWheelItemTextSize(int size) { + mPickerConfig.mWheelTVSize = size; + return this; + } + + public Builder setCyclic(boolean cyclic) { + mPickerConfig.cyclic = cyclic; + return this; + } + + public Builder setMinMillseconds(long millseconds) { + mPickerConfig.mMinCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setMaxMillseconds(long millseconds) { + mPickerConfig.mMaxCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setCurrentMillseconds(long millseconds) { + firstMs = millseconds; + mPickerConfig.mCurrentCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setYearText(String year) { + mPickerConfig.mYear = year; + return this; + } + + public Builder setMonthText(String month) { + mPickerConfig.mMonth = month; + return this; + } + + public Builder setDayText(String day) { + mPickerConfig.mDay = day; + return this; + } + + public Builder setHourText(String hour) { + mPickerConfig.mHour = hour; + return this; + } + + public Builder setMinuteText(String minute) { + mPickerConfig.mMinute = minute; + return this; + } + + public Builder setCallBack(OnDateSetListener listener) { + mPickerConfig.mCallBack = listener; + return this; + } + + public Builder setmIsWeek(boolean isWeek) { + this.isWeek = isWeek; + return this; + } + + public Builder setIsMonth(boolean isMonth) { + this.isMonth = isMonth; + return this; + } + + public Builder setIsDay(boolean isDay) { + this.isDay = isDay; + return this; + } + + public Builder setDayFirstTime(long dayFirstTime) { + this.mDayFirstTime = dayFirstTime; + return this; + } + + public Builder setDayLastTime(long dayLastTime) { + this.mDayLastTime = dayLastTime; + return this; + } + + public TimePickerClanDialog build() { + return newInstance(mPickerConfig, firstMs, isWeek, isMonth, isDay, mDayFirstTime, mDayLastTime); + } + + } + + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerDialog.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerDialog.java new file mode 100644 index 0000000..d07e2cf --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerDialog.java @@ -0,0 +1,416 @@ +package com.chwl.app.module_hall.hall.view.dialog; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +import com.chwl.app.R; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; +import com.chwl.library.utils.TimeUtils; +import com.jzxiang.pickerview.config.PickerConfig; +import com.jzxiang.pickerview.data.Type; +import com.jzxiang.pickerview.data.WheelCalendar; +import com.jzxiang.pickerview.listener.OnDateSetListener; + +import java.util.Calendar; + +/** + * Created by jzxiang on 16/4/19. + */ +public class TimePickerDialog extends DialogFragment implements View.OnClickListener { + PickerConfig mPickerConfig; + RelativeLayout rlWeekGroup; + TextView tvWeekFirstDay; + TextView tvWeekLastDay; + private TimeWheel mTimeWheel; + private long mCurrentMillSeconds; + private long mFirstMs; + private TimePickerListener mTimePickerListener; + private String mWeekFirstDay; + private String mWeekLastDay; + + private long mDayFirstTime; + private long mDayLastTime; + private final String defDayEndText = ResUtil.getString(R.string.view_dialog_timepickerdialog_01); + + /** + * 显示周区间 + */ + private boolean mIsWeek; + private boolean isMonth; + private boolean isDay; + + public float mTestSize = 13f; + + private static TimePickerDialog newInstance(PickerConfig pickerConfig, long firstMs, boolean isWeek, boolean isMonth, boolean isDay, long dayFirstTime, long dayLastTime) { + TimePickerDialog timePickerDialog = new TimePickerDialog(); + timePickerDialog.initialize(pickerConfig, firstMs, isWeek, isMonth, isDay, dayFirstTime, dayLastTime); + return timePickerDialog; + } + + public void setmTimePickerListener(TimePickerListener mTimePickerListener) { + this.mTimePickerListener = mTimePickerListener; + } + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + Activity activity = getActivity(); + activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); + + } + + @Override + public void onResume() { + super.onResume(); + + Window window = getDialog().getWindow(); + window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);//Here! + window.setGravity(Gravity.BOTTOM); + } + + private void initialize(PickerConfig pickerConfig, long firstMs, boolean isWeek, boolean isMonth, boolean isDay, long dayFirstTime, long dayLastTime) { + mPickerConfig = pickerConfig; + mFirstMs = firstMs; + mIsWeek = isWeek; + this.isMonth = isMonth; + this.isDay = isDay; + this.mDayFirstTime = dayFirstTime; + this.mDayLastTime = dayLastTime; + } + + @NonNull + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + Dialog dialog = new Dialog(getActivity(), R.style.Dialog_NoTitle); + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + dialog.setCancelable(true); + dialog.setCanceledOnTouchOutside(true); + dialog.setContentView(initView()); + return dialog; + } + + View initView() { + LayoutInflater inflater = LayoutInflater.from(getContext()); + View view = inflater.inflate(R.layout.dialog_custom_time_picker, null); + Context context = view.getContext(); + TextView cancel = view.findViewById(R.id.tv_cancel); + cancel.setOnClickListener(this); + cancel.setTextColor(context.getResources().getColor(R.color.color_999999)); + TextView sure = view.findViewById(R.id.tv_sure); + sure.setOnClickListener(this); + sure.setTextColor(context.getResources().getColor(R.color.app_248cfe)); + TextView title = view.findViewById(R.id.tv_title); + View toolbar = view.findViewById(R.id.toolbar); + + rlWeekGroup = view.findViewById(R.id.rl_week_group); + tvWeekFirstDay = view.findViewById(R.id.tv_week_first_day); + tvWeekLastDay = view.findViewById(R.id.tv_week_last_day); + tvWeekFirstDay.setSelected(true); + tvWeekLastDay.setSelected(mIsWeek); + rlWeekGroup.setVisibility(mIsWeek || isDay ? View.VISIBLE : View.GONE); + + if (isDay) { + if (mDayFirstTime != mDayLastTime) { + tvWeekLastDay.setText(TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + } else { + tvWeekLastDay.setText(defDayEndText); + } + tvWeekFirstDay.setOnClickListener(v -> { + tvWeekFirstDay.setSelected(true); + tvWeekLastDay.setSelected(false); + }); + tvWeekLastDay.setOnClickListener(v -> { + tvWeekFirstDay.setSelected(false); + tvWeekLastDay.setSelected(true); + }); + } + title.setText(mPickerConfig.mTitleString); + title.setTextColor(context.getResources().getColor(R.color.color_333333)); + cancel.setText(mPickerConfig.mCancelString); + sure.setText(mPickerConfig.mSureString); + + if (isMonth) { + mPickerConfig.mType = Type.YEAR_MONTH; + } + toolbar.setBackgroundColor(context.getResources().getColor(R.color.white)); + + mTimeWheel = new TimeWheel(view, mPickerConfig,mTestSize); + Calendar currCalendar = Calendar.getInstance(); + if (mFirstMs <= 0) { + mFirstMs = System.currentTimeMillis(); + } + currCalendar.setTimeInMillis(mFirstMs); + setWeekView(currCalendar); + Calendar calendar = Calendar.getInstance(); + mTimeWheel.setOnTimeChangeListener(() -> { + int year = mTimeWheel.getCurrentYear(); + int month = mTimeWheel.getCurrentMonth(); + int day = mTimeWheel.getCurrentDay(); + calendar.set(Calendar.YEAR, year); + calendar.set(Calendar.MONTH, month - 1); + calendar.set(Calendar.DAY_OF_MONTH, day); + setWeekView(calendar); + }); + + return view; + } + + private void setWeekView(Calendar calendar) { + long firstDayTime; + + if (isDay) { + if (tvWeekFirstDay.isSelected()) { + mDayFirstTime = calendar.getTimeInMillis(); + tvWeekFirstDay.setText(TimeUtils.getDateTimeString(mDayFirstTime, TimeUtils.DATE_FORMAT)); + } else { + mDayLastTime = calendar.getTimeInMillis(); + tvWeekLastDay.setText(TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + } + } else { + //获取周几 1-7 + int currweekDay = calendar.get(Calendar.DAY_OF_WEEK); + if (currweekDay == 1) {//周日 + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (7 - currweekDay)); + } else { + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (currweekDay - 2)); + } + + String first = TimeUtils.getDateTimeString(firstDayTime, TimeUtils.DATE_FORMAT); + mWeekFirstDay = first; + tvWeekFirstDay.setText(first); + + //周日 + long lastDayTime = firstDayTime + (TimeUtils.MILLIS_OF_A_DAY * 6); + String last = TimeUtils.getDateTimeString(lastDayTime, TimeUtils.DATE_FORMAT); + mWeekLastDay = last; + tvWeekLastDay.setText(last); + } + } + + @Override + public void onClick(View v) { + int i = v.getId(); + if (i == R.id.tv_cancel) { + dismiss(); + } else if (i == R.id.tv_sure) { + sureClicked(); + } + } + + /* + * @desc This method returns the current milliseconds. If current milliseconds is not set, + * this will return the system milliseconds. + * @param none + * @return long - the current milliseconds. + */ + public long getCurrentMillSeconds() { + if (mCurrentMillSeconds == 0) + return System.currentTimeMillis(); + + return mCurrentMillSeconds; + } + + /* + * @desc This method is called when onClick method is invoked by sure button. A Calendar instance is created and + * initialized. + * @param none + * @return none + */ + void sureClicked() { + Calendar calendar = Calendar.getInstance(); + calendar.clear(); + + calendar.set(Calendar.YEAR, mTimeWheel.getCurrentYear()); + calendar.set(Calendar.MONTH, mTimeWheel.getCurrentMonth() - 1); + calendar.set(Calendar.DAY_OF_MONTH, mTimeWheel.getCurrentDay()); + calendar.set(Calendar.HOUR_OF_DAY, mTimeWheel.getCurrentHour()); + calendar.set(Calendar.MINUTE, mTimeWheel.getCurrentMinute()); + + mCurrentMillSeconds = calendar.getTimeInMillis(); + + if (mTimePickerListener != null) { + if (isDay) { + if (defDayEndText.equals(tvWeekLastDay.getText().toString())) { + mDayLastTime = mDayFirstTime; + } + if (mDayFirstTime > mDayLastTime) { + SingleToastUtil.showToast(ResUtil.getString(R.string.view_dialog_timepickerdialog_02)); + return; + } + if (mDayLastTime - mDayFirstTime > 180 * TimeUtils.MILLIS_OF_A_DAY) { + SingleToastUtil.showToast(ResUtil.getString(R.string.view_dialog_timepickerdialog_03)); + return; + } + mTimePickerListener.getTime(mCurrentMillSeconds, + TimeUtils.getDateTimeString(mDayFirstTime, TimeUtils.DATE_FORMAT), + TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + + } else { + mTimePickerListener.getTime(mCurrentMillSeconds, mWeekFirstDay, mWeekLastDay); + } + } + + dismiss(); + } + + public interface TimePickerListener { + void getTime(long chooseTime, String weekFirstDay, String weekLastDay); + } + + public static class Builder { + PickerConfig mPickerConfig; + long firstMs; + boolean mIsWeek; + boolean isMonth; + boolean isDay; + private long mDayFirstTime; + private long mDayLastTime; + + public Builder() { + mPickerConfig = new PickerConfig(); + } + + public Builder setType(Type type) { + mPickerConfig.mType = type; + return this; + } + + public Builder setThemeColor(int color) { + mPickerConfig.mThemeColor = color; + return this; + } + + public Builder setCancelStringId(String left) { + mPickerConfig.mCancelString = left; + return this; + } + + public Builder setSureStringId(String right) { + mPickerConfig.mSureString = right; + return this; + } + + public Builder setTitleStringId(String title) { + mPickerConfig.mTitleString = title; + return this; + } + + public Builder setToolBarTextColor(int color) { + mPickerConfig.mToolBarTVColor = color; + return this; + } + + public Builder setWheelItemTextNormalColor(int color) { + mPickerConfig.mWheelTVNormalColor = color; + return this; + } + + public Builder setWheelItemTextSelectorColor(int color) { + mPickerConfig.mWheelTVSelectorColor = color; + return this; + } + + public Builder setWheelItemTextSize(int size) { + mPickerConfig.mWheelTVSize = size; + return this; + } + + public Builder setCyclic(boolean cyclic) { + mPickerConfig.cyclic = cyclic; + return this; + } + + public Builder setMinMillseconds(long millseconds) { + mPickerConfig.mMinCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setMaxMillseconds(long millseconds) { + mPickerConfig.mMaxCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setCurrentMillseconds(long millseconds) { + firstMs = millseconds; + mPickerConfig.mCurrentCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setYearText(String year) { + mPickerConfig.mYear = year; + return this; + } + + public Builder setMonthText(String month) { + mPickerConfig.mMonth = month; + return this; + } + + public Builder setDayText(String day) { + mPickerConfig.mDay = day; + return this; + } + + public Builder setHourText(String hour) { + mPickerConfig.mHour = hour; + return this; + } + + public Builder setMinuteText(String minute) { + mPickerConfig.mMinute = minute; + return this; + } + + public Builder setCallBack(OnDateSetListener listener) { + mPickerConfig.mCallBack = listener; + return this; + } + + public Builder setmIsWeek(boolean isWeek) { + mIsWeek = isWeek; + return this; + } + + public Builder setIsMonth(boolean isMonth) { + this.isMonth = isMonth; + return this; + } + + public Builder setIsDay(boolean isDay) { + this.isDay = isDay; + return this; + } + + public Builder setDayFirstTime(long dayFirstTime) { + this.mDayFirstTime = dayFirstTime; + return this; + } + + public Builder setDayLastTime(long dayLastTime) { + this.mDayLastTime = dayLastTime; + return this; + } + + public TimePickerDialog build() { + return newInstance(mPickerConfig, firstMs, mIsWeek, isMonth, isDay, mDayFirstTime, mDayLastTime); + } + + } + + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerGoldDialog.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerGoldDialog.java new file mode 100644 index 0000000..922d5a3 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimePickerGoldDialog.java @@ -0,0 +1,440 @@ +package com.chwl.app.module_hall.hall.view.dialog; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; + +import com.jzxiang.pickerview.config.PickerConfig; +import com.jzxiang.pickerview.data.Type; +import com.jzxiang.pickerview.data.WheelCalendar; +import com.jzxiang.pickerview.listener.OnDateSetListener; +import com.chwl.app.R; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; +import com.chwl.library.utils.TimeUtils; + +import java.util.Calendar; + +/** + * Created by jzxiang on 16/4/19. + */ +public class TimePickerGoldDialog extends DialogFragment implements View.OnClickListener { + PickerConfig mPickerConfig; + RelativeLayout rlWeekGroup; + TextView tvWeekFirstDay; + TextView tvWeekLastDay; + private TimeWheel mTimeWheel; + private long mCurrentMillSeconds; + private long mFirstMs; + private TimePickerListener mTimePickerListener; + private String mWeekFirstDay; + private String mWeekLastDay; + private long mWeekFirstDayNow; + private long mWeekLastDayNow; + + private long mDayFirstTime; + private long mDayLastTime; + private final String defDayEndText = ResUtil.getString(R.string.view_dialog_timepickerdialog_01); + + /** + * 显示周区间 + */ + private boolean mIsWeek; + private boolean isMonth; + private boolean isDay; + + private static TimePickerGoldDialog newInstance(PickerConfig pickerConfig, long firstMs, boolean isWeek, boolean isMonth, boolean isDay, long dayFirstTime, long dayLastTime) { + TimePickerGoldDialog timePickerDialog = new TimePickerGoldDialog(); + timePickerDialog.initialize(pickerConfig, firstMs, isWeek, isMonth, isDay, dayFirstTime, dayLastTime); + return timePickerDialog; + } + + public void setmTimePickerListener(TimePickerListener mTimePickerListener) { + this.mTimePickerListener = mTimePickerListener; + } + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + Activity activity = getActivity(); + activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); + + } + + @Override + public void onResume() { + super.onResume(); + + Window window = getDialog().getWindow(); + window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);//Here! + window.setGravity(Gravity.BOTTOM); + } + + private void initialize(PickerConfig pickerConfig, long firstMs, boolean isWeek, boolean isMonth, boolean isDay, long dayFirstTime, long dayLastTime) { + mPickerConfig = pickerConfig; + mFirstMs = firstMs; + mIsWeek = isWeek; + this.isMonth = isMonth; + this.isDay = isDay; + this.mDayFirstTime = dayFirstTime; + this.mDayLastTime = dayLastTime; + } + + @NonNull + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + Dialog dialog = new Dialog(getActivity(), R.style.Dialog_NoTitle); + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + dialog.setCancelable(true); + dialog.setCanceledOnTouchOutside(true); + dialog.setContentView(initView()); + return dialog; + } + + View initView() { + LayoutInflater inflater = LayoutInflater.from(getContext()); + View view = inflater.inflate(R.layout.dialog_custom_time_picker, null); + Context context = view.getContext(); + TextView cancel = view.findViewById(R.id.tv_cancel); + cancel.setOnClickListener(this); + cancel.setTextColor(context.getResources().getColor(R.color.color_999999)); + TextView sure = view.findViewById(R.id.tv_sure); + sure.setOnClickListener(this); + sure.setTextColor(context.getResources().getColor(R.color.app_248cfe)); + TextView title = view.findViewById(R.id.tv_title); + View toolbar = view.findViewById(R.id.toolbar); + + rlWeekGroup = view.findViewById(R.id.rl_week_group); + tvWeekFirstDay = view.findViewById(R.id.tv_week_first_day); + tvWeekLastDay = view.findViewById(R.id.tv_week_last_day); + tvWeekFirstDay.setSelected(true); + tvWeekLastDay.setSelected(mIsWeek); + rlWeekGroup.setVisibility(mIsWeek || isDay ? View.VISIBLE : View.GONE); + + if (isDay) { + if (mDayFirstTime != mDayLastTime) { + tvWeekLastDay.setText(TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + } else { + tvWeekLastDay.setText(defDayEndText); + } + tvWeekFirstDay.setOnClickListener(v -> { + tvWeekFirstDay.setSelected(true); + tvWeekLastDay.setSelected(false); + }); + tvWeekLastDay.setOnClickListener(v -> { + tvWeekFirstDay.setSelected(false); + tvWeekLastDay.setSelected(true); + }); + } + title.setText(mPickerConfig.mTitleString); + title.setTextColor(context.getResources().getColor(R.color.color_333333)); + cancel.setText(mPickerConfig.mCancelString); + sure.setText(mPickerConfig.mSureString); + + if (isMonth) { + mPickerConfig.mType = Type.YEAR_MONTH; + } + toolbar.setBackgroundColor(context.getResources().getColor(R.color.white)); + + mTimeWheel = new TimeWheel(view, mPickerConfig); + //设置现在的时间 + Calendar currCalendarNow = Calendar.getInstance(); + currCalendarNow.setTimeInMillis(System.currentTimeMillis()); + setWeekViewNow(currCalendarNow); + Calendar currCalendar = Calendar.getInstance(); + if (mFirstMs <= 0) { + mFirstMs = System.currentTimeMillis(); + } + currCalendar.setTimeInMillis(mFirstMs); + setWeekView(currCalendar); + Calendar calendar = Calendar.getInstance(); + mTimeWheel.setOnTimeChangeListener(() -> { + int year = mTimeWheel.getCurrentYear(); + int month = mTimeWheel.getCurrentMonth(); + int day = mTimeWheel.getCurrentDay(); + calendar.set(Calendar.YEAR, year); + calendar.set(Calendar.MONTH, month - 1); + calendar.set(Calendar.DAY_OF_MONTH, day); + setWeekView(calendar); + }); + + return view; + } + + private void setWeekViewNow(Calendar calendar) { + long firstDayTime; + //获取周几 1-7 + int currweekDay = calendar.get(Calendar.DAY_OF_WEEK); + if (currweekDay == 1) {//周日 + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (7 - currweekDay)); + } else { + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (currweekDay - 2)); + } + + mWeekFirstDayNow = firstDayTime; + + //周日 + mWeekLastDayNow = firstDayTime + (TimeUtils.MILLIS_OF_A_DAY * 6); + } + + private void setWeekView(Calendar calendar) { + long firstDayTime; + + if (isDay) { + if (tvWeekFirstDay.isSelected()) { + mDayFirstTime = calendar.getTimeInMillis(); + tvWeekFirstDay.setText(TimeUtils.getDateTimeString(mDayFirstTime, TimeUtils.DATE_FORMAT)); + } else { + mDayLastTime = calendar.getTimeInMillis(); + tvWeekLastDay.setText(TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + } + } else { + //获取周几 1-7 + int currweekDay = calendar.get(Calendar.DAY_OF_WEEK); + if (currweekDay == 1) {//周日 + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (7 - currweekDay)); + } else { + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (currweekDay - 2)); + } + + String first = TimeUtils.getDateTimeString(firstDayTime, TimeUtils.DATE_FORMAT); + mWeekFirstDay = first; + tvWeekFirstDay.setText(first); + + //周日 + long lastDayTime = firstDayTime + (TimeUtils.MILLIS_OF_A_DAY * 6); + String last = TimeUtils.getDateTimeString(lastDayTime, TimeUtils.DATE_FORMAT); + mWeekLastDay = last; + tvWeekLastDay.setText(last); + } + } + + @Override + public void onClick(View v) { + int i = v.getId(); + if (i == R.id.tv_cancel) { + dismiss(); + } else if (i == R.id.tv_sure) { + sureClicked(); + } + } + + /* + * @desc This method returns the current milliseconds. If current milliseconds is not set, + * this will return the system milliseconds. + * @param none + * @return long - the current milliseconds. + */ + public long getCurrentMillSeconds() { + if (mCurrentMillSeconds == 0) + return System.currentTimeMillis(); + + return mCurrentMillSeconds; + } + + /* + * @desc This method is called when onClick method is invoked by sure button. A Calendar instance is created and + * initialized. + * @param none + * @return none + */ + void sureClicked() { + Calendar calendar = Calendar.getInstance(); + calendar.clear(); + + calendar.set(Calendar.YEAR, mTimeWheel.getCurrentYear()); + calendar.set(Calendar.MONTH, mTimeWheel.getCurrentMonth() - 1); + calendar.set(Calendar.DAY_OF_MONTH, mTimeWheel.getCurrentDay()); + calendar.set(Calendar.HOUR_OF_DAY, mTimeWheel.getCurrentHour()); + calendar.set(Calendar.MINUTE, mTimeWheel.getCurrentMinute()); + + mCurrentMillSeconds = calendar.getTimeInMillis(); + + if (mTimePickerListener != null) { + if (isDay) { + if (defDayEndText.equals(tvWeekLastDay.getText().toString())) { + mDayLastTime = mDayFirstTime; + } + if (mDayFirstTime > mDayLastTime) { + SingleToastUtil.showToast(ResUtil.getString(R.string.view_dialog_timepickerdialog_02)); + return; + } + if (mDayLastTime - mDayFirstTime > 180 * TimeUtils.MILLIS_OF_A_DAY) { + SingleToastUtil.showToast(ResUtil.getString(R.string.view_dialog_timepickerdialog_03)); + return; + } + mTimePickerListener.getTime(mCurrentMillSeconds, + TimeUtils.getDateTimeString(mDayFirstTime, TimeUtils.DATE_FORMAT), + TimeUtils.getDateTimeString(mDayLastTime, TimeUtils.DATE_FORMAT)); + + } else { + if (mWeekFirstDayNow - TimeUtils.MILLIS_OF_A_DAY * 84 > mCurrentMillSeconds || mWeekLastDayNow < mCurrentMillSeconds) { + SingleToastUtil.showToast(ResUtil.getString(R.string.only_can_see_three_month_data)); + return; + } + mTimePickerListener.getTime(mCurrentMillSeconds, mWeekFirstDay, mWeekLastDay); + } + } + + dismiss(); + } + + public interface TimePickerListener { + void getTime(long chooseTime, String weekFirstDay, String weekLastDay); + } + + public static class Builder { + PickerConfig mPickerConfig; + long firstMs; + boolean mIsWeek; + boolean isMonth; + boolean isDay; + private long mDayFirstTime; + private long mDayLastTime; + + public Builder() { + mPickerConfig = new PickerConfig(); + } + + public Builder setType(Type type) { + mPickerConfig.mType = type; + return this; + } + + public Builder setThemeColor(int color) { + mPickerConfig.mThemeColor = color; + return this; + } + + public Builder setCancelStringId(String left) { + mPickerConfig.mCancelString = left; + return this; + } + + public Builder setSureStringId(String right) { + mPickerConfig.mSureString = right; + return this; + } + + public Builder setTitleStringId(String title) { + mPickerConfig.mTitleString = title; + return this; + } + + public Builder setToolBarTextColor(int color) { + mPickerConfig.mToolBarTVColor = color; + return this; + } + + public Builder setWheelItemTextNormalColor(int color) { + mPickerConfig.mWheelTVNormalColor = color; + return this; + } + + public Builder setWheelItemTextSelectorColor(int color) { + mPickerConfig.mWheelTVSelectorColor = color; + return this; + } + + public Builder setWheelItemTextSize(int size) { + mPickerConfig.mWheelTVSize = size; + return this; + } + + public Builder setCyclic(boolean cyclic) { + mPickerConfig.cyclic = cyclic; + return this; + } + + public Builder setMinMillseconds(long millseconds) { + mPickerConfig.mMinCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setMaxMillseconds(long millseconds) { + mPickerConfig.mMaxCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setCurrentMillseconds(long millseconds) { + firstMs = millseconds; + mPickerConfig.mCurrentCalendar = new WheelCalendar(millseconds); + return this; + } + + public Builder setYearText(String year) { + mPickerConfig.mYear = year; + return this; + } + + public Builder setMonthText(String month) { + mPickerConfig.mMonth = month; + return this; + } + + public Builder setDayText(String day) { + mPickerConfig.mDay = day; + return this; + } + + public Builder setHourText(String hour) { + mPickerConfig.mHour = hour; + return this; + } + + public Builder setMinuteText(String minute) { + mPickerConfig.mMinute = minute; + return this; + } + + public Builder setCallBack(OnDateSetListener listener) { + mPickerConfig.mCallBack = listener; + return this; + } + + public Builder setmIsWeek(boolean isWeek) { + mIsWeek = isWeek; + return this; + } + + public Builder setIsMonth(boolean isMonth) { + this.isMonth = isMonth; + return this; + } + + public Builder setIsDay(boolean isDay) { + this.isDay = isDay; + return this; + } + + public Builder setDayFirstTime(long dayFirstTime) { + this.mDayFirstTime = dayFirstTime; + return this; + } + + public Builder setDayLastTime(long dayLastTime) { + this.mDayLastTime = dayLastTime; + return this; + } + + public TimePickerGoldDialog build() { + return newInstance(mPickerConfig, firstMs, mIsWeek, isMonth, isDay, mDayFirstTime, mDayLastTime); + } + + } + + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimeWheel.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimeWheel.java new file mode 100644 index 0000000..9255640 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/dialog/TimeWheel.java @@ -0,0 +1,323 @@ +package com.chwl.app.module_hall.hall.view.dialog; + +import android.content.Context; +import android.view.View; + +import com.chwl.app.R; +import com.jzxiang.pickerview.config.PickerConfig; +import com.jzxiang.pickerview.data.source.TimeRepository; +import com.jzxiang.pickerview.utils.PickerContants; +import com.jzxiang.pickerview.utils.Utils; +import com.jzxiang.pickerview.wheel.OnWheelChangedListener; +import com.jzxiang.pickerview.wheel.WheelView; + +import java.util.Calendar; + +/** + * + * Created by jzxiang on 16/4/20. + */ +public class TimeWheel { + Context mContext; + + WheelView year, month, day, hour, minute; + CustomizeWheelAdapter mYearAdapter, mMonthAdapter, mDayAdapter, mHourAdapter, mMinuteAdapter; + + PickerConfig mPickerConfig; + TimeRepository mRepository; + + float mTextSize = 13f; + + private int currYear; + private int currMonth; + private int currDay; + + OnWheelChangedListener yearListener = new OnWheelChangedListener() { + @Override + public void onChanged(WheelView wheel, int oldValue, int newValue) { + currYear = newValue; + updateMonths(); + if (onTimeChangeListener != null) { + onTimeChangeListener.onChange(); + } + } + }; + OnWheelChangedListener monthListener = new OnWheelChangedListener() { + @Override + public void onChanged(WheelView wheel, int oldValue, int newValue) { + currMonth = newValue; + updateDays(); + if (onTimeChangeListener != null) { + onTimeChangeListener.onChange(); + } + } + }; + OnWheelChangedListener dayListener = new OnWheelChangedListener() { + @Override + public void onChanged(WheelView wheel, int oldValue, int newValue) { + currDay = newValue; + updateHours(); + if (onTimeChangeListener != null) { + onTimeChangeListener.onChange(); + } + } + }; + OnWheelChangedListener minuteListener = new OnWheelChangedListener() { + @Override + public void onChanged(WheelView wheel, int oldValue, int newValue) { + updateMinutes(); + if (onTimeChangeListener != null) { + onTimeChangeListener.onChange(); + } + } + }; + + public TimeWheel(View view, PickerConfig pickerConfig) { + mPickerConfig = pickerConfig; + + mRepository = new TimeRepository(pickerConfig); + mContext = view.getContext(); + initialize(view); + } + + public TimeWheel(View view, PickerConfig pickerConfig,float textSize) { + mPickerConfig = pickerConfig; + mTextSize = textSize; + mRepository = new TimeRepository(pickerConfig); + mContext = view.getContext(); + initialize(view); + } + + private OnTimeChangeListener onTimeChangeListener; + + public void setOnTimeChangeListener(OnTimeChangeListener onTimeChangeListener) { + this.onTimeChangeListener = onTimeChangeListener; + } + + public interface OnTimeChangeListener { + void onChange(); + } + + public void initialize(View view) { + initView(view); + initYear(); + initMonth(); + initDay(); + initHour(); + initMinute(); + } + + + void initView(View view) { + year = (WheelView) view.findViewById(R.id.year); + month = (WheelView) view.findViewById(R.id.month); + day = (WheelView) view.findViewById(R.id.day); + hour = (WheelView) view.findViewById(R.id.hour); + minute = (WheelView) view.findViewById(R.id.minute); + + switch (mPickerConfig.mType) { + case ALL: + + break; + case YEAR_MONTH_DAY: + Utils.hideViews(hour, minute); + day.setVisibility(View.VISIBLE); + break; + case YEAR_MONTH: + Utils.hideViews(day, hour, minute); + break; + case MONTH_DAY_HOUR_MIN: + Utils.hideViews(year,minute); + break; + case HOURS_MINS: + Utils.hideViews(year, month, day); + break; + case YEAR: + Utils.hideViews(month, day, hour, minute); + break; + } + + year.addChangingListener(yearListener); + year.addChangingListener(monthListener); + year.addChangingListener(dayListener); + year.addChangingListener(minuteListener); + month.addChangingListener(monthListener); + month.addChangingListener(dayListener); + month.addChangingListener(minuteListener); + day.addChangingListener(dayListener); + day.addChangingListener(minuteListener); + hour.addChangingListener(minuteListener); + } + + void initYear() { + int minYear = mRepository.getMinYear(); + int maxYear = mRepository.getMaxYear(); + + mYearAdapter = new CustomizeWheelAdapter(mContext, minYear, maxYear, PickerContants.FORMAT, mPickerConfig.mYear); + mYearAdapter.setMTextSize(mTextSize); + mYearAdapter.setConfig(mPickerConfig); + year.setViewAdapter(mYearAdapter); + year.setCurrentItem(mRepository.getDefaultCalendar().year - minYear); + } + + void initMonth() { + updateMonths(); + int curYear = getCurrentYear(); + int minMonth = mRepository.getMinMonth(curYear); + month.setCurrentItem(mRepository.getDefaultCalendar().month - minMonth); + month.setCyclic(mPickerConfig.cyclic); + } + + void initDay() { + updateDays(); + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + + int minDay = mRepository.getMinDay(curYear, curMonth); + day.setCurrentItem(mRepository.getDefaultCalendar().day - minDay); + day.setCyclic(mPickerConfig.cyclic); + } + + void initHour() { + updateHours(); + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + int curDay = getCurrentDay(); + + int minHour = mRepository.getMinHour(curYear, curMonth, curDay); + hour.setCurrentItem(mRepository.getDefaultCalendar().hour - minHour); + hour.setCyclic(mPickerConfig.cyclic); + } + + void initMinute() { + updateMinutes(); + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + int curDay = getCurrentDay(); + int curHour = getCurrentHour(); + int minMinute = mRepository.getMinMinute(curYear, curMonth, curDay, curHour); + + minute.setCurrentItem(mRepository.getDefaultCalendar().minute - minMinute); + minute.setCyclic(mPickerConfig.cyclic); + + } + + void updateMonths() { + if (month.getVisibility() == View.GONE) + return; + + int curYear = getCurrentYear(); + int minMonth = mRepository.getMinMonth(curYear); + int maxMonth = mRepository.getMaxMonth(curYear); + mMonthAdapter = new CustomizeWheelAdapter(mContext, minMonth, maxMonth, PickerContants.FORMAT, mPickerConfig.mMonth); + mMonthAdapter.setMTextSize(mTextSize); + mMonthAdapter.setConfig(mPickerConfig); + month.setViewAdapter(mMonthAdapter); + + if (mRepository.isMinYear(curYear)) { + month.setCurrentItem(0, false); + } + } + + void updateDays() { + if (day.getVisibility() == View.GONE) + return; + + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + year.getCurrentItem()); + calendar.set(Calendar.MONTH, curMonth); + + int maxDay = mRepository.getMaxDay(curYear, curMonth); + int minDay = mRepository.getMinDay(curYear, curMonth); + mDayAdapter = new CustomizeWheelAdapter(mContext, minDay, maxDay, PickerContants.FORMAT, mPickerConfig.mDay); + mDayAdapter.setMTextSize(mTextSize); + mDayAdapter.setConfig(mPickerConfig); + day.setViewAdapter(mDayAdapter); + + if (mRepository.isMinMonth(curYear, curMonth)) { + day.setCurrentItem(0, true); + } + + int dayCount = mDayAdapter.getItemsCount(); + if (day.getCurrentItem() >= dayCount) { + day.setCurrentItem(dayCount - 1, true); + } + } + + void updateHours() { + if (hour.getVisibility() == View.GONE) + return; + + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + int curDay = getCurrentDay(); + + int minHour = mRepository.getMinHour(curYear, curMonth, curDay); + int maxHour = mRepository.getMaxHour(curYear, curMonth, curDay); + + mHourAdapter = new CustomizeWheelAdapter(mContext, minHour, maxHour, PickerContants.FORMAT, mPickerConfig.mHour); + mHourAdapter.setMTextSize(mTextSize); + mHourAdapter.setConfig(mPickerConfig); + hour.setViewAdapter(mHourAdapter); + + if (mRepository.isMinDay(curYear, curMonth, curDay)) + hour.setCurrentItem(0, false); + } + + void updateMinutes() { + if (minute.getVisibility() == View.GONE) + return; + + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + int curDay = getCurrentDay(); + int curHour = getCurrentHour(); + + int minMinute = mRepository.getMinMinute(curYear, curMonth, curDay, curHour); + int maxMinute = mRepository.getMaxMinute(curYear, curMonth, curDay, curHour); + + mMinuteAdapter = new CustomizeWheelAdapter(mContext, minMinute, maxMinute, PickerContants.FORMAT, mPickerConfig.mMinute); + mMinuteAdapter.setMTextSize(mTextSize); + mMinuteAdapter.setConfig(mPickerConfig); + minute.setViewAdapter(mMinuteAdapter); + + if (mRepository.isMinHour(curYear, curMonth, curDay, curHour)) + minute.setCurrentItem(0, false); + } + + public int getCurrentYear() { + return year.getCurrentItem() + mRepository.getMinYear(); + } + + public int getCurrentMonth() { + int curYear = getCurrentYear(); + return month.getCurrentItem() + +mRepository.getMinMonth(curYear); + } + + public int getCurrentDay() { + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + return day.getCurrentItem() + mRepository.getMinDay(curYear, curMonth); + } + + public int getCurrentHour() { + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + int curDay = getCurrentDay(); + return hour.getCurrentItem() + mRepository.getMinHour(curYear, curMonth, curDay); + } + + public int getCurrentMinute() { + int curYear = getCurrentYear(); + int curMonth = getCurrentMonth(); + int curDay = getCurrentDay(); + int curHour = getCurrentHour(); + + return minute.getCurrentItem() + mRepository.getMinMinute(curYear, curMonth, curDay, curHour); + } + + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/indicator/StatisticsIndicatorAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/indicator/StatisticsIndicatorAdapter.java new file mode 100644 index 0000000..ec6e334 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/hall/view/indicator/StatisticsIndicatorAdapter.java @@ -0,0 +1,83 @@ +package com.chwl.app.module_hall.hall.view.indicator; + +import android.content.Context; +import android.view.ViewGroup; +import android.widget.FrameLayout; + +import androidx.core.content.ContextCompat; + +import com.chwl.app.R; +import com.chwl.app.ui.widget.XRecyclerView.ScaleTransitionPagerTitleView; +import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil; +import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter; +import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator; +import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView; +import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator; + +import java.util.ArrayList; +import java.util.List; + +/** + * 收入统计指示器 + * Created by lvzebiao on 2019/1/2. + */ + +public class StatisticsIndicatorAdapter extends CommonNavigatorAdapter{ + + private List tagList; + private int colorLineBottom; + + public StatisticsIndicatorAdapter(List tagList, int colorLineBottom) { + this.tagList = tagList; + if (this.tagList == null) { + this.tagList = new ArrayList<>(); + } + this.colorLineBottom = colorLineBottom; + } + + @Override + public int getCount() { + return tagList.size(); + } + + @Override + public IPagerTitleView getTitleView(Context context, int index) { + ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true); + scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.text_secondary_4f516a)); + scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.text_title_color)); + scaleTransitionPagerTitleView.setMinScale(1f); + scaleTransitionPagerTitleView.setTextSize(16); + scaleTransitionPagerTitleView.setText(tagList.get(index)); + scaleTransitionPagerTitleView.setOnClickListener(view -> { + if (mOnItemSelectListener != null) { + mOnItemSelectListener.onItemSelect(index); + } + }); + return scaleTransitionPagerTitleView; + } + + @Override + public IPagerIndicator getIndicator(Context context) { + LinePagerIndicator indicator = new LinePagerIndicator(context); + indicator.setMode(LinePagerIndicator.MODE_EXACTLY); + indicator.setLineHeight(UIUtil.dip2px(context, 3)); + indicator.setRoundRadius(UIUtil.dip2px(context, 1.5f)); + indicator.setLineWidth(UIUtil.dip2px(context, 25)); + indicator.setColors(context.getResources().getColor(R.color.app_248cfe)); + FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT); + lp.bottomMargin = UIUtil.dip2px(context, colorLineBottom); + indicator.setLayoutParams(lp); + return indicator; + } + + private OnItemSelectListener mOnItemSelectListener; + + public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) { + mOnItemSelectListener = onItemSelectListener; + } + + public interface OnItemSelectListener { + void onItemSelect(int position); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/im/NimHelper.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/NimHelper.java new file mode 100644 index 0000000..1c62edc --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/NimHelper.java @@ -0,0 +1,98 @@ +package com.chwl.app.module_hall.im; + +import android.text.TextUtils; + +import com.chwl.core.module_hall.im.FamilyImMsgInfo; +import com.netease.nim.uikit.api.NimUIKit; +import com.netease.nimlib.sdk.NIMClient; +import com.netease.nimlib.sdk.msg.MsgService; +import com.netease.nimlib.sdk.msg.model.IMMessage; +import com.netease.nimlib.sdk.team.model.Team; +import com.trello.rxlifecycle3.LifecycleProvider; +import com.chwl.app.R; +import com.chwl.core.manager.IMNetEaseManager; +import com.chwl.core.module_hall.im.ClanImMsgInfo; +import com.chwl.core.module_hall.im.HallImMsgInfo; +import com.chwl.library.utils.ResUtil; + +import java.util.Map; + +import io.reactivex.Single; +import io.reactivex.SingleOnSubscribe; + +/** + * + * Created by lvzebiao on 2019/1/8. + */ + +public class NimHelper { + + /** + * 更新家族消息到本地数据库 + * + * @param uuid 消息 UUID + * @param info 家族消息实体 + */ + public static void updateFamilyMsgInfoMessage(String uuid, FamilyImMsgInfo info) { + IMMessage message = IMNetEaseManager.get().queryMessageByUuid(uuid); + if (message != null) { + Map localExtension = FamilyImMsgInfo.convertToMap(info); + message.setLocalExtension(localExtension); + NIMClient.getService(MsgService.class) + .updateIMMessage(message); + } + } + + /** + * 更新模厅消息到本地数据库 + * + * @param uuid 消息 UUID + * @param info 模厅消息实体 + */ + public static void updateHallMsgInfoMessage(String uuid, HallImMsgInfo info) { + IMMessage message = IMNetEaseManager.get().queryMessageByUuid(uuid); + if (message != null) { + Map localExtension = HallImMsgInfo.convertToMap(info); + message.setLocalExtension(localExtension); + NIMClient.getService(MsgService.class) + .updateIMMessage(message); + } + } + + /** + * 更新公会消息到本地数据库 + * + * @param uuid 消息 UUID + * @param info 模厅消息实体 + */ + public static void updateClanMsgInfoMessage(String uuid, ClanImMsgInfo info) { + IMMessage message = IMNetEaseManager.get().queryMessageByUuid(uuid); + if (message != null) { + Map localExtension = ClanImMsgInfo.convertToMap(info); + message.setLocalExtension(localExtension); + NIMClient.getService(MsgService.class) + .updateIMMessage(message); + } + } + + /**云信sdk获取群信息*/ + public static Single getTeamById(LifecycleProvider provider, String tid) { + if (TextUtils.isEmpty(tid)) { + return Single.error(new Throwable(ResUtil.getString(R.string.module_hall_im_nimhelper_01))); + } + return Single.create((SingleOnSubscribe) emitter -> { + Team team = NimUIKit.getTeamProvider().getTeamById(tid); + if (team != null) { + emitter.onSuccess(team); + } else { + NimUIKit.getTeamProvider().fetchTeamById(tid, (success, result, code) -> { + if (success && result != null) { + emitter.onSuccess(result); + } else { + emitter.onError(new Throwable(ResUtil.getString(R.string.module_hall_im_nimhelper_02))); + } + }); + } + }).compose(provider.bindToLifecycle()); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/im/dialog/AgreeApplyDialog.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/dialog/AgreeApplyDialog.java new file mode 100644 index 0000000..4870c66 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/dialog/AgreeApplyDialog.java @@ -0,0 +1,92 @@ +package com.chwl.app.module_hall.im.dialog; + +import android.content.Context; +import android.os.Bundle; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.style.ForegroundColorSpan; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.appcompat.widget.AppCompatTextView; +import androidx.core.content.ContextCompat; + +import com.chwl.app.R; +import com.chwl.app.ui.widget.dialog.BaseDialog; + +/** + * @author wushaocheng + * @Description 同意申请 + * @Date 2013/2/23 + */ +public class AgreeApplyDialog extends BaseDialog { + + public AgreeApplyDialog(Context context) { + super(context, R.style.dialog); + init(); + } + + private void init() { + this.setCancelable(true); + this.setCanceledOnTouchOutside(true); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.layout_agree_apply_dialog); + + AppCompatTextView tvName = findViewById(R.id.tv_tip); + if (tvName != null) { + String tip = getContext().getString(R.string.sure_to_agree_user_join_room); + SpannableStringBuilder builder = new SpannableStringBuilder(tip); + builder.setSpan( + new ForegroundColorSpan(ContextCompat.getColor(getContext(),R.color.color_9168FA)), 2, + 4, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE + ); + tvName.setText(builder); + } + + ImageView close = findViewById(R.id.iv_close); + if (close != null) { + close.setOnClickListener(view -> { + this.dismiss(); + }); + } + + TextView ok = findViewById(R.id.btn_ok); + if (ok != null) { + ok.setOnClickListener(v -> { + this.dismiss(); + if (l != null) { + l.onOk(); + } + }); + } + TextView cancel = findViewById(R.id.btn_cancel); + if (cancel != null) { + cancel.setOnClickListener(v -> { + this.dismiss(); + if (l != null) { + l.onCancel(); + } + }); + } + } + + private OnActionListener l; + + public void setOnActionListener(OnActionListener l) { + this.l = l; + } + + public interface OnActionListener { + default void onOk() { + } + + default void onCancel() { + } + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/im/dialog/RefuseApplyDialog.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/dialog/RefuseApplyDialog.java new file mode 100644 index 0000000..54de893 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/dialog/RefuseApplyDialog.java @@ -0,0 +1,129 @@ +package com.chwl.app.module_hall.im.dialog; + +import android.content.Context; +import android.graphics.Color; +import android.os.Bundle; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.method.LinkMovementMethod; +import android.text.style.ForegroundColorSpan; +import android.view.View; +import android.widget.CheckBox; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.appcompat.widget.AppCompatTextView; +import androidx.core.content.ContextCompat; + +import com.chwl.app.R; +import com.chwl.app.ui.widget.dialog.BaseDialog; + +/** + * @author wushaocheng + * @Description 拒绝申请 + * @Date 2013/2/23 + */ +public class RefuseApplyDialog extends BaseDialog { + + private String titleMsg = ""; + private String tipMsg = ""; + private boolean isInvite = false; + + public RefuseApplyDialog(Context context) { + super(context, R.style.dialog); + init(); + } + + private void init() { + this.setCancelable(true); + this.setCanceledOnTouchOutside(true); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.layout_refuse_apply_dialog); + + AppCompatTextView tv_message = findViewById(R.id.tv_message); + if (tv_message != null) { + tv_message.setText(titleMsg); + } + + AppCompatTextView tvName = findViewById(R.id.tv_tip); + if (tvName != null) { + String tip = tipMsg; + SpannableStringBuilder builder = new SpannableStringBuilder(tip); + builder.setSpan( + new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.color_F92020)), 2, + 4, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE + ); + tvName.setText(builder); + } + + CheckBox checkBox = findViewById(R.id.tv_refuse_tip); + if (checkBox != null) { + if (isInvite) { + checkBox.setVisibility(View.VISIBLE); + checkBox.setHighlightColor(Color.TRANSPARENT); + checkBox.setMovementMethod(new LinkMovementMethod()); + } else { + checkBox.setVisibility(View.GONE); + } + } + + ImageView close = findViewById(R.id.iv_close); + if (close != null) { + close.setOnClickListener(view -> { + this.dismiss(); + }); + } + + TextView ok = findViewById(R.id.btn_ok); + if (ok != null) { + ok.setOnClickListener(v -> { + this.dismiss(); + if (l != null) { + l.onOk(checkBox.isChecked()); + } + }); + } + TextView cancel = findViewById(R.id.btn_cancel); + if (cancel != null) { + cancel.setOnClickListener(v -> { + this.dismiss(); + if (l != null) { + l.onCancel(); + } + }); + } + + } + + public void setTitleMsg(String titleMsg) { + this.titleMsg = titleMsg; + } + + public void setTipMsg(String tipMsg) { + this.tipMsg = tipMsg; + } + + public void setIsInvite(boolean isInvite) { + this.isInvite = isInvite; + } + + private OnActionListener l; + + public void setOnActionListener(OnActionListener l) { + this.l = l; + } + + public interface OnActionListener { + default void onOk(Boolean isCheck) { + } + + default void onCancel() { + } + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/ClanMsgViewHolder.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/ClanMsgViewHolder.java new file mode 100644 index 0000000..aa307af --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/ClanMsgViewHolder.java @@ -0,0 +1,242 @@ +package com.chwl.app.module_hall.im.msgholder; + +import android.graphics.Color; +import android.graphics.Typeface; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.TextPaint; +import android.text.TextUtils; +import android.text.style.ForegroundColorSpan; +import android.text.style.MetricAffectingSpan; +import android.util.TypedValue; +import android.view.View; +import android.widget.TextView; + +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.alibaba.fastjson2.JSON; +import com.coorchice.library.SuperTextView; +import com.example.lib_utils.spannable.SpannableTextBuilder; +import com.netease.nim.uikit.business.session.viewholder.MsgViewHolderBase; +import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter; +import com.netease.nim.uikit.common.util.sys.ScreenUtil; +import com.netease.nimlib.sdk.msg.model.IMMessage; +import com.orhanobut.logger.Logger; +import com.chwl.app.R; +import com.chwl.app.module_hall.im.NimHelper; +import com.chwl.app.ui.im.RouterHandler; +import com.chwl.core.im.custom.bean.CustomAttachment; +import com.chwl.core.manager.IMNetEaseManager; +import com.chwl.core.manager.event.HallInfoChangeEvent; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.ApplyResult; +import com.chwl.core.module_hall.im.ClanAttachment; +import com.chwl.core.module_hall.im.ClanImMsgInfo; +import com.chwl.core.module_hall.im.HallImMsgInfo; +import com.chwl.core.module_hall.im.bean.HallMsgComponent; +import com.chwl.core.module_hall.im.bean.HallMsgLayout; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; + +import org.greenrobot.eventbus.EventBus; + +import java.util.List; +import java.util.Map; +import java.util.Objects; + + +/** + * 公会im消息展示 + * Created by wushaocheng on 2019/1/7. + */ + +public class ClanMsgViewHolder extends MsgViewHolderBase{ + + private ConstraintLayout clContainer; + private TextView tvTitle; + private SuperTextView stvAgree; + private TextView tvContent; + private View llOpLayout; + private SuperTextView stvReject; + private View llResultLayout; + private TextView tvResult; + + public ClanMsgViewHolder(BaseMultiItemFetchLoadAdapter adapter) { + super(adapter); + } + + @Override + protected int getContentResId() { + return R.layout.layout_clan_msg_view_holder; + } + + @Override + protected void inflateContentView() { + tvTitle = findViewById(R.id.tv_title); + stvAgree = findViewById(R.id.stv_agree); + stvReject = findViewById(R.id.stv_reject); + llOpLayout = findViewById(R.id.ll_op_layout); + tvContent = findViewById(R.id.tv_content); + clContainer = findViewById(R.id.cl_container); + llResultLayout = findViewById(R.id.ll_result_layout); + tvResult = findViewById(R.id.tv_result); + } + + @Override + protected void bindContentView() { + clContainer.getLayoutParams().width = ScreenUtil.screenWidth * 240 / 375; + clContainer.setVisibility(View.GONE); + clContainer.setClickable(false); + if (message == null) { + return; + } + IMMessage imMessage = IMNetEaseManager.get().queryMessageByUuid(message.getUuid()); + if (imMessage == null || imMessage.getAttachment() == null) { + return; + } + if (!(imMessage.getAttachment() instanceof ClanAttachment)) { + return; + } + ClanAttachment attachment = (ClanAttachment) imMessage.getAttachment(); + ClanImMsgInfo info = attachment.getClanImMsgInfo(); + if (info == null) { + return; + } + if (message.getLocalExtension() != null) { + info = ClanImMsgInfo.convertMapToObject(message.getLocalExtension()); + } + Logger.i("infoType:" + info.getType()); + clContainer.setVisibility(View.VISIBLE); + if (info.getRouterType() > 0) { + final int routerType = info.getRouterType(); + final String routerValue = info.getRouterValue(); + clContainer.setClickable(true); + clContainer.setOnClickListener(v -> + RouterHandler.handle(context, routerType, routerValue)); + } + stvReject.setVisibility(View.VISIBLE); + int second = attachment.getSecond(); + if (second == CustomAttachment.CUSTOM_MSG_SUB_CLANAPPLY) { //申请加入 + setMsgTypeView(info, second); + } else if (second == CustomAttachment.CUSTOM_MSG_SUB_CLANNORMAL) {//其它文本通知 + llResultLayout.setVisibility(View.GONE); + llOpLayout.setVisibility(View.GONE); + } else { + llResultLayout.setVisibility(View.GONE); + llOpLayout.setVisibility(View.GONE); + } + + HallMsgLayout hallMsgLayout = null; + try { + String layout = info.getLayout(); + if (!TextUtils.isEmpty(layout)) { + hallMsgLayout = JSON.parseObject(layout, HallMsgLayout.class); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + if (hallMsgLayout == null) { + tvTitle.setText(""); + tvContent.setText(""); + return; + } + // title + tvTitle.setText(hallMsgLayout.getTitle().getContent()); + // content + List erbanSysMsgLayoutContent = hallMsgLayout.getContents(); + if (erbanSysMsgLayoutContent != null) { + SpannableTextBuilder textBuilder = new SpannableTextBuilder(tvContent); + for (HallMsgComponent component : erbanSysMsgLayoutContent) { + String msgBody = component.getContent(); + if (Objects.equals(msgBody, "/r/n")) { + msgBody = "\r\n"; + textBuilder.appendText(msgBody,null,null,null,null,null,null); + continue; + } + Integer textColor = null; + Integer textSize = null; + Integer textStyle = null; + if (component.getFontColor() != null) { + try { + textColor = Color.parseColor(component.getFontColor()); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + if (component.getFontSize() > 0) { + textSize = (int) component.getFontSize(); + } + if (component.isFontBold()) { + textStyle = Typeface.BOLD; + } + textBuilder.appendText(msgBody, textColor, null, textSize, textStyle, null, null); + } + textBuilder.apply(); + } + + } + + + private void handleClick(ClanImMsgInfo info, int second) { + stvAgree.setOnClickListener(v -> handleApply(info, second, 1)); + stvReject.setOnClickListener(v -> handleApply(info, second, 0)); + } + + /** + * + * @param type 1同意,0拒绝 + */ + private void handleApply(ClanImMsgInfo info, int second, int type) { + HallModel.get().dealApplyClan(info.getUrl(), type) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + SingleToastUtil.showToast(error); + } + + @Override + public void onSuccess(ApplyResult result) { + if (result.getCode() == ApplyResult.CODE_MSG_OUT_OF_DATE) { + info.setType(ClanImMsgInfo.MSG_TYPE_OUT_OF_DATE); + } else if (result.getCode() == ApplyResult.CODE_MSG_HAS_HANDLE) { + info.setType(ClanImMsgInfo.MSG_TYPE_HAS_HANDLE); + } else { + info.setType(type == 1 ? ClanImMsgInfo.MSG_TYPE_HAS_AGREE : + ClanImMsgInfo.MSG_TYPE_HAS_REJECT); + } + setMsgTypeView(info, second); + Map localExtension = ClanImMsgInfo.convertToMap(info); + message.setLocalExtension(localExtension); + updateMessageToLocal(info); + } + }); + } + + private void updateMessageToLocal(ClanImMsgInfo info) { + NimHelper.updateClanMsgInfoMessage(message.getUuid(), info); + } + + private void setMsgTypeView(ClanImMsgInfo info, int second) { + llResultLayout.setVisibility(View.VISIBLE); + llOpLayout.setVisibility(View.GONE); + if (info.getType() == ClanImMsgInfo.MSG_TYPE_HAS_AGREE) {//已同意 + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_01)); + tvResult.setTextColor(Color.parseColor("#09BB07")); + } else if (info.getType() == ClanImMsgInfo.MSG_TYPE_HAS_REJECT) {//已拒绝 + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_02)); + tvResult.setTextColor(Color.parseColor("#FF3852")); + } else if (info.getType() == ClanImMsgInfo.MSG_TYPE_OUT_OF_DATE) {//已过期 + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_03)); + tvResult.setTextColor(Color.parseColor("#333333")); + } else if (info.getType() == ClanImMsgInfo.MSG_TYPE_HAS_HANDLE) {//已处理 + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_04)); + tvResult.setTextColor(Color.parseColor("#333333")); + } else { + llResultLayout.setVisibility(View.GONE); + llOpLayout.setVisibility(View.VISIBLE); + handleClick(info, second); + } + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/FamilyMsgViewHolder.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/FamilyMsgViewHolder.java new file mode 100644 index 0000000..1e92019 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/FamilyMsgViewHolder.java @@ -0,0 +1,227 @@ +package com.chwl.app.module_hall.im.msgholder; + +import android.graphics.Color; +import android.graphics.Typeface; +import android.text.TextUtils; +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.Keep; +import androidx.appcompat.widget.AppCompatTextView; +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.alibaba.fastjson2.JSON; +import com.chwl.app.R; +import com.chwl.app.module_hall.im.NimHelper; +import com.chwl.app.ui.im.RouterHandler; +import com.chwl.core.im.custom.bean.CustomAttachment; +import com.chwl.core.manager.IMNetEaseManager; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.ApplyResult; +import com.chwl.core.module_hall.im.FamilyAttachment; +import com.chwl.core.module_hall.im.FamilyImMsgInfo; +import com.chwl.core.module_hall.im.bean.HallMsgComponent; +import com.chwl.core.module_hall.im.bean.HallMsgLayout; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; +import com.coorchice.library.SuperTextView; +import com.example.lib_utils.spannable.SpannableTextBuilder; +import com.netease.nim.uikit.business.session.viewholder.MsgViewHolderBase; +import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter; +import com.netease.nim.uikit.common.util.sys.ScreenUtil; +import com.netease.nimlib.sdk.msg.model.IMMessage; + +import java.util.List; +import java.util.Map; +import java.util.Objects; + + +/** + * 模厅im消息展示 + * Created by lvzebiao on 2019/1/7. + */ +@Keep +public class FamilyMsgViewHolder extends MsgViewHolderBase { + + private ConstraintLayout clContainer; + private TextView tvTitle; + private AppCompatTextView stvAgree; + private TextView tvContent; + private View llOpLayout; + private SuperTextView stvReject; + private View llResultLayout; + private SuperTextView tvResult; + + public FamilyMsgViewHolder(BaseMultiItemFetchLoadAdapter adapter) { + super(adapter); + } + + @Override + protected int getContentResId() { + return R.layout.layout_hall_msg_view_holder; + } + + @Override + protected void inflateContentView() { + tvTitle = findViewById(R.id.tv_title); + stvAgree = findViewById(R.id.stv_agree); + stvReject = findViewById(R.id.stv_reject); + llOpLayout = findViewById(R.id.ll_op_layout); + tvContent = findViewById(R.id.tv_content); + clContainer = findViewById(R.id.cl_container); + llResultLayout = findViewById(R.id.ll_result_layout); + tvResult = findViewById(R.id.tv_result); + } + + @Override + protected void bindContentView() { + clContainer.getLayoutParams().width = ScreenUtil.screenWidth * 240 / 375; + clContainer.setVisibility(View.GONE); + clContainer.setClickable(false); + if (message == null) { + return; + } + IMMessage imMessage = IMNetEaseManager.get().queryMessageByUuid(message.getUuid()); + if (imMessage == null || imMessage.getAttachment() == null) { + return; + } + if (!(imMessage.getAttachment() instanceof FamilyAttachment)) { + return; + } + FamilyAttachment attachment = (FamilyAttachment) imMessage.getAttachment(); + FamilyImMsgInfo info = attachment.getFamilyImMsgInfo(); + if (info == null) { + return; + } + if (message.getLocalExtension() != null) { + info = FamilyImMsgInfo.convertMapToObject(message.getLocalExtension()); + } + clContainer.setVisibility(View.VISIBLE); + if (info.getRouterType() > 0) { + final int routerType = info.getRouterType(); + final String routerValue = info.getRouterValue(); + clContainer.setClickable(true); + clContainer.setOnClickListener(v -> + RouterHandler.handle(context, routerType, routerValue)); + } + stvReject.setVisibility(View.VISIBLE); + int second = attachment.getSecond(); + if (second == CustomAttachment.CUSTOM_MSG_FAMILY_INVITE || second == CustomAttachment.CUSTOM_MSG_FAMILY_APPLY) { + setMsgTypeView(info, second); + } else { + llResultLayout.setVisibility(View.GONE); + llOpLayout.setVisibility(View.GONE); + } + + HallMsgLayout hallMsgLayout = null; + try { + String layout = info.getLayout(); + if (!TextUtils.isEmpty(layout)) { + hallMsgLayout = JSON.parseObject(layout, HallMsgLayout.class); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + if (hallMsgLayout == null) { + tvTitle.setText(""); + tvContent.setText(""); + return; + } + // title + tvTitle.setText(hallMsgLayout.getTitle().getContent()); + // content + List erbanSysMsgLayoutContent = hallMsgLayout.getContents(); + if (erbanSysMsgLayoutContent != null) { + SpannableTextBuilder textBuilder = new SpannableTextBuilder(tvContent); + for (HallMsgComponent component : erbanSysMsgLayoutContent) { + String msgBody = component.getContent(); + if (Objects.equals(msgBody, "/r/n")) { + msgBody = "\r\n"; + textBuilder.appendText(msgBody,null,null,null,null,null,null); + continue; + } + Integer textColor = null; + Integer textSize = null; + Integer textStyle = null; + if (component.getFontColor() != null) { + try { + textColor = Color.parseColor(component.getFontColor()); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + if (component.getFontSize() > 0) { + textSize = (int) component.getFontSize(); + } + if (component.isFontBold()) { + textStyle = Typeface.BOLD; + } + textBuilder.appendText(msgBody, textColor, null, textSize, textStyle, null, null); + } + textBuilder.apply(); + } + + } + + private void handleClick(FamilyImMsgInfo info, int second) { + stvAgree.setOnClickListener(view -> { + handleApply(info, second, 1); + }); + stvReject.setOnClickListener(view -> { + handleApply(info, second, 0); + }); + } + + /** + * @param type 1同意,0拒绝 + */ + private void handleApply(FamilyImMsgInfo info, int second, int type) { + HallModel.get().dealApply(info.getUrl(), type) + .subscribe(new BeanObserver<>() { + @Override + public void onErrorMsg(String error) { + SingleToastUtil.showToast(error); + } + + @Override + public void onSuccess(ApplyResult result) { + if (result.getCode() == ApplyResult.CODE_MSG_OUT_OF_DATE) { + info.setType(FamilyImMsgInfo.MSG_TYPE_OUT_OF_DATE); + } else if (result.getCode() == ApplyResult.CODE_MSG_HAS_HANDLE) { + info.setType(FamilyImMsgInfo.MSG_TYPE_HAS_HANDLE); + } else { + info.setType(type == 1 ? FamilyImMsgInfo.MSG_TYPE_HAS_AGREE : + FamilyImMsgInfo.MSG_TYPE_HAS_REJECT); + } + setMsgTypeView(info, second); + Map localExtension = FamilyImMsgInfo.convertToMap(info); + message.setLocalExtension(localExtension); + updateMessageToLocal(info); + } + }); + } + + private void updateMessageToLocal(FamilyImMsgInfo info) { + NimHelper.updateFamilyMsgInfoMessage(message.getUuid(), info); + } + + private void setMsgTypeView(FamilyImMsgInfo info, int second) { + llResultLayout.setVisibility(View.VISIBLE); + llOpLayout.setVisibility(View.GONE); + if (info.getType() == FamilyImMsgInfo.MSG_TYPE_HAS_AGREE) { + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_01)); + } else if (info.getType() == FamilyImMsgInfo.MSG_TYPE_HAS_REJECT) { + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_02)); + } else if (info.getType() == FamilyImMsgInfo.MSG_TYPE_OUT_OF_DATE) { + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_03)); + } else if (info.getType() == FamilyImMsgInfo.MSG_TYPE_HAS_HANDLE) { + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_04)); + } else { + llResultLayout.setVisibility(View.GONE); + llOpLayout.setVisibility(View.VISIBLE); + handleClick(info, second); + } + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/HallMsgViewHolder.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/HallMsgViewHolder.java new file mode 100644 index 0000000..01689a0 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/im/msgholder/HallMsgViewHolder.java @@ -0,0 +1,288 @@ +package com.chwl.app.module_hall.im.msgholder; + +import android.graphics.Color; +import android.graphics.Typeface; +import android.text.TextUtils; +import android.view.View; +import android.widget.TextView; + +import androidx.appcompat.widget.AppCompatTextView; +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.alibaba.fastjson2.JSON; +import com.chwl.app.R; +import com.chwl.app.module_hall.im.NimHelper; +import com.chwl.app.module_hall.im.dialog.AgreeApplyDialog; +import com.chwl.app.module_hall.im.dialog.RefuseApplyDialog; +import com.chwl.app.ui.im.RouterHandler; +import com.chwl.core.im.custom.bean.CustomAttachment; +import com.chwl.core.manager.IMNetEaseManager; +import com.chwl.core.manager.event.HallInfoChangeEvent; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.ApplyResult; +import com.chwl.core.module_hall.im.HallAttachment; +import com.chwl.core.module_hall.im.HallImMsgInfo; +import com.chwl.core.module_hall.im.bean.HallMsgComponent; +import com.chwl.core.module_hall.im.bean.HallMsgLayout; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.SingleToastUtil; +import com.coorchice.library.SuperTextView; +import com.example.lib_utils.spannable.SpannableTextBuilder; +import com.netease.nim.uikit.business.session.viewholder.MsgViewHolderBase; +import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter; +import com.netease.nim.uikit.common.util.sys.ScreenUtil; +import com.netease.nimlib.sdk.msg.model.IMMessage; +import com.orhanobut.logger.Logger; + +import org.greenrobot.eventbus.EventBus; + +import java.util.List; +import java.util.Map; +import java.util.Objects; + + +/** + * 模厅im消息展示 + * Created by lvzebiao on 2019/1/7. + */ +//xxx 更新云信消息扩展字段 示例 +public class HallMsgViewHolder extends MsgViewHolderBase { + + private ConstraintLayout clContainer; + private TextView tvTitle; + private AppCompatTextView stvAgree; + private TextView tvContent; + private View llOpLayout; + private SuperTextView stvReject; + private View llResultLayout; + private SuperTextView tvResult; + + public HallMsgViewHolder(BaseMultiItemFetchLoadAdapter adapter) { + super(adapter); + } + + @Override + protected int getContentResId() { + return R.layout.layout_hall_msg_view_holder; + } + + @Override + protected void inflateContentView() { + tvTitle = findViewById(R.id.tv_title); + stvAgree = findViewById(R.id.stv_agree); + stvReject = findViewById(R.id.stv_reject); + llOpLayout = findViewById(R.id.ll_op_layout); + tvContent = findViewById(R.id.tv_content); + clContainer = findViewById(R.id.cl_container); + llResultLayout = findViewById(R.id.ll_result_layout); + tvResult = findViewById(R.id.tv_result); + } + + @Override + protected void bindContentView() { + clContainer.getLayoutParams().width = ScreenUtil.screenWidth * 240 / 375; + clContainer.setVisibility(View.GONE); + clContainer.setClickable(false); + if (message == null) { + return; + } + IMMessage imMessage = IMNetEaseManager.get().queryMessageByUuid(message.getUuid()); + if (imMessage == null || imMessage.getAttachment() == null) { + return; + } + if (!(imMessage.getAttachment() instanceof HallAttachment)) { + return; + } + HallAttachment attachment = (HallAttachment) imMessage.getAttachment(); + HallImMsgInfo info = attachment.getHallImMsgInfo(); + if (info == null) { + return; + } + if (message.getLocalExtension() != null) { + info = HallImMsgInfo.convertMapToObject(message.getLocalExtension()); + } + Logger.i("infoType:" + info.getType()); + clContainer.setVisibility(View.VISIBLE); + if (info.getRouterType() > 0) { + final int routerType = info.getRouterType(); + final String routerValue = info.getRouterValue(); + clContainer.setClickable(true); + clContainer.setOnClickListener(v -> + RouterHandler.handle(context, routerType, routerValue)); + } + stvReject.setVisibility(View.VISIBLE); + int second = attachment.getSecond(); + if (second == CustomAttachment.CUSTOM_MSG_SUB_HALL_APPLY_JOIN) { + //申请加入 + setMsgTypeView(info, second); + } else if (second == CustomAttachment.CUSTOM_MSG_SUB_HALL_MANAGER_INVITE) { + //高管邀请 + setMsgTypeView(info, second); + } else if (second == CustomAttachment.CUSTOM_MSG_SUB_HALL_APPLY_EXIT) { + //成员申请退出 + setMsgTypeView(info, second); + stvReject.setVisibility(View.GONE); + } else if (second == CustomAttachment.CUSTOM_MSG_SUB_HALL_NOTICE) { + //模厅通知 + llResultLayout.setVisibility(View.GONE); + llOpLayout.setVisibility(View.GONE); + } else { + llResultLayout.setVisibility(View.GONE); + llOpLayout.setVisibility(View.GONE); + } + + HallMsgLayout hallMsgLayout = null; + try { + String layout = info.getLayout(); + if (!TextUtils.isEmpty(layout)) { + hallMsgLayout = JSON.parseObject(layout, HallMsgLayout.class); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + if (hallMsgLayout == null) { + tvTitle.setText(""); + tvContent.setText(""); + return; + } + // title + tvTitle.setText(hallMsgLayout.getTitle().getContent()); + // content + List erbanSysMsgLayoutContent = hallMsgLayout.getContents(); + if (erbanSysMsgLayoutContent != null) { + SpannableTextBuilder textBuilder = new SpannableTextBuilder(tvContent); + for (HallMsgComponent component : erbanSysMsgLayoutContent) { + String msgBody = component.getContent(); + if (Objects.equals(msgBody, "/r/n")) { + msgBody = "\r\n"; + textBuilder.appendText(msgBody,null,null,null,null,null,null); + continue; + }Integer textColor = null; + Integer textSize = null; + Integer textStyle = null; + if (component.getFontColor() != null) { + try { + textColor = Color.parseColor(component.getFontColor()); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + if (component.getFontSize() > 0) { + textSize = (int) component.getFontSize(); + } + if (component.isFontBold()) { + textStyle = Typeface.BOLD; + } + textBuilder.appendText(msgBody, textColor, null, textSize, textStyle, null, null); + } + textBuilder.apply(); + } + + } + + private void handleClick(HallImMsgInfo info, int second) { + stvAgree.setOnClickListener(view -> { + AgreeApplyDialog dialog = new AgreeApplyDialog(context); + dialog.setOnActionListener(new AgreeApplyDialog.OnActionListener() { + @Override + public void onOk() { + AgreeApplyDialog.OnActionListener.super.onOk(); + handleApply(info, second, 1); + } + }); + dialog.show(); + }); + stvReject.setOnClickListener(view -> { + RefuseApplyDialog dialog = new RefuseApplyDialog(context); + if (info.getUrl().contains("hall/dealInvite")) { + dialog.setIsInvite(false); + dialog.setTitleMsg(context.getString(R.string.refuse_invite)); + dialog.setTipMsg(context.getString(R.string.sure_to_refuse_room_join_apply)); + } else { + dialog.setIsInvite(true); + dialog.setTitleMsg(context.getString(R.string.refuse_apply)); + dialog.setTipMsg(context.getString(R.string.sure_to_refuse_user_join_room)); + } + dialog.setOnActionListener(new RefuseApplyDialog.OnActionListener() { + @Override + public void onOk(Boolean isCheck) { + RefuseApplyDialog.OnActionListener.super.onOk(isCheck); + if (isCheck) { + handleApply(info, second, -1); + } else { + handleApply(info, second, 0); + } + } + }); + dialog.show(); + }); + } + + /** + * @param type 1同意,0拒绝 + */ + private void handleApply(HallImMsgInfo info, int second, int type) { + HallModel.get().dealApply(info.getUrl(), type) + .subscribe(new BeanObserver<>() { + @Override + public void onErrorMsg(String error) { + SingleToastUtil.showToast(error); + if (error.equals("消息已過期")) { + info.setType(HallImMsgInfo.MSG_TYPE_OUT_OF_DATE); + } else if (error.equals("消息已處理")) { + info.setType(HallImMsgInfo.MSG_TYPE_HAS_HANDLE); + } + setMsgTypeView(info, second); + Map localExtension = HallImMsgInfo.convertToMap(info); + message.setLocalExtension(localExtension); + updateMessageToLocal(info); + if (second == CustomAttachment.CUSTOM_MSG_SUB_HALL_MANAGER_INVITE) { + EventBus.getDefault().post(new HallInfoChangeEvent()); + } + } + + @Override + public void onSuccess(ApplyResult result) { + if (result.getCode() == ApplyResult.CODE_MSG_OUT_OF_DATE) { + info.setType(HallImMsgInfo.MSG_TYPE_OUT_OF_DATE); + } else if (result.getCode() == ApplyResult.CODE_MSG_HAS_HANDLE) { + info.setType(HallImMsgInfo.MSG_TYPE_HAS_HANDLE); + } else { + info.setType(type == 1 ? HallImMsgInfo.MSG_TYPE_HAS_AGREE : + HallImMsgInfo.MSG_TYPE_HAS_REJECT); + } + setMsgTypeView(info, second); + Map localExtension = HallImMsgInfo.convertToMap(info); + message.setLocalExtension(localExtension); + updateMessageToLocal(info); + if (second == CustomAttachment.CUSTOM_MSG_SUB_HALL_MANAGER_INVITE) { + EventBus.getDefault().post(new HallInfoChangeEvent()); + } + } + }); + } + + private void updateMessageToLocal(HallImMsgInfo info) { + NimHelper.updateHallMsgInfoMessage(message.getUuid(), info); + } + + private void setMsgTypeView(HallImMsgInfo info, int second) { + llResultLayout.setVisibility(View.VISIBLE); + llOpLayout.setVisibility(View.GONE); + if (info.getType() == HallImMsgInfo.MSG_TYPE_HAS_AGREE) { + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_01)); + } else if (info.getType() == HallImMsgInfo.MSG_TYPE_HAS_REJECT) { + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_02)); + } else if (info.getType() == HallImMsgInfo.MSG_TYPE_OUT_OF_DATE) { + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_03)); + } else if (info.getType() == HallImMsgInfo.MSG_TYPE_HAS_HANDLE) { + tvResult.setText(ResUtil.getString(R.string.im_msgholder_hallmsgviewholder_04)); + } else { + llResultLayout.setVisibility(View.GONE); + llOpLayout.setVisibility(View.VISIBLE); + handleClick(info, second); + } + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/ClanIncomeFragment.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/ClanIncomeFragment.java new file mode 100644 index 0000000..e7d6f5f --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/ClanIncomeFragment.java @@ -0,0 +1,99 @@ +package com.chwl.app.module_hall.income; + +import android.os.Bundle; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpFragment; +import com.chwl.app.module_hall.income.adapter.ClanIncomeAdapter; +import com.chwl.app.module_hall.income.presenter.ClanIncomeFragmentPresenter; +import com.chwl.app.module_hall.income.view.IClanIncomeView; +import com.chwl.core.module_hall.income.bean.ClanTotalIncomeInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ListUtils; +import com.chwl.library.utils.ResUtil; + +/** + * 日收入统计 + * Created by lvzebiao on 2018/12/27. + */ +@CreatePresenter(ClanIncomeFragmentPresenter.class) +public class ClanIncomeFragment extends BaseMvpFragment implements IClanIncomeView { + + public static final String FLAG_CLAN_ID = "clanId"; + private ClanIncomeAdapter mIncomeAdapter; + private DayIncomeFragmentListener mDayIncomeFragmentListener; + private long clanId; + private static final String FLAG_IS_CLAN = "flag_is_clan"; + + public static ClanIncomeFragment getInstance(long clanId) { + ClanIncomeFragment fragment = new ClanIncomeFragment(); + Bundle bundle = new Bundle(); + bundle.putLong(FLAG_CLAN_ID, clanId); + fragment.setArguments(bundle); + return fragment; + } + + @Override + public void onFindViews() { + RecyclerView recyclerView = mView.findViewById(R.id.recycler_view); + + mIncomeAdapter = new ClanIncomeAdapter(requireArguments().getBoolean(FLAG_IS_CLAN, true)); + recyclerView.setLayoutManager(new LinearLayoutManager(mContext)); + recyclerView.setAdapter(mIncomeAdapter); + } + + @Override + public void onSetListener() { + } + + @Override + public void initiate() { + } + + public void getIncomeTotal(String startTimeStr, String endTimeStr) { + clanId = requireArguments().getLong(FLAG_CLAN_ID); + getMvpPresenter().incomeTotal(clanId, startTimeStr, endTimeStr); + } + + @Override + public int getRootLayoutId() { + return R.layout.fragment_day_income; + } + + private void setTotal(double total) { + if (mDayIncomeFragmentListener != null) + mDayIncomeFragmentListener.setTotal(total); + } + + public void setmDayIncomeFragmentListener(DayIncomeFragmentListener mDayIncomeFragmentListener) { + this.mDayIncomeFragmentListener = mDayIncomeFragmentListener; + } + + @Override + public void incomeTotalSuccess(ClanTotalIncomeInfo clanTotalIncomeInfo) { + setTotal(clanTotalIncomeInfo.getTotal()); + if (!ListUtils.isListEmpty(clanTotalIncomeInfo.getIncome())) { + hideStatus(); + mIncomeAdapter.setNewData(clanTotalIncomeInfo.getIncome()); + } else { + mIncomeAdapter.setNewData(null); + showNoData(ResUtil.getString(R.string.module_hall_income_clanincomefragment_01)); + } + + } + + @Override + public void incomeTotalFail(String message) { + showNoData(ResUtil.getString(R.string.module_hall_income_clanincomefragment_02)); + setTotal(0); + mIncomeAdapter.setNewData(null); + } + + public interface DayIncomeFragmentListener { + void setTotal(double total); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/DayIncomeFragment.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/DayIncomeFragment.java new file mode 100644 index 0000000..1737c7a --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/DayIncomeFragment.java @@ -0,0 +1,139 @@ +package com.chwl.app.module_hall.income; + +import android.os.Bundle; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpFragment; +import com.chwl.app.module_hall.income.adapter.IncomeAdapter; +import com.chwl.app.module_hall.income.presenter.IncomePresenter; +import com.chwl.app.module_hall.income.view.IIncomeView; +import com.chwl.core.module_hall.income.bean.IncomeInfo; +import com.chwl.core.module_hall.income.bean.IncomeTotalInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ResUtil; + +import java.util.List; + +/** + * 日收入统计 + * Created by lvzebiao on 2018/12/27. + */ + +@CreatePresenter(IncomePresenter.class) +public class DayIncomeFragment extends BaseMvpFragment implements IIncomeView { + + public static final int TYPE_DAY = 0; + public static final int TYPE_WEEK = 1; + public static final int TYPE_MONTH = 2; + public static final String FLAG_DAY_TYPE = "dayType"; + + private int mDayType; + private long hallId; + private IncomeAdapter mIncomeAdapter; + + private DayIncomeFragmentListener mDayIncomeFragmentListener; + + public static DayIncomeFragment getInstance(long hallId, int dayType) { + DayIncomeFragment fragment = new DayIncomeFragment(); + Bundle bundle = new Bundle(); + bundle.putInt(FLAG_DAY_TYPE, dayType); + bundle.putLong("hallId", hallId); + fragment.setArguments(bundle); + return fragment; + } + + @Override + public void onFindViews() { + RecyclerView recyclerView = mView.findViewById(R.id.recycler_view); + + mIncomeAdapter = new IncomeAdapter(mContext, null); + recyclerView.setLayoutManager(new LinearLayoutManager(mContext)); + mIncomeAdapter.setOnItemChildClickListener((adapter, view, position) -> { + List incomeInfos = mIncomeAdapter.getData(); + if (incomeInfos.size() > 0) { + IncomeInfo incomeInfo = incomeInfos.get(position); + + if (mDayType == TYPE_WEEK) + IncomeDetailActivity.start(mContext, hallId, incomeInfo, mStartTimeStr, mEndTimeStr); + else + IncomeDetailActivity.start(mContext, hallId, incomeInfo, mStartTimeStr, ""); + + } + }); + recyclerView.setAdapter(mIncomeAdapter); + } + + @Override + public void onSetListener() { + } + + @Override + public void initiate() { + } + + public void getIncomeTotal(long hallId, String startTimeStr, String endTimeStr) { + mStartTimeStr = startTimeStr; + mEndTimeStr = endTimeStr; + + if (mDayType == TYPE_WEEK) { + getMvpPresenter().incomeTotal(hallId, startTimeStr, endTimeStr); + } else { + getMvpPresenter().incomeTotal(hallId, startTimeStr, ""); + } + } + + @Override + protected void onInitArguments(Bundle bundle) { + if (bundle != null) { + mDayType = bundle.getInt(FLAG_DAY_TYPE, 0); + hallId = bundle.getLong("hallId", 0); + } + } + + @Override + public int getRootLayoutId() { + return R.layout.fragment_day_income_old; + } + + private String mStartTimeStr = ""; + private String mEndTimeStr = ""; + + private void setTotal(long total) { + if (mDayIncomeFragmentListener != null) + mDayIncomeFragmentListener.setTotal(total); + } + + public void setmDayIncomeFragmentListener(DayIncomeFragmentListener mDayIncomeFragmentListener) { + this.mDayIncomeFragmentListener = mDayIncomeFragmentListener; + } + + @Override + public void incomeTotalSuccess(IncomeTotalInfo incomeTotalInfo) { + hideStatus(); + setTotal(incomeTotalInfo.getTotal()); + + if (incomeTotalInfo.getVos() != null) { + mIncomeAdapter.setNewData(incomeTotalInfo.getVos()); + mIncomeAdapter.notifyDataSetChanged(); + } else { + showNoData(ResUtil.getString(R.string.avroom_presenter_roomnewbiepresenter_01)); + } + + } + + @Override + public void incomeTotalFail(String message) { + hideStatus(); + showNoData("暫無數據~"); + setTotal(0); + mIncomeAdapter.setNewData(null); + mIncomeAdapter.notifyDataSetChanged(); + } + + public interface DayIncomeFragmentListener { + void setTotal(long total); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/GoldRecordFragment.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/GoldRecordFragment.kt new file mode 100644 index 0000000..94e0728 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/GoldRecordFragment.kt @@ -0,0 +1,105 @@ +package com.chwl.app.module_hall.income + +import android.os.Bundle +import androidx.fragment.app.viewModels +import androidx.recyclerview.widget.LinearLayoutManager +import com.chwl.app.R +import com.chwl.app.base.BaseViewBindingFragment +import com.chwl.app.common.EmptyViewHelper +import com.chwl.app.databinding.FragmentAssociationBinding +import com.chwl.app.earn.EarnRecordViewModel +import com.chwl.app.earn.adapter.GoldRecordAdapter +import com.chwl.app.ui.utils.RVDelegate +import com.chwl.core.earn.bean.HallMemberGoldFlowInfo +import com.chwl.library.utils.ResUtil + +/** + * 金币明细 + * Created by wushaocheng on 2022/12/16. + */ +class GoldRecordFragment : BaseViewBindingFragment() { + + companion object { + + @JvmStatic + fun getInstance(hallId: Long): GoldRecordFragment { + val args = Bundle() + val fragment = GoldRecordFragment() + fragment.arguments = args + return fragment + } + } + + private val mGoldDetailAdapter: GoldRecordAdapter by lazy { GoldRecordAdapter() } + private lateinit var rvDelegate: RVDelegate + + private val earnRecordModel: EarnRecordViewModel by viewModels() + + private var mDayIncomeFragmentListener: DayIncomeFragmentListener? = null + + private var mStartTimeStr = "" + private var mEndTimeStr = "" + + override fun init() { + rvDelegate = RVDelegate.Builder() + .setLayoutManager(LinearLayoutManager(context)) + .setRecyclerView(binding.recyclerView) + .setEmptyView( + EmptyViewHelper.createEmptyTextView( + context, + ResUtil.getString(R.string.association_list_empty) + ) + ) + .setAdapter(mGoldDetailAdapter) + .build() + + earnRecordModel.goldRecordLiveData.observe(viewLifecycleOwner) { + it?.total?.let { it1 -> setTotal(it1) } + rvDelegate.setNewData(it?.hallMember) + } + + } + + fun getIncomeTotal(hallId: Long, startTimeStr: String, endTimeStr: String) { + mStartTimeStr = startTimeStr + mEndTimeStr = endTimeStr + earnRecordModel.getHallMemberTotalList(startTimeStr, endTimeStr) + } + + fun setDiamondSort(status: Boolean){ + if(status) { + val data = mGoldDetailAdapter.data + data.sortBy { it.giftDiamonds } + mGoldDetailAdapter.setNewData(data) + }else{ + val data = mGoldDetailAdapter.data + data.sortByDescending { it.giftDiamonds } + mGoldDetailAdapter.setNewData(data) + } + } + + fun setRemainSort(status: Boolean){ + if(status) { + val data = mGoldDetailAdapter.data + data.sortBy { it.remainGolds } + mGoldDetailAdapter.setNewData(data) + }else{ + val data = mGoldDetailAdapter.data + data.sortByDescending { it.remainGolds } + mGoldDetailAdapter.setNewData(data) + } + } + + private fun setTotal(total: Long) { + mDayIncomeFragmentListener?.setTotal(total) + } + + fun setmDayIncomeFragmentListener(mDayIncomeFragmentListener: DayIncomeFragmentListener) { + this.mDayIncomeFragmentListener = mDayIncomeFragmentListener + } + + interface DayIncomeFragmentListener { + fun setTotal(total: Long) + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/HallIncomeFragment.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/HallIncomeFragment.java new file mode 100644 index 0000000..36efc6a --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/HallIncomeFragment.java @@ -0,0 +1,100 @@ +package com.chwl.app.module_hall.income; + +import android.os.Bundle; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpFragment; +import com.chwl.app.module_hall.income.adapter.HallIncomeAdapter; +import com.chwl.app.module_hall.income.presenter.HallIncomeFragmentPresenter; +import com.chwl.app.module_hall.income.view.IHallIncomeView; +import com.chwl.core.module_hall.income.bean.HallIncomeInfo; +import com.chwl.core.module_hall.income.bean.HallTotalIncomeInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ListUtils; +import com.chwl.library.utils.ResUtil; + +/** + * 日收入统计 + * Created by lvzebiao on 2018/12/27. + */ + +@CreatePresenter(HallIncomeFragmentPresenter.class) +public class HallIncomeFragment extends BaseMvpFragment implements IHallIncomeView { + + public static final String FLAG_HALL_ID = "clanId"; + private RecyclerView recyclerView; + private HallIncomeAdapter mIncomeAdapter; + private DayIncomeFragmentListener mDayIncomeFragmentListener; + private long hallId; + + public static HallIncomeFragment getInstance(long hallId) { + HallIncomeFragment fragment = new HallIncomeFragment(); + Bundle bundle = new Bundle(); + bundle.putLong(FLAG_HALL_ID, hallId); + fragment.setArguments(bundle); + return fragment; + } + + @Override + public void onFindViews() { + recyclerView = mView.findViewById(R.id.recycler_view); + + mIncomeAdapter = new HallIncomeAdapter(); + recyclerView.setLayoutManager(new LinearLayoutManager(mContext)); + recyclerView.setAdapter(mIncomeAdapter); + } + + @Override + public void onSetListener() { + } + + @Override + public void initiate() { + } + + public void getIncomeTotal(String startTimeStr, String endTimeStr) { + hallId = requireArguments().getLong(FLAG_HALL_ID); + getMvpPresenter().incomeTotal(hallId, startTimeStr, endTimeStr); + } + + @Override + public int getRootLayoutId() { + return R.layout.fragment_day_income; + } + + private void setTotal(double total) { + if (mDayIncomeFragmentListener != null) + mDayIncomeFragmentListener.setTotal(total); + } + + public void setmDayIncomeFragmentListener(DayIncomeFragmentListener mDayIncomeFragmentListener) { + this.mDayIncomeFragmentListener = mDayIncomeFragmentListener; + } + + @Override + public void incomeTotalSuccess(HallTotalIncomeInfo hallTotalIncomeInfo) { + setTotal(hallTotalIncomeInfo.getTotal()); + if (!ListUtils.isListEmpty(hallTotalIncomeInfo.getIncome())) { + hideStatus(); + mIncomeAdapter.setNewData(hallTotalIncomeInfo.getIncome()); + } else { + mIncomeAdapter.setNewData(null); + showNoData(ResUtil.getString(R.string.avroom_presenter_roomnewbiepresenter_01)); + } + + } + + @Override + public void incomeTotalFail(String message) { + showNoData("暂无数据"); + setTotal(0); + mIncomeAdapter.setNewData(null); + } + + public interface DayIncomeFragmentListener { + void setTotal(double total); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/IncomeDetailActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/IncomeDetailActivity.java new file mode 100644 index 0000000..3a08c39 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/IncomeDetailActivity.java @@ -0,0 +1,129 @@ +package com.chwl.app.module_hall.income; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.netease.nim.uikit.StatusBarUtil; +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpActivity; +import com.chwl.library.common.util.Utils; +import com.chwl.app.module_hall.income.adapter.IncomeDetailAdapter; +import com.chwl.app.module_hall.income.presenter.IncomeDetailPresenter; +import com.chwl.app.module_hall.income.view.IIncomeDetailView; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.widget.recyclerview.decoration.SpacingDecoration; +import com.chwl.core.module_hall.income.bean.IncomeGiftInfo; +import com.chwl.core.module_hall.income.bean.IncomeInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ResUtil; + +import java.util.List; + +@CreatePresenter(IncomeDetailPresenter.class) +public class IncomeDetailActivity extends BaseMvpActivity implements IIncomeDetailView { + private static final String FLAG_INCOME_INFO = "incomeInfo"; + private static final String FLAG_START_TIME = "startTime"; + private static final String FLAG_END_TIME = "endTime"; + private static final String FLAG_HALL_ID = "hallId"; + + private ImageView mAvatar; + private TextView tvName; + private RecyclerView recyclerView; + + private IncomeInfo mIncomeInfo; + private String mStartTimeStr; + private String mEndTimeStr; + private long hallId; + + private IncomeDetailAdapter mIncomeDetailAdapter; + + public static void start(Context context, long hallId, IncomeInfo incomeInfo, String startTimeStr, String endTimeStr) { + Intent intent = new Intent(context, IncomeDetailActivity.class); + intent.putExtra(FLAG_INCOME_INFO, incomeInfo); + intent.putExtra(FLAG_START_TIME, startTimeStr); + intent.putExtra(FLAG_END_TIME, endTimeStr); + intent.putExtra(FLAG_HALL_ID, hallId); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.activity_income_detail); + findView(); + + initWhiteTitleBar(ResUtil.getString(R.string.module_hall_income_incomedetailactivity_02)); + mIncomeDetailAdapter = new IncomeDetailAdapter(null); + + recyclerView.setAdapter(mIncomeDetailAdapter); + recyclerView.setLayoutManager(new GridLayoutManager(this, 3)); + int heightSpace = Utils.dip2px(this, 10); + recyclerView.addItemDecoration(new SpacingDecoration(heightSpace, heightSpace, true)); + + mIncomeInfo = (IncomeInfo) getIntent().getSerializableExtra(FLAG_INCOME_INFO); + mStartTimeStr = getIntent().getStringExtra(FLAG_START_TIME); + mEndTimeStr = getIntent().getStringExtra(FLAG_END_TIME); + hallId = getIntent().getLongExtra(FLAG_HALL_ID, 0); + if (mIncomeInfo != null) { + ImageLoadUtils.loadAvatar(this, mIncomeInfo.getAvatar(), mAvatar); + tvName.setText(mIncomeInfo.getNick()); + getMvpPresenter().incomeDetail(mIncomeInfo.getReciveUid(), hallId, mStartTimeStr, mEndTimeStr); + } else + finish(); + + } + + private void findView() { + mAvatar = findViewById(R.id.iv_avatar); + tvName = findViewById(R.id.tv_name); + recyclerView = findViewById(R.id.recycler_view); + } + + private boolean mHasInit = false; + + @Override + protected void onResume() { + super.onResume(); + + if (!mHasInit && mIncomeInfo != null) { + mHasInit = true; + getMvpPresenter().incomeDetail(mIncomeInfo.getReciveUid(), hallId, mStartTimeStr, mEndTimeStr); + } + } + + @Override + public void incomeDetailSuccess(List incomeGiftInfoList) { + hideStatus(); + + if (incomeGiftInfoList != null && incomeGiftInfoList.size() > 0) + mIncomeDetailAdapter.setNewData(incomeGiftInfoList); + else + showNoData(); + } + + @Override + public void incomeDetailFail(String message) { + hideStatus(); + showNoData(); + } + + @Override + protected boolean needSteepStateBar() { + return true; + } + + @Override + protected void setStatusBar() { + super.setStatusBar(); + StatusBarUtil.transparencyBar(this); + StatusBarUtil.StatusBarLightMode(this); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/SingleRoomIncomeFragment.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/SingleRoomIncomeFragment.java new file mode 100644 index 0000000..2362210 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/SingleRoomIncomeFragment.java @@ -0,0 +1,110 @@ +package com.chwl.app.module_hall.income; + +import android.os.Bundle; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpFragment; +import com.chwl.app.module_hall.income.adapter.SingleRoomIncomeAdapter; +import com.chwl.app.module_hall.income.presenter.SingRoomIncomeFragmentPresenter; +import com.chwl.app.module_hall.income.view.ISingRoomIncomeView; +import com.chwl.core.module_hall.income.bean.SingleRoomTotalIncomeInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ListUtils; +import com.chwl.library.utils.ResUtil; + +/** + * 日收入统计 + * Created by lvzebiao on 2018/12/27. + */ + +@CreatePresenter(SingRoomIncomeFragmentPresenter.class) +public class SingleRoomIncomeFragment extends BaseMvpFragment implements ISingRoomIncomeView { + + public static final int TYPE_DAY = 0; + public static final int TYPE_WEEK = 1; + public static final String FLAG_DAY_TYPE = "dayType"; + public static final String FLAG_CLAN_ID = "clanId"; + public static final String FLAG_HALL_ID = "hallId"; + private SingleRoomIncomeAdapter mIncomeAdapter; + private DayIncomeFragmentListener mDayIncomeFragmentListener; + + public static SingleRoomIncomeFragment getInstance(int dayType, long clanId, long hallId) { + SingleRoomIncomeFragment fragment = new SingleRoomIncomeFragment(); + Bundle bundle = new Bundle(); + bundle.putInt(FLAG_DAY_TYPE, dayType); + bundle.putLong(FLAG_CLAN_ID, clanId); + bundle.putLong(FLAG_HALL_ID, hallId); + fragment.setArguments(bundle); + return fragment; + } + + @Override + public void onFindViews() { + RecyclerView recyclerView = mView.findViewById(R.id.recycler_view); + + mIncomeAdapter = new SingleRoomIncomeAdapter(); + recyclerView.setLayoutManager(new LinearLayoutManager(mContext)); + recyclerView.setAdapter(mIncomeAdapter); + } + + @Override + public void onSetListener() { + } + + @Override + public void initiate() { + } + + public void getIncomeTotal(String startTimeStr, String endTimeStr) { + long clanId = requireArguments().getLong(FLAG_CLAN_ID); + long hallId = requireArguments().getLong(FLAG_HALL_ID); + getMvpPresenter().incomeTotal( + clanId == 0 ? null : String.valueOf(clanId), + hallId == 0 ? null : String.valueOf(hallId), + startTimeStr, + endTimeStr); + } + + @Override + public int getRootLayoutId() { + return R.layout.fragment_day_income; + } + + private void setTotal(double total) { + if (mDayIncomeFragmentListener != null) + mDayIncomeFragmentListener.setTotal(total); + } + + public void setmDayIncomeFragmentListener(DayIncomeFragmentListener mDayIncomeFragmentListener) { + this.mDayIncomeFragmentListener = mDayIncomeFragmentListener; + } + + @Override + public void incomeTotalSuccess(SingleRoomTotalIncomeInfo incomeInfo) { + hideStatus(); + setTotal(incomeInfo.getTotalDiamond()); + + if (!ListUtils.isListEmpty(incomeInfo.getIncomes())) { + mIncomeAdapter.setNewData(incomeInfo.getIncomes()); + } else { + mIncomeAdapter.setNewData(null); + showNoData(); + } + + } + + @Override + public void incomeTotalFail(String message) { + hideStatus(); + showNoData(ResUtil.getString(R.string.module_hall_income_singleroomincomefragment_01)); + setTotal(0); + mIncomeAdapter.setNewData(null); + } + + public interface DayIncomeFragmentListener { + void setTotal(double total); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/ClanIncomeAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/ClanIncomeAdapter.java new file mode 100644 index 0000000..f32a605 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/ClanIncomeAdapter.java @@ -0,0 +1,47 @@ +package com.chwl.app.module_hall.income.adapter; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.core.module_hall.income.bean.ClanIncomeInfo; +import com.chwl.library.utils.ResUtil; + +import org.jetbrains.annotations.NotNull; + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +public class ClanIncomeAdapter extends BaseQuickAdapter { + + private final boolean isClan; + + public ClanIncomeAdapter(boolean isClan) { + super(R.layout.item_clan_income); + this.isClan = isClan; + } + + @Override + protected void convert(@NotNull BaseViewHolder helper, ClanIncomeInfo item) { + + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); + decimalFormat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH)); + helper.setText(R.id.tv_bag_income, "+" + decimalFormat.format(item.getBagIncome())) + .setText(R.id.tv_normal_gift_income, "+" + decimalFormat.format(item.getNormalGiftIncome())) + .setText(R.id.tv_room_income, "+" + decimalFormat.format(item.getRoomIncome())) + .setText(R.id.tv_hall_number, helper.getLayoutPosition() + 1 + ".") + .setText(R.id.tv_hall_name, item.getHallName()) + .setText(R.id.tv_room_income_desc, isClan ? ResUtil.getString(R.string.income_adapter_clanincomeadapter_01) : ResUtil.getString(R.string.income_adapter_clanincomeadapter_02)); + + if (isClan) { + helper.setGone(R.id.group, true) + .setText(R.id.tv_send_gift_number, item.getGiftUv()) + .setText(R.id.tv_new_user_send_gift_number, item.getNewUserSendGiftNum()); + } else { + helper.setGone(R.id.group, false); + } + ImageLoadUtils.loadImage(mContext, item.getHallAvatar(), helper.getView(R.id.iv_hall_avatar)); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/HallIncomeAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/HallIncomeAdapter.java new file mode 100644 index 0000000..4ef12ff --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/HallIncomeAdapter.java @@ -0,0 +1,35 @@ +package com.chwl.app.module_hall.income.adapter; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtilsV2; +import com.chwl.core.module_hall.income.bean.HallIncomeInfo; + +import org.jetbrains.annotations.NotNull; + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +public class HallIncomeAdapter extends BaseQuickAdapter { + + public HallIncomeAdapter() { + super(R.layout.item_hall_income); + } + + @Override + protected void convert(@NotNull BaseViewHolder helper, HallIncomeInfo item) { + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); + decimalFormat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH)); + helper.setText(R.id.tv_bag_income, "+" + decimalFormat.format(item.getBagIncome())) + .setText(R.id.tv_normal_gift_income, "+" + decimalFormat.format(item.getNormalGiftIncome())) + .setText(R.id.tv_room_income, "+" + decimalFormat.format(item.getRoomIncome())) + .setText(R.id.tv_send_gift_number, item.getGiftUv()) + .setText(R.id.tv_new_user_send_gift_number, item.getNewUserSendGiftNum()); + + ImageLoadUtilsV2.loadImage(helper.getView(R.id.civ_avatar), item.getHallAvatar()); + helper.setText(R.id.tv_name, item.getHallName()); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/IncomeAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/IncomeAdapter.java new file mode 100644 index 0000000..66232e9 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/IncomeAdapter.java @@ -0,0 +1,49 @@ +package com.chwl.app.module_hall.income.adapter; + +import android.content.Context; +import android.text.TextUtils; + +import androidx.annotation.Nullable; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.core.module_hall.income.bean.IncomeInfo; +import com.chwl.library.utils.ResUtil; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.List; +import java.util.Locale; + +public class IncomeAdapter extends BaseQuickAdapter { + + public IncomeAdapter(Context context, @Nullable List data) { + super(R.layout.item_income); + } + + @Override + protected void convert(BaseViewHolder helper, IncomeInfo item) { + + if (item == null) + return; + + ImageLoadUtils.loadAvatar(mContext, item.getAvatar(), helper.getView(R.id.iv_avatar)); + + helper.setText(R.id.tv_row_num, item.getRowNum()); + String nick = item.getNick(); + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); + decimalFormat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH)); + if (!TextUtils.isEmpty(nick) && nick.length() > 4) + nick = nick.substring(0, 4) + "..."; + helper.setText(R.id.tv_name, nick); + helper.setText(R.id.tv_num, String.format(mContext.getString(R.string.label_id_format), item.getErbanNo())); + helper.setText(R.id.tv_gold, decimalFormat.format(item.getTotalGoldNum())); + + helper.addOnClickListener(R.id.container); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/IncomeDetailAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/IncomeDetailAdapter.java new file mode 100644 index 0000000..0aac962 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/IncomeDetailAdapter.java @@ -0,0 +1,65 @@ +package com.chwl.app.module_hall.income.adapter; + +import android.text.SpannableString; +import android.text.style.ForegroundColorSpan; + +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.core.module_hall.income.bean.IncomeGiftInfo; +import com.chwl.library.utils.ResUtil; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +public class IncomeDetailAdapter extends BaseQuickAdapter { + + + public IncomeDetailAdapter(@Nullable List data) { + super(R.layout.item_income_gift, data); + } + + @Override + protected void convert(BaseViewHolder helper, IncomeGiftInfo item) { + + if (item == null) + return; + + ImageLoadUtils.loadImage(mContext, item.getPicUrl(), helper.getView(R.id.iv_gift)); + + helper.setText(R.id.tv_gift_name, item.getGiftName()); + helper.setText(R.id.tv_gift_gold, formatGold(item.getGoldPrice())); + helper.setText(R.id.tv_gift_num, "X" + item.getGiftNum()); + } + + private SpannableString formatGold(long total) { + + SpannableString spannableString; + ForegroundColorSpan first = new ForegroundColorSpan(ContextCompat.getColor(mContext, R.color.app_248cfe)); + ForegroundColorSpan second = new ForegroundColorSpan(ContextCompat.getColor(mContext, R.color.text_normal_c6c6e9)); + + if (total > 10000) { + double d = (double) total; + d = d / 10000; + BigDecimal df = new BigDecimal(d); + String goldStr = df.setScale(2, RoundingMode.DOWN).toString(); + + spannableString = new SpannableString(goldStr + ResUtil.getString(R.string.income_adapter_incomedetailadapter_01)); + spannableString.setSpan(first, 0, goldStr.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(second, goldStr.length(), goldStr.length() + 3, SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + + } else { + String str = String.valueOf(total); + + spannableString = new SpannableString(str + ResUtil.getString(R.string.income_adapter_incomedetailadapter_02)); + spannableString.setSpan(first, 0, str.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(second, str.length(), str.length() + 2, SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + } + return spannableString; + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/LiveIncomeAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/LiveIncomeAdapter.java new file mode 100644 index 0000000..a3eea3d --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/LiveIncomeAdapter.java @@ -0,0 +1,35 @@ +package com.chwl.app.module_hall.income.adapter; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.utils.ImageLoadUtilsV2; +import com.chwl.core.module_hall.income.bean.ClanIncomeInfo; +import com.chwl.core.module_hall.income.bean.LiveIncomeInfo; +import com.chwl.library.utils.ResUtil; + +import org.jetbrains.annotations.NotNull; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; + +public class LiveIncomeAdapter extends BaseQuickAdapter { + + public LiveIncomeAdapter() { + super(R.layout.item_live_income); + } + + @Override + protected void convert(@NotNull BaseViewHolder helper, LiveIncomeInfo item) { + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); + helper.setText(R.id.tvIncome, decimalFormat.format(item.getIncome())) + .setText(R.id.tv_hall_number, String.valueOf(helper.getLayoutPosition() + 1)) + .setText(R.id.tv_user_name, item.getNick()) + .setText(R.id.tv_hall_name, item.getHallName()); + ImageLoadUtils.loadAvatar(item.getAvatar(),helper.getView(R.id.iv_user_avatar) ); + ImageLoadUtils.loadImage(mContext, item.getHallAvatar(), helper.getView(R.id.iv_hall_avatar)); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/SingleRoomIncomeAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/SingleRoomIncomeAdapter.java new file mode 100644 index 0000000..4fe070b --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/adapter/SingleRoomIncomeAdapter.java @@ -0,0 +1,40 @@ +package com.chwl.app.module_hall.income.adapter; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.BaseViewHolder; +import com.chwl.app.R; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.core.module_hall.income.bean.SingleRoomIncomeInfo; +import com.chwl.library.utils.ResUtil; + +import org.jetbrains.annotations.NotNull; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +public class SingleRoomIncomeAdapter extends BaseQuickAdapter { + + public SingleRoomIncomeAdapter() { + super(R.layout.item_single_room_income); + } + + @Override + protected void convert(@NotNull BaseViewHolder helper, SingleRoomIncomeInfo item) { + helper.setText(R.id.tv_author_income, formatGoldNun(item.getAnchorDiamondNum())) + .setText(R.id.tv_room_income, formatGoldNun(item.getRoomDiamondNum())) + .setText(R.id.tv_user_id, "ID:" + item.getErbanNo()) + .setText(R.id.tv_hall_number, String.valueOf(helper.getLayoutPosition() + 1)) + .setText(R.id.tv_user_name, item.getNick()); + ImageLoadUtils.loadImage(mContext, item.getAvatar(), helper.getView(R.id.iv_hall_avatar)); + } + + private String formatGoldNun(double goldNum) { + if (goldNum > 10000) { + double d = goldNum; + d = d / 10000; + BigDecimal df = new BigDecimal(d); + return "+" + df.setScale(2, RoundingMode.DOWN).toString() + ResUtil.getString(R.string.income_adapter_singleroomincomeadapter_01); + } + return "+" + goldNum; + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/ClanIncomeFragmentPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/ClanIncomeFragmentPresenter.java new file mode 100644 index 0000000..361eeaf --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/ClanIncomeFragmentPresenter.java @@ -0,0 +1,39 @@ +package com.chwl.app.module_hall.income.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IClanIncomeView; +import com.chwl.core.module_hall.income.IncomeModel; +import com.chwl.core.module_hall.income.bean.ClanTotalIncomeInfo; + +import org.jetbrains.annotations.NotNull; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class ClanIncomeFragmentPresenter extends BaseMvpPresenter { + + public void incomeTotal(long id, String startTimeStr, String endTimeStr) { + IncomeModel.get().getClanIncomeList(id, startTimeStr, endTimeStr).compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(@NotNull ClanTotalIncomeInfo clanTotalIncomeInfo) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalSuccess(clanTotalIncomeInfo); + } + + @Override + public void onError(@NotNull Throwable e) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalFail(e.getMessage()); + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/ClanIncomePresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/ClanIncomePresenter.java new file mode 100644 index 0000000..e8cf572 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/ClanIncomePresenter.java @@ -0,0 +1,120 @@ +package com.chwl.app.module_hall.income.presenter; + +import android.text.SpannableString; +import android.text.style.RelativeSizeSpan; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IIncomeStatisticsView; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.TimeUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Locale; + +public class ClanIncomePresenter extends BaseMvpPresenter { + + private String mStartTimeStr; + private String mEndTimeStr; + + private String weekFirstDay; + private String weekLastDay; + /** + * 周范围内选中的日期 + */ + private long mWeekChooseDay; + /** + * 日范围内选中的日期 + */ + private long mDay; + + public void initCurrentDay() { + mDay = mWeekChooseDay = System.currentTimeMillis(); + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(mDay); + + int curWeekDay = calendar.get(Calendar.DAY_OF_WEEK); + //周一的时间 + long firstDayTime; + if (curWeekDay == 1) {//周日 + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (7 - curWeekDay)); + } else { + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (curWeekDay - 2)); + } + //周日 + long lastDayTime = firstDayTime + (TimeUtils.MILLIS_OF_A_DAY * 6); + weekFirstDay = TimeUtils.getDateTimeString(firstDayTime, TimeUtils.DATE_FORMAT); + weekLastDay = TimeUtils.getDateTimeString(lastDayTime, TimeUtils.DATE_FORMAT); + String ym = new SimpleDateFormat("yyyy-MM").format(mDay); + mStartTimeStr = TimeUtils.getFirstDayOfMonth(ym); + mEndTimeStr = TimeUtils.getLastDayOfMonth(ym); + } + + public String setTotal(double total) { + + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); + decimalFormat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH)); + return decimalFormat.format(total); + } + + public String getmStartTimeStr() { + return mStartTimeStr; + } + + public void setmStartTimeStr(String mStartTimeStr) { + this.mStartTimeStr = mStartTimeStr; + } + + public String getmEndTimeStr() { + return mEndTimeStr; + } + + public void setmEndTimeStr(String mEndTimeStr) { + this.mEndTimeStr = mEndTimeStr; + } + + public long getmDay() { + return mDay; + } + + public void setmDayStr(long day) { + this.mDay = day; + } + + public String getDayFormat() { + return TimeUtils.getDateTimeString(mDay, TimeUtils.DATE_FORMAT); + } + + public long getmWeekChooseDay() { + return mWeekChooseDay; + } + + public void setmWeekChooseDay(long weekChooseDay) { + this.mWeekChooseDay = weekChooseDay; + } + + public String getWeekChooseDayFormat() { + return TimeUtils.getDateTimeString(mWeekChooseDay, TimeUtils.DATE_FORMAT); + } + + public String getWeekFirstDay() { + return weekFirstDay; + } + + public void setWeekFirstDay(String weekFirstDay) { + this.weekFirstDay = weekFirstDay; + } + + public String getWeekLastDay() { + return weekLastDay; + } + + public void setWeekLastDay(String weekLastDay) { + this.weekLastDay = weekLastDay; + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/HallIncomeFragmentPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/HallIncomeFragmentPresenter.java new file mode 100644 index 0000000..b3b5742 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/HallIncomeFragmentPresenter.java @@ -0,0 +1,39 @@ +package com.chwl.app.module_hall.income.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IHallIncomeView; +import com.chwl.core.module_hall.income.IncomeModel; +import com.chwl.core.module_hall.income.bean.HallTotalIncomeInfo; + +import org.jetbrains.annotations.NotNull; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class HallIncomeFragmentPresenter extends BaseMvpPresenter { + + public void incomeTotal(long id, String startTimeStr, String endTimeStr) { + IncomeModel.get().getHallIncomeList(id, startTimeStr, endTimeStr).compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(@NotNull HallTotalIncomeInfo hallTotalIncomeInfo) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalSuccess(hallTotalIncomeInfo); + } + + @Override + public void onError(@NotNull Throwable e) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalFail(e.getMessage()); + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomeDetailPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomeDetailPresenter.java new file mode 100644 index 0000000..bf6c167 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomeDetailPresenter.java @@ -0,0 +1,39 @@ +package com.chwl.app.module_hall.income.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IIncomeDetailView; +import com.chwl.core.module_hall.income.IncomeModel; +import com.chwl.core.module_hall.income.bean.IncomeGiftInfo; + +import java.util.List; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class IncomeDetailPresenter extends BaseMvpPresenter { + + public void incomeDetail(long memberId,long hallId, String startTimeStr, String endTimeStr) { + IncomeModel.get().incomeDetail(memberId, hallId, startTimeStr, endTimeStr) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver>() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(List incomeGiftInfos) { + if (getMvpView() == null) + return; + getMvpView().incomeDetailSuccess(incomeGiftInfos); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) + return; + getMvpView().incomeDetailFail(e.getMessage()); + } + }); + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomePresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomePresenter.java new file mode 100644 index 0000000..ae25dbc --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomePresenter.java @@ -0,0 +1,38 @@ +package com.chwl.app.module_hall.income.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IIncomeView; +import com.chwl.core.module_hall.income.IncomeModel; +import com.chwl.core.module_hall.income.bean.IncomeTotalInfo; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class IncomePresenter extends BaseMvpPresenter { + + public void incomeTotal(long hallId,String startTimeStr, String endTimeStr) { + IncomeModel.get().incomeTotal(hallId, startTimeStr, endTimeStr) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(IncomeTotalInfo incomeTotalInfo) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalSuccess(incomeTotalInfo); + } + + @Override + public void onError(Throwable e) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalFail(e.getMessage()); + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomeStatisticsPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomeStatisticsPresenter.java new file mode 100644 index 0000000..f8f4373 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/IncomeStatisticsPresenter.java @@ -0,0 +1,127 @@ +package com.chwl.app.module_hall.income.presenter; + +import android.text.SpannableString; +import android.text.style.RelativeSizeSpan; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IIncomeStatisticsView; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.TimeUtils; +import com.example.lib_utils.AppUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Locale; + +public class IncomeStatisticsPresenter extends BaseMvpPresenter { + + private String mStartTimeStr; + private String mEndTimeStr; + /** 周范围内选中的日期 */ + private long mWeekChooseDay; + /** 日范围内选中的日期 */ + private long mDay; + + private String weekFirstDay; + private String weekLastDay; + + public void initCurrentDay() { + mDay = mWeekChooseDay = System.currentTimeMillis(); + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(mDay); + + int curWeekDay = calendar.get(Calendar.DAY_OF_WEEK); + //周一的时间 + long firstDayTime; + if (curWeekDay == 1) {//周日 + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (7 - curWeekDay)); + } else { + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (curWeekDay - 2)); + } + //周日 + long lastDayTime = firstDayTime + (TimeUtils.MILLIS_OF_A_DAY * 6); + + weekFirstDay = TimeUtils.getDateTimeString(firstDayTime, TimeUtils.DATE_FORMAT); + weekLastDay = TimeUtils.getDateTimeString(lastDayTime, TimeUtils.DATE_FORMAT); + String ym = new SimpleDateFormat("yyyy-MM").format(mDay); + mStartTimeStr = TimeUtils.getFirstDayOfMonth(ym); + mEndTimeStr = TimeUtils.getLastDayOfMonth(ym); + } + + public SpannableString setTotal(long total) { + + SpannableString spannableString; + RelativeSizeSpan sizeSpan = new RelativeSizeSpan(0.5f); + + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); + decimalFormat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH)); + String unit = AppUtils.getApp().getString(R.string.avroom_widget_messageview_027); + String str = decimalFormat.format(total) + unit; + + spannableString = new SpannableString(str); + spannableString.setSpan(sizeSpan, str.length() - unit.length(), str.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + + return spannableString; + } + + public String getmStartTimeStr() { + return mStartTimeStr; + } + + public void setmStartTimeStr(String mStartTimeStr) { + this.mStartTimeStr = mStartTimeStr; + } + + public String getmEndTimeStr() { + return mEndTimeStr; + } + + public void setmEndTimeStr(String mEndTimeStr) { + this.mEndTimeStr = mEndTimeStr; + } + + public long getmDay() { + return mDay; + } + + public void setmDayStr(long day) { + this.mDay = day; + } + + public String getDayFormat() { + return TimeUtils.getDateTimeString(mDay, TimeUtils.DATE_FORMAT); + } + + public long getmWeekChooseDay() { + return mWeekChooseDay; + } + + public void setmWeekChooseDay(long weekChooseDay) { + this.mWeekChooseDay = weekChooseDay; + } + + public String getWeekChooseDayFormat() { + return TimeUtils.getDateTimeString(mWeekChooseDay, TimeUtils.DATE_FORMAT); + } + + public String getWeekFirstDay() { + return weekFirstDay; + } + + public void setWeekFirstDay(String weekFirstDay) { + this.weekFirstDay = weekFirstDay; + } + + public String getWeekLastDay() { + return weekLastDay; + } + + public void setWeekLastDay(String weekLastDay) { + this.weekLastDay = weekLastDay; + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/LiveIncomeFragmentPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/LiveIncomeFragmentPresenter.java new file mode 100644 index 0000000..fa9c0e2 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/LiveIncomeFragmentPresenter.java @@ -0,0 +1,41 @@ +package com.chwl.app.module_hall.income.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IClanIncomeView; +import com.chwl.app.module_hall.income.view.ILiveIncomeView; +import com.chwl.core.module_hall.income.IncomeModel; +import com.chwl.core.module_hall.income.bean.ClanTotalIncomeInfo; +import com.chwl.core.module_hall.income.bean.LiveTotalIncomeInfo; + +import org.jetbrains.annotations.NotNull; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class LiveIncomeFragmentPresenter extends BaseMvpPresenter { + + public void incomeTotal(long id, String startTimeStr, String endTimeStr) { + IncomeModel.get().getLiveIncomeList(id, startTimeStr, endTimeStr).compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(@NotNull LiveTotalIncomeInfo liveTotalIncomeInfo) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalSuccess(liveTotalIncomeInfo); + } + + @Override + public void onError(@NotNull Throwable e) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalFail(e.getMessage()); + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/RoomIncomePresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/RoomIncomePresenter.java new file mode 100644 index 0000000..eaf2552 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/RoomIncomePresenter.java @@ -0,0 +1,128 @@ +package com.chwl.app.module_hall.income.presenter; + +import android.text.SpannableString; +import android.text.style.RelativeSizeSpan; + +import com.chwl.app.R; +import com.chwl.app.application.App; +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IIncomeStatisticsView; +import com.chwl.library.utils.TimeUtils; +import com.example.lib_utils.AppUtils; + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Locale; + +public class RoomIncomePresenter extends BaseMvpPresenter { + + private String mStartTimeStr; + private String mEndTimeStr; + + private String weekFirstDay; + private String weekLastDay; + /** + * 周范围内选中的日期 + */ + private long mWeekChooseDay; + /** + * 日范围内选中的日期 + */ + private long mDay; + + public void initCurrentDay() { + mDay = mWeekChooseDay = System.currentTimeMillis(); + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(mDay); + + int curWeekDay = calendar.get(Calendar.DAY_OF_WEEK); + //周一的时间 + long firstDayTime; + if (curWeekDay == 1) {//周日 + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (7 - curWeekDay)); + } else { + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (curWeekDay - 2)); + } + //周日 + long lastDayTime = firstDayTime + (TimeUtils.MILLIS_OF_A_DAY * 6); + weekFirstDay = TimeUtils.getDateTimeString(firstDayTime, TimeUtils.DATE_FORMAT); + weekLastDay = TimeUtils.getDateTimeString(lastDayTime, TimeUtils.DATE_FORMAT); + String ym = new SimpleDateFormat("yyyy-MM").format(mDay); + mStartTimeStr = TimeUtils.getFirstDayOfMonth(ym); + mEndTimeStr = TimeUtils.getLastDayOfMonth(ym); + } + + public SpannableString setTotal(double total) { + + SpannableString spannableString; + RelativeSizeSpan sizeSpan = new RelativeSizeSpan(0.5f); + + DecimalFormat decimalFormat = new DecimalFormat("###################.###########"); + decimalFormat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ENGLISH)); + String unit = AppUtils.getApp().getString(R.string.avroom_widget_messageview_027); + String str = decimalFormat.format(total) + unit; + + spannableString = new SpannableString(str); + spannableString.setSpan(sizeSpan, str.length() - unit.length(), str.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + + return spannableString; + } + + public String getmStartTimeStr() { + return mStartTimeStr; + } + + public void setmStartTimeStr(String mStartTimeStr) { + this.mStartTimeStr = mStartTimeStr; + } + + public String getmEndTimeStr() { + return mEndTimeStr; + } + + public void setmEndTimeStr(String mEndTimeStr) { + this.mEndTimeStr = mEndTimeStr; + } + + public long getmDay() { + return mDay; + } + + public void setmDayStr(long day) { + this.mDay = day; + } + + public String getDayFormat() { + return TimeUtils.getDateTimeString(mDay, TimeUtils.DATE_FORMAT); + } + + public long getmWeekChooseDay() { + return mWeekChooseDay; + } + + public void setmWeekChooseDay(long weekChooseDay) { + this.mWeekChooseDay = weekChooseDay; + } + + public String getWeekChooseDayFormat() { + return TimeUtils.getDateTimeString(mWeekChooseDay, TimeUtils.DATE_FORMAT); + } + + public String getWeekFirstDay() { + return weekFirstDay; + } + + public void setWeekFirstDay(String weekFirstDay) { + this.weekFirstDay = weekFirstDay; + } + + public String getWeekLastDay() { + return weekLastDay; + } + + public void setWeekLastDay(String weekLastDay) { + this.weekLastDay = weekLastDay; + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/SingRoomIncomeFragmentPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/SingRoomIncomeFragmentPresenter.java new file mode 100644 index 0000000..393b839 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/SingRoomIncomeFragmentPresenter.java @@ -0,0 +1,40 @@ +package com.chwl.app.module_hall.income.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.ISingRoomIncomeView; +import com.chwl.core.module_hall.income.IncomeModel; +import com.chwl.core.module_hall.income.bean.SingleRoomTotalIncomeInfo; + +import org.jetbrains.annotations.NotNull; + +import io.reactivex.SingleObserver; +import io.reactivex.disposables.Disposable; + +public class SingRoomIncomeFragmentPresenter extends BaseMvpPresenter { + + public void incomeTotal(String clanId, String hallId, String startTimeStr, String endTimeStr) { + IncomeModel.get().getSingleRoomIncomeList(clanId, hallId, startTimeStr, endTimeStr) + .compose(bindToLifecycle()) + .subscribe(new SingleObserver() { + @Override + public void onSubscribe(Disposable d) { + + } + + @Override + public void onSuccess(@NotNull SingleRoomTotalIncomeInfo incomeInfo) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalSuccess(incomeInfo); + } + + @Override + public void onError(@NotNull Throwable e) { + if (getMvpView() == null) + return; + getMvpView().incomeTotalFail(e.getMessage()); + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/SingleRoomIncomePresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/SingleRoomIncomePresenter.java new file mode 100644 index 0000000..3e68715 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/presenter/SingleRoomIncomePresenter.java @@ -0,0 +1,134 @@ +package com.chwl.app.module_hall.income.presenter; + +import android.text.SpannableString; +import android.text.style.RelativeSizeSpan; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.income.view.IIncomeStatisticsView; +import com.chwl.library.utils.ResUtil; +import com.chwl.library.utils.TimeUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.Calendar; + +public class SingleRoomIncomePresenter extends BaseMvpPresenter { + + private String mStartTimeStr; + private String mEndTimeStr; + + private String weekFirstDay; + private String weekLastDay; + /** + * 周范围内选中的日期 + */ + private long mWeekChooseDay; + /** + * 日范围内选中的日期 + */ + private long mDay; + + public void initCurrentDay() { + mDay = mWeekChooseDay = System.currentTimeMillis(); + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(mDay); + + int curWeekDay = calendar.get(Calendar.DAY_OF_WEEK); + //周一的时间 + long firstDayTime; + if (curWeekDay == 1) {//周日 + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (7 - curWeekDay)); + } else { + firstDayTime = calendar.getTimeInMillis() - (TimeUtils.MILLIS_OF_A_DAY * (curWeekDay - 2)); + } + //周日 + long lastDayTime = firstDayTime + (TimeUtils.MILLIS_OF_A_DAY * 6); + weekFirstDay = TimeUtils.getDateTimeString(firstDayTime, TimeUtils.DATE_FORMAT); + weekLastDay = TimeUtils.getDateTimeString(lastDayTime, TimeUtils.DATE_FORMAT); + String ym = new SimpleDateFormat("yyyy-MM").format(mDay); + mStartTimeStr = TimeUtils.getFirstDayOfMonth(ym); + mEndTimeStr = TimeUtils.getLastDayOfMonth(ym); + } + + public SpannableString setTotal(double total) { + + SpannableString spannableString; + RelativeSizeSpan sizeSpan = new RelativeSizeSpan(0.5f); + + if (total > 10000) { + double d = (double) total; + d = d / 10000; + BigDecimal df = new BigDecimal(d); + String str = df.setScale(2, RoundingMode.DOWN).toString() + ResUtil.getString(R.string.income_presenter_singleroomincomepresenter_01); + + spannableString = new SpannableString(str); + spannableString.setSpan(sizeSpan, str.length() - 3, str.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + + } else { + String str = String.valueOf(total) + ResUtil.getString(R.string.income_presenter_singleroomincomepresenter_02); + + spannableString = new SpannableString(str); + spannableString.setSpan(sizeSpan, str.length() - 2, str.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + } + + return spannableString; + } + + public String getmStartTimeStr() { + return mStartTimeStr; + } + + public void setmStartTimeStr(String mStartTimeStr) { + this.mStartTimeStr = mStartTimeStr; + } + + public String getmEndTimeStr() { + return mEndTimeStr; + } + + public void setmEndTimeStr(String mEndTimeStr) { + this.mEndTimeStr = mEndTimeStr; + } + + public long getmDay() { + return mDay; + } + + public void setmDayStr(long day) { + this.mDay = day; + } + + public String getDayFormat() { + return TimeUtils.getDateTimeString(mDay, TimeUtils.DATE_FORMAT); + } + + public long getmWeekChooseDay() { + return mWeekChooseDay; + } + + public void setmWeekChooseDay(long weekChooseDay) { + this.mWeekChooseDay = weekChooseDay; + } + + public String getWeekChooseDayFormat() { + return TimeUtils.getDateTimeString(mWeekChooseDay, TimeUtils.DATE_FORMAT); + } + + public String getWeekFirstDay() { + return weekFirstDay; + } + + public void setWeekFirstDay(String weekFirstDay) { + this.weekFirstDay = weekFirstDay; + } + + public String getWeekLastDay() { + return weekLastDay; + } + + public void setWeekLastDay(String weekLastDay) { + this.weekLastDay = weekLastDay; + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IClanIncomeView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IClanIncomeView.java new file mode 100644 index 0000000..8c15599 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IClanIncomeView.java @@ -0,0 +1,10 @@ +package com.chwl.app.module_hall.income.view; + +import com.chwl.core.module_hall.income.bean.ClanTotalIncomeInfo; +import com.chwl.library.base.IMvpBaseView; + +public interface IClanIncomeView extends IMvpBaseView { + + void incomeTotalSuccess(ClanTotalIncomeInfo clanTotalIncomeInfo); + void incomeTotalFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IHallIncomeView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IHallIncomeView.java new file mode 100644 index 0000000..14ddaec --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IHallIncomeView.java @@ -0,0 +1,10 @@ +package com.chwl.app.module_hall.income.view; + +import com.chwl.core.module_hall.income.bean.HallTotalIncomeInfo; +import com.chwl.library.base.IMvpBaseView; + +public interface IHallIncomeView extends IMvpBaseView { + + void incomeTotalSuccess(HallTotalIncomeInfo hallTotalIncomeInfo); + void incomeTotalFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeDetailView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeDetailView.java new file mode 100644 index 0000000..961c428 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeDetailView.java @@ -0,0 +1,12 @@ +package com.chwl.app.module_hall.income.view; + +import com.chwl.core.module_hall.income.bean.IncomeGiftInfo; +import com.chwl.library.base.IMvpBaseView; + +import java.util.List; + +public interface IIncomeDetailView extends IMvpBaseView { + + void incomeDetailSuccess(List incomeGiftInfoList); + void incomeDetailFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeStatisticsView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeStatisticsView.java new file mode 100644 index 0000000..c92850a --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeStatisticsView.java @@ -0,0 +1,6 @@ +package com.chwl.app.module_hall.income.view; + +import com.chwl.library.base.IMvpBaseView; + +public interface IIncomeStatisticsView extends IMvpBaseView { +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeView.java new file mode 100644 index 0000000..1bb3303 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/IIncomeView.java @@ -0,0 +1,10 @@ +package com.chwl.app.module_hall.income.view; + +import com.chwl.core.module_hall.income.bean.IncomeTotalInfo; +import com.chwl.library.base.IMvpBaseView; + +public interface IIncomeView extends IMvpBaseView { + + void incomeTotalSuccess(IncomeTotalInfo incomeTotalInfo); + void incomeTotalFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/ILiveIncomeView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/ILiveIncomeView.java new file mode 100644 index 0000000..3bff6fc --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/ILiveIncomeView.java @@ -0,0 +1,11 @@ +package com.chwl.app.module_hall.income.view; + +import com.chwl.core.module_hall.income.bean.LiveTotalIncomeInfo; +import com.chwl.library.base.IMvpBaseView; + +public interface ILiveIncomeView extends IMvpBaseView { + + void incomeTotalSuccess(LiveTotalIncomeInfo liveTotalIncomeInfo); + + void incomeTotalFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/ISingRoomIncomeView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/ISingRoomIncomeView.java new file mode 100644 index 0000000..63f60c7 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/ISingRoomIncomeView.java @@ -0,0 +1,10 @@ +package com.chwl.app.module_hall.income.view; + +import com.chwl.core.module_hall.income.bean.SingleRoomTotalIncomeInfo; +import com.chwl.library.base.IMvpBaseView; + +public interface ISingRoomIncomeView extends IMvpBaseView { + + void incomeTotalSuccess(SingleRoomTotalIncomeInfo incomeInfo); + void incomeTotalFail(String message); +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/LiveIncomeFragment.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/LiveIncomeFragment.java new file mode 100644 index 0000000..d64924d --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/income/view/LiveIncomeFragment.java @@ -0,0 +1,98 @@ +package com.chwl.app.module_hall.income.view; + +import android.os.Bundle; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.chwl.app.R; +import com.chwl.app.base.BaseMvpFragment; +import com.chwl.app.module_hall.income.adapter.LiveIncomeAdapter; +import com.chwl.app.module_hall.income.presenter.LiveIncomeFragmentPresenter; +import com.chwl.core.module_hall.income.bean.LiveTotalIncomeInfo; +import com.chwl.library.base.factory.CreatePresenter; +import com.chwl.library.utils.ListUtils; +import com.chwl.library.utils.ResUtil; + +/** + * 主播收入統計 + * Created by wushaocheng on 2022/11/10. + */ + +@CreatePresenter(LiveIncomeFragmentPresenter.class) +public class LiveIncomeFragment extends BaseMvpFragment implements ILiveIncomeView { + + public static final String FLAG_CLAN_ID = "clanId"; + private LiveIncomeAdapter mIncomeAdapter; + private DayIncomeFragmentListener mDayIncomeFragmentListener; + private long clanId; + + public static LiveIncomeFragment getInstance(long clanId) { + LiveIncomeFragment fragment = new LiveIncomeFragment(); + Bundle bundle = new Bundle(); + bundle.putLong(FLAG_CLAN_ID, clanId); + fragment.setArguments(bundle); + return fragment; + } + + @Override + public void onFindViews() { + RecyclerView recyclerView = mView.findViewById(R.id.recycler_view); + + mIncomeAdapter = new LiveIncomeAdapter(); + recyclerView.setLayoutManager(new LinearLayoutManager(mContext)); + recyclerView.setAdapter(mIncomeAdapter); + } + + @Override + public void onSetListener() { + } + + @Override + public void initiate() { + } + + public void getIncomeTotal(String startTimeStr, String endTimeStr) { + clanId = requireArguments().getLong(FLAG_CLAN_ID); + getMvpPresenter().incomeTotal(clanId, startTimeStr, endTimeStr); + } + + @Override + public int getRootLayoutId() { + return R.layout.fragment_hall_income; + } + + private void setTotal(double total) { + if (mDayIncomeFragmentListener != null) + mDayIncomeFragmentListener.setTotal(total); + } + + public void setmDayIncomeFragmentListener(DayIncomeFragmentListener mDayIncomeFragmentListener) { + this.mDayIncomeFragmentListener = mDayIncomeFragmentListener; + } + + @Override + public void incomeTotalSuccess(LiveTotalIncomeInfo liveTotalIncomeInfo) { + setTotal(liveTotalIncomeInfo.getTotal()); + if (!ListUtils.isListEmpty(liveTotalIncomeInfo.getMemberIncome())) { + hideStatus(); + mIncomeAdapter.setNewData(liveTotalIncomeInfo.getMemberIncome()); + } else { + mIncomeAdapter.setNewData(null); + showNoData(ResUtil.getString(R.string.module_hall_income_clanincomefragment_01)); + } + + } + + @Override + public void incomeTotalFail(String message) { + showNoData(ResUtil.getString(R.string.module_hall_income_clanincomefragment_02)); + setTotal(0); + mIncomeAdapter.setNewData(null); + } + + public interface DayIncomeFragmentListener { + void setTotal(double total); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/secretcode/PwdCodeMgr.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/secretcode/PwdCodeMgr.java new file mode 100644 index 0000000..f5208d4 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/secretcode/PwdCodeMgr.java @@ -0,0 +1,55 @@ +package com.chwl.app.module_hall.secretcode; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.chwl.core.module_hall.secretcode.bean.SecretCodeInfo; +import com.chwl.core.utils.SharedPreferenceUtils; + +/** + * emoji 暗号的一个缓存处理,24小时刷新 + * Created by lvzebiao on 2019/2/27. + */ + +public class PwdCodeMgr { + /** + * 保存暗号的信息 + */ + public final static String KEY_EMOJI_CODE_JSON = "emoji_code_json"; + + private SecretCodeInfo mCodeInfo = null; + + private static final class Helper { + public static final PwdCodeMgr INSTANCE = new PwdCodeMgr(); + } + + public static PwdCodeMgr get() { + return Helper.INSTANCE; + } + + public void onCreateInit() { + getCodeFromCache(); + } + + /** + * 用户退出登录的时候调用 + */ + public void onLogout() { + mCodeInfo = null; + SharedPreferenceUtils.put(KEY_EMOJI_CODE_JSON, ""); + } + + private void getCodeFromCache() { + try { + if (mCodeInfo == null) { + String json = (String) SharedPreferenceUtils.get(KEY_EMOJI_CODE_JSON, ""); + if (!TextUtils.isEmpty(json)) { + mCodeInfo = new Gson().fromJson(json, SecretCodeInfo.class); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/HTeamDataManager.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/HTeamDataManager.java new file mode 100644 index 0000000..3672b1b --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/HTeamDataManager.java @@ -0,0 +1,46 @@ +package com.chwl.app.module_hall.team; + +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.Observer; + +import com.chwl.core.module_hall.hall.bean.HTeamInfo; + +/** + * 厅群信息的管理,只针对单个群信息 + * Created by lvzebiao on 2019/1/15. + */ + +public class HTeamDataManager { + + private MutableLiveData liveHTeamInfo; + + private String tid; + + private static final class Helper { + public static final HTeamDataManager INSTANCE = new HTeamDataManager(); + } + + public static HTeamDataManager get() { + return Helper.INSTANCE; + } + + public void init(String tid) { + this.tid = tid; + liveHTeamInfo = new MutableLiveData<>(); + } + + public void onDestroy() { + this.tid = null; + liveHTeamInfo = null; + } + + public void registerInfo(LifecycleOwner owner, Observer observer) { + if (liveHTeamInfo == null) { + return; + } + liveHTeamInfo.observe(owner, observer); + } + + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/HTeamMemberListActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/HTeamMemberListActivity.java new file mode 100644 index 0000000..2342dd7 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/HTeamMemberListActivity.java @@ -0,0 +1,400 @@ +package com.chwl.app.module_hall.team.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.text.style.ForegroundColorSpan; +import android.view.View; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.chwl.app.ui.widget.TextSpannableBuilder; +import com.netease.nim.uikit.business.ait.AitContactType; +import com.netease.nim.uikit.business.ait.selector.AitContactSelectorActivity; +import com.chwl.app.R; +import com.chwl.app.UIHelper; +import com.chwl.app.avroom.widget.MessageView; +import com.chwl.app.base.BaseViewBindingActivity; +import com.chwl.app.base.TitleBar; +import com.chwl.app.base.list.BaseViewHolder; +import com.chwl.app.base.list.CommonAdapter; +import com.chwl.app.base.list.IRecyclerListener; +import com.chwl.app.base.list.LineColorDecoration; +import com.chwl.app.common.widget.dialog.DialogManager; +import com.chwl.app.databinding.ActivityHteamMemberListBinding; +import com.chwl.app.module_hall.HallConstant; +import com.chwl.app.module_hall.team.adapter.HTeamMemberListAdapter; +import com.chwl.app.team.bean.NimTeamMember; +import com.chwl.core.module_hall.hall.bean.HTeamInfo; +import com.chwl.core.module_hall.hall.bean.HTeamMember; +import com.chwl.core.module_hall.team.HTeamModel; +import com.chwl.core.module_hall.team.event.HteamMemberNumChangeEvent; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.library.utils.ResUtil; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.ArrayList; +import java.util.List; + +import io.reactivex.Single; + +/** + * 厅群成员列表 + * Created by lvzebiao on 2019/1/14. + */ + +public class HTeamMemberListActivity extends BaseViewBindingActivity implements IRecyclerListener { + + private HTeamInfo hTeamInfo; + + /** + * 页面类型{@link HTeamMemberListAdapter.Type} + */ + private int pageType; + + private HTeamMemberListAdapter adapter; + /** + * 群人数 + */ + private int allCount; + /**群管理人数*/ + private int managerCount; + /**已禁言人数*/ + private int muteCount; + /** + * 我自己在群聊中的角色 + */ + private int myRole; + + public static void start(Activity context, HTeamInfo info, int type) { + start(context, info, type, 0); + } + + public static void start(Activity context, HTeamInfo info, int type, int requestCode) { + Intent intent = new Intent(context, HTeamMemberListActivity.class); + intent.putExtra(HallConstant.EXTRA_DATA_BEAN, info); + intent.putExtra(HallConstant.EXTRA_HTEAM_LIST_TYPE, type); + if (requestCode > 0) { + context.startActivityForResult(intent, requestCode); + } else { + context.startActivity(intent); + } + } + + @Override + public void init() { + EventBus.getDefault().register(this); + hTeamInfo = (HTeamInfo) getIntent().getSerializableExtra(HallConstant.EXTRA_DATA_BEAN); + pageType = getIntent().getIntExtra(HallConstant.EXTRA_HTEAM_LIST_TYPE, 0); + if (hTeamInfo == null) { + toast(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_01)); + finish(); + return; + } + String title; + if (pageType == HTeamMemberListAdapter.Type.MARK_ADMIN_MEMBERS) { + title = ResUtil.getString(R.string.team_activity_hteammemberlistactivity_02); + } else if (pageType == HTeamMemberListAdapter.Type.MARK_MUTE_MEMBERS) { + title = ResUtil.getString(R.string.team_activity_hteammemberlistactivity_03); + } else { + title = ResUtil.getString(R.string.team_activity_hteammemberlistactivity_04); + } + initTitleBar(title); + myRole = hTeamInfo.getRole(); + //管理员能添加和删除成员 + boolean isManager = (myRole == HTeamMember.TYPE.TEAM_OWNER || + myRole == HTeamMember.TYPE.TEAM_ADMIN); + if (pageType == HTeamMemberListAdapter.Type.CHECK_ALL_MEMBERS + && isManager) { + mTitleBar.addAction(new TitleBar.ImageAction(R.drawable.ic_add_hteam_member) { + @Override + public void performAction(View view) { + SelectTeamMemberActivity.start(context, + SelectTeamMemberActivity.TYPE_INVATE_TO_HTEAM, hTeamInfo.getChatId()); + } + }); + mTitleBar.addAction(new TitleBar.ImageAction(R.drawable.ic_remove_hteam_member) { + @Override + public void performAction(View view) { + adapter.setShowRemoveIcon(true); + binding.refreshRecyclerView.getWrapper().notifyDataSetChanged(); + } + }); + } + updateCountView(); + binding.refreshRecyclerView.addItemDecoration( + new LineColorDecoration( + this, + R.color.line_color, + 15, 15)); + binding.refreshRecyclerView.setPageSize(50); + binding.refreshRecyclerView.setRecyclerListener(this, this); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onHteamMemberNumChange(HteamMemberNumChangeEvent event) { + //刷新列表 + binding.refreshRecyclerView.onRefreshList(); + if (hTeamInfo != null) { + HTeamModel.get().getDetailHTeamInfo(hTeamInfo.getTid()).subscribe(); + } + } + + @Override + public CommonAdapter createAdapter(Context context) { + adapter = new HTeamMemberListAdapter( + R.layout.item_hteam_member_common, pageType, myRole); + adapter + .setOnItemClickListener((holder, item, position) -> { + if (item == null) { + return; + } + if (pageType == HTeamMemberListAdapter.Type.AIT_MEMBERS) { + Intent intent = new Intent(); + NimTeamMember member = new NimTeamMember(); + String tid = getIntent().getStringExtra(HallConstant.EXTRA_TID); + if (tid == null) { + tid = ""; + } + member.setTid(tid); + member.setAccount(String.valueOf(item.getUid())); + member.setTeamNick(item.getNick()); + intent.putExtra(AitContactSelectorActivity.RESULT_DATA, member); + intent.putExtra(AitContactSelectorActivity.RESULT_TYPE, + AitContactType.TEAM_MEMBER); + setResult(RESULT_OK, intent); + finish(); + return; + } + if (pageType == HTeamMemberListAdapter.Type.CHECK_ALL_MEMBERS) { + //成员列表才能查看客态主页 + if (!adapter.isShowRemoveIcon()) { + UIHelper.showUserInfoAct(context, item.getUid()); + } + } + }) + .addChildClickIds(R.id.iv_operation) + .setOnItemChildClickListener((holder, viewId, item, position) -> + handleOperation(holder, item)); + return adapter; + } + + @Override + public RecyclerView.LayoutManager createLayoutManager() { + return new LinearLayoutManager(this); + } + + @Override + public Single> getSingle(int page, int size) { + return HTeamModel.get().getAllMembers(hTeamInfo.getChatId(), page, size) + .flatMap(listMemberInfo -> { + List list = listMemberInfo.getMembers(); + if (list == null) { + list = new ArrayList<>(); + } + allCount = listMemberInfo.getCount(); + muteCount = listMemberInfo.getMuteCount(); + managerCount = listMemberInfo.getManagerCount(); + updateCountView(); + return Single.just(list); + }); + } + + private void updateCountView() { + if (pageType == HTeamMemberListAdapter.Type.MARK_MUTE_MEMBERS) { + binding.tvListInfo.setText(getResources().getString(R.string.lu_hteam_has_mute_num, muteCount)); + } else if (pageType == HTeamMemberListAdapter.Type.MARK_ADMIN_MEMBERS) { + binding.tvListInfo.setText(getResources().getString(R.string.lu_hteam_manager_num, managerCount)); + } else { + binding.tvListInfo.setText(getResources().getString(R.string.lu_hteam_num, allCount)); + } + } + + private void handleOperation(BaseViewHolder holder, HTeamMember item) { + if (pageType == HTeamMemberListAdapter.Type.MARK_ADMIN_MEMBERS) { + managerOp(item); + } else if (pageType == HTeamMemberListAdapter.Type.MARK_MUTE_MEMBERS) { + lockMicOp(item); + } else if (pageType == HTeamMemberListAdapter.Type.CHECK_ALL_MEMBERS) { + removeMemberOp(item); + } + } + + /** + * 禁言操作 + */ + private void lockMicOp(HTeamMember item) { + if (item.isBannedStatus()) { + HTeamModel.get().banHteamMember(item.getChatId(), item.getUid(), false) + .compose(bindToLifecycle()) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + toast(error); + } + + @Override + public void onSuccess(String s) { + item.setBannedStatus(false); + muteCount --; + updateCountView(); + binding.refreshRecyclerView.getWrapper().notifyDataSetChanged(); + } + }); + return; + } + TextSpannableBuilder builder = new TextSpannableBuilder(null); + builder.append(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_05)) + .append(item.getNick(), new ForegroundColorSpan( + getResources().getColor(R.color.appColor))) + .append(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_06)); + getDialogManager().showOkCancelDialog(builder.build(), new DialogManager.OkCancelDialogListener() { + @Override + public void onCancel() { + + } + + @Override + public void onOk() { + HTeamModel.get().banHteamMember(item.getChatId(), item.getUid(), true) + .compose(bindToLifecycle()) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + toast(error); + } + + @Override + public void onSuccess(String s) { + item.setBannedStatus(true); + muteCount ++; + updateCountView(); + binding.refreshRecyclerView.getWrapper().notifyDataSetChanged(); + } + }); + } + }); + } + + /** + * 管理员处理 + */ + private void managerOp(HTeamMember item) { + TextSpannableBuilder builder = new TextSpannableBuilder(null); + if (item.isAdmin()) { + builder.append(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_07)) + .append(item.getNick(), new ForegroundColorSpan( + getResources().getColor(R.color.appColor))) + .append(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_08)); + } else { + builder.append(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_09)) + .append(item.getNick(), new ForegroundColorSpan( + getResources().getColor(R.color.appColor))) + .append(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_010)); + } + getDialogManager().showOkCancelDialog(builder.build(), new DialogManager.OkCancelDialogListener() { + @Override + public void onCancel() { + + } + + @Override + public void onOk() { + Single single; + if (item.isAdmin()) { + single = HTeamModel.get().removeHteamManager(item.getChatId(), item.getUid()); + } else { + single = HTeamModel.get().setHteamManager(item.getChatId(), item.getUid()); + } + single.compose(bindToLifecycle()) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + toast(error); + } + + @Override + public void onSuccess(String s) { + toast(s); + if (item.isAdmin()) { + managerCount --; + item.setRoleType(HTeamMember.TYPE.TEAM_NORMAL); + } else { + managerCount ++; + item.setRoleType(HTeamMember.TYPE.TEAM_ADMIN); + } + updateCountView(); + binding.refreshRecyclerView.getWrapper().notifyDataSetChanged(); + //更新群信息 + HTeamModel.get().getDetailHTeamInfo(hTeamInfo.getTid()).subscribe(); + } + }); + } + }); + } + + /** + * 删除群成员 + */ + private void removeMemberOp(HTeamMember item) { + TextSpannableBuilder builder = new TextSpannableBuilder(null); + builder.append(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_011)) + .append(item.getNick(), new ForegroundColorSpan(getResources().getColor(R.color.appColor))) + .append(ResUtil.getString(R.string.team_activity_hteammemberlistactivity_012)); + getDialogManager().showOkCancelDialog(builder.build(), new DialogManager.OkCancelDialogListener() { + @Override + public void onCancel() { + adapter.setShowRemoveIcon(false); + binding.refreshRecyclerView.getWrapper().notifyDataSetChanged(); + } + + @Override + public void onOk() { + HTeamModel.get().kickHteamMember(item.getChatId(), String.valueOf(item.getUid())) + .compose(bindToLifecycle()) + .doOnSuccess(s -> + HTeamModel.get().getDetailHTeamInfo(hTeamInfo.getTid()).subscribe()) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + toast(error); + } + + @Override + public void onSuccess(String s) { + adapter.setShowRemoveIcon(false); + if (adapter.getData().contains(item)) { + int positon = adapter.getData().indexOf(item); + adapter.getData().remove(positon); + } + binding.refreshRecyclerView.getWrapper().notifyDataSetChanged(); + allCount--; + updateCountView(); + } + }); + + } + }); + } + + @Override + public void onBackPressed() { + if (adapter != null && adapter.isShowRemoveIcon()) { + adapter.setShowRemoveIcon(false); + binding.refreshRecyclerView.getWrapper().notifyDataSetChanged(); + return; + } + super.onBackPressed(); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/HallTeamMessageActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/HallTeamMessageActivity.java new file mode 100644 index 0000000..bcf9b8b --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/HallTeamMessageActivity.java @@ -0,0 +1,360 @@ +package com.chwl.app.module_hall.team.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import com.chwl.app.R; +import com.chwl.app.module_hall.team.HTeamDataManager; +import com.chwl.app.module_hall.team.adapter.HTeamMemberListAdapter; +import com.chwl.app.team.view.NimTeamManagementActivity; +import com.chwl.app.team.view.NimTeamMessageFragment; +import com.chwl.app.team.viewmodel.TeamVM; +import com.chwl.app.ui.im.avtivity.BaseMessageActivity; +import com.chwl.core.initial.InitialModel; +import com.chwl.core.initial.bean.InitInfo; +import com.chwl.core.level.UserLevelVo; +import com.chwl.core.module_hall.hall.bean.HTeamInfo; +import com.chwl.core.module_hall.team.HTeamModel; +import com.chwl.core.team.bean.TeamEvent; +import com.chwl.core.user.UserModel; +import com.chwl.core.user.bean.UserInfo; +import com.chwl.library.rxbus.RxBus; +import com.chwl.library.utils.ResUtil; +import com.netease.nim.uikit.api.NimUIKit; +import com.netease.nim.uikit.api.model.contact.ContactChangedObserver; +import com.netease.nim.uikit.api.model.team.TeamDataChangedObserver; +import com.netease.nim.uikit.api.model.team.TeamMemberDataChangedObserver; +import com.netease.nim.uikit.api.wrapper.NimToolBarOptions; +import com.netease.nim.uikit.business.ait.AitManager; +import com.netease.nim.uikit.business.ait.event.AitContactActionEvent; +import com.netease.nim.uikit.business.ait.selector.AitContactSelectorActivity; +import com.netease.nim.uikit.business.session.constant.Extras; +import com.netease.nim.uikit.business.session.fragment.MessageFragment; +import com.netease.nim.uikit.business.session.module.list.MessageListPanelEx; +import com.netease.nim.uikit.common.activity.ToolBarOptions; +import com.netease.nim.uikit.impl.NimUIKitImpl; +import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum; +import com.netease.nimlib.sdk.team.constant.TeamTypeEnum; +import com.netease.nimlib.sdk.team.model.Team; +import com.netease.nimlib.sdk.team.model.TeamMember; +import com.trello.rxlifecycle3.android.ActivityEvent; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.List; +import java.util.Objects; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + + +/** + * 厅群 + * Created by lvzebiao on 2019/1/10. + */ +public class HallTeamMessageActivity extends BaseMessageActivity { + + private static final String TAG = "NimTeamMessageActivity"; + + // model + private Team team; + /** + * 群详情 + */ + private HTeamInfo hTeamInfo; + + private View invalidTeamTipView; + + private TextView invalidTeamTipText; + + private ImageView managementView; + + private NimTeamMessageFragment fragment; + + private ImageView ivSetting; + + private TeamVM teamViewModel; + + + public static void start(Context context, String tid) { + Intent intent = new Intent(); + intent.putExtra(Extras.EXTRA_ACCOUNT, tid); + intent.putExtra(Extras.EXTRA_CUSTOMIZATION, NimUIKitImpl.commonTeamSessionCustomization); + intent.setClass(context, HallTeamMessageActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); + context.startActivity(intent); + } + + protected void findViews() { + invalidTeamTipView = findViewById(R.id.invalid_team_tip); + invalidTeamTipText = findViewById(R.id.invalid_team_text); + managementView = findViewById(R.id.iv_team_member_list); + ivSetting = findViewById(R.id.iv_setting); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + HTeamDataManager.get().init(sessionId); + findViews(); + + teamViewModel = new TeamVM(); + + openTeamManagementPage(); + + registerTeamUpdateObserver(true); + + RxBus.get().toFlowable(TeamEvent.class) + .compose(bindUntilEvent(ActivityEvent.DESTROY)) + .subscribeOn(Schedulers.computation()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(teamEvent -> { + switch (teamEvent.getOperation()) { + case TeamEvent.OP_DELETE_TEAM: + case TeamEvent.OP_QUIT_TEAM: + requestTeamInfo(); + break; + + case TeamEvent.OP_UPDATE_MSG: + MessageListPanelEx messageListPanelEx = fragment.getMessageListPanelEx(); + int itemIndex = messageListPanelEx.getItemIndex(teamEvent.getMsgUuid()); + messageListPanelEx.refreshViewHolderByIndex(itemIndex); + break; + } + }); + EventBus.getDefault().register(this); + requestTeamInfo(); + } + + private void setTitleBar(Team team) { + initTitleBar(team.getName()); + if (team.isMyTeam()) { + ivSetting.setVisibility(View.GONE); + } else { + ivSetting.setVisibility(View.GONE); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + HTeamDataManager.get().onDestroy(); + registerTeamUpdateObserver(false); + EventBus.getDefault().unregister(this); + } + + @Override + protected void onStart() { + super.onStart(); + } + + @Override + protected void onResume() { + super.onResume(); + } + + /** + * 强行完成@人页面的跳转 + * + * @see AitManager 下的 afterTextChanged 方法里改掉原来的跳转逻辑, + * 通过 rxbus 的方式在这里打开我们的成员列表页面 + */ + @Subscribe(threadMode = ThreadMode.MAIN) + public void openAitTeamMemberPage(AitContactActionEvent event) { + String content = event.getContent(); + if (content != null && !Objects.equals(content, "") && content.endsWith("@")) { + if (hTeamInfo == null) { + return; + } + //跳转到群成员列表 + HTeamMemberListActivity.start(this, hTeamInfo, HTeamMemberListAdapter.Type.AIT_MEMBERS, + AitContactSelectorActivity.REQUEST_CODE); + } + } + + public void openTeamManagementPage() { + managementView.setOnClickListener(v -> { + NimTeamManagementActivity.start(this, team.getId()); + }); + } + + /** + * 请求群基本信息 + */ + private void requestTeamInfo() { + // 请求群基本信息 + Team t = NimUIKit.getTeamProvider().getTeamById(sessionId); + if (t != null) { + updateTeamInfo(t); + } else { + NimUIKit.getTeamProvider().fetchTeamById(sessionId, (success, result, code) -> { + if (success && result != null) { + updateTeamInfo(result); + } else { + onRequestTeamInfoFailed(); + } + }); + } + HTeamModel.get().getDetailHTeamInfo(sessionId) + .compose(bindToLifecycle()) + .subscribe(info -> this.hTeamInfo = info); + } + + private void onRequestTeamInfoFailed() { + toast(ResUtil.getString(R.string.team_activity_hallteammessageactivity_01)); + } + + /** + * 更新群信息 + * + * @param d + */ + private void updateTeamInfo(final Team d) { + if (d == null) { + return; + } + + team = d; + fragment.setTeam(team); + + setTitle(team == null ? sessionId : team.getName() + "(" + team.getMemberCount() + ResUtil.getString(R.string.team_activity_hallteammessageactivity_02)); + + invalidTeamTipText.setText(team.getType() == TeamTypeEnum.Normal ? R.string.normal_team_invalid_tip : R.string.team_invalid_tip); + invalidTeamTipView.setVisibility(team.isMyTeam() ? View.GONE : View.VISIBLE); + + managementView.setVisibility(team.isMyTeam() ? View.VISIBLE : View.GONE); + + setTitleBar(team); + + } + + @Override + public void setTitle(CharSequence title) { + super.setTitle(title); + getToolBar().setTitle(title); + } + + /** + * 注册群信息更新监听 + * + * @param register + */ + private void registerTeamUpdateObserver(boolean register) { + NimUIKit.getTeamChangedObservable().registerTeamDataChangedObserver(teamDataChangedObserver, register); + NimUIKit.getTeamChangedObservable().registerTeamMemberDataChangedObserver(teamMemberDataChangedObserver, register); + NimUIKit.getContactChangedObservable().registerObserver(friendDataChangedObserver, register); + } + + /** + * 群资料变动通知和移除群的通知(包括自己退群和群被解散) + */ + TeamDataChangedObserver teamDataChangedObserver = new TeamDataChangedObserver() { + @Override + public void onUpdateTeams(List teams) { + if (team == null) { + return; + } + for (Team t : teams) { + if (t.getId().equals(team.getId())) { + updateTeamInfo(t); + break; + } + } + } + + @Override + public void onRemoveTeam(Team team) { + if (team == null) { + return; + } + if (team.getId().equals(HallTeamMessageActivity.this.team.getId())) { + updateTeamInfo(team); + } + } + }; + + /** + * 群成员资料变动通知和移除群成员通知 + */ + TeamMemberDataChangedObserver teamMemberDataChangedObserver = new TeamMemberDataChangedObserver() { + + @Override + public void onUpdateTeamMember(List members) { + fragment.refreshMessageList(); + } + + @Override + public void onRemoveTeamMember(List member) { + Log.e(TAG, "onRemoveTeamMember() called with: member = [" + member + "]"); + } + }; + + ContactChangedObserver friendDataChangedObserver = new ContactChangedObserver() { + @Override + public void onAddedOrUpdatedFriends(List accounts) { + fragment.refreshMessageList(); + } + + @Override + public void onDeletedFriends(List accounts) { + fragment.refreshMessageList(); + } + + @Override + public void onAddUserToBlackList(List account) { + fragment.refreshMessageList(); + } + + @Override + public void onRemoveUserFromBlackList(List account) { + fragment.refreshMessageList(); + } + }; + + @Override + protected MessageFragment fragment() { + // 添加fragment + Bundle arguments = getIntent().getExtras(); + if (arguments != null) { + arguments.putSerializable(Extras.EXTRA_TYPE, SessionTypeEnum.Team); + } + fragment = new NimTeamMessageFragment(); + fragment.setArguments(arguments); + fragment.setContainerId(R.id.message_fragment_container); + + // 等级限制 + UserInfo userInfo = UserModel.get().getCacheLoginUserInfo(); + if (userInfo != null) { + UserLevelVo userLevelVo = userInfo.getUserLevelVo(); + if (userLevelVo != null) { + fragment.setCurrentLevel(userLevelVo.experLevelSeq); + } + } + InitInfo initInfo = InitialModel.get().getCacheInitInfo(); + if (initInfo != null) { + fragment.setLimitLevel(initInfo.getPrivateChatLevelNo()); + } + + return fragment; + } + + @Override + protected int getContentViewId() { + return R.layout.activity_hall_team_message; + } + + @Override + protected void initToolBar() { + ToolBarOptions options = new NimToolBarOptions(); + options.titleString = ResUtil.getString(R.string.team_activity_hallteammessageactivity_03); + setToolBar(R.id.toolbar, options); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/SelectTeamMemberActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/SelectTeamMemberActivity.java new file mode 100644 index 0000000..7c2f8a7 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/SelectTeamMemberActivity.java @@ -0,0 +1,195 @@ +package com.chwl.app.module_hall.team.activity; + +import android.content.Context; +import android.content.Intent; +import android.util.ArrayMap; +import android.view.View; +import android.widget.ImageView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.chwl.app.R; +import com.chwl.app.base.BaseViewBindingActivity; +import com.chwl.app.base.TitleBar; +import com.chwl.app.base.list.BaseViewHolder; +import com.chwl.app.base.list.CommonAdapter; +import com.chwl.app.base.list.IRecyclerListener; +import com.chwl.app.base.list.LineColorDecoration; +import com.chwl.app.databinding.ActivitySelectGroupMemberBinding; +import com.chwl.app.module_hall.HallConstant; +import com.chwl.app.module_hall.HallDataManager; +import com.chwl.app.module_hall.team.adapter.SelectTeamMemberAdapter; +import com.chwl.core.module_hall.hall.HallModel; +import com.chwl.core.module_hall.hall.bean.ListMemberInfo; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.core.module_hall.team.HTeamModel; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.library.utils.ResUtil; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import io.reactivex.Single; + +/** + * 选择群成员 + * Created by lvzebiao on 2019/1/3. + */ + +public class SelectTeamMemberActivity extends BaseViewBindingActivity implements IRecyclerListener { + + /** + * 添加厅成员到群 + */ + public final static int TYPE_INVATE_TO_HTEAM = 1; + + private SelectTeamMemberAdapter adapter; + + private int type; + + private long chatId; + + private Map lastPageMap = new ArrayMap<>(); + + public static void start(Context context) { + start(context, 0, 0); + } + + public static void start(Context context, int type, long chatId) { + Intent intent = new Intent(context, SelectTeamMemberActivity.class); + intent.putExtra("type", type); + intent.putExtra(HallConstant.EXTRA_CHAT_ID, chatId); + context.startActivity(intent); + } + + @Override + public void init() { + type = getIntent().getIntExtra("type", 0); + chatId = getIntent().getLongExtra(HallConstant.EXTRA_CHAT_ID, 0); + //noinspection unchecked + List lastPageList = (ArrayList) getIntent() + .getSerializableExtra("EXTRA_SELECTED_MEMBERS"); + if (lastPageList == null) { + lastPageList = new ArrayList<>(); + } + for (MemberInfo info : lastPageList) { + lastPageMap.put(info.getUid(), info); + } + if (type == TYPE_INVATE_TO_HTEAM) { + initTitleBar(R.string.lu_invite_group_member); + } else { + initTitleBar(R.string.lu_select_group_member); + } + binding.refreshRecyclerView.addItemDecoration( + new LineColorDecoration( + this, + R.color.line_color, + 15, 15)); + binding.refreshRecyclerView.setPageSize(50); + binding.refreshRecyclerView.setRecyclerListener(this, this); + binding.titleBar.setActionTextColor(getResources().getColor(R.color.appColor)); + binding.titleBar.addAction(new TitleBar.TextAction(ResUtil.getString(R.string.team_activity_selectteammemberactivity_01)) { + @Override + public void performAction(View view) { + if (adapter == null) { + return; + } + ArrayList selectList = new ArrayList<>(); + for (MemberInfo info : adapter.getData()) { + if (info.isSelect()) { + selectList.add(info); + } + } + if (selectList.size() == 0) { + toast(ResUtil.getString(R.string.team_activity_selectteammemberactivity_02)); + return; + } + if (type == TYPE_INVATE_TO_HTEAM) { + //邀请进群 + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < selectList.size(); i++) { + builder.append(selectList.get(i).getUid()); + if (i < selectList.size() - 1) { + builder.append(","); + } + } + getDialogManager().showProgressDialog(context); + HTeamModel.get().invateHteamMember(chatId, builder.toString()) + .compose(bindToLifecycle()) + .doAfterTerminate(() -> getDialogManager().dismissDialog()) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + toast(error); + } + + @Override + public void onSuccess(String s) { + toast(s); + finish(); + } + }); + return; + } + Intent intent = new Intent(); + intent.putExtra("EXTRA_SELECTED_MEMBERS", selectList); + setResult(RESULT_OK, intent); + finish(); + } + }); + setSelectCount(0); + } + + @Override + public CommonAdapter createAdapter(Context context) { + adapter = new SelectTeamMemberAdapter(R.layout.list_item_common_group_member); + adapter.addChildClickIds(R.id.iv_select) + .setOnItemChildClickListener((holder, viewId, item, position) -> { + item.setSelect(!item.isSelect()); + ImageView ivSelect = holder.getView(R.id.iv_select); + ivSelect.setImageResource(item.isSelect() ? + R.drawable.ic_hall_member_checked : R.drawable.ic_hall_member_unchecked); + int selectCount = 0; + for (MemberInfo info : adapter.getData()) { + if (info.isSelect()) { + selectCount++; + } + } + setSelectCount(selectCount); + }); + return adapter; + } + + @Override + public RecyclerView.LayoutManager createLayoutManager() { + return new LinearLayoutManager(this); + } + + @Override + public Single> getSingle(int page, int size) { + Single single; + if (type == TYPE_INVATE_TO_HTEAM) { + single = HTeamModel.get().getHallMemberButChat(chatId, page, size); + } else { + single = HallModel.get().getAllMembers(HallDataManager.get().getHallId(), page, size); + } + return single + .flatMap(listMemberInfo -> { + List list = listMemberInfo.getMembers(); + if (list == null) { + list = new ArrayList<>(); + } + for (MemberInfo info : list) { + info.setSelect(lastPageMap.containsKey(info.getUid())); + } + return Single.just(list); + }); + } + + private void setSelectCount(int count) { + binding.tvHasSelectNum.setText(getResources().getString(R.string.lu_has_select_num, count)); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/TeamEditActivity.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/TeamEditActivity.java new file mode 100644 index 0000000..b0a2c6d --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/activity/TeamEditActivity.java @@ -0,0 +1,132 @@ +package com.chwl.app.module_hall.team.activity; + +import android.content.Context; +import android.content.Intent; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.View; + +import com.chwl.app.R; +import com.chwl.app.base.BaseViewBindingActivity; +import com.chwl.app.base.TitleBar; +import com.chwl.app.databinding.ActivityTeamEditBinding; +import com.chwl.app.module_hall.HallConstant; +import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil; +import com.chwl.core.module_hall.hall.bean.HTeamInfo; +import com.chwl.core.module_hall.team.HTeamModel; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.core.utils.net.RxHelper; +import com.chwl.library.utils.ResUtil; + +/** + * 群公告,群名称编辑 + * Created by lvzebiao on 2019/1/4. + */ + +public class TeamEditActivity extends BaseViewBindingActivity { + + /** + * 群名称 + */ + public final static int TYPE_EDIT_TEAM_NAME = 0; + /** + * 群公告 + */ + public final static int TYPE_EDIT_TEAM_NOTICE = 1; + + public final static String KEY_TYPE_EDIT = "type_edit"; + + private int type = TYPE_EDIT_TEAM_NAME; + + private int maxLength = 0; + + private HTeamInfo hTeamInfo; + + public static void start(Context context, int type, HTeamInfo info) { + Intent intent = new Intent(context, TeamEditActivity.class); + intent.putExtra(KEY_TYPE_EDIT, type); + intent.putExtra(HallConstant.EXTRA_DATA_BEAN, info); + context.startActivity(intent); + } + + @Override + public void init() { + if (getIntent() != null) { + type = getIntent().getIntExtra(KEY_TYPE_EDIT, TYPE_EDIT_TEAM_NAME); + hTeamInfo = (HTeamInfo) getIntent().getSerializableExtra(HallConstant.EXTRA_DATA_BEAN); + } + if (hTeamInfo == null) { + toast(ResUtil.getString(R.string.team_activity_teameditactivity_01)); + finish(); + return; + } + if (type == TYPE_EDIT_TEAM_NAME) { + initTitleBar(R.string.lu_team_name); + maxLength = 15; + binding.etContent.setHint(ResUtil.getString(R.string.team_activity_teameditactivity_02)); + binding.etContent.getLayoutParams().height = UIUtil.dip2px(this, 45); + binding.tvLimit.setVisibility(View.GONE); + binding.etContent.setSingleLine(true); + binding.ivClearText.setVisibility(View.VISIBLE); + binding.ivClearText.setOnClickListener(v -> binding.etContent.setText("")); + binding.etContent.setTextAutoCursor(hTeamInfo.getName()); + binding.etContent.setGravity(Gravity.CENTER_VERTICAL); + binding.etContent.setMaxLength(maxLength); + binding.etContent.setBanBlank(true); + } else { + initTitleBar(R.string.lu_team_notice); + maxLength = 150; + binding.etContent.setHint(ResUtil.getString(R.string.team_activity_teameditactivity_03)); + binding.ivClearText.setVisibility(View.GONE); + binding.etContent.setTextAutoCursor(hTeamInfo.getNotice()); + binding.etContent.setGravity(Gravity.START); + binding.etContent.setMaxLength(maxLength); + binding.etContent.setBanBlank(false); + } + + binding.tvLimit.setText(getResources().getString(R.string.lu_limit_edit_num, maxLength)); + binding.titleBar.setActionTextColor(getResources().getColor(R.color.appColor)); + binding.titleBar.addAction(new TitleBar.TextAction(ResUtil.getString(R.string.team_activity_teameditactivity_04)) { + @Override + public void performAction(View view) { + submit(); + } + }); + } + + private void submit() { + String newContent = binding.etContent.getText().toString(); + String newName = null; + String newNotice = null; + if (type == TYPE_EDIT_TEAM_NAME) { + if (TextUtils.isEmpty(newContent)) { + toast(ResUtil.getString(R.string.team_activity_teameditactivity_05)); + return; + } + newName = newContent; + } else { + if (TextUtils.isEmpty(newContent)) { + toast(ResUtil.getString(R.string.team_activity_teameditactivity_06)); + return; + } + newNotice = newContent; + } + getDialogManager().showProgressDialog(this); + HTeamModel.get().updateTeamInfo(hTeamInfo.getChatId(), null, newName, newNotice) + .compose(RxHelper.bindActivity(this)) + .doAfterTerminate(() -> getDialogManager().dismissDialog()) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + toast(error); + } + + @Override + public void onSuccess(String s) { + HTeamModel.get().getDetailHTeamInfo(hTeamInfo.getTid()).subscribe(); + finish(); + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/adapter/HTeamMemberListAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/adapter/HTeamMemberListAdapter.java new file mode 100644 index 0000000..1254b27 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/adapter/HTeamMemberListAdapter.java @@ -0,0 +1,118 @@ +package com.chwl.app.module_hall.team.adapter; + +import android.view.View; +import android.widget.ImageView; + +import com.chwl.app.R; +import com.chwl.app.base.list.BaseViewHolder; +import com.chwl.app.base.list.CommonAdapter; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.widget.UserInfoView; +import com.chwl.core.module_hall.hall.bean.HTeamMember; +import com.chwl.core.user.UserModel; + +/** + * 厅群成员列表 + * Created by lvzebiao on 2019/1/14. + */ + +public class HTeamMemberListAdapter extends CommonAdapter { + + private int type; + /**显示删除按钮*/ + private boolean showRemoveIcon; + /** + * 表示自己在群里的角色 + */ + private int myRole; + + public interface Type { + /**查看所有成员*/ + int CHECK_ALL_MEMBERS = 0; + /**禁言列表*/ + int MARK_MUTE_MEMBERS = 1; + /**设置管理列表*/ + int MARK_ADMIN_MEMBERS = 2; + /** + * @ 人的处理 + */ + int AIT_MEMBERS = 3; + } + + public HTeamMemberListAdapter(int layoutId, int type, int myRole) { + super(layoutId); + this.type = type; + this.myRole = myRole; + } + + public void setShowRemoveIcon(boolean showRemoveIcon) { + this.showRemoveIcon = showRemoveIcon; + } + + public boolean isShowRemoveIcon() { + return showRemoveIcon; + } + + @Override + protected void convert(BaseViewHolder holder, HTeamMember item) { + UserInfoView userInfoView = holder.getView(R.id.user_info_view); + userInfoView.setData(item); + ImageLoadUtils.loadAvatar(item.getAvatar(), holder.getView(R.id.iv_avatar)); + holder.setText(R.id.tv_id, "ID : " + item.getErbanNo()); + //角色 + int labelId = 0; + if(item.getRoleType() == HTeamMember.TYPE.TEAM_OWNER) { + labelId = R.drawable.lable_hall_owner; + } else if (item.getRoleType() == HTeamMember.TYPE.TEAM_ADMIN) { + labelId = R.drawable.lable_hteam_admin; + } + if (labelId != 0) { + holder.setImageResource(R.id.iv_member_label, labelId); + } else { + holder.setImageDrawable(R.id.iv_member_label, null); + } + ImageView ivOperation = holder.getView(R.id.iv_operation); + if (type == Type.MARK_MUTE_MEMBERS) { + ivOperation.setImageResource(item.isBannedStatus() ? + R.drawable.ic_hteam_lock_mic_ture : R.drawable.ic_hteam_lock_mic_false); + handleOpBtnStatus(ivOperation, item); + } else if (type == Type.MARK_ADMIN_MEMBERS) { + if (item.getRoleType() == HTeamMember.TYPE.TEAM_ADMIN) { + ivOperation.setImageResource(R.drawable.ic_hall_member_checked); + } else { + ivOperation.setImageResource(R.drawable.ic_hall_member_unchecked); + } + if (UserModel.get().isMyseft(item.getUid())) { + ivOperation.setVisibility(View.GONE); + } else { + ivOperation.setVisibility(View.VISIBLE); + } + } else if (type == Type.AIT_MEMBERS) { + ivOperation.setVisibility(View.GONE); + } else { + //查看群成员 + if (showRemoveIcon) { + //移除群成员模式 + ivOperation.setImageResource(R.drawable.ic_remove); + handleOpBtnStatus(ivOperation, item); + } else { + ivOperation.setVisibility(View.GONE); + } + } + } + + private void handleOpBtnStatus(ImageView ivOperation, HTeamMember item) { + if (UserModel.get().isMyseft(item.getUid())) { + //自己不显示 + ivOperation.setVisibility(View.GONE); + } else if (item.getRoleType() == HTeamMember.TYPE.TEAM_OWNER) { + //厅主也不显示 + ivOperation.setVisibility(View.GONE); + } else if (myRole == item.getRoleType()) { + ivOperation.setVisibility(View.GONE); + } else { + ivOperation.setVisibility(View.VISIBLE); + } + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/adapter/SelectTeamMemberAdapter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/adapter/SelectTeamMemberAdapter.java new file mode 100644 index 0000000..5f1ea1d --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/adapter/SelectTeamMemberAdapter.java @@ -0,0 +1,51 @@ +package com.chwl.app.module_hall.team.adapter; + +import android.view.View; +import android.widget.ImageView; + +import com.chwl.app.R; +import com.chwl.app.base.list.BaseViewHolder; +import com.chwl.app.base.list.CommonAdapter; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.widget.UserInfoView; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.core.module_hall.hall.bean.RoleType; +import com.chwl.core.user.UserModel; + +/** + * 选择厅成员 + * Created by lvzebiao on 2019/1/3. + */ + +public class SelectTeamMemberAdapter extends CommonAdapter { + + public SelectTeamMemberAdapter(int layoutId) { + super(layoutId); + } + + @Override + protected void convert(BaseViewHolder holder, MemberInfo item) { + UserInfoView userInfoView = holder.getView(R.id.user_info_view); + userInfoView.setData(item); + ImageLoadUtils.loadAvatar(item.getAvatar(), holder.getView(R.id.iv_avatar)); + holder.setText(R.id.tv_id, "ID : " + item.getErbanNo()); + ImageView ivSelect = holder.getView(R.id.iv_select); + if (UserModel.get().isMyseft(item.getUid())) { + ivSelect.setVisibility(View.GONE); + } else { + ivSelect.setVisibility(View.VISIBLE); + } + ivSelect.setImageResource(item.isSelect() ? + R.drawable.ic_hall_member_checked : R.drawable.ic_hall_member_unchecked); + //角色 + int labelId = 0; + if(item.getRoleType() == RoleType.OWNER) { + labelId = R.drawable.lable_hall_owner; + } else if (item.getRoleType() == RoleType.ADMIN) { + labelId = R.drawable.label_hall_manager; + } + if (labelId != 0) { + holder.setImageResource(R.id.iv_member_label, labelId); + } + } +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/presenter/CreateHallTeamPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/presenter/CreateHallTeamPresenter.java new file mode 100644 index 0000000..1db457d --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/presenter/CreateHallTeamPresenter.java @@ -0,0 +1,48 @@ +package com.chwl.app.module_hall.team.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.HallDataManager; +import com.chwl.app.module_hall.team.view.ICreateHallTeamView; +import com.chwl.core.module_hall.hall.bean.HTeamInfo; +import com.chwl.core.module_hall.hall.bean.MemberInfo; +import com.chwl.core.module_hall.team.HTeamModel; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.library.base.PresenterEvent; + +import java.util.List; + +/** + * 创建群 + * Created by lvzebiao on 2019/1/3. + */ + +public class CreateHallTeamPresenter extends BaseMvpPresenter{ + + public void createHTeam(String icon, String name, List members, int type) { + StringBuilder strMembers = new StringBuilder(""); + for (int i = 0; i < members.size(); i++) { + strMembers.append(members.get(i).getUid()); + if (i < members.size() - 1) { + strMembers.append(","); + } + } + HTeamModel.get().createHTeam(HallDataManager.get().getHallId(), + icon, name, strMembers.toString(), type) + .compose(bindUntilEvent(PresenterEvent.DESTROY)) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + if (getMvpView() == null) { + return; + } + getMvpView().onCreateHTeamFailed(error); + } + + @Override + public void onSuccess(HTeamInfo info) { + getMvpView().onCreateHTeamSuccess(info); + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/presenter/TeamInfoShowPresenter.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/presenter/TeamInfoShowPresenter.java new file mode 100644 index 0000000..78f2540 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/presenter/TeamInfoShowPresenter.java @@ -0,0 +1,55 @@ +package com.chwl.app.module_hall.team.presenter; + +import com.chwl.app.base.BaseMvpPresenter; +import com.chwl.app.module_hall.team.view.ITeamInfoShowView; +import com.chwl.core.module_hall.hall.bean.HTeamInfo; +import com.chwl.core.module_hall.team.HTeamModel; +import com.chwl.core.utils.net.BeanObserver; +import com.chwl.library.base.PresenterEvent; + +/** + * + * Created by lvzebiao on 2019/1/3. + */ + +public class TeamInfoShowPresenter extends BaseMvpPresenter { + + public void getDetailHTeamInfo(String tid) { + HTeamModel.get().getDetailHTeamInfo(tid) + .compose(bindUntilEvent(PresenterEvent.DESTROY)) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + if (getMvpView() == null) { + return; + } + getMvpView().onGetHTeamInfoFailed(error); + } + + @Override + public void onSuccess(HTeamInfo info) { + + } + }); + } + + public void updatePromptStatus(long chatId, boolean promptStatus) { + HTeamModel.get().updateTeamPrompt(chatId, promptStatus) + .compose(bindUntilEvent(PresenterEvent.DESTROY)) + .subscribe(new BeanObserver() { + @Override + public void onErrorMsg(String error) { + if (getMvpView() == null) { + return; + } + getMvpView().onUpdatePromptStatusFailed(error); + } + + @Override + public void onSuccess(String s) { + getMvpView().onUpdatePromptStatus(promptStatus); + } + }); + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/ICreateHallTeamView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/ICreateHallTeamView.java new file mode 100644 index 0000000..bb77c53 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/ICreateHallTeamView.java @@ -0,0 +1,17 @@ +package com.chwl.app.module_hall.team.view; + +import com.chwl.core.module_hall.hall.bean.HTeamInfo; +import com.chwl.library.base.IMvpBaseView; + +/** + * + * Created by lvzebiao on 2019/1/3. + */ + +public interface ICreateHallTeamView extends IMvpBaseView { + + void onCreateHTeamSuccess(HTeamInfo info); + + void onCreateHTeamFailed(String error); + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/ITeamInfoShowView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/ITeamInfoShowView.java new file mode 100644 index 0000000..c115378 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/ITeamInfoShowView.java @@ -0,0 +1,20 @@ +package com.chwl.app.module_hall.team.view; + +import com.chwl.core.module_hall.hall.bean.HTeamInfo; +import com.chwl.library.base.IMvpBaseView; + +/** + * Created by lvzebiao on 2019/1/3. + */ + +public interface ITeamInfoShowView extends IMvpBaseView { + + void onGetHTeamInfo(HTeamInfo hTeamInfo); + + void onGetHTeamInfoFailed(String error); + + void onUpdatePromptStatus(boolean isOn); + + void onUpdatePromptStatusFailed(String error); + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/widget/GridMemberView.java b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/widget/GridMemberView.java new file mode 100644 index 0000000..1d02bb4 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/team/view/widget/GridMemberView.java @@ -0,0 +1,72 @@ +package com.chwl.app.module_hall.team.view.widget; + +import android.content.Context; +import android.util.AttributeSet; + +import com.google.android.flexbox.FlexboxLayout; +import com.chwl.app.common.widget.CircleImageView; +import com.chwl.app.ui.utils.ImageLoadUtils; +import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil; +import com.chwl.library.utils.ListUtils; + +import java.util.List; + +/** + * 成员格子View + * Created by lvzebiao on 2019/1/11. + */ + +public class GridMemberView extends FlexboxLayout { + + private int itemWidth; + + private int divider; + + private int lineSpace; + + private Context context; + + private int columnCount = 5; + + public GridMemberView(Context context) { + this(context, null); + } + + public GridMemberView(Context context, AttributeSet attrs) { + super(context, attrs); + this.context = context; + itemWidth = UIUtil.dip2px(context, 43); + divider = (UIUtil.getScreenWidth(context) - itemWidth * columnCount) / (columnCount + 1); + lineSpace = UIUtil.dip2px(context, 20); + } + + public void setData(List list) { + removeAllViews(); + if (ListUtils.isListEmpty(list)) { + setVisibility(GONE); + return; + } + setVisibility(VISIBLE); + int maxRow = (int) Math.ceil((double) list.size() / (double) columnCount); + for (int i = 0; i < list.size(); i++) { + CircleImageView imageView = new CircleImageView(context); + ImageLoadUtils.loadAvatar(list.get(i), imageView); + FlexboxLayout.LayoutParams params = new LayoutParams(itemWidth, itemWidth); + int currColumn = i % columnCount; + if (currColumn == 0) { + params.leftMargin = divider; + } else { + params.leftMargin = 0; + } + params.rightMargin = divider; + int currRow = i / columnCount; + if (currRow == maxRow - 1) { + params.bottomMargin = 0; + } else { + params.bottomMargin = lineSpace; + } + addView(imageView, params); + } + } + +} diff --git a/app/src/module_labour_union/java/com/chwl/app/module_hall/viewmodel/AssociationViewModel.kt b/app/src/module_labour_union/java/com/chwl/app/module_hall/viewmodel/AssociationViewModel.kt new file mode 100644 index 0000000..96756b8 --- /dev/null +++ b/app/src/module_labour_union/java/com/chwl/app/module_hall/viewmodel/AssociationViewModel.kt @@ -0,0 +1,63 @@ +package com.chwl.app.module_hall.viewmodel + +import androidx.lifecycle.MutableLiveData +import com.chwl.app.base.BaseViewModel +import com.chwl.core.association.bean.ClanListInfo +import com.chwl.core.association.bean.HallListInfo +import com.chwl.core.association.bean.MemberExchangeInfo +import com.chwl.core.association.model.AssociationModel + +class AssociationViewModel : BaseViewModel() { + + //公会列表 + private val _clanListLiveData = MutableLiveData?>() + val clanListLiveData: MutableLiveData?> = _clanListLiveData + + //牌照房列表 + private val _hallListLiveData = MutableLiveData?>() + val hallListLiveData: MutableLiveData?> = _hallListLiveData + + //获取家族下的兑换权限管理的成员列表 + private val _memberExchangeLiveData = MutableLiveData?>() + val memberExchangeLiveData: MutableLiveData?> = _memberExchangeLiveData + + //修改兑换权限管理 + private val _operateMemberExchangeLiveData = MutableLiveData() + val operateMemberExchangeLiveData: MutableLiveData = _operateMemberExchangeLiveData + + fun getClanList() { + safeLaunch( + block = { + _clanListLiveData.value = AssociationModel.getClanList() + } + ) + } + + fun getHallList() { + safeLaunch( + block = { + _hallListLiveData.value = AssociationModel.getHallList() + } + ) + } + + fun getMemberExchangeList() { + safeLaunch( + true, + block = { + _memberExchangeLiveData.value = AssociationModel.getMemberExchangeList() + } + ) + } + + fun operateMemberExchange(status: Int, targetUid: Long, type: String) { + safeLaunch( + true, + block = { + _operateMemberExchangeLiveData.value = + AssociationModel.operateMemberExchange(status, targetUid) ?: type + } + ) + } + +} \ No newline at end of file diff --git a/app/src/module_labour_union/res/drawable-ar-xhdpi/bg_item_tab_big.webp b/app/src/module_labour_union/res/drawable-ar-xhdpi/bg_item_tab_big.webp new file mode 100644 index 0000000..1a05c5d Binary files /dev/null and b/app/src/module_labour_union/res/drawable-ar-xhdpi/bg_item_tab_big.webp differ diff --git a/app/src/module_labour_union/res/drawable-ar-xhdpi/bg_item_tab_small.webp b/app/src/module_labour_union/res/drawable-ar-xhdpi/bg_item_tab_small.webp new file mode 100644 index 0000000..f7384e0 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-ar-xhdpi/bg_item_tab_small.webp differ diff --git a/app/src/module_labour_union/res/drawable-ar-xhdpi/lable_hall_owner.webp b/app/src/module_labour_union/res/drawable-ar-xhdpi/lable_hall_owner.webp new file mode 100644 index 0000000..5953d30 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-ar-xhdpi/lable_hall_owner.webp differ diff --git a/app/src/module_labour_union/res/drawable-ar-xhdpi/lable_hteam_admin.webp b/app/src/module_labour_union/res/drawable-ar-xhdpi/lable_hteam_admin.webp new file mode 100644 index 0000000..5414bda Binary files /dev/null and b/app/src/module_labour_union/res/drawable-ar-xhdpi/lable_hteam_admin.webp differ diff --git a/app/src/module_labour_union/res/drawable-ar-xxhdpi/bg_hall_manager.webp b/app/src/module_labour_union/res/drawable-ar-xxhdpi/bg_hall_manager.webp new file mode 100644 index 0000000..9cd9484 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-ar-xxhdpi/bg_hall_manager.webp differ diff --git a/app/src/module_labour_union/res/drawable-ar-xxhdpi/bg_hall_owner.webp b/app/src/module_labour_union/res/drawable-ar-xxhdpi/bg_hall_owner.webp new file mode 100644 index 0000000..d0fb8e1 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-ar-xxhdpi/bg_hall_owner.webp differ diff --git a/app/src/module_labour_union/res/drawable-ar-xxhdpi/ic_rank_list.webp b/app/src/module_labour_union/res/drawable-ar-xxhdpi/ic_rank_list.webp new file mode 100644 index 0000000..6d0fabf Binary files /dev/null and b/app/src/module_labour_union/res/drawable-ar-xxhdpi/ic_rank_list.webp differ diff --git a/app/src/module_labour_union/res/drawable-en-xhdpi/bg_item_tab_big.webp b/app/src/module_labour_union/res/drawable-en-xhdpi/bg_item_tab_big.webp new file mode 100644 index 0000000..3b674aa Binary files /dev/null and b/app/src/module_labour_union/res/drawable-en-xhdpi/bg_item_tab_big.webp differ diff --git a/app/src/module_labour_union/res/drawable-en-xhdpi/bg_item_tab_small.webp b/app/src/module_labour_union/res/drawable-en-xhdpi/bg_item_tab_small.webp new file mode 100644 index 0000000..577bc6e Binary files /dev/null and b/app/src/module_labour_union/res/drawable-en-xhdpi/bg_item_tab_small.webp differ diff --git a/app/src/module_labour_union/res/drawable-en-xhdpi/lable_hall_owner.webp b/app/src/module_labour_union/res/drawable-en-xhdpi/lable_hall_owner.webp new file mode 100644 index 0000000..88c1d0b Binary files /dev/null and b/app/src/module_labour_union/res/drawable-en-xhdpi/lable_hall_owner.webp differ diff --git a/app/src/module_labour_union/res/drawable-en-xhdpi/lable_hteam_admin.webp b/app/src/module_labour_union/res/drawable-en-xhdpi/lable_hteam_admin.webp new file mode 100644 index 0000000..3c352db Binary files /dev/null and b/app/src/module_labour_union/res/drawable-en-xhdpi/lable_hteam_admin.webp differ diff --git a/app/src/module_labour_union/res/drawable-en-xxhdpi/bg_hall_manager.webp b/app/src/module_labour_union/res/drawable-en-xxhdpi/bg_hall_manager.webp new file mode 100644 index 0000000..386b005 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-en-xxhdpi/bg_hall_manager.webp differ diff --git a/app/src/module_labour_union/res/drawable-en-xxhdpi/bg_hall_owner.webp b/app/src/module_labour_union/res/drawable-en-xxhdpi/bg_hall_owner.webp new file mode 100644 index 0000000..753fd89 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-en-xxhdpi/bg_hall_owner.webp differ diff --git a/app/src/module_labour_union/res/drawable-en-xxhdpi/ic_rank_list.webp b/app/src/module_labour_union/res/drawable-en-xxhdpi/ic_rank_list.webp new file mode 100644 index 0000000..7efbe84 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-en-xxhdpi/ic_rank_list.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_check_stream.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_check_stream.webp new file mode 100644 index 0000000..ed86348 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_check_stream.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_admin.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_admin.webp new file mode 100644 index 0000000..a905b91 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_admin.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_admin_small.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_admin_small.webp new file mode 100644 index 0000000..5801174 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_admin_small.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_exchange.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_exchange.webp new file mode 100644 index 0000000..efcd68d Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_exchange.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_exchange_small.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_exchange_small.webp new file mode 100644 index 0000000..fea9eba Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_exchange_small.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income.webp new file mode 100644 index 0000000..7dd9756 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income_small.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income_small.webp new file mode 100644 index 0000000..495fb29 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income_small.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income_statistics.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income_statistics.webp new file mode 100644 index 0000000..beb4520 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_income_statistics.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_menu_img.9.png b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_menu_img.9.png new file mode 100644 index 0000000..34d0be7 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_menu_img.9.png differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_menu_img_righ.9.png b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_menu_img_righ.9.png new file mode 100644 index 0000000..c1e90d1 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_menu_img_righ.9.png differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_top.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_top.webp new file mode 100644 index 0000000..ae5acca Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_hall_top.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_income.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_income.webp new file mode 100644 index 0000000..456917e Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_income.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_item_tab_big.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_item_tab_big.webp new file mode 100644 index 0000000..3a64d9a Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_item_tab_big.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_item_tab_small.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_item_tab_small.webp new file mode 100644 index 0000000..41566d8 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_item_tab_small.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_manage_setup.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_manage_setup.webp new file mode 100644 index 0000000..e86999f Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_manage_setup.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_member_income.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_member_income.webp new file mode 100644 index 0000000..1caee5a Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_member_income.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_message_popup.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_message_popup.webp new file mode 100644 index 0000000..c8233a5 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_message_popup.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_room_message_popup.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_room_message_popup.webp new file mode 100644 index 0000000..b5fe83e Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_room_message_popup.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/bg_single_room_income.webp b/app/src/module_labour_union/res/drawable-xhdpi/bg_single_room_income.webp new file mode 100644 index 0000000..d53fc10 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/bg_single_room_income.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/h_team_chat_more.webp b/app/src/module_labour_union/res/drawable-xhdpi/h_team_chat_more.webp new file mode 100644 index 0000000..a0ff8b7 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/h_team_chat_more.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_add_hteam_member.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_add_hteam_member.webp new file mode 100644 index 0000000..a72a165 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_add_hteam_member.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_add_member.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_add_member.webp new file mode 100644 index 0000000..0430e10 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_add_member.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_admin_add.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_admin_add.webp new file mode 100644 index 0000000..3a02b40 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_admin_add.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_edit_clear.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_edit_clear.webp new file mode 100644 index 0000000..a768f08 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_edit_clear.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_edit_warning.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_edit_warning.webp new file mode 100644 index 0000000..3708f1a Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_edit_warning.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_exit.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_exit.webp new file mode 100644 index 0000000..1f97689 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_exit.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_add.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_add.webp new file mode 100644 index 0000000..95d5b96 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_add.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_income.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_income.webp new file mode 100644 index 0000000..29ea10e Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_income.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_manage_more.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_manage_more.webp new file mode 100644 index 0000000..db87b7c Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_manage_more.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_checked.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_checked.webp new file mode 100644 index 0000000..4be2c62 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_checked.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_more.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_more.webp new file mode 100644 index 0000000..131048e Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_more.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_search.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_search.webp new file mode 100644 index 0000000..b584c86 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_search.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_unchecked.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_unchecked.webp new file mode 100644 index 0000000..511624c Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_member_unchecked.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_name_set.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_name_set.webp new file mode 100644 index 0000000..5222c1a Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_name_set.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_right_white.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_right_white.webp new file mode 100644 index 0000000..3c28f00 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_right_white.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_setting.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_setting.webp new file mode 100644 index 0000000..6122ca2 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hall_setting.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hteam_lock_mic_false.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hteam_lock_mic_false.webp new file mode 100644 index 0000000..e3bf3b9 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hteam_lock_mic_false.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_hteam_lock_mic_ture.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_hteam_lock_mic_ture.webp new file mode 100644 index 0000000..da7aceb Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_hteam_lock_mic_ture.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_remove.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_remove.webp new file mode 100644 index 0000000..11fdded Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_remove.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_remove_hteam_member.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_remove_hteam_member.webp new file mode 100644 index 0000000..f9ea74f Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_remove_hteam_member.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_remove_member.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_remove_member.webp new file mode 100644 index 0000000..ea3085c Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_remove_member.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_set_admin.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_set_admin.webp new file mode 100644 index 0000000..2ec463e Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_set_admin.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_setting.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_setting.webp new file mode 100644 index 0000000..2d8a2d6 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_setting.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/ic_top_arrow.webp b/app/src/module_labour_union/res/drawable-xhdpi/ic_top_arrow.webp new file mode 100644 index 0000000..9b246bf Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/ic_top_arrow.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/icon_date_arrow.webp b/app/src/module_labour_union/res/drawable-xhdpi/icon_date_arrow.webp new file mode 100644 index 0000000..db6c003 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/icon_date_arrow.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/icon_hall_date_arrow.webp b/app/src/module_labour_union/res/drawable-xhdpi/icon_hall_date_arrow.webp new file mode 100644 index 0000000..2f52b5e Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/icon_hall_date_arrow.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/icon_hall_date_gray_arrow.webp b/app/src/module_labour_union/res/drawable-xhdpi/icon_hall_date_gray_arrow.webp new file mode 100644 index 0000000..d1be3a6 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/icon_hall_date_gray_arrow.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/icon_me_hall_entrance.webp b/app/src/module_labour_union/res/drawable-xhdpi/icon_me_hall_entrance.webp new file mode 100644 index 0000000..5c7b5e4 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/icon_me_hall_entrance.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/icon_user_info_page_hall.webp b/app/src/module_labour_union/res/drawable-xhdpi/icon_user_info_page_hall.webp new file mode 100644 index 0000000..327f480 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/icon_user_info_page_hall.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/label_hall_manager.webp b/app/src/module_labour_union/res/drawable-xhdpi/label_hall_manager.webp new file mode 100644 index 0000000..cea2978 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/label_hall_manager.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/lable_hall_owner.webp b/app/src/module_labour_union/res/drawable-xhdpi/lable_hall_owner.webp new file mode 100644 index 0000000..01a8273 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/lable_hall_owner.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/lable_hteam_admin.webp b/app/src/module_labour_union/res/drawable-xhdpi/lable_hteam_admin.webp new file mode 100644 index 0000000..69ce3dc Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/lable_hteam_admin.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_little_qq.webp b/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_little_qq.webp new file mode 100644 index 0000000..69690d9 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_little_qq.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_member_list.webp b/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_member_list.webp new file mode 100644 index 0000000..0219ecf Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_member_list.webp differ diff --git a/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_setting.webp b/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_setting.webp new file mode 100644 index 0000000..5cb7dbf Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xhdpi/lu_ic_setting.webp differ diff --git a/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_and_hall_owner.webp b/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_and_hall_owner.webp new file mode 100644 index 0000000..0f477eb Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_and_hall_owner.webp differ diff --git a/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_owner.webp b/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_owner.webp new file mode 100644 index 0000000..c133162 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_owner.webp differ diff --git a/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_super_admin.webp b/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_super_admin.webp new file mode 100644 index 0000000..f22307f Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xxhdpi/bg_clan_super_admin.webp differ diff --git a/app/src/module_labour_union/res/drawable-xxhdpi/bg_hall_manager.webp b/app/src/module_labour_union/res/drawable-xxhdpi/bg_hall_manager.webp new file mode 100644 index 0000000..fe0e143 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xxhdpi/bg_hall_manager.webp differ diff --git a/app/src/module_labour_union/res/drawable-xxhdpi/bg_hall_owner.webp b/app/src/module_labour_union/res/drawable-xxhdpi/bg_hall_owner.webp new file mode 100644 index 0000000..cba9fc7 Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xxhdpi/bg_hall_owner.webp differ diff --git a/app/src/module_labour_union/res/drawable-xxhdpi/ic_rank_list.webp b/app/src/module_labour_union/res/drawable-xxhdpi/ic_rank_list.webp new file mode 100644 index 0000000..bf4106e Binary files /dev/null and b/app/src/module_labour_union/res/drawable-xxhdpi/ic_rank_list.webp differ diff --git a/app/src/module_labour_union/res/drawable/admin_manager_bg_popup.xml b/app/src/module_labour_union/res/drawable/admin_manager_bg_popup.xml new file mode 100644 index 0000000..7b278b3 --- /dev/null +++ b/app/src/module_labour_union/res/drawable/admin_manager_bg_popup.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/drawable/bg_gradient_363e45_2b4658_r10.xml b/app/src/module_labour_union/res/drawable/bg_gradient_363e45_2b4658_r10.xml new file mode 100644 index 0000000..4cb0f1b --- /dev/null +++ b/app/src/module_labour_union/res/drawable/bg_gradient_363e45_2b4658_r10.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/drawable/bg_hall_menu.xml b/app/src/module_labour_union/res/drawable/bg_hall_menu.xml new file mode 100644 index 0000000..e054bf8 --- /dev/null +++ b/app/src/module_labour_union/res/drawable/bg_hall_menu.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/drawable/bg_hall_owner_text.xml b/app/src/module_labour_union/res/drawable/bg_hall_owner_text.xml new file mode 100644 index 0000000..e1f6531 --- /dev/null +++ b/app/src/module_labour_union/res/drawable/bg_hall_owner_text.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/drawable/bg_member_search_edit.xml b/app/src/module_labour_union/res/drawable/bg_member_search_edit.xml new file mode 100644 index 0000000..03b8af9 --- /dev/null +++ b/app/src/module_labour_union/res/drawable/bg_member_search_edit.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/drawable/selector_hall_group_radio.xml b/app/src/module_labour_union/res/drawable/selector_hall_group_radio.xml new file mode 100644 index 0000000..56ccd2c --- /dev/null +++ b/app/src/module_labour_union/res/drawable/selector_hall_group_radio.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/app/src/module_labour_union/res/drawable/shape_admin_bottom_bg.xml b/app/src/module_labour_union/res/drawable/shape_admin_bottom_bg.xml new file mode 100644 index 0000000..1bc8dd1 --- /dev/null +++ b/app/src/module_labour_union/res/drawable/shape_admin_bottom_bg.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/drawable/shape_team_et_bg.xml b/app/src/module_labour_union/res/drawable/shape_team_et_bg.xml new file mode 100644 index 0000000..30a917f --- /dev/null +++ b/app/src/module_labour_union/res/drawable/shape_team_et_bg.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_add_member.xml b/app/src/module_labour_union/res/layout/activity_add_member.xml new file mode 100644 index 0000000..16deb3e --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_add_member.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_admin_add.xml b/app/src/module_labour_union/res/layout/activity_admin_add.xml new file mode 100644 index 0000000..b892482 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_admin_add.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_admin_list.xml b/app/src/module_labour_union/res/layout/activity_admin_list.xml new file mode 100644 index 0000000..8164581 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_admin_list.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_auth_setting.xml b/app/src/module_labour_union/res/layout/activity_auth_setting.xml new file mode 100644 index 0000000..c6483de --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_auth_setting.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_clan_income.xml b/app/src/module_labour_union/res/layout/activity_clan_income.xml new file mode 100644 index 0000000..9e61e0e --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_clan_income.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_exchange_permission.xml b/app/src/module_labour_union/res/layout/activity_exchange_permission.xml new file mode 100644 index 0000000..fcf8b81 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_exchange_permission.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_hall_member_list.xml b/app/src/module_labour_union/res/layout/activity_hall_member_list.xml new file mode 100644 index 0000000..cbfe8eb --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_hall_member_list.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_hall_name.xml b/app/src/module_labour_union/res/layout/activity_hall_name.xml new file mode 100644 index 0000000..fc01647 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_hall_name.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_hall_team_message.xml b/app/src/module_labour_union/res/layout/activity_hall_team_message.xml new file mode 100644 index 0000000..09c1f77 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_hall_team_message.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_hteam_member_list.xml b/app/src/module_labour_union/res/layout/activity_hteam_member_list.xml new file mode 100644 index 0000000..d89eb0c --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_hteam_member_list.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_income_detail.xml b/app/src/module_labour_union/res/layout/activity_income_detail.xml new file mode 100644 index 0000000..90e24a7 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_income_detail.xml @@ -0,0 +1,22 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_income_statistics.xml b/app/src/module_labour_union/res/layout/activity_income_statistics.xml new file mode 100644 index 0000000..975ea41 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_income_statistics.xml @@ -0,0 +1,289 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_module_clan.xml b/app/src/module_labour_union/res/layout/activity_module_clan.xml new file mode 100644 index 0000000..f3f1884 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_module_clan.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/module_labour_union/res/layout/activity_module_hall.xml b/app/src/module_labour_union/res/layout/activity_module_hall.xml new file mode 100644 index 0000000..d06a88c --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_module_hall.xml @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/module_labour_union/res/layout/activity_remove_member.xml b/app/src/module_labour_union/res/layout/activity_remove_member.xml new file mode 100644 index 0000000..32f0f67 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_remove_member.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_room_income.xml b/app/src/module_labour_union/res/layout/activity_room_income.xml new file mode 100644 index 0000000..bc8a2a4 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_room_income.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_select_group_member.xml b/app/src/module_labour_union/res/layout/activity_select_group_member.xml new file mode 100644 index 0000000..94c6364 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_select_group_member.xml @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_single_room_income.xml b/app/src/module_labour_union/res/layout/activity_single_room_income.xml new file mode 100644 index 0000000..48845ab --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_single_room_income.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_super_admin_add.xml b/app/src/module_labour_union/res/layout/activity_super_admin_add.xml new file mode 100644 index 0000000..1ad1604 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_super_admin_add.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_super_admin_manege.xml b/app/src/module_labour_union/res/layout/activity_super_admin_manege.xml new file mode 100644 index 0000000..e4ed009 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_super_admin_manege.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_super_admin_room_set.xml b/app/src/module_labour_union/res/layout/activity_super_admin_room_set.xml new file mode 100644 index 0000000..4c57081 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_super_admin_room_set.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_team_edit.xml b/app/src/module_labour_union/res/layout/activity_team_edit.xml new file mode 100644 index 0000000..595a45c --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_team_edit.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_vip_main.xml b/app/src/module_labour_union/res/layout/activity_vip_main.xml new file mode 100644 index 0000000..77d1d2e --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_vip_main.xml @@ -0,0 +1,644 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/activity_vip_setting.xml b/app/src/module_labour_union/res/layout/activity_vip_setting.xml new file mode 100644 index 0000000..19a2a35 --- /dev/null +++ b/app/src/module_labour_union/res/layout/activity_vip_setting.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/dialog_clan_time_picker.xml b/app/src/module_labour_union/res/layout/dialog_clan_time_picker.xml new file mode 100644 index 0000000..a6db82a --- /dev/null +++ b/app/src/module_labour_union/res/layout/dialog_clan_time_picker.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/module_labour_union/res/layout/dialog_custom_time_picker.xml b/app/src/module_labour_union/res/layout/dialog_custom_time_picker.xml new file mode 100644 index 0000000..17de07e --- /dev/null +++ b/app/src/module_labour_union/res/layout/dialog_custom_time_picker.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/module_labour_union/res/layout/dialog_hall_menu.xml b/app/src/module_labour_union/res/layout/dialog_hall_menu.xml new file mode 100644 index 0000000..cc0c0af --- /dev/null +++ b/app/src/module_labour_union/res/layout/dialog_hall_menu.xml @@ -0,0 +1,23 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/fragment_day_income.xml b/app/src/module_labour_union/res/layout/fragment_day_income.xml new file mode 100644 index 0000000..7abcb90 --- /dev/null +++ b/app/src/module_labour_union/res/layout/fragment_day_income.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/fragment_day_income_old.xml b/app/src/module_labour_union/res/layout/fragment_day_income_old.xml new file mode 100644 index 0000000..c14347f --- /dev/null +++ b/app/src/module_labour_union/res/layout/fragment_day_income_old.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/fragment_hall_income.xml b/app/src/module_labour_union/res/layout/fragment_hall_income.xml new file mode 100644 index 0000000..63102c1 --- /dev/null +++ b/app/src/module_labour_union/res/layout/fragment_hall_income.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/fragment_week_income.xml b/app/src/module_labour_union/res/layout/fragment_week_income.xml new file mode 100644 index 0000000..77d9ef6 --- /dev/null +++ b/app/src/module_labour_union/res/layout/fragment_week_income.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_auth_menu.xml b/app/src/module_labour_union/res/layout/item_auth_menu.xml new file mode 100644 index 0000000..91bbdc8 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_auth_menu.xml @@ -0,0 +1,28 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_auth_setting.xml b/app/src/module_labour_union/res/layout/item_auth_setting.xml new file mode 100644 index 0000000..6052bac --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_auth_setting.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/module_labour_union/res/layout/item_clan_income.xml b/app/src/module_labour_union/res/layout/item_clan_income.xml new file mode 100644 index 0000000..3b3e803 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_clan_income.xml @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_group_list.xml b/app/src/module_labour_union/res/layout/item_group_list.xml new file mode 100644 index 0000000..fe0ed1e --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_group_list.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_hall.xml b/app/src/module_labour_union/res/layout/item_hall.xml new file mode 100644 index 0000000..50007a9 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_hall.xml @@ -0,0 +1,36 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_hall_exchange.xml b/app/src/module_labour_union/res/layout/item_hall_exchange.xml new file mode 100644 index 0000000..0ea3633 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_hall_exchange.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_hall_income.xml b/app/src/module_labour_union/res/layout/item_hall_income.xml new file mode 100644 index 0000000..8701147 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_hall_income.xml @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_has_select_avatar.xml b/app/src/module_labour_union/res/layout/item_has_select_avatar.xml new file mode 100644 index 0000000..75d6903 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_has_select_avatar.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_hteam_member_common.xml b/app/src/module_labour_union/res/layout/item_hteam_member_common.xml new file mode 100644 index 0000000..49947ca --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_hteam_member_common.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_income.xml b/app/src/module_labour_union/res/layout/item_income.xml new file mode 100644 index 0000000..35cb3a0 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_income.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_income_gift.xml b/app/src/module_labour_union/res/layout/item_income_gift.xml new file mode 100644 index 0000000..7b1252f --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_income_gift.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_live_income.xml b/app/src/module_labour_union/res/layout/item_live_income.xml new file mode 100644 index 0000000..cd40c86 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_live_income.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_live_tag_dialog.xml b/app/src/module_labour_union/res/layout/item_live_tag_dialog.xml new file mode 100644 index 0000000..6c782df --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_live_tag_dialog.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_manage_room.xml b/app/src/module_labour_union/res/layout/item_manage_room.xml new file mode 100644 index 0000000..77064d1 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_manage_room.xml @@ -0,0 +1,35 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_manage_room_set.xml b/app/src/module_labour_union/res/layout/item_manage_room_set.xml new file mode 100644 index 0000000..58f2dd5 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_manage_room_set.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + diff --git a/app/src/module_labour_union/res/layout/item_manage_super_admin.xml b/app/src/module_labour_union/res/layout/item_manage_super_admin.xml new file mode 100644 index 0000000..b7e1538 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_manage_super_admin.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_member.xml b/app/src/module_labour_union/res/layout/item_member.xml new file mode 100644 index 0000000..019741e --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_member.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_search_admin.xml b/app/src/module_labour_union/res/layout/item_search_admin.xml new file mode 100644 index 0000000..ebab6ce --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_search_admin.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_single_room_income.xml b/app/src/module_labour_union/res/layout/item_single_room_income.xml new file mode 100644 index 0000000..9fc6cbc --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_single_room_income.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_tab_big.xml b/app/src/module_labour_union/res/layout/item_tab_big.xml new file mode 100644 index 0000000..2d78c28 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_tab_big.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_tab_small.xml b/app/src/module_labour_union/res/layout/item_tab_small.xml new file mode 100644 index 0000000..04b25f1 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_tab_small.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/item_vip_auth.xml b/app/src/module_labour_union/res/layout/item_vip_auth.xml new file mode 100644 index 0000000..00945c6 --- /dev/null +++ b/app/src/module_labour_union/res/layout/item_vip_auth.xml @@ -0,0 +1,28 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/layout_auth_menu_divider.xml b/app/src/module_labour_union/res/layout/layout_auth_menu_divider.xml new file mode 100644 index 0000000..bbb516e --- /dev/null +++ b/app/src/module_labour_union/res/layout/layout_auth_menu_divider.xml @@ -0,0 +1,7 @@ + + + diff --git a/app/src/module_labour_union/res/layout/layout_clan_msg_view_holder.xml b/app/src/module_labour_union/res/layout/layout_clan_msg_view_holder.xml new file mode 100644 index 0000000..8d2b427 --- /dev/null +++ b/app/src/module_labour_union/res/layout/layout_clan_msg_view_holder.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/layout_hall_msg_view_holder.xml b/app/src/module_labour_union/res/layout/layout_hall_msg_view_holder.xml new file mode 100644 index 0000000..83c82fa --- /dev/null +++ b/app/src/module_labour_union/res/layout/layout_hall_msg_view_holder.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/layout_head_name.xml b/app/src/module_labour_union/res/layout/layout_head_name.xml new file mode 100644 index 0000000..33bf698 --- /dev/null +++ b/app/src/module_labour_union/res/layout/layout_head_name.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/list_item_common_group_member.xml b/app/src/module_labour_union/res/layout/list_item_common_group_member.xml new file mode 100644 index 0000000..11a7a9b --- /dev/null +++ b/app/src/module_labour_union/res/layout/list_item_common_group_member.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/layout/popup_admin_more.xml b/app/src/module_labour_union/res/layout/popup_admin_more.xml new file mode 100644 index 0000000..d11ab9a --- /dev/null +++ b/app/src/module_labour_union/res/layout/popup_admin_more.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/values-ar/strings.xml b/app/src/module_labour_union/res/values-ar/strings.xml new file mode 100644 index 0000000..d78c760 --- /dev/null +++ b/app/src/module_labour_union/res/values-ar/strings.xml @@ -0,0 +1,43 @@ + + + + مجموعة الدردشة في القاعة + إنشاء مجموعة دردشة + الدخل الإجمالي + + تحميل صورة مجموعة + إدخال اسم المجموعة + تحديد أعضاء المجموعة + إضافة أعضاء للمجموعة + صورة المجموعة + كتم الإشعارات + معلومات المجموعة + اسم المجموعة + إعلان المجموعة + الحد الأقصى لعدد الأحرف: %d + + تقديم طلب للانضمام إلى القاعة + الانضمام للمجموعة + + رفض + موافقة + + تم تحديد: %d شخص + أعضاء المجموعة: %d شخص + الأعضاء المكتومون: %d شخص + مديري المجموعة: %d شخص + + هل تؤكد الانضمام إلى المنظمة؟ + نعم + لا + + إحصائيات يومية + إحصائيات أسبوعية + إحصائيات شهرية + هل أنت متأكد أنك تريد إزالة + هوية مدير النقابة الفائقة لـ + تمت الإزالة بنجاح + هل أنت متأكد أنك تريد إضافة المستخدم + كمسؤول فائق للنقابة؟ + اسم الغرفة + \ No newline at end of file diff --git a/app/src/module_labour_union/res/values-zh-rTW/strings.xml b/app/src/module_labour_union/res/values-zh-rTW/strings.xml new file mode 100644 index 0000000..0ea6b05 --- /dev/null +++ b/app/src/module_labour_union/res/values-zh-rTW/strings.xml @@ -0,0 +1,47 @@ + + + + + 廳群聊 + 創建群聊 + 總收入 + + 上傳群頭像 + 輸入群名稱 + 選擇群成員 + 添加群成員 + 群頭像 + 消息免打擾 + 群資料 + 群名稱 + 群公告 + %d字內 + + 申請入廳 + 加入群 + + 拒絕 + 同意 + + 已選擇人數 : %d人 + 群成員人數 : %d人 + 已禁言人數 : %d人 + 群管理人數 : %d人 + + 確認加入公會 + + + + 按日統計 + 每周統計 + 每月統計 + 確定要移除 + 的公會超級管理員身份嗎? + 移除成功 + 確定要添加用戶 + 為公會超級管理員嗎? + + 房间名 + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/values/colors.xml b/app/src/module_labour_union/res/values/colors.xml new file mode 100644 index 0000000..0d2c4cc --- /dev/null +++ b/app/src/module_labour_union/res/values/colors.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/module_labour_union/res/values/strings.xml b/app/src/module_labour_union/res/values/strings.xml new file mode 100644 index 0000000..35f7775 --- /dev/null +++ b/app/src/module_labour_union/res/values/strings.xml @@ -0,0 +1,44 @@ + + + + + Hall Group Chat + Create Group Chat + Total Income + Upload Group Avatar + Enter Group Name + Select Group Members + Add Group Members + Group Avatar + Mute Notifications + Group Information + Group Name + Group Announcement + %d Characters Maximum + + Apply to Enter Hall + Join Group + + Reject + Agree + + Selected: %d People + Group Members: %d People + Muted Members: %d People + Group Managers: %d People + + Confirm to join organization + Yes + No + + Daily statistics + Weekly statistics + Monthly statistics + Are you sure you want to remove + \'s guild super admin identity? + Removal successful + Are you sure you want to add user + as a guild super admin? + + Room Name +