辖区人口
This commit is contained in:
parent
dc4ef5a20c
commit
b123c57942
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.6.21" />
|
||||
<option name="version" value="1.6.0" />
|
||||
</component>
|
||||
</project>
|
@ -89,7 +89,7 @@ dependencies {
|
||||
api "io.github.razerdp:BasePopup:$rootProject.popup_version"
|
||||
//选择器
|
||||
api 'io.github.lucksiege:pictureselector:v2.7.3-rc08'
|
||||
api 'me.rosuh:AndroidFilePicker:0.7.0-x'
|
||||
api 'me.rosuh:AndroidFilePicker:0.8.3'
|
||||
|
||||
//toast
|
||||
api 'com.github.getActivity:ToastUtils:9.5'
|
||||
|
@ -205,6 +205,8 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_CHOOSE_GRID_USER = "/modulecommon/activity/chooseGridUser";//网格员选择
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_CHOOSE_COMMUNITY_USER = "/modulecommon/activity/chooseCommunityUser";//社区专管员选择
|
||||
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_AREA_POPULACE_LIST = "/modulecommon/activity/populaceAreaList";//辖区人口
|
||||
|
||||
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_INCIDENT_REPORT = "/modulecommon/activity/incidentReport";//事件上报
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_INCIDENT_EDIT = "/modulecommon/activity/incidentEdit";//事件修改
|
||||
@ -247,6 +249,7 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_GRID_STATISTICS = "/modulecommon/activity/gridStatistics";//统计分析
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_DEPT_STATISTICS = "/modulecommon/activity/deptStatistics";//统计分析
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_COMMAND_STATISTICS = "/modulecommon/activity/commandStatistics";//统计分析
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_POPULACE_DETAIL = "/modulecommon/activity/populaceBaseDetail";//人口详情
|
||||
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_KNOWLEDGE_LIBRARY_LIST = "/modulecommon/activity/knowledgeList";//知识库列表
|
||||
public static final String PATH_MODULE_COMMON_ACTIVITY_KNOWLEDGE_LIBRARY_DETAIL = "/modulecommon/activity/knowledgeDetail";//知识详情
|
||||
@ -565,4 +568,5 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_GRID_FRAGMENT_PERSON_LIB = "/modulegrid/fragment/personLib";//人口库
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -44,6 +44,15 @@ public class PersonSearchBean {
|
||||
private String religionDictionaryName;
|
||||
private String serviceSpace;
|
||||
private String telephone;
|
||||
private String type;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getAreaCode() {
|
||||
return areaCode;
|
||||
|
@ -11,9 +11,9 @@ public class BaseUrlApi {
|
||||
// public static final String IP = "http://10.25.242.183:80/";/* 测试IP */
|
||||
public static final String IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
||||
public static final String SYS_USERCENTER = "usercenter/";
|
||||
public static final String SYS_POPULATION = "population/";/*人口系统*/
|
||||
public static final String SYS_POPULATION = "populationhouse/";/*人口系统*/
|
||||
public static final String SYS_CASE = "case/";/*事件部件*/
|
||||
public static final String SYS_HOUSE = "house/";/*房屋系统*/
|
||||
public static final String SYS_HOUSE = "populationhouse/";/*房屋系统*/
|
||||
public static final String SYS_SECURITY = "manage/";/*社会治安*/
|
||||
public static final String SYS_TASK = "task/";/*任务系统*/
|
||||
public static final String SYS_LIBRARY = "library/";/*知识库系统*/
|
||||
|
@ -0,0 +1,55 @@
|
||||
package com.tenlionsoft.baselib.core.widget.base;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.tenlionsoft.baselib.R;
|
||||
import com.tenlionsoft.baselib.core.beans.AreaBean;
|
||||
import com.tenlionsoft.baselib.core.beans.AreaSimpleBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/20 - 11:18 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:区域筛选
|
||||
*/
|
||||
public class ConditionAreaIdAdapter extends BaseRecyclerAdapter<AreaBean, ConditionHolder> {
|
||||
public List<AreaBean> mSelBeans = new ArrayList<>();
|
||||
|
||||
public ConditionAreaIdAdapter(Context ctx, List<AreaBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConditionHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.item_condition_sel, parent, false);
|
||||
return new ConditionHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(ConditionHolder holder, int i) {
|
||||
AreaBean bean = mData.get(i);
|
||||
holder.mTvName.setText(bean.getAreaName());
|
||||
holder.mCbCheck.setOnCheckedChangeListener(null);
|
||||
holder.mTvName.setTextColor(bean.isCheck() ? Color.parseColor("#1296db") : Color.BLACK);
|
||||
holder.mCbCheck.setChecked(bean.isCheck());
|
||||
holder.mCbCheck.setOnCheckedChangeListener((buttonView, isChecked) -> mLis.onItemCheckChange(bean, isChecked, i));
|
||||
holder.itemView.setOnClickListener(v -> mLis.onItemCheckChange(bean, !bean.isCheck(), i));
|
||||
}
|
||||
|
||||
private OnItemCheckChange mLis;
|
||||
|
||||
public void addOnitemCheckChange(OnItemCheckChange lis) {
|
||||
this.mLis = lis;
|
||||
}
|
||||
|
||||
public interface OnItemCheckChange {
|
||||
void onItemCheckChange(AreaBean bean, boolean isCheck, int pos);
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package com.tenlionsoft.baselib.core.widget.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.tenlionsoft.baselib.R;
|
||||
import com.tenlionsoft.baselib.core.beans.AreaBean;
|
||||
import com.tenlionsoft.baselib.core.beans.AreaSimpleBean;
|
||||
import com.tenlionsoft.baselib.core.widget.base.ConditionAreaAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.ConditionAreaIdAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import razerdp.basepopup.BasePopupWindow;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/9/30 - 2:58 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 条件选择
|
||||
*/
|
||||
public class ConditionAreaIdPopup extends BasePopupWindow {
|
||||
private List<AreaBean> mDatas;
|
||||
private RecyclerView mRlvConditions;
|
||||
private ConditionAreaIdAdapter mAdapter;
|
||||
private OnListPopupItemClickListener mOnListPopupItemClickListener;
|
||||
|
||||
public ConditionAreaIdPopup(Context context, List<AreaBean> datas) {
|
||||
super(context);
|
||||
View view = createPopupById(R.layout.popup_condition_layout);
|
||||
RecyclerView rlvCondition = view.findViewById(R.id.rlv_conditions);
|
||||
if (datas == null) {
|
||||
mDatas = new ArrayList<>();
|
||||
} else {
|
||||
mDatas = datas;
|
||||
}
|
||||
mAdapter = new ConditionAreaIdAdapter(context, mDatas);
|
||||
rlvCondition.setLayoutManager(new LinearLayoutManager(context));
|
||||
rlvCondition.setAdapter(mAdapter);
|
||||
setContentView(view);
|
||||
|
||||
setBackgroundColor(Color.parseColor("#11000000"));
|
||||
setPopupGravity(Gravity.BOTTOM | Gravity.CENTER);
|
||||
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||
int height = (int) (displayMetrics.heightPixels * 0.5);
|
||||
setHeight(height);
|
||||
mAdapter.addOnitemCheckChange((bean, isCheck, pos) -> {
|
||||
if (isCheck) {
|
||||
mAdapter.mSelBeans.clear();
|
||||
mAdapter.mSelBeans.add(bean);
|
||||
} else {
|
||||
mAdapter.mSelBeans.remove(bean);
|
||||
}
|
||||
bean.setCheck(isCheck);
|
||||
mOnListPopupItemClickListener.onItemClick(bean, isCheck, pos);
|
||||
if (isCheck) {
|
||||
if (true) {
|
||||
for (int i = 0; i < mAdapter.getData().size(); i++) {
|
||||
if (!mAdapter.getData().get(i).getAreaId().equals(bean.getAreaId())) {
|
||||
mAdapter.getData().get(i).setCheck(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mAdapter.notifyDataSetChanged();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public OnListPopupItemClickListener getOnListPopupItemClickListener() {
|
||||
return mOnListPopupItemClickListener;
|
||||
}
|
||||
|
||||
public void setOnListPopupItemClickListener(OnListPopupItemClickListener onListPopupItemClickListener) {
|
||||
mOnListPopupItemClickListener = onListPopupItemClickListener;
|
||||
}
|
||||
|
||||
public interface OnListPopupItemClickListener {
|
||||
void onItemClick(AreaBean bean, boolean isCheck, int pos);
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.4.0-rc'
|
||||
ext.kotlin_version = '1.6.0'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
@ -3,12 +3,24 @@
|
||||
package="com.tengshisoft.commonmodule">
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name=".activitys.populace.CensusBaseDetailActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.populace.PopulaceAreaListActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.cases.IncidentCheckInfoActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.cases.IncidentHandleInfoActivity"
|
||||
android:exported="false"
|
||||
|
@ -0,0 +1,245 @@
|
||||
package com.tengshisoft.commonmodule.activitys.populace;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
import com.tengshisoft.commonmodule.R2;
|
||||
import com.tengshisoft.commonmodule.beans.SuccessBean;
|
||||
import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.PersonSearchBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.views.CenterBaseInputView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.IDCard;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 人口详情
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_POPULACE_DETAIL)
|
||||
public class CensusBaseDetailActivity extends BaseActivity {
|
||||
|
||||
@BindView(R2.id.et_identity)
|
||||
TextView mEtIdentity;//身份证号
|
||||
@BindView(R2.id.et_name)
|
||||
TextView mEtName;//姓名
|
||||
@BindView(R2.id.et_once_name)
|
||||
TextView mEtOnceName;//曾用名---
|
||||
@BindView(R2.id.tv_gender)
|
||||
TextView mTvGender;//性别
|
||||
@BindView(R2.id.tv_birth)
|
||||
TextView mTvBirth;//生日
|
||||
@BindView(R2.id.tv_nation)
|
||||
TextView mTvNation;//民族
|
||||
@BindView(R2.id.tv_marry)
|
||||
TextView mTvMarry;//婚姻
|
||||
@BindView(R2.id.tv_political)
|
||||
TextView mTvPolitical;//政治面貌
|
||||
@BindView(R2.id.tv_edu)
|
||||
TextView mTvEdu;//学历
|
||||
@BindView(R2.id.tv_religion)
|
||||
TextView mTvReligion;//宗教
|
||||
@BindView(R2.id.tv_work_type)
|
||||
TextView mTvWorkType;//职业类别
|
||||
@BindView(R2.id.et_work)
|
||||
TextView mTvWork;//职业
|
||||
@BindView(R2.id.et_work_space)
|
||||
TextView mEtWorkSpace;//服务处所-----
|
||||
@BindView(R2.id.et_phone)
|
||||
TextView mEtPhone;//联系方式
|
||||
@BindView(R2.id.et_census_detail)
|
||||
TextView mEtCensusDetail;//户籍地详址
|
||||
@BindView(R2.id.et_cur_detail)
|
||||
TextView mEtCurDetail;//现在详细地址
|
||||
@BindView(R2.id.tv_area)
|
||||
TextView mTvArea;
|
||||
@BindView(R2.id.tv_grid)
|
||||
TextView mTvGrid;
|
||||
@BindView(R2.id.btn_del)
|
||||
Button mBtnDel;
|
||||
|
||||
@BindView(R2.id.tv_type)
|
||||
TextView mTvType;
|
||||
|
||||
private Unbinder mBind;
|
||||
private String mId;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_census_base_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doShowOptions() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clearSearch() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSearchByTitle() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("详情");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mId = getIntent().getStringExtra("id");
|
||||
getDetailData(mId);
|
||||
mBtnDel.setOnClickListener(v -> onShowDelReason());
|
||||
}
|
||||
|
||||
private void onShowDelReason() {
|
||||
CenterBaseInputView intputView = new CenterBaseInputView.DialogBuilder(mActivity).build();
|
||||
intputView.addOnChoseListener((time, content) -> {
|
||||
intputView.HideSoftKeyBoardDialog(mActivity);
|
||||
intputView.dismiss();
|
||||
doDelBean(content);
|
||||
});
|
||||
intputView.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
private void getDetailData(String id) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getBaseInfoDetailById(id, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<PersonSearchBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull PersonSearchBean searchBaseInfoBean) {
|
||||
setDataToView(searchBaseInfoBean, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
private void doDelBean(String content) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
||||
builder.setTitle("提示")
|
||||
.setMessage("确定要删除该条信息吗?")
|
||||
.setPositiveButton("确定", (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
ProgressDialog dialog1 = UIUtil.initDialog(mActivity, "删除中...");
|
||||
dialog1.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.doDelBaseInfo(mId, content, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull SuccessBean successBean) {
|
||||
dialog1.dismiss();
|
||||
ToastUtils.show("删除成功");
|
||||
setResult(13);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
dialog1.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 回填数据
|
||||
*/
|
||||
private void setDataToView(PersonSearchBean bean, int type) {
|
||||
mEtIdentity.setText(IDCard.idMask(bean.getIdCardNumber(), 10, 4));//身份证号码
|
||||
mEtName.setText(bean.getFullName());//姓名
|
||||
mEtOnceName.setText(bean.getNameUsedBefore());//曾用名---
|
||||
mTvGender.setText(bean.getGenderDictionaryName());//性别
|
||||
mTvArea.setText(bean.getAreaNames());
|
||||
mTvGrid.setText(bean.getGridName());
|
||||
mTvBirth.setText(bean.getBirthDate());//生日
|
||||
mTvNation.setText(bean.getNationDictionaryName());//民族
|
||||
mTvMarry.setText(bean.getMaritalStatusDictionaryName());//婚姻
|
||||
mTvPolitical.setText(bean.getPoliticalStatusDictionaryName());//政治面貌
|
||||
mTvEdu.setText(bean.getEducationDictionaryName());//学历
|
||||
mTvReligion.setText(bean.getReligionDictionaryName());//宗教
|
||||
mTvWorkType.setText(bean.getOccupationCategoryDictionaryName());//职业类别
|
||||
mTvWork.setText(bean.getOccupation());//职业
|
||||
mEtWorkSpace.setText(bean.getServiceSpace());//服务处所-----
|
||||
mEtPhone.setText(bean.getTelephone());//联系方式
|
||||
mEtCensusDetail.setText(bean.getNativePlaceAddr());//户籍地详址
|
||||
mEtCurDetail.setText(bean.getCurrentResidenceAddr());//现在详细地址
|
||||
if (!TextUtils.isEmpty(bean.getType())) {
|
||||
switch (bean.getType()) {
|
||||
case "1":
|
||||
mTvType.setText("户籍人口");
|
||||
break;
|
||||
case "2":
|
||||
mTvType.setText("常住人口");
|
||||
break;
|
||||
case "3":
|
||||
mTvType.setText("外来人口");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
}
|
||||
}
|
@ -0,0 +1,645 @@
|
||||
package com.tengshisoft.commonmodule.activitys.populace;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
import com.tengshisoft.commonmodule.R2;
|
||||
import com.tengshisoft.commonmodule.adapters.CensusPersonAdapter;
|
||||
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
|
||||
import com.tengshisoft.commonmodule.beans.CensusPersonBean;
|
||||
import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tengshisoft.commonmodule.views.ConditionAreaGridPopup;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AreaSimpleBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ConditionAreaPopup;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ItemSplitDivider;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 辖区人口
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_AREA_POPULACE_LIST)
|
||||
public class PopulaceAreaListActivity extends BaseActivity {
|
||||
|
||||
@BindView(R2.id.tv_grid)
|
||||
TextView mTvGrid;
|
||||
@BindView(R2.id.rlv_components)
|
||||
RecyclerView mRlvComponents;
|
||||
@BindView(R2.id.srl_content)
|
||||
SmartRefreshLayout mSrlContent;
|
||||
@BindView(R2.id.pb_loading)
|
||||
ProgressBar mPbLoading;
|
||||
@BindView(R2.id.iv_empty_data)
|
||||
ImageView mIvEmptyData;
|
||||
@BindView(R2.id.tv_error_hint)
|
||||
TextView mTvErrorHint;
|
||||
@BindView(R2.id.et_search_key)
|
||||
EditText mEtSearchKey;
|
||||
@BindView(R2.id.tv_area)
|
||||
TextView mTvArea;
|
||||
@BindView(R2.id.tv_area1)
|
||||
TextView mTvArea1;
|
||||
@BindView(R2.id.tv_area_2)
|
||||
TextView mTvArea2;
|
||||
@BindView(R2.id.tv_area3)
|
||||
TextView mTvArea3;
|
||||
@BindView(R2.id.tv_total)
|
||||
TextView mTvTotal;
|
||||
private Unbinder mBind;
|
||||
private List<CensusPersonBean.RowsBean> mDatas;
|
||||
private CensusPersonAdapter mAdapter;
|
||||
private int mCurrentPage = 1;
|
||||
private String mKeywords = "";
|
||||
|
||||
private ProgressDialog mDialog;
|
||||
private int mSearchDelay = 600;
|
||||
private List<AreaSimpleBean> mArea1List;
|
||||
private List<AreaSimpleBean> mArea2List;
|
||||
private List<AreaSimpleBean> mArea3List;
|
||||
private AreaSimpleBean mSelArea1;
|
||||
private AreaSimpleBean mSelArea2;
|
||||
private AreaSimpleBean mSelArea3;
|
||||
private String mCurrentAreaCode = PathConfig.DEFAULT_AREA_2_CODE;
|
||||
private String mSelAreaCode = "";
|
||||
private AreaGridListBean.RowsBean mSelGrid;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_populace_area_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doShowOptions() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clearSearch() {
|
||||
mKeywords = "";
|
||||
doRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSearchByTitle() {
|
||||
doSearch();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("辖区人口");
|
||||
ImmersionBar.with(mActivity)
|
||||
.statusBarColor("#FFFFFF")
|
||||
.statusBarDarkFont(true)
|
||||
.titleBar(mRlTitleBar)
|
||||
.init();
|
||||
mTvBaseTitle.setTextColor(Color.BLACK);
|
||||
mRlTitleBar.setBackgroundColor(getResources().getColor(R.color.white));
|
||||
mIvAppSearchIcon.setVisibility(View.GONE);
|
||||
mTvAppBack.setBackgroundResource(R.drawable.ic_back_black);
|
||||
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mIvAppSearchIcon.setVisibility(View.VISIBLE);
|
||||
mDatas = new ArrayList<>();
|
||||
mAdapter = new CensusPersonAdapter(mActivity, mDatas);
|
||||
mRlvComponents.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvComponents.setAdapter(mAdapter);
|
||||
mRlvComponents.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#BFBFBF")));
|
||||
mSrlContent.setOnRefreshListener(v -> doRefresh());
|
||||
mSrlContent.setOnLoadMoreListener(v -> doLoadMore());
|
||||
setStateView(13);
|
||||
|
||||
mAdapter.addOnItemClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_POPULACE_DETAIL)
|
||||
.withString("id", v.getBasePopulationInfoId())
|
||||
.navigation());
|
||||
mDialog = UIUtil.initDialog(mActivity, "搜索中...");
|
||||
//判断用户登录账号区域
|
||||
int userAreaLevel = UserLgUtils.getUserAreaLevel();
|
||||
String areaFullName = UserLgUtils.getUserFullAreaName();
|
||||
|
||||
//1 市 2旗县区 3乡镇街道 4村社区
|
||||
//
|
||||
if (userAreaLevel != -1) {
|
||||
mSelAreaCode = UserLgUtils.getUserAreaCode();
|
||||
mTvArea.setText(areaFullName);
|
||||
switch (userAreaLevel) {
|
||||
case 1://市
|
||||
mCurrentAreaCode = UserLgUtils.getUserAreaCode();
|
||||
break;
|
||||
case 2://旗县区
|
||||
mTvArea1.setEnabled(false);
|
||||
mTvArea1.setVisibility(View.GONE);
|
||||
mSelArea1 = new AreaSimpleBean();
|
||||
mSelArea1.setId(UserLgUtils.getUserAreaCode());
|
||||
mTvArea2.setVisibility(View.VISIBLE);
|
||||
mTvArea3.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 3://乡镇街道
|
||||
mTvArea1.setEnabled(false);
|
||||
mTvArea2.setEnabled(false);
|
||||
mSelArea2 = new AreaSimpleBean();
|
||||
mSelArea2.setId(UserLgUtils.getUserAreaCode());
|
||||
mTvArea1.setVisibility(View.GONE);
|
||||
mTvArea2.setVisibility(View.GONE);
|
||||
mTvArea3.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 4://村社区
|
||||
mTvArea1.setEnabled(false);
|
||||
mTvArea2.setEnabled(false);
|
||||
mTvArea3.setEnabled(false);
|
||||
mSelArea3 = new AreaSimpleBean();
|
||||
mSelArea3.setId(UserLgUtils.getUserAreaCode());
|
||||
mTvArea1.setVisibility(View.GONE);
|
||||
mTvArea2.setVisibility(View.GONE);
|
||||
mTvArea3.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ToastUtils.show("您的账号区划配置错误,请联系管理员");
|
||||
finish();
|
||||
}
|
||||
doRefresh();
|
||||
mEtSearchKey.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||
hideSoftKeyboard();
|
||||
mEtSearchKey.clearFocus();
|
||||
mKeywords = v.getText().toString();
|
||||
mDialog.show();
|
||||
doRefresh();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
mTvArea1.setOnClickListener(v -> {
|
||||
if (mArea1List != null && mArea1List.size() > 0) {
|
||||
onShowArea1();
|
||||
} else {
|
||||
getAreaList(1, mCurrentAreaCode);
|
||||
}
|
||||
});
|
||||
mTvArea2.setOnClickListener(v -> {
|
||||
if (mSelArea1 == null) {
|
||||
ToastUtils.show("请选择旗县区");
|
||||
return;
|
||||
}
|
||||
if (mArea2List != null && mArea2List.size() > 0) {
|
||||
onShowArea2();
|
||||
} else {
|
||||
getAreaList(2, mSelArea1.getId());
|
||||
}
|
||||
});
|
||||
mTvArea3.setOnClickListener(v -> {
|
||||
if (mSelArea2 == null) {
|
||||
ToastUtils.show("请选择乡镇街道");
|
||||
return;
|
||||
}
|
||||
if (mArea3List != null && mArea3List.size() > 0) {
|
||||
onShowArea3();
|
||||
} else {
|
||||
getAreaList(3, mSelArea2.getId());
|
||||
}
|
||||
});
|
||||
mTvGrid.setOnClickListener(v -> {
|
||||
if (mSelArea3 == null) {
|
||||
ToastUtils.show("请先选择社区、村");
|
||||
return;
|
||||
}
|
||||
if (mGridList != null && mGridList.size() > 0) {
|
||||
onShowGrid();
|
||||
} else {
|
||||
getGridList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取网格
|
||||
*/
|
||||
private void getGridList() {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getGridByAreaCode(mSelArea3.getId(), "", "1", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<AreaGridListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull AreaGridListBean areaGridListBean) {
|
||||
if (dialog != null && dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
if (areaGridListBean.getRows() != null && areaGridListBean.getRows().size() > 0) {
|
||||
mGridList = areaGridListBean.getRows();
|
||||
onShowGrid();
|
||||
} else {
|
||||
ToastUtils.show("暂无网格数据");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
if (dialog != null && dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private List<AreaGridListBean.RowsBean> mGridList;
|
||||
|
||||
/**
|
||||
* 选择网格
|
||||
*/
|
||||
private void onShowGrid() {
|
||||
ConditionAreaGridPopup conditionPopup = new ConditionAreaGridPopup(mActivity, mGridList);
|
||||
conditionPopup.setOnListPopupItemClickListener((bean, isCheck, pos) -> {
|
||||
if (isCheck) {
|
||||
//选中了
|
||||
mSelGrid = bean;
|
||||
mTvGrid.setText(mSelGrid.getGridName());
|
||||
} else {
|
||||
//清除了选项
|
||||
mSelGrid = null;
|
||||
mTvGrid.setText("网格");
|
||||
}
|
||||
mDialog.show();
|
||||
doRefresh();
|
||||
conditionPopup.dismiss();
|
||||
});
|
||||
conditionPopup.showPopupWindow(mTvGrid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取片区内的部件列表
|
||||
*/
|
||||
private void getAreaPopulaceList(int currentPage) {
|
||||
mCurrentPage = currentPage;
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getPopulaceListByAreaId(
|
||||
mKeywords,
|
||||
mSelAreaCode,
|
||||
mSelGrid == null ? "" : mSelGrid.getGridId(),
|
||||
mCurrentPage + "",
|
||||
UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CensusPersonBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull CensusPersonBean communityListBean) {
|
||||
if (mDialog != null && mDialog.isShowing()) {
|
||||
mDialog.dismiss();
|
||||
}
|
||||
mTvTotal.setText("人口总数 : " + communityListBean.getTotal());
|
||||
if (communityListBean.getRows() != null && communityListBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(communityListBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(communityListBean.getRows());
|
||||
}
|
||||
setStateView(14);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mSrlContent.finishRefresh();
|
||||
if (mDatas.size() >= communityListBean.getTotal()) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
setStateView(14);
|
||||
} else {
|
||||
if (TextUtils.isEmpty(mKeywords)) {
|
||||
//无数据
|
||||
setStateView(15);
|
||||
} else {
|
||||
setStateView(15);
|
||||
ToastUtils.show("未查询到相关内容");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
if (mDialog != null && mDialog.isShowing()) {
|
||||
mDialog.dismiss();
|
||||
}
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
ExceptionHandler.handleException(e);
|
||||
setStateView(16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12) {
|
||||
if (resultCode == 13) {
|
||||
doRefresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//加载更多
|
||||
private void doLoadMore() {
|
||||
getAreaPopulaceList(mCurrentPage);
|
||||
}
|
||||
|
||||
//刷新
|
||||
private void doRefresh() {
|
||||
mDatas.clear();
|
||||
mAdapter.setData(mDatas);
|
||||
getAreaPopulaceList(1);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void doSearch() {
|
||||
String searchContent = mEtAppSearchContent.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(searchContent)) {
|
||||
hideSoftKeyboard();
|
||||
setStateView(13);
|
||||
mKeywords = searchContent;
|
||||
mCurrentPage = 1;
|
||||
getAreaPopulaceList(mCurrentPage);
|
||||
} else {
|
||||
ToastUtils.show("请输入要查询的内容");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区选择
|
||||
*/
|
||||
private void onShowArea1() {
|
||||
ConditionAreaPopup conditionPopup = new ConditionAreaPopup(mActivity, mArea1List);
|
||||
conditionPopup.setOnListPopupItemClickListener((bean, isCheck, pos) -> {
|
||||
if (isCheck) {
|
||||
//选中了
|
||||
mSelArea1 = bean;
|
||||
mTvArea1.setText(mSelArea1.getName());
|
||||
mSelAreaCode = mSelArea1.getId();
|
||||
|
||||
mArea2List = null;
|
||||
mSelArea2 = null;
|
||||
mTvArea2.setText("乡镇街道");
|
||||
|
||||
mArea3List = null;
|
||||
mSelArea3 = null;
|
||||
mTvArea3.setText("村、社区");
|
||||
} else {
|
||||
//清除了选项
|
||||
mSelArea1 = null;
|
||||
mArea1List = null;
|
||||
mTvArea1.setText("旗县区");
|
||||
|
||||
mArea2List = null;
|
||||
mSelArea2 = null;
|
||||
mTvArea2.setText("乡镇街道");
|
||||
|
||||
mArea3List = null;
|
||||
mSelArea3 = null;
|
||||
mTvArea3.setText("村、社区");
|
||||
mSelAreaCode = UserLgUtils.getUserAreaCode();
|
||||
|
||||
|
||||
}
|
||||
mSelGrid = null;
|
||||
mGridList = null;
|
||||
mTvGrid.setText("网格");
|
||||
mDialog.show();
|
||||
doRefresh();
|
||||
conditionPopup.dismiss();
|
||||
});
|
||||
conditionPopup.showPopupWindow(mTvArea1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 乡镇街道选择
|
||||
*/
|
||||
private void onShowArea2() {
|
||||
ConditionAreaPopup conditionPopup = new ConditionAreaPopup(mActivity, mArea2List);
|
||||
conditionPopup.setOnListPopupItemClickListener((bean, isCheck, pos) -> {
|
||||
if (isCheck) {
|
||||
//选中了
|
||||
mSelArea2 = bean;
|
||||
mTvArea2.setText(mSelArea2.getName());
|
||||
mSelAreaCode = mSelArea2.getId();
|
||||
mArea3List = null;
|
||||
mSelArea3 = null;
|
||||
mTvArea3.setText("村、社区");
|
||||
} else {
|
||||
//清除了选项
|
||||
mArea2List = null;
|
||||
mSelArea2 = null;
|
||||
mTvArea2.setText("乡镇街道");
|
||||
mSelAreaCode = mSelArea1.getId();
|
||||
mArea3List = null;
|
||||
mSelArea3 = null;
|
||||
mTvArea3.setText("村、社区");
|
||||
}
|
||||
mSelGrid = null;
|
||||
mGridList = null;
|
||||
mTvGrid.setText("网格");
|
||||
mDialog.show();
|
||||
doRefresh();
|
||||
conditionPopup.dismiss();
|
||||
});
|
||||
conditionPopup.showPopupWindow(mTvArea2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 社区村选择
|
||||
*/
|
||||
private void onShowArea3() {
|
||||
ConditionAreaPopup conditionPopup = new ConditionAreaPopup(mActivity, mArea3List);
|
||||
conditionPopup.setOnListPopupItemClickListener((bean, isCheck, pos) -> {
|
||||
if (isCheck) {
|
||||
//选中了
|
||||
mSelArea3 = bean;
|
||||
mTvArea3.setText(mSelArea3.getName());
|
||||
mSelAreaCode = mSelArea3.getId();
|
||||
} else {
|
||||
//清除了选项
|
||||
mArea3List = null;
|
||||
mSelArea3 = null;
|
||||
mTvArea3.setText("村、社区");
|
||||
mSelAreaCode = mSelArea2.getId();
|
||||
}
|
||||
mSelGrid = null;
|
||||
mGridList = null;
|
||||
mTvGrid.setText("网格");
|
||||
mDialog.show();
|
||||
doRefresh();
|
||||
conditionPopup.dismiss();
|
||||
});
|
||||
conditionPopup.showPopupWindow(mTvArea3);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取区域数据
|
||||
*/
|
||||
private void getAreaList(int type, String id) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.getAreaListByCode(id, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<AreaSimpleBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<AreaSimpleBean> areaListBeans) {
|
||||
dialog.dismiss();
|
||||
if (null != areaListBeans && areaListBeans.size() > 0) {
|
||||
switch (type) {
|
||||
case 1: //area1
|
||||
mArea1List = areaListBeans;
|
||||
onShowArea1();
|
||||
break;
|
||||
case 2://area2
|
||||
mArea2List = areaListBeans;
|
||||
onShowArea2();
|
||||
break;
|
||||
case 3://area3
|
||||
mArea3List = areaListBeans;
|
||||
onShowArea3();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ToastUtils.show("暂无区域数据");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.show("获取区域失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态显示
|
||||
* 12 默认
|
||||
* 13 搜索中
|
||||
* 14 搜索完成有数据
|
||||
* 15 搜索完成没有数据
|
||||
* 16 搜索失败
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
private void setStateView(int state) {
|
||||
switch (state) {
|
||||
case 12://默认
|
||||
case 15:
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mSrlContent.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("暂无数据");
|
||||
break;
|
||||
case 13://搜索中
|
||||
mPbLoading.setVisibility(View.VISIBLE);
|
||||
mSrlContent.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.GONE);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("加载中...");
|
||||
break;
|
||||
case 14://搜索完成有数据
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mSrlContent.setVisibility(View.VISIBLE);
|
||||
mIvEmptyData.setVisibility(View.GONE);
|
||||
mTvErrorHint.setVisibility(View.GONE);
|
||||
break;
|
||||
case 16://搜索失败
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mSrlContent.setVisibility(View.GONE);
|
||||
mIvEmptyData.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("加载失败,请稍后重试");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.tengshisoft.commonmodule.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
|
||||
import com.tenlionsoft.baselib.R;
|
||||
import com.tenlionsoft.baselib.core.beans.AreaSimpleBean;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.ConditionHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/20 - 11:18 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:网格筛选
|
||||
*/
|
||||
public class ConditionAreaGridAdapter extends BaseRecyclerAdapter<AreaGridListBean.RowsBean, ConditionHolder> {
|
||||
public List<AreaGridListBean.RowsBean> mSelBeans = new ArrayList<>();
|
||||
|
||||
public ConditionAreaGridAdapter(Context ctx, List<AreaGridListBean.RowsBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConditionHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.item_condition_sel, parent, false);
|
||||
return new ConditionHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(ConditionHolder holder, int i) {
|
||||
AreaGridListBean.RowsBean bean = mData.get(i);
|
||||
holder.mTvName.setText(bean.getGridName());
|
||||
holder.mCbCheck.setOnCheckedChangeListener(null);
|
||||
holder.mTvName.setTextColor(bean.isCheck() ? Color.parseColor("#1296db") : Color.BLACK);
|
||||
holder.mCbCheck.setChecked(bean.isCheck());
|
||||
holder.mCbCheck.setOnCheckedChangeListener((buttonView, isChecked) -> mLis.onItemCheckChange(bean, isChecked, i));
|
||||
holder.itemView.setOnClickListener(v -> mLis.onItemCheckChange(bean, !bean.isCheck(), i));
|
||||
}
|
||||
|
||||
private OnItemCheckChange mLis;
|
||||
|
||||
public void addOnitemCheckChange(OnItemCheckChange lis) {
|
||||
this.mLis = lis;
|
||||
}
|
||||
|
||||
public interface OnItemCheckChange {
|
||||
void onItemCheckChange(AreaGridListBean.RowsBean bean, boolean isCheck, int pos);
|
||||
}
|
||||
}
|
@ -577,7 +577,7 @@ public interface GridApis {
|
||||
*/
|
||||
@Headers({"base_url_name:person", "Content-Type: application/json", "Accept: application/json"})
|
||||
@DELETE("app/basepopulationinfo/removebasepopulationinfo/{ids}")
|
||||
Observable<SuccessBean> doDelBaseInfo(@Path("ids") String id, @Header("token") String token);
|
||||
Observable<SuccessBean> doDelBaseInfo(@Path("ids") String id, @Query("reason") String reason, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 保存人员基础信息
|
||||
@ -1156,6 +1156,19 @@ public interface GridApis {
|
||||
@Query("page") String page,
|
||||
@Header("token") String token);
|
||||
|
||||
|
||||
/**
|
||||
* 根据区域code与网格id查看人口
|
||||
*/
|
||||
@Headers({"base_url_name:person", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/basepopulationinfo/listpageareaorgrid")
|
||||
Observable<CensusPersonBean> getPopulaceListByAreaId(
|
||||
@Query("keywords") String keywords,
|
||||
@Query("areaCode") String areaCode,
|
||||
@Query("gridId") String gridId,
|
||||
@Query("page") String page,
|
||||
@Header("token") String token);
|
||||
|
||||
/**
|
||||
* 我处理过的事件
|
||||
*/
|
||||
|
@ -0,0 +1,88 @@
|
||||
package com.tengshisoft.commonmodule.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.tengshisoft.commonmodule.adapters.ConditionAreaGridAdapter;
|
||||
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
|
||||
import com.tenlionsoft.baselib.R;
|
||||
import com.tenlionsoft.baselib.core.beans.AreaSimpleBean;
|
||||
import com.tenlionsoft.baselib.core.widget.base.ConditionAreaAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import razerdp.basepopup.BasePopupWindow;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/9/30 - 2:58 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 条件选择-网格
|
||||
*/
|
||||
public class ConditionAreaGridPopup extends BasePopupWindow {
|
||||
private List<AreaGridListBean.RowsBean> mDatas;
|
||||
private RecyclerView mRlvConditions;
|
||||
private ConditionAreaGridAdapter mAdapter;
|
||||
private OnListPopupItemClickListener mOnListPopupItemClickListener;
|
||||
|
||||
public ConditionAreaGridPopup(Context context, List<AreaGridListBean.RowsBean> datas) {
|
||||
super(context);
|
||||
View view = createPopupById(R.layout.popup_condition_layout);
|
||||
RecyclerView rlvCondition = view.findViewById(R.id.rlv_conditions);
|
||||
if (datas == null) {
|
||||
mDatas = new ArrayList<>();
|
||||
} else {
|
||||
mDatas = datas;
|
||||
}
|
||||
mAdapter = new ConditionAreaGridAdapter(context, mDatas);
|
||||
rlvCondition.setLayoutManager(new LinearLayoutManager(context));
|
||||
rlvCondition.setAdapter(mAdapter);
|
||||
setContentView(view);
|
||||
|
||||
setBackgroundColor(Color.parseColor("#11000000"));
|
||||
setPopupGravity(Gravity.BOTTOM | Gravity.CENTER);
|
||||
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||
int height = (int) (displayMetrics.heightPixels * 0.5);
|
||||
setHeight(height);
|
||||
mAdapter.addOnitemCheckChange((bean, isCheck, pos) -> {
|
||||
if (isCheck) {
|
||||
mAdapter.mSelBeans.clear();
|
||||
mAdapter.mSelBeans.add(bean);
|
||||
} else {
|
||||
mAdapter.mSelBeans.remove(bean);
|
||||
}
|
||||
bean.setCheck(isCheck);
|
||||
mOnListPopupItemClickListener.onItemClick(bean, isCheck, pos);
|
||||
if (isCheck) {
|
||||
if (true) {
|
||||
for (int i = 0; i < mAdapter.getData().size(); i++) {
|
||||
if (!mAdapter.getData().get(i).getGridId().equals(bean.getGridId())) {
|
||||
mAdapter.getData().get(i).setCheck(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mAdapter.notifyDataSetChanged();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public OnListPopupItemClickListener getOnListPopupItemClickListener() {
|
||||
return mOnListPopupItemClickListener;
|
||||
}
|
||||
|
||||
public void setOnListPopupItemClickListener(OnListPopupItemClickListener onListPopupItemClickListener) {
|
||||
mOnListPopupItemClickListener = onListPopupItemClickListener;
|
||||
}
|
||||
|
||||
public interface OnListPopupItemClickListener {
|
||||
void onItemClick(AreaGridListBean.RowsBean bean, boolean isCheck, int pos);
|
||||
}
|
||||
}
|
301
commonmodule/src/main/res/layout/activity_census_base_detail.xml
Normal file
301
commonmodule/src/main/res/layout/activity_census_base_detail.xml
Normal file
@ -0,0 +1,301 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_base_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/shape_blue_bg"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/ll_base_info"
|
||||
android:layout_marginTop="-20dp"
|
||||
android:background="@drawable/shape_rectangle_white_top">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="20dp">
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="所在地区" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="所在网格" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_grid"
|
||||
style="@style/item_content_23" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="身份证号" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_identity"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="人口类型" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="姓        名" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_name"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="曾  用  名" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_once_name"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="性        别" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gender"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="出生日期" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_birth"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="民         族" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nation"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="婚姻状况" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_marry"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="政治面貌" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_political"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="学         历" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_edu"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="宗教信仰" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_religion"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="职业类别" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_work_type"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="职          业" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_work"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="服务处所" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_work_space"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="联系方式" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_phone"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="籍贯地址" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_census_detail"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_white">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_23"
|
||||
android:text="现住址" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/et_cur_detail"
|
||||
style="@style/item_content_23" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_del"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/sel_btn_gray_red"
|
||||
android:text="删除"
|
||||
android:textColor="@color/black"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
190
commonmodule/src/main/res/layout/activity_populace_area_list.xml
Normal file
190
commonmodule/src/main/res/layout/activity_populace_area_list.xml
Normal file
@ -0,0 +1,190 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shp_bottom_line"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_total"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/white"
|
||||
android:padding="5dp"
|
||||
android:text="人口总数:0"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_16"
|
||||
android:textStyle="bold" />
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:background="@color/gray_line"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_grid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_sort_gray"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="网格"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/layout_search_item" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold"
|
||||
tools:text="乌兰察布乌兰察布乌兰察布" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_sort_gray"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="旗县区"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area_2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_sort_gray"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="乡镇、街道"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_sort_gray"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="社区、村"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:padding="5dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_components"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty_data"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/ic_empty_data" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_error_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:textColor="@color/black"
|
||||
tools:text="加载数据失败" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
@ -73,6 +73,7 @@
|
||||
android:minWidth="0dp"
|
||||
android:minHeight="0dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:visibility="gone"
|
||||
android:paddingRight="8dp"
|
||||
android:text="编辑"
|
||||
android:textColor="@color/text_20" />
|
||||
|
@ -101,6 +101,7 @@ public class LeaderMainFragment extends BaseFragment {
|
||||
"事件处理",
|
||||
"通讯录",
|
||||
"事件追踪",
|
||||
"辖区人口",
|
||||
};
|
||||
private int[] mBtnIds = new int[]{
|
||||
R.drawable.ic_incident_accept_icon,
|
||||
@ -110,7 +111,8 @@ public class LeaderMainFragment extends BaseFragment {
|
||||
R.drawable.ic_incident_accept_icon,
|
||||
R.drawable.ic_case_dispose,
|
||||
R.drawable.ic_list_contact,
|
||||
R.drawable.ic_journal_list};
|
||||
R.drawable.ic_journal_list,
|
||||
R.drawable.ic_populace_list_icon};
|
||||
private FunctionTitleNumAdapter mNumAdapter;
|
||||
private Disposable mDisposable;
|
||||
private List mDatas;
|
||||
@ -491,6 +493,11 @@ public class LeaderMainFragment extends BaseFragment {
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_INCIDENT_AREA_LIST)
|
||||
.navigation();
|
||||
break;
|
||||
case "辖区人口":
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_AREA_POPULACE_LIST)
|
||||
.navigation();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
BIN
mainmodule/src/main/res/drawable-xhdpi/ic_populace_list_icon.png
Normal file
BIN
mainmodule/src/main/res/drawable-xhdpi/ic_populace_list_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Loading…
Reference in New Issue
Block a user