From 146ab9f0be42af8ce5c5b0822ee468353b6dd5b7 Mon Sep 17 00:00:00 2001 From: huangjian Date: Thu, 19 Nov 2020 20:43:33 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AE=B6=E6=97=8F=E5=B1=95=E7=A4=BA=202.=E5=85=AC?= =?UTF-8?q?=E4=BC=9A=E4=B8=BB=E9=A1=B5=E5=A2=9E=E5=8A=A0=E5=AE=B6=E6=97=8F?= =?UTF-8?q?=E9=95=BF=E5=92=8C=E5=AE=B6=E6=97=8F=E5=85=AC=E4=BC=9A=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 3 + .../erban/pay/activity/GiveGoldActivity.kt | 3 +- .../pay/activity/GiveGoldToUserActivity.kt | 3 +- .../erban/ui/user/UserInfoActivity.java | 134 +++++---- .../res/drawable/shape_7154ee_stroke_1dp.xml | 7 + .../res/drawable/shape_ffa768_stroke_1dp.xml | 7 + .../main/res/layout/activity_user_info.xml | 32 ++- .../erban/module_hall/HallDataManager.java | 29 +- .../hall/activity/ClanIncomeActivity.java | 257 +++++++++++++++++ .../hall/activity/ModuleHallActivity.java | 222 ++++++++++----- .../hall/adapter/HallListAdapter.java | 20 ++ .../hall/presenter/ModuleHallPresenter.java | 4 - .../income/ClanIncomeFragment.java | 182 ++++++++++++ .../income/presenter/ClanIncomePresenter.java | 107 +++++++ .../res/layout/activity_module_hall.xml | 261 +++++++++++++++--- .../res/layout/item_hall.xml | 36 +++ .../res/layout/activity_give_gold_to_user.xml | 2 +- .../user/bean/UserInfo.java | 7 + .../module_hall/hall/HallModel.java | 50 ++++ .../module_hall/hall/IHallModel.java | 6 + .../hall/bean/ClanAndHallInfo.java | 9 + .../module_hall/hall/bean/ClanInfo.java | 19 ++ .../module_hall/hall/bean/HallInfo.java | 5 + 23 files changed, 1205 insertions(+), 200 deletions(-) create mode 100644 app/src/main/res/drawable/shape_7154ee_stroke_1dp.xml create mode 100644 app/src/main/res/drawable/shape_ffa768_stroke_1dp.xml create mode 100644 app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/activity/ClanIncomeActivity.java create mode 100644 app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/adapter/HallListAdapter.java create mode 100644 app/src/module_labour_union/java/com/yizhuan/erban/module_hall/income/ClanIncomeFragment.java create mode 100644 app/src/module_labour_union/java/com/yizhuan/erban/module_hall/income/presenter/ClanIncomePresenter.java create mode 100644 app/src/module_labour_union/res/layout/item_hall.xml create mode 100644 core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/ClanAndHallInfo.java create mode 100644 core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/ClanInfo.java diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index df054aa97..9c83ef81f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -998,6 +998,9 @@ + diff --git a/app/src/main/java/com/yizhuan/erban/pay/activity/GiveGoldActivity.kt b/app/src/main/java/com/yizhuan/erban/pay/activity/GiveGoldActivity.kt index f66b47698..d8d846fe1 100644 --- a/app/src/main/java/com/yizhuan/erban/pay/activity/GiveGoldActivity.kt +++ b/app/src/main/java/com/yizhuan/erban/pay/activity/GiveGoldActivity.kt @@ -1,10 +1,11 @@ -package com.yinyuan.doudou.pay.activity +package com.yizhuan.erban.pay.activity import android.annotation.SuppressLint import android.app.Activity import android.content.Intent import android.os.Bundle import androidx.recyclerview.widget.LinearLayoutManager +import com.yinyuan.doudou.pay.activity.GiveGoldSearchActivity import com.yinyuan.doudou.pay.adapter.LatelyGiveAdapter import com.yizhuan.erban.R import com.yizhuan.erban.base.BaseActivity diff --git a/app/src/main/java/com/yizhuan/erban/pay/activity/GiveGoldToUserActivity.kt b/app/src/main/java/com/yizhuan/erban/pay/activity/GiveGoldToUserActivity.kt index d7f851bfd..74e480fd6 100644 --- a/app/src/main/java/com/yizhuan/erban/pay/activity/GiveGoldToUserActivity.kt +++ b/app/src/main/java/com/yizhuan/erban/pay/activity/GiveGoldToUserActivity.kt @@ -1,4 +1,4 @@ -package com.yinyuan.doudou.pay.activity +package com.yizhuan.erban.pay.activity import android.annotation.SuppressLint import android.content.Context @@ -9,7 +9,6 @@ import android.text.TextWatcher import com.jungly.gridpasswordview.GridPasswordView import com.yizhuan.erban.R import com.yizhuan.erban.base.BaseActivity -import com.yizhuan.erban.pay.activity.GiveGoldSuccessActivity import com.yizhuan.erban.pay.password.GiveGoldPassWordFragment import com.yizhuan.erban.ui.utils.ImageLoadUtils import com.yizhuan.xchat_android_core.DemoCache diff --git a/app/src/main/java/com/yizhuan/erban/ui/user/UserInfoActivity.java b/app/src/main/java/com/yizhuan/erban/ui/user/UserInfoActivity.java index e091d4d07..5293ccd76 100644 --- a/app/src/main/java/com/yizhuan/erban/ui/user/UserInfoActivity.java +++ b/app/src/main/java/com/yizhuan/erban/ui/user/UserInfoActivity.java @@ -18,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.alibaba.security.biometrics.service.build.V; import com.jude.rollviewpager.hintview.TextHintView; +import com.netease.nim.uikit.common.util.sys.ScreenUtil; import com.netease.nim.uikit.impl.cache.NimUserInfoCache; import com.netease.nim.uikit.support.glide.GlideApp; import com.netease.nimlib.sdk.RequestCallbackWrapper; @@ -54,6 +55,7 @@ import com.yizhuan.xchat_android_core.customer_server.CustomerServerModel; import com.yizhuan.xchat_android_core.im.friend.IMFriendModel; import com.yizhuan.xchat_android_core.level.UserLevelVo; import com.yizhuan.xchat_android_core.module_hall.hall.HallModel; +import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanInfo; import com.yizhuan.xchat_android_core.module_hall.hall.bean.HallInfo; import com.yizhuan.xchat_android_core.praise.PraiseModel; import com.yizhuan.xchat_android_core.praise.event.IsLikedEvent; @@ -91,7 +93,7 @@ import java.util.Objects; @ActLayoutRes(R.layout.activity_user_info) public class UserInfoActivity extends BaseBindingActivity - implements UserPhotoAdapter.ImageClickListener, ObservableScrollView.ScrollViewListener{ + implements UserPhotoAdapter.ImageClickListener, ObservableScrollView.ScrollViewListener { public static final int REQUEST_CODE_UPDATE_VOICE = 1; @@ -148,6 +150,7 @@ public class UserInfoActivity extends BaseBindingActivity() { @@ -212,8 +215,7 @@ public class UserInfoActivity extends BaseBindingActivity() { @@ -295,48 +297,74 @@ public class UserInfoActivity extends BaseBindingActivity0隐藏申请按钮 - mBinding.llModuleHall.setVisibility(View.GONE); - if (userInfo.getHallId() > 0){ - if (AuthModel.get().getCurrentUid() != userId && HallDataManager.get().getHallId() <= 0){ - mBinding.tvApplyHall.setVisibility(View.VISIBLE); - } - HallModel.get().getHallInfo(userInfo.getUid(), userInfo.getHallId()) - .compose(RxHelper.bindContext(context)) - .subscribe(new BeanObserver() { - @Override - public void onErrorMsg(String error) { - - } - - @Override - public void onSuccess(HallInfo hallInfo) { - mBinding.llModuleHall.setVisibility(View.VISIBLE); - mBinding.tvHallName.setText(hallInfo.getHallName()); - mBinding.tvHallId.setText("公会ID:"+hallInfo.getHallId()); - mBinding.tvHallMemberNum.setText("公会人数:"+hallInfo.getMemberCount()); - GlideApp.with(context) - .load(hallInfo.getOwnerAvatar()) - .placeholder(R.drawable.default_avatar) - .into(mBinding.ivHallAvatar); - } - }); - mBinding.tvApplyHall.setOnClickListener(v -> applyJoinHall(userInfo.getHallId())); - } } } - private void applyJoinHall(long hallId){ + @SuppressLint({"CheckResult", "SetTextI18n"}) + private void initClanAndHall() { + HallModel.get().getUserHallAndClan(AuthModel.get().getCurrentUid()) + .compose(bindToLifecycle()) + .subscribe(clanAndHallInfo -> { + HallInfo hallInfo = clanAndHallInfo.getHall(); + ClanInfo clanInfo = clanAndHallInfo.getClan(); + boolean showApply = AuthModel.get().getCurrentUid() != userId && HallDataManager.get().getHallId() <= 0; + if (hallInfo != null && hallInfo.getHallId() > 0) { + mBinding.llModuleHall.setVisibility(View.VISIBLE); + mBinding.llHall.setVisibility(View.VISIBLE); + mBinding.tvHallId.setText("公会ID:" + hallInfo.getHallId() + ""); + mBinding.tvHallName.setText(hallInfo.getHallName()); + mBinding.tvHallMemberNum.setText("公会人数:" + hallInfo.getMemberCount()); + GlideApp.with(this) + .load(hallInfo.getOwnerAvatar()) + .placeholder(R.drawable.default_avatar) + .into(mBinding.ivHallAvatar); + if (clanInfo == null || clanInfo.getId() <= 0) { + //单独展示公会头要变大点 + LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) mBinding.ivHallAvatar.getLayoutParams(); + layoutParams.width = ScreenUtil.dip2px(60); + layoutParams.height = ScreenUtil.dip2px(60); + mBinding.ivHallAvatar.setLayoutParams(layoutParams); + if (showApply) { + mBinding.tvApplyHall.setVisibility(View.VISIBLE); + mBinding.tvApplyHall.setOnClickListener(v -> applyJoinHall(hallInfo.getHallId())); + } + } + } else { + mBinding.llHall.setVisibility(View.GONE); + } + if (clanInfo != null && clanInfo.getId() > 0) { + mBinding.llModuleHall.setVisibility(View.VISIBLE); + mBinding.llHall.setVisibility(View.VISIBLE); + mBinding.tvClanId.setText("家族ID:" + clanInfo.getId()); + mBinding.tvClanName.setText(clanInfo.getName()); + mBinding.tvClanMemberNum.setText("家族人数:" +clanInfo.getClanMemberNum()); + mBinding.tvClanHallNum.setText("公会数量:" + clanInfo.getClanHallNum()); + GlideApp.with(this) + .load(clanInfo.getAvatar()) + .placeholder(R.drawable.default_avatar) + .into(mBinding.ivClanAvatar); + + if (showApply && hallInfo != null && hallInfo.getHallId() > 0) { + mBinding.tvApplyHall.setVisibility(View.VISIBLE); + mBinding.tvApplyHall.setOnClickListener(v -> applyJoinHall(hallInfo.getHallId())); + } + } else { + mBinding.llHall.setVisibility(View.GONE); + } + + }); + } + + private void applyJoinHall(long hallId) { HallModel.get().applyJoinHall(hallId) .compose(RxHelper.bindActivity(UserInfoActivity.this)) .subscribe(new BeanObserver() { @@ -353,7 +381,7 @@ public class UserInfoActivity extends BaseBindingActivity list) { @@ -384,13 +413,13 @@ public class UserInfoActivity extends BaseBindingActivity list) { mBinding.rvDynamic.setLayoutManager(new LinearLayoutManager(this)); - UserInfoDynamicAdapter dynamicAdapter = new UserInfoDynamicAdapter(this,identityState); + UserInfoDynamicAdapter dynamicAdapter = new UserInfoDynamicAdapter(this, identityState); dynamicAdapter.setNewData(list); dynamicAdapter.setEnableLoadMore(false); dynamicAdapter.setOnItemChildClickListener((baseQuickAdapter, view, pos) -> { @@ -423,7 +453,7 @@ public class UserInfoActivity extends BaseBindingActivity deleteDynamic(pos,dynamicAdapter)); + ButtonItem item = new ButtonItem("删除", () -> deleteDynamic(pos, dynamicAdapter)); list_adapter.add(item); } getDialogManager().showCommonPopupDialog(list_adapter, "取消"); @@ -439,13 +469,13 @@ public class UserInfoActivity extends BaseBindingActivity list){ - if (ListUtils.isListEmpty(list)){ + private void initPhoto(List list) { + if (ListUtils.isListEmpty(list)) { return; } TextHintView hintView = new TextHintView(this); hintView.setBackground(getResources().getDrawable(R.drawable.bg_userinfo_photo_hintview)); - hintView.setTextSize(SizeUtils.dp2px(this,4)); + hintView.setTextSize(SizeUtils.dp2px(this, 4)); hintView.setTextColor(getResources().getColor(R.color.blue)); mBinding.rollView.setHintView(hintView); UserInfoPhotoAdapter bannerAdapter = new UserInfoPhotoAdapter(list, this); @@ -480,20 +510,20 @@ public class UserInfoActivity extends BaseBindingActivity { - if (flag == 0 && oldScrollY > SizeUtils.dp2px(this,200)) { + if (flag == 0 && oldScrollY > SizeUtils.dp2px(this, 200)) { //展开 flag = 1; mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back_black); mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.white)); setTitleVisible(true); - setEditButton(identityState,true); + setEditButton(identityState, true); } else if (flag == 1 && oldScrollY <= 200) { //合起来 flag = 0; mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back); mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.transparent)); setTitleVisible(false); - setEditButton(identityState,false); + setEditButton(identityState, false); } }); } @@ -626,11 +656,11 @@ public class UserInfoActivity extends BaseBindingActivity + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_ffa768_stroke_1dp.xml b/app/src/main/res/drawable/shape_ffa768_stroke_1dp.xml new file mode 100644 index 000000000..ebd42db4f --- /dev/null +++ b/app/src/main/res/drawable/shape_ffa768_stroke_1dp.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_user_info.xml b/app/src/main/res/layout/activity_user_info.xml index 8de9f7c5c..b134b61ac 100644 --- a/app/src/main/res/layout/activity_user_info.xml +++ b/app/src/main/res/layout/activity_user_info.xml @@ -233,19 +233,21 @@ android:paddingBottom="@dimen/dp_15"> - + android:src="@drawable/default_cover" + app:borderRadius="8dp" + app:type="round" /> + android:layout_height="wrap_content" + android:orientation="horizontal"> - + android:src="@drawable/default_cover" + app:borderRadius="8dp" + app:type="round" /> liveClanInfo; + private static final class Helper { public static final HallDataManager INSTANCE = new HallDataManager(); } @@ -101,6 +109,7 @@ public class HallDataManager { } } lastHallId = newHallId; + clanId = userInfo.getClanId(); } } @@ -120,6 +129,10 @@ public class HallDataManager { 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); } @@ -128,19 +141,23 @@ public class HallDataManager { liveHallExist.observe(owner, observer); } + @SuppressLint("CheckResult") public void updateHallInfo() { if (getHallId() <= 0) { return; } HallModel.get().getHallInfo(AuthModel.get().getCurrentUid(), getHallId()) - .subscribe(info -> { - hallInfo = info; - liveHallName.setValue(hallInfo.getHallName()); - liveHallExist.setValue(hallInfo.getHallId() > 0); - liveHallID.setValue(hallInfo.getHallId()); - }); + .subscribe(this::updateHallInfo); } + public void updateHallInfo(HallInfo info) { + hallInfo = info; + liveHallName.setValue(hallInfo.getHallName()); + liveHallExist.setValue(hallInfo.getHallId() > 0); + liveHallID.setValue(hallInfo.getHallId()); + } + + public String getHallName() { String hallName = liveHallName.getValue(); if (hallName == null) { diff --git a/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/activity/ClanIncomeActivity.java b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/activity/ClanIncomeActivity.java new file mode 100644 index 000000000..0608e5a88 --- /dev/null +++ b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/activity/ClanIncomeActivity.java @@ -0,0 +1,257 @@ +package com.yizhuan.erban.module_hall.hall.activity; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +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.yizhuan.erban.R; +import com.yizhuan.erban.base.BaseMvpActivity; +import com.yizhuan.erban.module_hall.hall.view.dialog.TimePickerDialog; +import com.yizhuan.erban.module_hall.hall.view.indicator.StatisticsIndicatorAdapter; +import com.yizhuan.erban.module_hall.income.ClanIncomeFragment; +import com.yizhuan.erban.module_hall.income.DayIncomeFragment; +import com.yizhuan.erban.module_hall.income.presenter.ClanIncomePresenter; +import com.yizhuan.erban.module_hall.income.presenter.IncomeStatisticsPresenter; +import com.yizhuan.erban.module_hall.income.view.IIncomeStatisticsView; +import com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator; +import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper; +import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator; +import com.yizhuan.xchat_android_core.statistic.StatisticManager; +import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol; +import com.yizhuan.xchat_android_library.base.factory.CreatePresenter; +import com.yizhuan.xchat_android_library.utils.config.BasicConfig; + +import java.util.ArrayList; +import java.util.List; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + +/** + * 家族所有公会的收入统计 + * Created by lvzebiao on 2018/12/27. + */ + +@CreatePresenter(ClanIncomePresenter.class) +public class ClanIncomeActivity extends BaseMvpActivity + implements IIncomeStatisticsView, TimePickerDialog.TimePickerListener, ClanIncomeFragment.DayIncomeFragmentListener { + + private static final int TYPE_DAY = 0; + private static final int TYPE_WEEK = 1; + + @BindView(R.id.view_pager) + ViewPager viewPager; + + List list = new ArrayList<>(); + @BindView(R.id.indicator) + MagicIndicator indicator; + + @BindView(R.id.tv_month_day_start) + TextView tvMonthDayStart; + @BindView(R.id.tv_month_day_end) + TextView tvMonthDayEnd; + @BindView(R.id.tv_year) + TextView tvYear; + @BindView(R.id.tv_total) + TextView tvTotal; + + public static void start(Context context) { + + StatisticManager.Instance().onEvent(BasicConfig.INSTANCE.getAppContext(), + StatisticsProtocol.Event.HALL_INCOME_CLICK, "收入统计入口", null); + + Intent intent = new Intent(context, ClanIncomeActivity.class); + context.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_income_statistics); + ButterKnife.bind(this); + + initTitleBar("收入统计"); + initIndicator(); + + ClanIncomeFragment fragment = ClanIncomeFragment.getInstance(ClanIncomeFragment.TYPE_DAY); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + + fragment = ClanIncomeFragment.getInstance(ClanIncomeFragment.TYPE_WEEK); + fragment.setmDayIncomeFragmentListener(this); + list.add(fragment); + + viewPager.setAdapter(adapter); + +// initDay(); + + } + + private boolean mHasInit = false; + + @Override + protected void onResume() { + super.onResume(); + + if (!mHasInit) { + mHasInit = true; + initDay(); + } + } + + /** + * 初始化当前日,周 + */ + private void initDay() { + + ClanIncomePresenter 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("每日统计"); + tagList.add("每周统计"); + + 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; + ClanIncomePresenter presenter = getMvpPresenter(); + String day; + + if (mCurrentType == TYPE_WEEK) { + StatisticManager.Instance().onEvent(BasicConfig.INSTANCE.getAppContext(), + StatisticsProtocol.Event.HALL_INCOME_WEEKLY_CLICK, "切换每周统计", null); + day = presenter.getWeekChooseDayFormat(); + } else + day = presenter.getDayFormat(); + + getIncomeTotal(day, presenter.getmStartTimeStr(), presenter.getmEndTimeStr()); + } + + @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(); + } + }; + + @OnClick({R.id.iv_date_arrow, R.id.ll_day_group}) + public void onViewClicked(View view) { + switch (view.getId()) { + case R.id.iv_date_arrow: + case R.id.ll_day_group: + ClanIncomePresenter presenter = getMvpPresenter(); + boolean isWeek = mCurrentType == TYPE_WEEK; + + 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); + + 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) { + ClanIncomePresenter presenter = getMvpPresenter(); + + if (mCurrentType == TYPE_DAY) { + presenter.setmDayStr(chooseTime); + getIncomeTotal(presenter.getDayFormat(), "", ""); + + } else if (mCurrentType == TYPE_WEEK) { + presenter.setmWeekChooseDay(chooseTime); + presenter.setmStartTimeStr(weekFirstDay); + presenter.setmEndTimeStr(weekLastDay); + + getIncomeTotal("", weekFirstDay, weekLastDay); + } + + } + + 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])); + list.get(0).getIncomeTotal(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])); + list.get(1).getIncomeTotal(weekFirstDay, weekLastDay); + } + + } + + @Override + public void setTotal(long total) { + tvTotal.setText(getMvpPresenter().setTotal(total)); + } +} diff --git a/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/activity/ModuleHallActivity.java b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/activity/ModuleHallActivity.java index bda031c80..f369a536b 100644 --- a/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/activity/ModuleHallActivity.java +++ b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/activity/ModuleHallActivity.java @@ -11,6 +11,7 @@ import android.view.View; import android.widget.ImageView; import android.widget.TextView; +import androidx.annotation.Nullable; import androidx.core.widget.NestedScrollView; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; @@ -27,10 +28,13 @@ import com.yizhuan.erban.common.widget.dialog.DialogManager; import com.yizhuan.erban.friend.action.AbstractSelectFriendAction; import com.yizhuan.erban.module_hall.HallDataManager; import com.yizhuan.erban.module_hall.hall.adapter.GroupMemberListAdapter; +import com.yizhuan.erban.module_hall.hall.adapter.HallListAdapter; import com.yizhuan.erban.module_hall.hall.adapter.OptionAdapter; import com.yizhuan.erban.module_hall.hall.presenter.ModuleHallPresenter; import com.yizhuan.erban.module_hall.hall.view.IModuleHallView; import com.yizhuan.erban.module_hall.hall.view.dialog.HallMenuDialog; +import com.yizhuan.erban.ui.user.UserInfoActivity; +import com.yizhuan.erban.ui.utils.RVDelegate; import com.yizhuan.erban.ui.webview.CommonWebViewActivity; import com.yizhuan.erban.ui.widget.ButtonItem; import com.yizhuan.erban.ui.widget.marqueeview.Utils; @@ -38,6 +42,9 @@ import com.yizhuan.erban.ui.widget.recyclerview.decoration.SpacingDecoration; import com.yizhuan.xchat_android_core.auth.AuthModel; import com.yizhuan.xchat_android_core.module_hall.hall.HallModel; import com.yizhuan.xchat_android_core.module_hall.hall.bean.AuthInfo; +import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanAndHallInfo; +import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanInfo; +import com.yizhuan.xchat_android_core.module_hall.hall.bean.HallInfo; import com.yizhuan.xchat_android_core.module_hall.hall.bean.MemberInfo; import com.yizhuan.xchat_android_core.module_hall.hall.bean.OptionInfo; import com.yizhuan.xchat_android_core.statistic.StatisticManager; @@ -54,6 +61,7 @@ import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; +import io.reactivex.functions.Consumer; /** @@ -65,42 +73,48 @@ public class ModuleHallActivity extends BaseMvpActivity mAuthInfoList; + private HallListAdapter hallListAdapter; + private RVDelegate rvDelegate; + + @Nullable + private ClanInfo clanInfo; private int page = 100; - - private int pageSize = 100; - + private final int pageSize = 20; private boolean isLoading; private long lastClickTime; @@ -148,7 +165,6 @@ public class ModuleHallActivity extends BaseMvpActivity { + String bgUrl = ""; + HallInfo hallInfo = clanAndHallInfo.getHall(); + if (hallInfo != null && hallInfo.getHallId() != 0) { + HallDataManager.get().updateHallInfo(hallInfo); + clHall.setVisibility(View.VISIBLE); + clHall.setOnClickListener(v -> UserInfoActivity.Companion.start(context,hallInfo.getOwnerUid())); + bgUrl = hallInfo.getOwnerAvatar(); + tvHallId.setText("公会ID:" + hallInfo.getHallId() + ""); + tvOwnerUid.setText("66号:" + hallInfo.getOwnerErbanNo()); + tvOwnerName.setText(hallInfo.getOwnerNick()); + tvTitle.setText(hallInfo.getHallName()); + GlideApp.with(ivAvatar.getContext()) + .load(hallInfo.getOwnerAvatar()) + .placeholder(R.drawable.default_avatar) + .into(ivAvatar); + } else { + clHall.setVisibility(View.GONE); + } + clanInfo = clanAndHallInfo.getClan(); + if (clanInfo != null && clanInfo.getId() != 0) { + clClan.setVisibility(View.VISIBLE); + clClan.setOnClickListener(v -> UserInfoActivity.Companion.start(context,clanInfo.getElderUid())); + bgUrl = clanInfo.getAvatar(); + tvClanId.setText("家族ID:" + clanInfo.getId()); + tvClanOwnerUid.setText("66号:" + clanInfo.getElderErbanNo()); + tvClanOwnerName.setText(clanInfo.getElderName()); + tvTitle.setText(clanInfo.getName()); + GlideApp.with(ivClanAvatar.getContext()) + .load(clanInfo.getAvatar()) + .placeholder(R.drawable.default_avatar) + .into(ivClanAvatar); + loadHallList(); + } else { + clHall.setVisibility(View.GONE); + } + + GlideApp.with(ivAvatarBg.getContext()) + .load(bgUrl) + .placeholder(R.drawable.default_avatar) + .into(ivAvatarBg); + }); + } + + @SuppressLint({"CheckResult", "SetTextI18n"}) + private void loadHallList() { + if (clanInfo == null) return; + HallModel.get().getClanHallList(clanInfo.getId()) + .compose(bindToLifecycle()) + .subscribe(hallInfos -> { + if (rvDelegate == null) { + rvDelegate = new RVDelegate.Builder() + .setAdapter(hallListAdapter = new HallListAdapter()) + .setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)) + .setPageSize(20) + .setRecyclerView(rvHall) + .build(); + } + llHallList.setVisibility(View.VISIBLE); + tvClanMemberCount.setText("公会列表(" + hallInfos.size() + ")"); + rvDelegate.setNewData(hallInfos); + }); } @Override @@ -194,7 +278,7 @@ public class ModuleHallActivity extends BaseMvpActivity optionInfoList = mOptionAdapter.getData(); - OptionInfo optionInfo = optionInfoList.get(position); - - // code --> url --> 原生 - if (OptionInfo.OPTION_LOOK_HALL_INCOME.equals(optionInfo.getCode())) { - - if (!TextUtils.isEmpty(optionInfo.getUrl())) - CommonWebViewActivity.start(ModuleHallActivity.this, optionInfo.getUrl()); - else - IncomeStatisticsActivity.start(ModuleHallActivity.this); - - } else if (OptionInfo.OPTION_HALL_BUILD.equals(optionInfo.getCode())) { - Log.i("option", "do nothing"); - } else if (OptionInfo.OPTION_ADD_HALL_MEMBER_WITH_PWD.equals(optionInfo.getCode())) { - - StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HALL_ADDMEMBERS_CLICK, - "添加成员-面板"); - HallSearchActivity.start(context, AbstractSelectFriendAction.TYPE_MODULE_HALL); - - } else if (OptionInfo.OPTION_HALL_OWNER_ROOM_SERIAL.equals(optionInfo.getCode())) { - StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HALL_HALLINCOME_CLICK, - "厅收入统计"); - String url = optionInfo.getUrl(); - if (!TextUtils.isEmpty(url)) - CommonWebViewActivity.start(ModuleHallActivity.this, optionInfo.getUrl()); + mOptionAdapter.setOnItemChildClickListener((adapter, view, position) -> { + List optionInfoList = mOptionAdapter.getData(); + OptionInfo optionInfo = optionInfoList.get(position); + // code --> url --> 原生 + if (OptionInfo.OPTION_LOOK_HALL_INCOME.equals(optionInfo.getCode())) { + if (!TextUtils.isEmpty(optionInfo.getUrl())) { + CommonWebViewActivity.start(ModuleHallActivity.this, optionInfo.getUrl()); } else { - toast("请更新到最新版本"); + IncomeStatisticsActivity.start(ModuleHallActivity.this); } + } else if (OptionInfo.OPTION_GUILD_INCOME.equals(optionInfo.getCode())) { + if (!TextUtils.isEmpty(optionInfo.getUrl())) { + CommonWebViewActivity.start(ModuleHallActivity.this, optionInfo.getUrl()); + } else { + ClanIncomeActivity.start(ModuleHallActivity.this); + } + } else if (OptionInfo.OPTION_HALL_BUILD.equals(optionInfo.getCode())) { + Log.i("option", "do nothing"); + } else if (OptionInfo.OPTION_ADD_HALL_MEMBER_WITH_PWD.equals(optionInfo.getCode())) { + + StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HALL_ADDMEMBERS_CLICK, + "添加成员-面板"); + HallSearchActivity.start(context, AbstractSelectFriendAction.TYPE_MODULE_HALL); + + } else if (OptionInfo.OPTION_HALL_OWNER_ROOM_SERIAL.equals(optionInfo.getCode())) { + StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HALL_HALLINCOME_CLICK, + "厅收入统计"); + String url = optionInfo.getUrl(); + if (!TextUtils.isEmpty(url)) + CommonWebViewActivity.start(ModuleHallActivity.this, optionInfo.getUrl()); + + } else { + toast("请更新到最新版本"); } + }); } } - @Override public void onReloadDate() { super.onReloadDate(); @@ -283,6 +369,7 @@ public class ModuleHallActivity extends BaseMvpActivity { mSrlGroup.setRefreshing(false); @@ -334,22 +421,10 @@ public class ModuleHallActivity extends BaseMvpActivity list_adapter = new ArrayList<>(); for (AuthInfo authInfo : authInfoList) { - if (authInfo.getCode().equals(AuthInfo.AUTH_APPLY_HALL_EXIT)){ + if (authInfo.getCode().equals(AuthInfo.AUTH_APPLY_HALL_EXIT)) { continue; } if (authInfo.isOwnAuth()) { - ButtonItem item = new ButtonItem(authInfo.getName(),() -> { + ButtonItem item = new ButtonItem(authInfo.getName(), () -> { jumpCode(authInfo.getCode()); }); list_adapter.add(item); diff --git a/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/adapter/HallListAdapter.java b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/adapter/HallListAdapter.java new file mode 100644 index 000000000..7adfc7133 --- /dev/null +++ b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/adapter/HallListAdapter.java @@ -0,0 +1,20 @@ +package com.yizhuan.erban.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.yizhuan.erban.R; +import com.yizhuan.erban.ui.utils.ImageLoadUtils; +import com.yizhuan.xchat_android_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/yizhuan/erban/module_hall/hall/presenter/ModuleHallPresenter.java b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/presenter/ModuleHallPresenter.java index 53c228b64..0525585d3 100644 --- a/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/presenter/ModuleHallPresenter.java +++ b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/hall/presenter/ModuleHallPresenter.java @@ -53,10 +53,6 @@ public class ModuleHallPresenter extends BaseMvpPresenter{ }); } - public void getHallInfo() { - HallDataManager.get().updateHallInfo(); - } - /** * 成员列表 */ diff --git a/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/income/ClanIncomeFragment.java b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/income/ClanIncomeFragment.java new file mode 100644 index 000000000..73bd9deb9 --- /dev/null +++ b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/income/ClanIncomeFragment.java @@ -0,0 +1,182 @@ +package com.yizhuan.erban.module_hall.income; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.yizhuan.erban.R; +import com.yizhuan.erban.base.BaseMvpFragment; +import com.yizhuan.erban.module_hall.income.adapter.IncomeAdapter; +import com.yizhuan.erban.module_hall.income.presenter.IncomePresenter; +import com.yizhuan.erban.module_hall.income.view.IIncomeView; +import com.yizhuan.xchat_android_core.module_hall.income.bean.IncomeInfo; +import com.yizhuan.xchat_android_core.module_hall.income.bean.IncomeTotalInfo; +import com.yizhuan.xchat_android_library.base.factory.CreatePresenter; + +import java.util.List; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.Unbinder; + +/** + * 日收入统计 + * Created by lvzebiao on 2018/12/27. + */ + +@CreatePresenter(IncomePresenter.class) +public class ClanIncomeFragment extends BaseMvpFragment implements IIncomeView{ + + public static final int TYPE_DAY = 0; + public static final int TYPE_WEEK = 1; + public static final String FLAG_DAY_TYPE = "dayType"; + + private int mDayType; + private IncomeAdapter mIncomeAdapter; + + private DayIncomeFragmentListener mDayIncomeFragmentListener; + + Unbinder unbinder; + + @BindView(R.id.recycler_view) + RecyclerView recyclerView; + + public static ClanIncomeFragment getInstance(int dayType) { + ClanIncomeFragment fragment = new ClanIncomeFragment(); + Bundle bundle = new Bundle(); + bundle.putInt(FLAG_DAY_TYPE, dayType); + fragment.setArguments(bundle); + return fragment; + } + + @Override + public void onFindViews() { + mIncomeAdapter = new IncomeAdapter(mContext, null); + recyclerView.setLayoutManager(new LinearLayoutManager(mContext)); + mIncomeAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() { + @Override + public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) { + List incomeInfos = mIncomeAdapter.getData(); + if (incomeInfos.size() > 0) { + IncomeInfo incomeInfo = incomeInfos.get(position); + + if (mDayType == TYPE_WEEK) + IncomeDetailActivity.start(mContext, incomeInfo, mStartTimeStr, mEndTimeStr); + else + IncomeDetailActivity.start(mContext, incomeInfo, mStartTimeStr, ""); + + } + } + }); + recyclerView.setAdapter(mIncomeAdapter); + recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { + @Override + public void onScrollStateChanged(RecyclerView recyclerView, int newState) { + super.onScrollStateChanged(recyclerView, newState); +// if (newState == RecyclerView.SCROLL_STATE_IDLE) { +// if (isLoading || noMoreData) { +// return; +// } +// LinearLayoutManager manager = (LinearLayoutManager) recyclerView.getLayoutManager(); +// int lastfirst = manager.findLastVisibleItemPosition(); +// int itemCount = mGroupMemberListAdapter.getItemCount(); +// if (itemCount >= 2 && lastfirst >= itemCount - 2) { +// loadMembers(); +// } +// } + } + }); + + } + + @Override + public void onSetListener() { + } + + @Override + public void initiate() { + } + + public void getIncomeTotal(String startTimeStr, String endTimeStr) { + mStartTimeStr = startTimeStr; + mEndTimeStr = endTimeStr; + + if (mDayType == TYPE_WEEK) { + getMvpPresenter().incomeTotal(startTimeStr, endTimeStr); + } else { + getMvpPresenter().incomeTotal(startTimeStr, ""); + } + } + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + super.onCreateView(inflater, container, savedInstanceState); + unbinder = ButterKnife.bind(this, mView); + + return mView; + } + + @Override + protected void onInitArguments(Bundle bundle) { + if (bundle != null) { + mDayType = bundle.getInt(FLAG_DAY_TYPE, 0); + } + } + + @Override + public int getRootLayoutId() { + return R.layout.fragment_day_income; + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + unbinder.unbind(); + } + + 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(); + } + + } + + @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/yizhuan/erban/module_hall/income/presenter/ClanIncomePresenter.java b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/income/presenter/ClanIncomePresenter.java new file mode 100644 index 000000000..e777b259c --- /dev/null +++ b/app/src/module_labour_union/java/com/yizhuan/erban/module_hall/income/presenter/ClanIncomePresenter.java @@ -0,0 +1,107 @@ +package com.yizhuan.erban.module_hall.income.presenter; + +import android.text.SpannableString; +import android.text.style.RelativeSizeSpan; + +import com.yizhuan.erban.base.BaseMvpPresenter; +import com.yizhuan.erban.module_hall.income.view.IIncomeStatisticsView; +import com.yizhuan.xchat_android_library.utils.TimeUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Calendar; + +public class ClanIncomePresenter extends BaseMvpPresenter { + + private String mStartTimeStr; + private String mEndTimeStr; + /** 周范围内选中的日期 */ + 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); + + mStartTimeStr = TimeUtils.getDateTimeString(firstDayTime, TimeUtils.DATE_FORMAT); + mEndTimeStr = TimeUtils.getDateTimeString(lastDayTime, TimeUtils.DATE_FORMAT); + } + + public SpannableString setTotal(long 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() + "万钻石"; + + spannableString = new SpannableString(str); + spannableString.setSpan(sizeSpan, str.length() - 3, str.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); + + } else { + String str = String.valueOf(total) + "钻石"; + + 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); + } + +} 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 index 87682ebb6..8e92882fb 100644 --- a/app/src/module_labour_union/res/layout/activity_module_hall.xml +++ b/app/src/module_labour_union/res/layout/activity_module_hall.xml @@ -34,60 +34,231 @@ - + app:layout_constraintTop_toTopOf="parent"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + app:barrierDirection="bottom" + app:constraint_referenced_ids="cl_clan,cl_hall" /> + app:layout_constraintTop_toBottomOf="@id/barrier_top" /> + + + + + + + + + + app:layout_constraintTop_toBottomOf="@id/ll_hall_list"> + + + + + + + \ No newline at end of file diff --git a/app/src/module_quick_pass/res/layout/activity_give_gold_to_user.xml b/app/src/module_quick_pass/res/layout/activity_give_gold_to_user.xml index 91f19e989..6e3015b18 100644 --- a/app/src/module_quick_pass/res/layout/activity_give_gold_to_user.xml +++ b/app/src/module_quick_pass/res/layout/activity_give_gold_to_user.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" android:background="@color/white" android:orientation="vertical" - tools:context="com.yinyuan.doudou.pay.activity.GiveGoldToUserActivity"> + tools:context=".pay.activity.GiveGoldToUserActivity"> > getClanHallList(long clanId) { + return api.getClanHallList(clanId) + .compose(RxHelper.handleCommon()); + } + + + @Override + public Single getClanAllMembers(long uid, int page, int pageSize) { + return api.getClanAllMembers(uid, page, pageSize) + .compose(RxHelper.handleCommon(ListMemberInfo::new)); + } + + @Override + public Single getUserHallAndClan(long uid) { + return api.getUserHallAndClan(uid) + .compose(RxHelper.handleCommon()); + } + + private interface Api { /** * 申请加入模厅 @@ -372,5 +394,33 @@ public class HallModel extends BaseModel implements IHallModel { @GET("/hall/getOwnerHallInfo") Single> getOwnerHallInfo(@Query("uid") long uid, @Query("targetUid") long targetUid); + + /** + * 获取家族下的公会列表 + */ + @GET("/clan/listHall") + Single>> getClanHallList(@Query("clanId") long clanId); + + /** + * 获取家族下的成员列表 + */ + @GET("/clan/listMember") + Single> getClanAllMembers(@Query("uid") long uid, + @Query("page") int page, + @Query("pageSize") int pageSize); + + /** + * + * 获取用户家族信息 + */ + @GET("/clan/getUserClanInfo") + Single> getUserClanInfo(@Query("uid") long uid); + + /** + * + * 获取用户家族和公会信息 + */ + @GET("/clan/getUserHallAndClan") + Single> getUserHallAndClan(@Query("uid") long uid); } } \ No newline at end of file diff --git a/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/IHallModel.java b/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/IHallModel.java index 678ca3c0b..dbadc3cb8 100644 --- a/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/IHallModel.java +++ b/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/IHallModel.java @@ -2,6 +2,7 @@ package com.yizhuan.xchat_android_core.module_hall.hall; import com.yizhuan.xchat_android_core.module_hall.hall.bean.AuthInfo; +import com.yizhuan.xchat_android_core.module_hall.hall.bean.ClanAndHallInfo; import com.yizhuan.xchat_android_core.module_hall.hall.bean.OptionInfo; import com.yizhuan.xchat_android_core.module_hall.hall.bean.ApplyResult; import com.yizhuan.xchat_android_core.module_hall.hall.bean.HallInfo; @@ -67,4 +68,9 @@ public interface IHallModel { Single getOwnerHallInfo(long targetUid); + Single> getClanHallList(long clanId); + + Single getClanAllMembers(long clanId, int page, int pageSize); + + Single getUserHallAndClan(long uid); } diff --git a/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/ClanAndHallInfo.java b/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/ClanAndHallInfo.java new file mode 100644 index 000000000..ed08b6fb7 --- /dev/null +++ b/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/ClanAndHallInfo.java @@ -0,0 +1,9 @@ +package com.yizhuan.xchat_android_core.module_hall.hall.bean; + +import lombok.Data; + +@Data +public class ClanAndHallInfo { + private ClanInfo clan; + private HallInfo hall; +} diff --git a/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/ClanInfo.java b/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/ClanInfo.java new file mode 100644 index 000000000..965cf7aa1 --- /dev/null +++ b/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/ClanInfo.java @@ -0,0 +1,19 @@ +package com.yizhuan.xchat_android_core.module_hall.hall.bean; + +import lombok.Data; + +@Data +public class ClanInfo { + private String avatar; + private String clanHallNum; + private int clanMemberNum; + private int id; + private String name; + private long elderUid; + private String elderName; + private long elderErbanNo; + private int status; + private long ownerId; + private boolean userIsElder; + +} diff --git a/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/HallInfo.java b/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/HallInfo.java index b4e43edfe..4ca083056 100644 --- a/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/HallInfo.java +++ b/core/src/model_labour_union/java/com/yizhuan/xchat_android_core/module_hall/hall/bean/HallInfo.java @@ -20,6 +20,11 @@ public class HallInfo { */ private long ownerUid; + /** + * 厅主Id + */ + private long ownerErbanNo; + /** * 厅人数 */