统计分析
@ -34,4 +34,10 @@
|
||||
|
||||
```
|
||||
1.修复Bug RecyclerView Inconsistency detected
|
||||
```
|
||||
|
||||
### 2023-6-15 (1.0.5)
|
||||
|
||||
```
|
||||
1.辖区人口添加人口类型筛选条件
|
||||
```
|
@ -570,5 +570,7 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_GRID_FRAGMENT_PERSON_LIB = "/modulegrid/fragment/personLib";//人口库
|
||||
|
||||
|
||||
|
||||
public static final String PATH_MODULE_COMMON_FRAGMENT_INCIDENT_STATISTICS = "/modulecommon/fragment/incidentLeaderStatistics";//事件统计
|
||||
public static final String PATH_MODULE_COMMON_FRAGMENT_POPULACE_STATISTICS = "/modulecommon/fragment/populaceLeaderStatistics";//人口统计
|
||||
public static final String PATH_MODULE_COMMON_FRAGMENT_GRID_STATISTICS = "/modulecommon/fragment/gridLeaderStatistics";//网格统计
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ package com.tenlionsoft.baselib.core.retrofit_net;
|
||||
*/
|
||||
public class BaseUrlApi {
|
||||
|
||||
// public static final String IP = "http://192.168.0.15:7011/";/* 测试IP */
|
||||
public static final String IP = "http://192.168.0.15:7011/";/* 测试IP */
|
||||
// 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 IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
||||
public static final String SYS_USERCENTER = "usercenter/";
|
||||
public static final String SYS_POPULATION = "populationhouse/";/*人口系统*/
|
||||
public static final String SYS_CASE = "case/";/*事件部件*/
|
||||
@ -20,8 +20,8 @@ public class BaseUrlApi {
|
||||
public static final String SYS_VISITS = "visits/";/*信访系统*/
|
||||
|
||||
public static final String BASE_MAIN_IP = IP + SYS_USERCENTER;
|
||||
public static final String BASE_CASE_IP = IP + SYS_CASE;
|
||||
// public static final String BASE_CASE_IP = "http://192.168.0.120:9000/" + SYS_CASE;
|
||||
// public static final String BASE_CASE_IP = IP + SYS_CASE;
|
||||
public static final String BASE_CASE_IP = "http://192.168.0.120:9000/" + SYS_CASE;
|
||||
public static final String BASE_CASE_LOCAL_IP="http://49.233.36.36:58099/case/";
|
||||
public static final String BASE_LIBRARY_IP = IP + SYS_LIBRARY;
|
||||
public static final String BASE_TASK_IP = IP + SYS_TASK;
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.tenlionsoft.baselib.core.widget.base;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/11/4 - 3:17 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: viewpage2简单指示器
|
||||
*/
|
||||
public class ViewPageWhiteNavigatorAdapter extends CommonNavigatorAdapter {
|
||||
private List<String> mTitles;
|
||||
private Context mContext;
|
||||
private ViewPager2 mVp;
|
||||
|
||||
public ViewPageWhiteNavigatorAdapter(Context ctx, List<String> titles, ViewPager2 vp) {
|
||||
this.mTitles = titles;
|
||||
this.mContext = ctx;
|
||||
this.mVp = vp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mTitles.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerTitleView getTitleView(Context context, int index) {
|
||||
ColorTransitionPagerTitleView cView = new ColorTransitionPagerTitleView(context);
|
||||
cView.setNormalColor(Color.WHITE);
|
||||
cView.setSelectedColor(Color.WHITE);
|
||||
cView.setText(mTitles.get(index));
|
||||
cView.setTextSize(14F);
|
||||
cView.setOnClickListener(v -> mVp.setCurrentItem(index));
|
||||
return cView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPagerIndicator getIndicator(Context context) {
|
||||
LinePagerIndicator indicator = new LinePagerIndicator(context);
|
||||
indicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
|
||||
indicator.setColors(Color.WHITE);
|
||||
return indicator;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.tenlionsoft.baselib.core.widget.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.text.TextPaint;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.tenlionsoft.baselib.R;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/3 - 4:58 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 字体加粗
|
||||
*/
|
||||
public class TypeBoldTextView extends androidx.appcompat.widget.AppCompatTextView {
|
||||
|
||||
public TypeBoldTextView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public TypeBoldTextView(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public TypeBoldTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.TypeBoldTextView, defStyleAttr, 0);
|
||||
int type = a.getInteger(R.styleable.TypeBoldTextView_txt_is_bold, 0);
|
||||
if (type == 0) {
|
||||
setTextBold();
|
||||
}
|
||||
}
|
||||
|
||||
private void setTextBold() {
|
||||
try {
|
||||
TextPaint paint = this.getPaint();
|
||||
if (paint != null) {
|
||||
paint.setFakeBoldText(true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 79 KiB |
6
baselib/src/main/res/drawable/shp_rectangle_blue_shallow.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#E7F1FF" />
|
||||
<corners android:radius="3dp" />
|
||||
</shape>
|
@ -21,6 +21,7 @@
|
||||
<attr name="iconRight" format="reference" />
|
||||
<attr name="duration_max" format="integer" />
|
||||
<attr name="text_type_cus" format="integer" />
|
||||
<attr name="txt_is_bold" format="integer" />
|
||||
<declare-styleable name="JCameraView">
|
||||
<attr name="iconSize" />
|
||||
<attr name="iconMargin" />
|
||||
@ -33,6 +34,9 @@
|
||||
<declare-styleable name="TypeFaceTextView">
|
||||
<attr name="text_type_cus" />
|
||||
</declare-styleable>
|
||||
<declare-styleable name="TypeBoldTextView">
|
||||
<attr name="txt_is_bold" />
|
||||
</declare-styleable>
|
||||
<declare-styleable name="DiffuseView">
|
||||
<attr name="diffuse_color" />
|
||||
<attr name="diffuse_coreColor" />
|
||||
@ -187,7 +191,7 @@
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PageNavigationView">
|
||||
<attr name="NavigationPaddingTop" format="dimension"/>
|
||||
<attr name="NavigationPaddingBottom" format="dimension"/>
|
||||
<attr name="NavigationPaddingTop" format="dimension" />
|
||||
<attr name="NavigationPaddingBottom" format="dimension" />
|
||||
</declare-styleable>
|
||||
</resources>
|
@ -44,6 +44,7 @@
|
||||
<color name="text_gray01">#535353</color>
|
||||
<color name="text_gray02">#7C7C7C</color>
|
||||
<color name="text_blue">#00A6FE</color>
|
||||
<color name="text_blue_shallow">#E7F1FF</color>
|
||||
<color name="text_blue_tr">#3300A6FE</color>
|
||||
<color name="blue_line">#00BEF7</color>
|
||||
<color name="text_80_gray">#808080</color>
|
||||
@ -116,6 +117,7 @@
|
||||
<color name="gray_bg">#F1F1F6</color>
|
||||
<color name="gray">#F2F2F2</color>
|
||||
<color name="gray_fa">#FAFAFA</color>
|
||||
<color name="gray_ef_ef">#EFEFEF</color>
|
||||
<color name="gray_BA">#BABABA</color>
|
||||
<color name="gray_db">#D8D8D8</color>
|
||||
<color name="red_ff">#FF0000</color>
|
||||
@ -183,6 +185,7 @@
|
||||
<color name="text_black_52">#525252</color>
|
||||
<color name="text_black_EB1">#525252</color>
|
||||
<color name="text_black_8F">#8F8F8F</color>
|
||||
<color name="gray_text_8A">#8A8A8A</color>
|
||||
<color name="text_black_53">#535353</color>
|
||||
<color name="text_black_57">#575757</color>
|
||||
<color name="text_gray_66">#666666</color>
|
||||
@ -205,4 +208,8 @@
|
||||
<color name="btn_green">#AA37B54A</color>
|
||||
<color name="btn_purple">#AA6B6FD2</color>
|
||||
<color name="col_main_theme">#216cd8</color>
|
||||
|
||||
<color name="label_green">#03C591</color>
|
||||
<color name="label_blue">#2579FB</color>
|
||||
<color name="label_yellow">#FF9A05</color>
|
||||
</resources>
|
@ -7,6 +7,7 @@
|
||||
<dimen name="text_21">21dp</dimen>
|
||||
<dimen name="text_22">22dp</dimen>
|
||||
<dimen name="text_14">14dp</dimen>
|
||||
<dimen name="text_12">12dp</dimen>
|
||||
<dimen name="text_15">15dp</dimen>
|
||||
<dimen name="text_16">16dp</dimen>
|
||||
<dimen name="material_bottom_navigation_active_item_max_width">168dp</dimen>
|
||||
|
@ -1,45 +1,36 @@
|
||||
package com.tengshisoft.commonmodule.activitys.logs;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||
import com.bigkoo.pickerview.view.TimePickerView;
|
||||
import com.github.mikephil.charting.charts.BarChart;
|
||||
import com.github.mikephil.charting.components.XAxis;
|
||||
import com.github.mikephil.charting.components.YAxis;
|
||||
import com.github.mikephil.charting.data.BarData;
|
||||
import com.github.mikephil.charting.data.BarDataSet;
|
||||
import com.github.mikephil.charting.data.BarEntry;
|
||||
import com.github.mikephil.charting.formatter.LargeValueFormatter;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
import com.tengshisoft.commonmodule.R2;
|
||||
import com.tengshisoft.commonmodule.beans.GridStatistCountBean;
|
||||
import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.TimeUtils;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.base.ViewPageNavigatorAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.ViewPageWhiteNavigatorAdapter;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
@ -49,20 +40,17 @@ import io.reactivex.rxjava3.disposables.Disposable;
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_COMMAND_STATISTICS)
|
||||
public class StatisticsCommandActivity extends BaseActivity {
|
||||
@BindView(R2.id.bc_task)
|
||||
BarChart mBcTask;
|
||||
@BindView(R2.id.tv_start_date)
|
||||
TextView mTvStartDate;
|
||||
@BindView(R2.id.tv_end_date)
|
||||
TextView mTvEndDate;
|
||||
@BindView(R2.id.bc_case)
|
||||
BarChart mBcCase;
|
||||
|
||||
@BindView(R2.id.mi_tabs)
|
||||
public MagicIndicator mMiTabs;
|
||||
@BindView(R2.id.vp_content)
|
||||
public ViewPager2 mVpContent;
|
||||
@BindView(R2.id.iv_back)
|
||||
ImageView mIvBack;
|
||||
|
||||
private Unbinder mBind;
|
||||
private String mStartDate;
|
||||
private String mEndDate;
|
||||
private ProgressDialog mProgressDialog;
|
||||
private List<BaseFragment> mFragments;
|
||||
private List<String> mTitles = Arrays.asList("事件", "人口", "网格员");
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -77,241 +65,31 @@ public class StatisticsCommandActivity extends BaseActivity {
|
||||
.init();
|
||||
mRlTitleBar.setVisibility(View.GONE);
|
||||
initViews();
|
||||
getStatistCount(1);
|
||||
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
mIvBack.setOnClickListener(v -> finish());
|
||||
mStartDate = TimeUtils.getCurrentMonth() + "-01";
|
||||
mEndDate = TimeUtils.getCurrentMonth() + "-" + TimeUtils.getMonthEnd();
|
||||
mTvStartDate.setOnClickListener(v -> onShowDate(1));
|
||||
mTvEndDate.setOnClickListener(v -> onShowDate(2));
|
||||
mTvStartDate.setText(mStartDate);
|
||||
mTvEndDate.setText(mEndDate);
|
||||
buildCaseCount(new ArrayList<>());
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
}
|
||||
|
||||
private void onShowDate(int i) {
|
||||
hideSoftKeyboard();
|
||||
TimePickerView mTimePickerView = new TimePickerBuilder(mActivity, (date, v) -> {
|
||||
switch (i) {
|
||||
case 1:
|
||||
String start = TimeUtils.dateToString(date);
|
||||
int s = TimeUtils.compareDate(start, mEndDate);
|
||||
if (s <= 0) {
|
||||
mStartDate = TimeUtils.dateToString(date);
|
||||
mTvStartDate.setText(mStartDate);
|
||||
getStatistCount(2);
|
||||
} else {
|
||||
ToastUtils.show("结束日期小于开始日期");
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
String time = TimeUtils.dateToString(date);
|
||||
int i1 = TimeUtils.compareDate(mStartDate, time);
|
||||
if (i1 <= 0) {
|
||||
mEndDate = TimeUtils.dateToString(date);
|
||||
mTvEndDate.setText(mEndDate);
|
||||
getStatistCount(2);
|
||||
} else {
|
||||
ToastUtils.show("结束日期小于开始日期");
|
||||
}
|
||||
break;
|
||||
}
|
||||
})
|
||||
.setTitleText("请选日期")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setType(new boolean[]{true, true, true, false, false, false})
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTimePickerView.show();
|
||||
}
|
||||
|
||||
|
||||
private void getStatistCountByDept() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getTaskStatistCountByDept(UserLgUtils.getUserDeptId(), UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<List<GridStatistCountBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<GridStatistCountBean> gridStatistCountBeans) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计任务数量
|
||||
*/
|
||||
private void getStatistCount(int type) {
|
||||
if (type == 2) {
|
||||
mProgressDialog = UIUtil.initDialog(mActivity, "加载中...");
|
||||
mProgressDialog.show();
|
||||
}
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getTaskStatistCount(mStartDate, mEndDate, UserLgUtils.getToken())
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<List<GridStatistCountBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<GridStatistCountBean> gridStatistCountBeans) {
|
||||
if (type == 2) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
for (int i = 0; i < gridStatistCountBeans.size(); i++) {
|
||||
gridStatistCountBeans.get(i).setCount((20 * (i + 1)) + "");
|
||||
|
||||
}
|
||||
for (int i = 0; i < 20; i++) {
|
||||
GridStatistCountBean b = new GridStatistCountBean();
|
||||
b.setCount(10 + "");
|
||||
b.setDataType("测试" + i);
|
||||
gridStatistCountBeans.add(b);
|
||||
}
|
||||
buildTaskCount(gridStatistCountBeans);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
if (type == 2) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建任务数
|
||||
*/
|
||||
private void buildTaskCount(List<GridStatistCountBean> list) {
|
||||
List<BarEntry> datas = new ArrayList<>();
|
||||
List<String> xValues = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
datas.add(new BarEntry(i, Float.parseFloat(list.get(i).getCount())));
|
||||
xValues.add(list.get(i).getDataType());
|
||||
}
|
||||
BarDataSet barDataSet = new BarDataSet(datas, "任务");
|
||||
barDataSet.setBarBorderColor(Color.CYAN);
|
||||
barDataSet.setValueFormatter(new LargeValueFormatter() {
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
return (int) value + "";
|
||||
}
|
||||
});
|
||||
BarData barData = new BarData(barDataSet);
|
||||
barData.setBarWidth(0.3f);
|
||||
mBcTask.setData(barData);
|
||||
YAxis axisLeft = mBcTask.getAxisLeft();
|
||||
// axisLeft.setAxisMaximum(1); Y轴最大值
|
||||
axisLeft.setAxisMinimum(0);
|
||||
axisLeft.setValueFormatter(new LargeValueFormatter() {
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
return (int) value + "";
|
||||
}
|
||||
});
|
||||
XAxis xAxis = mBcTask.getXAxis();
|
||||
xAxis.setDrawGridLines(false);
|
||||
xAxis.setAxisLineWidth(1f);
|
||||
xAxis.setAxisLineColor(Color.BLACK);
|
||||
xAxis.setLabelRotationAngle(-60);
|
||||
xAxis.setLabelCount(list.size(), false);
|
||||
xAxis.setAxisMinimum(1.0f);
|
||||
|
||||
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
|
||||
xAxis.setValueFormatter(new LargeValueFormatter() {
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
return xValues.get((int) value);
|
||||
}
|
||||
});
|
||||
mBcTask.setNoDataText("暂无数据");
|
||||
mBcTask.getAxisRight().setEnabled(false);
|
||||
mBcTask.getDescription().setEnabled(false);
|
||||
mBcTask.notifyDataSetChanged();
|
||||
mBcTask.setScaleXEnabled(true);
|
||||
mBcTask.setScaleYEnabled(false);
|
||||
mBcTask.invalidate();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建事件统计
|
||||
*/
|
||||
private void buildCaseCount(List<GridStatistCountBean> list) {
|
||||
List<BarEntry> datas = new ArrayList<>();
|
||||
List<String> xValues = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
datas.add(new BarEntry(i, Float.parseFloat(list.get(i).getCount())));
|
||||
xValues.add(list.get(i).getDataType());
|
||||
}
|
||||
BarDataSet barDataSet = new BarDataSet(datas, "事件");
|
||||
barDataSet.setBarBorderColor(Color.CYAN);
|
||||
barDataSet.setValueFormatter(new LargeValueFormatter() {
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
return (int) value + "";
|
||||
}
|
||||
});
|
||||
BarData barData = new BarData(barDataSet);
|
||||
barData.setBarWidth(0.3f);
|
||||
mBcCase.setData(barData);
|
||||
YAxis axisLeft = mBcCase.getAxisLeft();
|
||||
axisLeft.setAxisMaximum(30);
|
||||
axisLeft.setAxisMinimum(0);
|
||||
axisLeft.setValueFormatter(new LargeValueFormatter() {
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
return (int) value + "";
|
||||
}
|
||||
});
|
||||
XAxis xAxis = mBcCase.getXAxis();
|
||||
xAxis.setDrawGridLines(false);
|
||||
xAxis.setAxisLineWidth(1f);
|
||||
xAxis.setAxisLineColor(Color.BLACK);
|
||||
xAxis.setLabelRotationAngle(30);
|
||||
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
|
||||
xAxis.setValueFormatter(new LargeValueFormatter() {
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
return xValues.get((int) value);
|
||||
}
|
||||
});
|
||||
mBcCase.setNoDataText("暂无数据");
|
||||
mBcCase.getAxisRight().setEnabled(false);
|
||||
mBcCase.getDescription().setEnabled(false);
|
||||
mBcCase.notifyDataSetChanged();
|
||||
mBcCase.invalidate();
|
||||
mFragments = new ArrayList<>();
|
||||
BaseFragment incidentFragment = (BaseFragment) ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_FRAGMENT_INCIDENT_STATISTICS)
|
||||
.navigation();
|
||||
BaseFragment populaceFragment = (BaseFragment) ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_FRAGMENT_POPULACE_STATISTICS)
|
||||
.navigation();
|
||||
BaseFragment gridFragment = (BaseFragment) ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_FRAGMENT_GRID_STATISTICS)
|
||||
.navigation();
|
||||
mFragments.add(incidentFragment);
|
||||
mFragments.add(populaceFragment);
|
||||
mFragments.add(gridFragment);
|
||||
VpRecordAdapter adapter = new VpRecordAdapter(this);
|
||||
mVpContent.setAdapter(adapter);
|
||||
CommonNavigator commonNavigator = new CommonNavigator(this);
|
||||
commonNavigator.setAdapter(new ViewPageWhiteNavigatorAdapter(this, mTitles, mVpContent));
|
||||
commonNavigator.setAdjustMode(false);
|
||||
mMiTabs.setNavigator(commonNavigator);
|
||||
UIUtil.bindViewPager2(mMiTabs, mVpContent, null);
|
||||
}
|
||||
|
||||
|
||||
@ -324,4 +102,21 @@ public class StatisticsCommandActivity extends BaseActivity {
|
||||
protected void doSearchByTitle() {
|
||||
|
||||
}
|
||||
|
||||
private class VpRecordAdapter extends FragmentStateAdapter {
|
||||
public VpRecordAdapter(@NonNull FragmentActivity fragmentActivity) {
|
||||
super(fragmentActivity);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return mFragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mFragments.size();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
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.R;
|
||||
import com.tengshisoft.commonmodule.beans.LabelBean;
|
||||
import com.tengshisoft.commonmodule.holders.LabelHolder;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/9/26 - 3:01 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 图表指示
|
||||
*/
|
||||
public class LabelAdapter extends BaseRecyclerAdapter<LabelBean, LabelHolder> {
|
||||
|
||||
public LabelAdapter(Context ctx, List<LabelBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabelHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_incident_label, parent, false);
|
||||
return new LabelHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(LabelHolder h, int i) {
|
||||
LabelBean bean = mData.get(i);
|
||||
h.mIvLabel.setBackgroundColor(Color.parseColor(bean.getColor()));
|
||||
h.mTvHint.setText(bean.getHint());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package com.tengshisoft.commonmodule.beans;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AreaIncidentScaleBean {
|
||||
|
||||
private int noOverNum;
|
||||
private int overNum;
|
||||
private int reportNum;
|
||||
private List<ReportTypeListBean> reportTypeList;
|
||||
|
||||
public int getNoOverNum() {
|
||||
return noOverNum;
|
||||
}
|
||||
|
||||
public void setNoOverNum(int noOverNum) {
|
||||
this.noOverNum = noOverNum;
|
||||
}
|
||||
|
||||
public int getOverNum() {
|
||||
return overNum;
|
||||
}
|
||||
|
||||
public void setOverNum(int overNum) {
|
||||
this.overNum = overNum;
|
||||
}
|
||||
|
||||
public int getReportNum() {
|
||||
return reportNum;
|
||||
}
|
||||
|
||||
public void setReportNum(int reportNum) {
|
||||
this.reportNum = reportNum;
|
||||
}
|
||||
|
||||
public List<ReportTypeListBean> getReportTypeList() {
|
||||
return reportTypeList;
|
||||
}
|
||||
|
||||
public void setReportTypeList(List<ReportTypeListBean> reportTypeList) {
|
||||
this.reportTypeList = reportTypeList;
|
||||
}
|
||||
|
||||
public static class ReportTypeListBean {
|
||||
private int noOverNum;
|
||||
private int overNum;
|
||||
private int reportNum;
|
||||
private String reportScale;
|
||||
private String typeId;
|
||||
private String typeName;
|
||||
|
||||
public int getNoOverNum() {
|
||||
return noOverNum;
|
||||
}
|
||||
|
||||
public void setNoOverNum(int noOverNum) {
|
||||
this.noOverNum = noOverNum;
|
||||
}
|
||||
|
||||
public int getOverNum() {
|
||||
return overNum;
|
||||
}
|
||||
|
||||
public void setOverNum(int overNum) {
|
||||
this.overNum = overNum;
|
||||
}
|
||||
|
||||
public int getReportNum() {
|
||||
return reportNum;
|
||||
}
|
||||
|
||||
public void setReportNum(int reportNum) {
|
||||
this.reportNum = reportNum;
|
||||
}
|
||||
|
||||
public String getReportScale() {
|
||||
return reportScale;
|
||||
}
|
||||
|
||||
public void setReportScale(String reportScale) {
|
||||
this.reportScale = reportScale;
|
||||
}
|
||||
|
||||
public String getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(String typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.tengshisoft.commonmodule.beans;
|
||||
|
||||
public class LabelBean {
|
||||
private String color;
|
||||
private String hint;
|
||||
private String hintId;
|
||||
|
||||
|
||||
public String getHintId() {
|
||||
return hintId;
|
||||
}
|
||||
|
||||
public void setHintId(String hintId) {
|
||||
this.hintId = hintId;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getHint() {
|
||||
return hint;
|
||||
}
|
||||
|
||||
public void setHint(String hint) {
|
||||
this.hint = hint;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.tengshisoft.commonmodule.fragments;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/11/30 - 4:15 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 网格统计
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_COMMON_FRAGMENT_GRID_STATISTICS)
|
||||
public class GridLeaderStatisticsFragment extends BaseFragment {
|
||||
|
||||
private Unbinder mBind;
|
||||
|
||||
@Override
|
||||
protected void setDataToView(View dataView) {
|
||||
mBind = ButterKnife.bind(this, dataView);
|
||||
setStateView(STATE_LOAD);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void refreshView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadMoreData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getContentViewId() {
|
||||
return R.layout.fragment_grid_leader_statistics;
|
||||
}
|
||||
}
|
@ -0,0 +1,323 @@
|
||||
package com.tengshisoft.commonmodule.fragments;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.github.mikephil.charting.animation.Easing;
|
||||
import com.github.mikephil.charting.charts.HorizontalBarChart;
|
||||
import com.github.mikephil.charting.charts.PieChart;
|
||||
import com.github.mikephil.charting.components.XAxis;
|
||||
import com.github.mikephil.charting.components.YAxis;
|
||||
import com.github.mikephil.charting.data.PieData;
|
||||
import com.github.mikephil.charting.data.PieDataSet;
|
||||
import com.github.mikephil.charting.data.PieEntry;
|
||||
import com.github.mikephil.charting.formatter.DefaultValueFormatter;
|
||||
import com.github.mikephil.charting.formatter.LargeValueFormatter;
|
||||
import com.github.mikephil.charting.formatter.PercentFormatter;
|
||||
import com.github.mikephil.charting.utils.MPPointF;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
import com.tengshisoft.commonmodule.R2;
|
||||
import com.tengshisoft.commonmodule.adapters.LabelAdapter;
|
||||
import com.tengshisoft.commonmodule.beans.AreaIncidentScaleBean;
|
||||
import com.tengshisoft.commonmodule.beans.CaseTypeBean;
|
||||
import com.tengshisoft.commonmodule.beans.LabelBean;
|
||||
import com.tengshisoft.commonmodule.nets.CenterApis;
|
||||
import com.tengshisoft.commonmodule.nets.GridApis;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/11/30 - 4:15 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 事件统计
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_COMMON_FRAGMENT_INCIDENT_STATISTICS)
|
||||
public class IncidentLeaderStatisticsFragment extends BaseFragment {
|
||||
@BindView(R2.id.rlv_label)
|
||||
RecyclerView mRlvLabel;
|
||||
@BindView(R2.id.pie_chart)
|
||||
PieChart mPieChart;
|
||||
@BindView(R2.id.tv_undo_incident)
|
||||
TextView mTvUndoIncident;
|
||||
@BindView(R2.id.tv_do_incident)
|
||||
TextView mTvDoIncident;
|
||||
@BindView(R2.id.hbc_category_chart)
|
||||
HorizontalBarChart mHbcChart;
|
||||
private Unbinder mBind;
|
||||
private LabelAdapter mLabelAdapter;
|
||||
private List<LabelBean> mLabelBeanList;
|
||||
private List<Integer> labelColors = Arrays.asList(Color.parseColor("#FF6191F7"),
|
||||
Color.parseColor("#FF60D8A8"),
|
||||
Color.parseColor("#FFFFA800"),
|
||||
Color.parseColor("#FF154CFF"),
|
||||
Color.parseColor("#FFFFDA2D"),
|
||||
Color.parseColor("#FF60D8A8"));
|
||||
private List<LabelBean> labelHint = null;
|
||||
|
||||
@Override
|
||||
protected void setDataToView(View dataView) {
|
||||
mBind = ButterKnife.bind(this, dataView);
|
||||
setStateView(STATE_SUCCESS);
|
||||
initViews();
|
||||
getTypeList();
|
||||
getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取事件类型
|
||||
*/
|
||||
private void getTypeList() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(GridApis.class)
|
||||
.getCaseTypeListAll(UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<CaseTypeBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<CaseTypeBean> componentTypeBeans) {
|
||||
if (componentTypeBeans != null && componentTypeBeans.size() > 0) {
|
||||
for (int i = 0; i < componentTypeBeans.size(); i++) {
|
||||
int col = Color.parseColor("#FF154CFF");
|
||||
if (labelColors.size() < componentTypeBeans.size()) {
|
||||
col = labelColors.get(i);
|
||||
} else {
|
||||
col = getRandomColor();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.show("暂无数据");
|
||||
setStateView(STATE_EMPTY);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
setStateView(STATE_ERROR);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
private void getData() {
|
||||
// Observable<AreaIncidentScaleBean> areaTypeScale =
|
||||
RetrofitManager.getInstance()
|
||||
.create(CenterApis.class)
|
||||
.getAreaTypeScale(UserLgUtils.getUserAreaCode(), UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<AreaIncidentScaleBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull AreaIncidentScaleBean b) {
|
||||
setInfoToView(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
})
|
||||
;//事件分类占比
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示事件分类占比
|
||||
*/
|
||||
private void setInfoToView(AreaIncidentScaleBean b) {
|
||||
ArrayList<PieEntry> entries = new ArrayList<>();
|
||||
if (b.getReportTypeList() == null || b.getReportTypeList().size() == 0) return;
|
||||
for (int i = 0; i < b.getReportTypeList().size(); i++) {
|
||||
float num = Float.parseFloat(b.getReportTypeList().get(i).getReportScale());
|
||||
entries.add(new PieEntry(num, "", ""));
|
||||
}
|
||||
PieDataSet dataSet = new PieDataSet(entries, "");
|
||||
dataSet.setDrawIcons(false);
|
||||
dataSet.setSliceSpace(0f);
|
||||
dataSet.setIconsOffset(new MPPointF(0, 40));
|
||||
dataSet.setSelectionShift(5f);
|
||||
ArrayList<Integer> colors = new ArrayList<>();
|
||||
colors.add(Color.rgb(3, 197, 145));
|
||||
colors.add(Color.rgb(37, 121, 251));
|
||||
colors.add(Color.rgb(255, 154, 5));
|
||||
dataSet.setColors(colors);
|
||||
|
||||
PieData data = new PieData(dataSet);
|
||||
data.setValueFormatter(new PercentFormatter());
|
||||
data.setDrawValues(false);
|
||||
data.setValueTextSize(11f);
|
||||
data.setValueTextColor(Color.WHITE);
|
||||
float total = 0;
|
||||
//TODO mPieChart.setCenterText(generateCenterSpannableText(total));
|
||||
mPieChart.setData(data);
|
||||
mPieChart.highlightValues(null);
|
||||
mPieChart.invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化视图
|
||||
*/
|
||||
private void initViews() {
|
||||
// mLabelBeanList = new ArrayList<>();
|
||||
// for (int i = 0; i < labelColors.size(); i++) {
|
||||
// LabelBean b = new LabelBean();
|
||||
// b.setColor(labelColors.get(i));
|
||||
// b.setHint(labelHint.get(i));
|
||||
// mLabelBeanList.add(b);
|
||||
// }
|
||||
// mLabelAdapter = new LabelAdapter(mActivity, mLabelBeanList);
|
||||
// mRlvLabel.setLayoutManager(new GridLayoutManager(mActivity, 3));
|
||||
// mRlvLabel.setAdapter(mLabelAdapter);
|
||||
// initPieChart();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化 事件分类占比
|
||||
*/
|
||||
private void initPieChart() {
|
||||
mPieChart.setUsePercentValues(true);
|
||||
mPieChart.getDescription().setEnabled(false);
|
||||
mPieChart.setExtraOffsets(5, 10, 5, 5);
|
||||
mPieChart.setDragDecelerationFrictionCoef(0.95f);
|
||||
|
||||
|
||||
mPieChart.setDrawHoleEnabled(true);
|
||||
mPieChart.setHoleColor(Color.WHITE);
|
||||
|
||||
mPieChart.setTransparentCircleColor(Color.WHITE);
|
||||
mPieChart.setTransparentCircleAlpha(110);
|
||||
|
||||
mPieChart.setHoleRadius(90f);//饼状图中间圆的半径大小
|
||||
mPieChart.setTransparentCircleRadius(120f);//圆环的半径
|
||||
|
||||
mPieChart.setDrawCenterText(true);
|
||||
|
||||
mPieChart.setRotationAngle(0);
|
||||
mPieChart.setRotationEnabled(true);
|
||||
mPieChart.setHighlightPerTapEnabled(true);
|
||||
mPieChart.animateY(1400, Easing.EaseInOutQuad);
|
||||
mPieChart.setEntryLabelColor(Color.WHITE);
|
||||
mPieChart.setEntryLabelTextSize(12f);
|
||||
mPieChart.setDrawEntryLabels(false);
|
||||
mPieChart.getLegend().setEnabled(false);
|
||||
mPieChart.setNoDataText("当前区域无事件数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private void initHoChart() {
|
||||
mHbcChart.getDescription().setEnabled(false);
|
||||
mHbcChart.getLegend().setEnabled(false);
|
||||
mHbcChart.setExtraOffsets(0, 10, 10, 10);
|
||||
mHbcChart.setNoDataText("当前区域无数据");
|
||||
mHbcChart.setScaleXEnabled(true);
|
||||
mHbcChart.setScaleYEnabled(false);
|
||||
mHbcChart.setDrawGridBackground(false);//不绘制网格
|
||||
setAxis();
|
||||
}
|
||||
|
||||
private void setAxis() {
|
||||
XAxis xAxis = mHbcChart.getXAxis();
|
||||
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
|
||||
xAxis.setDrawGridLines(false);
|
||||
xAxis.setTextSize(12f);
|
||||
xAxis.setLabelCount(6);
|
||||
xAxis.setGranularity(1f);//防止放大图后,标签错乱
|
||||
final String label[] = {"市容环境", "宣传广告", "施工管理", "街面秩序", "突发事件", "其他事件"};
|
||||
xAxis.setValueFormatter(new LargeValueFormatter() {
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
try {
|
||||
return label[(int) value];
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
});
|
||||
YAxis axisRight = mHbcChart.getAxisRight();
|
||||
axisRight.setAxisMinimum(0f);
|
||||
axisRight.setDrawGridLines(true);//绘制网格
|
||||
axisRight.enableGridDashedLine(5f, 20f, 0f);
|
||||
axisRight.setAxisMaximum(100f);
|
||||
axisRight.setTextSize(12f);
|
||||
axisRight.setValueFormatter(new DefaultValueFormatter(0));//显示整数
|
||||
//不显示顶部的轴
|
||||
YAxis axisLeft = mHbcChart.getAxisLeft();
|
||||
axisLeft.setAxisMinimum(0f);
|
||||
axisLeft.setAxisMaximum(100f);
|
||||
axisLeft.setEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取随机颜色值
|
||||
*/
|
||||
private int getRandomColor() {
|
||||
Random rnd = new Random();
|
||||
int color = Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadMoreData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getContentViewId() {
|
||||
return R.layout.fragment_incident_leader_statistics;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.tengshisoft.commonmodule.fragments;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/11/30 - 4:15 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 人口统计
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_COMMON_FRAGMENT_POPULACE_STATISTICS)
|
||||
public class PopulaceLeaderStatisticsFragment extends BaseFragment {
|
||||
|
||||
private Unbinder mBind;
|
||||
|
||||
@Override
|
||||
protected void setDataToView(View dataView) {
|
||||
mBind = ButterKnife.bind(this, dataView);
|
||||
setStateView(STATE_LOAD);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void refreshView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadMoreData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getContentViewId() {
|
||||
return R.layout.fragment_populace_leader_statistics;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.tengshisoft.commonmodule.holders;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.tengshisoft.commonmodule.R;
|
||||
|
||||
public class LabelHolder extends RecyclerView.ViewHolder {
|
||||
public ImageView mIvLabel;
|
||||
public TextView mTvHint;
|
||||
|
||||
public LabelHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mIvLabel = itemView.findViewById(R.id.iv_label);
|
||||
mTvHint = itemView.findViewById(R.id.tv_hint);
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.tengshisoft.commonmodule.nets;
|
||||
|
||||
import com.tengshisoft.commonmodule.adapters.CommunityUserListBean;
|
||||
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
|
||||
import com.tengshisoft.commonmodule.beans.AreaIncidentScaleBean;
|
||||
import com.tengshisoft.commonmodule.beans.DeferDetailBean;
|
||||
import com.tengshisoft.commonmodule.beans.DepartmentListBean;
|
||||
import com.tengshisoft.commonmodule.beans.DisposeDetailBean;
|
||||
@ -423,4 +424,14 @@ public interface CenterApis {
|
||||
Observable<AreaGridListBean> getGridListByAreaCode(@Path("areaCode") String areaCode,
|
||||
@Query("page") String page,
|
||||
@Header("token") String token);
|
||||
|
||||
//========================统计==========================
|
||||
|
||||
/**
|
||||
* 事件分类占比
|
||||
*/
|
||||
@Headers({"base_url_name:case", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/report/count/count-area-type-scale/{areaCode}")
|
||||
Observable<AreaIncidentScaleBean> getAreaTypeScale(@Path("areaCode") String areaCode,
|
||||
@Header("token") String token);
|
||||
}
|
||||
|
BIN
commonmodule/src/main/res/drawable-xhdpi/ic_hot_detail_icon.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
commonmodule/src/main/res/drawable-xhdpi/ic_hot_icon.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
BIN
commonmodule/src/main/res/drawable-xhdpi/ic_no_dis_icon.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 2.7 KiB |
BIN
commonmodule/src/main/res/drawable-xhdpi/ic_yellow_bg.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
commonmodule/src/main/res/drawable-xhdpi/ic_yet_dis_icon.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
5
commonmodule/src/main/res/drawable/shp_label_blue.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/label_blue" />
|
||||
</shape>
|
5
commonmodule/src/main/res/drawable/shp_label_green.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/label_green" />
|
||||
</shape>
|
5
commonmodule/src/main/res/drawable/shp_label_yellow.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/label_yellow" />
|
||||
</shape>
|
@ -2,7 +2,7 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_fa"
|
||||
android:background="@color/gray_ef_ef"
|
||||
android:clipChildren="true">
|
||||
|
||||
<ImageView
|
||||
@ -27,199 +27,21 @@
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/ic_back_white" />
|
||||
|
||||
<TextView
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/mi_tabs"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="统计分析"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
android:layout_height="50dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/iv_title"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="-80dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="@drawable/shape_rectangle_white_10"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@color/main_theme" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="选择查询事件段"
|
||||
android:textColor="@color/text_20"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="开始时间"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
style="@style/vertical_line"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_start_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_cir"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="请选择开始时间"
|
||||
android:textColor="@color/text_20"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="结束时间"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
style="@style/vertical_line"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_end_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_cir"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="请选择结束时间"
|
||||
android:textColor="@color/text_20"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vp_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/ll_time"
|
||||
android:orientation="vertical"
|
||||
android:overScrollMode="never">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_rectangle_white_10"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="10dp">
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@color/main_theme" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:padding="5dp"
|
||||
android:text="事件统计"
|
||||
android:textColor="@color/text_20"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.github.mikephil.charting.charts.BarChart
|
||||
android:id="@+id/bc_case"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/shape_rectangle_white_10"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="10dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@color/main_theme" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:padding="5dp"
|
||||
android:text="任务统计"
|
||||
android:textColor="@color/text_20"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.github.mikephil.charting.charts.BarChart
|
||||
android:id="@+id/bc_task"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
android:layout_below="@id/rl_title"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,10 @@
|
||||
<?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:id="@+id/ll_page"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,378 @@
|
||||
<?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:id="@+id/ll_page"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/gray">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shp_rectangle_white_5"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="当前区域:"
|
||||
android:textColor="#303030"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_sort_gray"
|
||||
android:drawablePadding="5dp"
|
||||
android:focusable="true"
|
||||
android:textColor="#4261FF"
|
||||
android:textSize="12dp"
|
||||
tools:text="乌兰察布市/集宁区/XXXX县/XXXX镇/XXX村" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cur_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="#303030"
|
||||
android:textSize="12dp"
|
||||
tools:text="数据更新时间:2023-06-00 12:35" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<!--事件分类占比-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shp_rectangle_white_5"
|
||||
android:orientation="vertical"
|
||||
android:padding="17dp"
|
||||
tools:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_statistics_title_icon" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeBoldTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="事件分类占比"
|
||||
android:textColor="@color/black" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shp_rectangle_blue_shallow"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_no_dis_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_undo_incident"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="未处理事件\n11件"
|
||||
android:textColor="#464E58"
|
||||
android:textSize="@dimen/text_12" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shp_rectangle_blue_shallow"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_yet_dis_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_do_incident"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="已处理事件\n11件"
|
||||
android:textColor="#464E58"
|
||||
android:textSize="@dimen/text_12" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.github.mikephil.charting.charts.PieChart
|
||||
android:id="@+id/pie_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/item_incident_label" />
|
||||
</LinearLayout>
|
||||
<!-- 热门事件 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/shp_rectangle_white_5"
|
||||
android:orientation="vertical"
|
||||
android:padding="17dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_hot_incident_icon" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeBoldTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="热门事件分析"
|
||||
android:textColor="@color/black" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ic_yellow_bg"
|
||||
android:orientation="vertical"
|
||||
android:minHeight="50dp"
|
||||
android:padding="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:background="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hot_type_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/text_12"
|
||||
tools:text="市容环境" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeBoldTextView
|
||||
android:id="@+id/tv_hot_type_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/text_16"
|
||||
tools:text="暴露垃圾暴露垃圾暴露垃圾暴露垃圾暴露垃圾" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:layout_marginRight="-10dp"
|
||||
android:src="@drawable/ic_hot_icon" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:minHeight="50dp"
|
||||
android:background="@drawable/ic_hot_incident_detail_bg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hot_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:padding="15dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/text_14"
|
||||
tools:text="共计上报714件\n占比31%" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@drawable/ic_hot_detail_icon" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/shp_rectangle_white_5"
|
||||
android:orientation="vertical"
|
||||
android:padding="17dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_category"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_statistics_title_icon" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeBoldTextView
|
||||
android:id="@+id/tv_category"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_toRightOf="@id/iv_category"
|
||||
android:text="事件分类"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="#FF2F5CFB" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="已处理"
|
||||
android:textColor="#FF43474B"
|
||||
android:textSize="@dimen/text_12" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="#FFFFA800" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:text="未处理"
|
||||
android:textColor="#FF43474B"
|
||||
android:textSize="@dimen/text_12" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<com.github.mikephil.charting.charts.HorizontalBarChart
|
||||
android:id="@+id/hbc_category_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp"
|
||||
android:layout_marginTop="10dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
@ -0,0 +1,10 @@
|
||||
<?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:id="@+id/ll_page"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
</LinearLayout>
|
24
commonmodule/src/main/res/layout/item_incident_label.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?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="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_label"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:textColor="#FF43474B"
|
||||
android:textSize="@dimen/text_12"
|
||||
tools:text="宣传广告" />
|
||||
</LinearLayout>
|
@ -334,30 +334,6 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull UserExpandInfoBean userExpandInfoBean) {
|
||||
UserLgUtils.setUserAreaCode("");
|
||||
UserLgUtils.setUserAreaLevel(-1);
|
||||
UserLgUtils.setUserFullAreaName("");
|
||||
if (!TextUtils.isEmpty(userExpandInfoBean.getAreaCode())) {
|
||||
String cityCode = userExpandInfoBean.getAreaCode().substring(0, 4);
|
||||
String areaCode = userExpandInfoBean.getAreaCode().substring(0, 6);
|
||||
String streetCode = userExpandInfoBean.getAreaCode().substring(0, 9);
|
||||
String villageCode = userExpandInfoBean.getAreaCode();
|
||||
UserLgUtils.setUserAreaCode(userExpandInfoBean.getAreaCode());
|
||||
UserLgUtils.setUserAreaLevel(userExpandInfoBean.getUserLevel());
|
||||
if (!TextUtils.isEmpty(userExpandInfoBean.getAreaName())) {
|
||||
String areaName = userExpandInfoBean.getAreaName();
|
||||
areaName = areaName.substring(areaName.lastIndexOf("/") + 1);
|
||||
UserLgUtils.setUserAreaName(areaName);
|
||||
UserLgUtils.setUserFullAreaName(userExpandInfoBean.getAreaName());
|
||||
}
|
||||
GlobalProvider.save(mActivity, "cityCode", cityCode);
|
||||
GlobalProvider.save(mActivity, "areaCode", areaCode);
|
||||
GlobalProvider.save(mActivity, "streetCode", streetCode);
|
||||
GlobalProvider.save(mActivity, "villageCode", villageCode);
|
||||
GlobalProvider.save(mActivity, "fullAreaCode", userExpandInfoBean.getAreaCode());
|
||||
|
||||
}
|
||||
LogUtils.e("融合通信号码==" + userExpandInfoBean.getSmcNumber() + "==" + userExpandInfoBean.getSmcPassword());
|
||||
if (!TextUtils.isEmpty(userExpandInfoBean.getSmcNumber())) {
|
||||
UserLgUtils.setHwAccount(userExpandInfoBean.getSmcNumber());
|
||||
UserLgUtils.setHwPwd(userExpandInfoBean.getSmcPassword());
|
||||
@ -366,15 +342,6 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
|
||||
doLoginHWClound();
|
||||
}
|
||||
}
|
||||
String ids = "";
|
||||
List<UserExpandInfoBean.DepartmentsBean> departments = userExpandInfoBean.getDepartments();
|
||||
for (int i = 0; i < departments.size(); i++) {
|
||||
ids += departments.get(i).getDepartmentId() + ",";
|
||||
}
|
||||
if (ids.endsWith(",")) {
|
||||
ids = ids.substring(0, ids.length() - 1);
|
||||
}
|
||||
UserLgUtils.setUserDeptId(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,10 +1,7 @@
|
||||
package com.tengshisoft.mainmodule.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.provider.Settings;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
@ -104,7 +101,8 @@ public class LeaderMainFragment extends BaseFragment {
|
||||
"事件处理",
|
||||
"通讯录",
|
||||
"事件追踪",
|
||||
"辖区人口"
|
||||
"辖区人口",
|
||||
"数据统计"
|
||||
};
|
||||
private int[] mBtnIds = new int[]{
|
||||
R.drawable.ic_incident_accept_icon,
|
||||
@ -115,7 +113,8 @@ public class LeaderMainFragment extends BaseFragment {
|
||||
R.drawable.ic_case_dispose,
|
||||
R.drawable.ic_list_contact,
|
||||
R.drawable.ic_journal_list,
|
||||
R.drawable.ic_populace_list_icon};
|
||||
R.drawable.ic_populace_list_icon,
|
||||
R.drawable.ic_journal_list};
|
||||
private FunctionTitleNumAdapter mNumAdapter;
|
||||
private Disposable mDisposable;
|
||||
private List mDatas;
|
||||
@ -528,11 +527,10 @@ public class LeaderMainFragment extends BaseFragment {
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_AREA_POPULACE_LIST)
|
||||
.navigation();
|
||||
break;
|
||||
case "统计分析":
|
||||
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_COMMAND_STATISTICS)
|
||||
// .navigation();
|
||||
case "数据统计":
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_COMMAND_STATISTICS)
|
||||
.navigation();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|