Commit cb057a09753300e4da2e5ed22bd7077b5c8d2d8e
1 parent
42f883a1
Exists in
yxb_dev
and in
2 other branches
no message
Showing
8 changed files
with
220 additions
and
9 deletions
Show diff stats
.idea/modules.xml
... | ... | @@ -4,8 +4,9 @@ |
4 | 4 | <modules> |
5 | 5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> |
6 | 6 | <module fileurl="file://$PROJECT_DIR$/mvpsdk/mvpsdk.iml" filepath="$PROJECT_DIR$/mvpsdk/mvpsdk.iml" /> |
7 | - <module fileurl="file://$PROJECT_DIR$/parentWorkHolper.iml" filepath="$PROJECT_DIR$/parentWorkHolper.iml" /> | |
8 | 7 | <module fileurl="file://E:\parentwork\parentWorkHolper.iml" filepath="E:\parentwork\parentWorkHolper.iml" /> |
8 | + <module fileurl="file://F:\parentwork\parentWorkHolper.iml" filepath="F:\parentwork\parentWorkHolper.iml" /> | |
9 | + <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" /> | |
9 | 10 | <module fileurl="file://F:\parentWorkHolper\parentwork.iml" filepath="F:\parentWorkHolper\parentwork.iml" /> |
10 | 11 | <module fileurl="file://$PROJECT_DIR$/processor/processor.iml" filepath="$PROJECT_DIR$/processor/processor.iml" /> |
11 | 12 | <module fileurl="file://$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" filepath="$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" /> | ... | ... |
app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/adapter/ReportSceneAdapter.java
0 → 100644
... | ... | @@ -0,0 +1,52 @@ |
1 | +package com.shunzhi.parent.adapter; | |
2 | + | |
3 | +import android.content.Context; | |
4 | +import android.view.LayoutInflater; | |
5 | +import android.view.View; | |
6 | +import android.view.ViewGroup; | |
7 | +import android.widget.LinearLayout; | |
8 | + | |
9 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | |
10 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | |
11 | +import com.shunzhi.parent.R; | |
12 | +import com.shunzhi.parent.bean.report.SceneDetialBean; | |
13 | + | |
14 | +/** | |
15 | + * Created by Administrator on 2018/3/30 0030. | |
16 | + */ | |
17 | + | |
18 | +public class ReportSceneAdapter extends BaseRecyclerViewAdapter<SceneDetialBean> { | |
19 | + Context context; | |
20 | + | |
21 | + public ReportSceneAdapter(Context context) { | |
22 | + this.context = context; | |
23 | + } | |
24 | + | |
25 | + | |
26 | + @Override | |
27 | + public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | |
28 | + View view = LayoutInflater.from(context).inflate(R.layout.item_scene_detial, parent,false); | |
29 | + return new MyViewHolder(view); | |
30 | + } | |
31 | + | |
32 | + private class MyViewHolder extends BaseRecyclerViewHolder<SceneDetialBean> { | |
33 | + | |
34 | + LinearLayout item_view; | |
35 | + | |
36 | + public MyViewHolder(View view) { | |
37 | + super(view); | |
38 | + item_view = view.findViewById(R.id.item_view); | |
39 | + } | |
40 | + | |
41 | + @Override | |
42 | + public void onBindViewHolder(SceneDetialBean object, int position) { | |
43 | + item_view.setOnClickListener(new View.OnClickListener() { | |
44 | + @Override | |
45 | + public void onClick(View v) { | |
46 | + | |
47 | + } | |
48 | + }); | |
49 | + } | |
50 | + | |
51 | + } | |
52 | +} | ... | ... |
app/src/main/java/com/shunzhi/parent/bean/report/SceneDetialBean.java
0 → 100644
app/src/main/java/com/shunzhi/parent/ui/activity/report/ReportSceneActivity.java
... | ... | @@ -19,7 +19,7 @@ import com.shunzhi.parent.ui.fragment.report.ReportSceneFragment; |
19 | 19 | * Created by Administrator on 2018/3/28 0028. |
20 | 20 | */ |
21 | 21 | |
22 | -public class ReportSceneActivity extends BaseMVPCompatActivity implements View.OnClickListener{ | |
22 | +public class ReportSceneActivity extends BaseMVPCompatActivity implements View.OnClickListener { | |
23 | 23 | public static void getInstance(Context context) { |
24 | 24 | Intent intent = new Intent(context, ReportSceneActivity.class); |
25 | 25 | context.startActivity(intent); |
... | ... | @@ -45,6 +45,7 @@ public class ReportSceneActivity extends BaseMVPCompatActivity implements View. |
45 | 45 | protected void initView(Bundle savedInstanceState) { |
46 | 46 | initViews(); |
47 | 47 | } |
48 | + | |
48 | 49 | private void initViews() { |
49 | 50 | reportSceneFragment = new ReportSceneFragment(); |
50 | 51 | ivBack = findViewById(R.id.back_top); |
... | ... | @@ -58,6 +59,7 @@ public class ReportSceneActivity extends BaseMVPCompatActivity implements View. |
58 | 59 | .show(reportSceneFragment).commit(); |
59 | 60 | |
60 | 61 | } |
62 | + | |
61 | 63 | @Override |
62 | 64 | protected int getLayoutId() { |
63 | 65 | return R.layout.activity_report_scene; |
... | ... | @@ -65,6 +67,6 @@ public class ReportSceneActivity extends BaseMVPCompatActivity implements View. |
65 | 67 | |
66 | 68 | @Override |
67 | 69 | public void onClick(View v) { |
68 | - | |
70 | + finish(); | |
69 | 71 | } |
70 | 72 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ReportSceneFragment.java
... | ... | @@ -3,18 +3,32 @@ package com.shunzhi.parent.ui.fragment.report; |
3 | 3 | import android.os.Bundle; |
4 | 4 | import android.support.annotation.NonNull; |
5 | 5 | import android.support.annotation.Nullable; |
6 | +import android.support.v7.widget.LinearLayoutManager; | |
7 | +import android.support.v7.widget.RecyclerView; | |
6 | 8 | import android.view.View; |
7 | 9 | |
8 | 10 | import com.share.mvpsdk.base.BasePresenter; |
9 | 11 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
12 | +import com.share.mvpsdk.view.chartview.ChartView; | |
13 | +import com.share.mvpsdk.view.chartview.data.InputData; | |
10 | 14 | import com.shunzhi.parent.R; |
15 | +import com.shunzhi.parent.adapter.ReportSceneAdapter; | |
16 | +import com.shunzhi.parent.bean.report.SceneDetialBean; | |
17 | + | |
18 | +import java.util.ArrayList; | |
19 | +import java.util.List; | |
11 | 20 | |
12 | 21 | /** |
13 | 22 | * Created by Administrator on 2018/3/28 0028. |
14 | 23 | */ |
15 | 24 | |
16 | 25 | public class ReportSceneFragment extends BaseMVPCompatFragment { |
26 | + private RecyclerView recycle_scene; | |
27 | + private ReportSceneAdapter sceneDetialAdapter; | |
28 | + List<SceneDetialBean> list=new ArrayList<>(); | |
29 | + | |
17 | 30 | |
31 | + private ChartView chartView; | |
18 | 32 | @NonNull |
19 | 33 | @Override |
20 | 34 | public BasePresenter initPresenter() { |
... | ... | @@ -28,7 +42,51 @@ public class ReportSceneFragment extends BaseMVPCompatFragment { |
28 | 42 | |
29 | 43 | @Override |
30 | 44 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
45 | + recycle_scene=view.findViewById(R.id.recycle_scene); | |
46 | + chartView=view.findViewById(R.id.chartView); | |
47 | + recycle_scene.setLayoutManager(new LinearLayoutManager(getActivity())); | |
48 | + sceneDetialAdapter=new ReportSceneAdapter(getActivity()); | |
49 | + SceneDetialBean sceneDetialBean=new SceneDetialBean(); | |
50 | + list.add(sceneDetialBean); | |
51 | + list.add(sceneDetialBean); | |
52 | + list.add(sceneDetialBean); | |
53 | + sceneDetialAdapter.addAll(list); | |
54 | + recycle_scene.setAdapter(sceneDetialAdapter); | |
55 | + | |
56 | + initChartViews(); | |
31 | 57 | |
32 | 58 | |
33 | 59 | } |
60 | + | |
61 | + private void initChartViews() { | |
62 | + | |
63 | + chartView.setColors(R.color.textColor,R.color.huodong_blue,R.color.gray); | |
64 | + List<InputData> inputDataList=new ArrayList<>(); | |
65 | + List<InputData> inputDataList1=new ArrayList<>(); | |
66 | + List<InputData> inputDataList2=new ArrayList<>(); | |
67 | + for (int i = 0; i < 7; i++) { | |
68 | + InputData inputData=new InputData("3/"+i,10*i); | |
69 | + inputDataList.add(inputData); | |
70 | + } | |
71 | + | |
72 | + chartView.setChartPaths(inputDataList); | |
73 | + | |
74 | + for (int i = 0; i < 7; i++) { | |
75 | + InputData inputData=new InputData("3/"+i,20*i); | |
76 | + inputDataList1.add(inputData); | |
77 | + } | |
78 | + | |
79 | + chartView.setChartPaths(inputDataList1); | |
80 | + | |
81 | + for (int i = 0; i < 7; i++) { | |
82 | + InputData inputData=new InputData("3/"+i,15*i); | |
83 | + inputDataList2.add(inputData); | |
84 | + } | |
85 | + | |
86 | + chartView.setChartPaths(inputDataList2); | |
87 | + | |
88 | + } | |
89 | + | |
90 | + | |
91 | + | |
34 | 92 | } | ... | ... |
app/src/main/res/layout/fragment_report_scene.xml
... | ... | @@ -122,25 +122,32 @@ |
122 | 122 | </LinearLayout> |
123 | 123 | </LinearLayout> |
124 | 124 | |
125 | - <LinearLayout | |
125 | + <FrameLayout | |
126 | 126 | android:layout_width="match_parent" |
127 | 127 | android:layout_height="wrap_content" |
128 | 128 | android:layout_marginTop="@dimen/size_dp_10"> |
129 | 129 | |
130 | + <com.share.mvpsdk.view.chartview.ChartView | |
131 | + android:layout_width="match_parent" | |
132 | + android:layout_height="match_parent" | |
133 | + android:id="@+id/chartView" | |
134 | + /> | |
135 | + | |
130 | 136 | <TextView |
137 | + android:visibility="gone" | |
131 | 138 | android:layout_width="match_parent" |
132 | 139 | android:layout_height="200dp" |
140 | + android:text="图表控件" | |
133 | 141 | android:layout_gravity="center" |
134 | - android:background="@color/huodong_blue" | |
135 | 142 | android:gravity="center" |
136 | - android:text="图表控件" | |
137 | - android:textColor="@color/md_red_500" /> | |
143 | + android:textColor="@color/md_red_500" | |
144 | + android:background="@color/huodong_blue" /> | |
138 | 145 | |
139 | - </LinearLayout> | |
146 | + </FrameLayout> | |
140 | 147 | |
141 | 148 | |
142 | 149 | <android.support.v7.widget.RecyclerView |
143 | - android:id="@+id/recycle_deyu" | |
150 | + android:id="@+id/recycle_scene" | |
144 | 151 | android:layout_width="match_parent" |
145 | 152 | android:layout_height="wrap_content" |
146 | 153 | android:layout_marginTop="@dimen/size_dp_10" | ... | ... |
... | ... | @@ -0,0 +1,83 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:layout_width="match_parent" | |
4 | + android:layout_height="wrap_content" | |
5 | + android:layout_marginTop="@dimen/size_dp_10" | |
6 | + android:background="@color/white" | |
7 | + android:divider="@color/divider_gray"> | |
8 | + | |
9 | + <LinearLayout | |
10 | + android:id="@+id/item_view" | |
11 | + android:layout_width="match_parent" | |
12 | + android:layout_height="wrap_content" | |
13 | + android:layout_margin="10dp"> | |
14 | + | |
15 | + <LinearLayout | |
16 | + android:layout_width="match_parent" | |
17 | + android:layout_height="match_parent" | |
18 | + android:layout_weight="1" | |
19 | + android:orientation="vertical"> | |
20 | + | |
21 | + <LinearLayout | |
22 | + android:layout_width="match_parent" | |
23 | + android:layout_height="wrap_content" | |
24 | + android:orientation="horizontal"> | |
25 | + | |
26 | + <TextView | |
27 | + android:id="@+id/leavel" | |
28 | + android:layout_width="wrap_content" | |
29 | + android:layout_height="wrap_content" | |
30 | + android:layout_weight="1" | |
31 | + android:text="优秀" | |
32 | + android:textColor="@color/textGreen" | |
33 | + android:textSize="@dimen/sp_16" /> | |
34 | + | |
35 | + <TextView | |
36 | + android:id="@+id/txt_info" | |
37 | + android:layout_width="wrap_content" | |
38 | + android:layout_height="wrap_content" | |
39 | + android:layout_weight="1" | |
40 | + android:gravity="center" | |
41 | + android:text="课堂纪律-上课发言" | |
42 | + android:textColor="@color/textGreen" | |
43 | + android:textSize="@dimen/sp_16" /> | |
44 | + | |
45 | + <TextView | |
46 | + android:id="@+id/count" | |
47 | + android:layout_width="wrap_content" | |
48 | + android:layout_height="wrap_content" | |
49 | + android:layout_weight="1" | |
50 | + android:gravity="right" | |
51 | + android:text="+4" | |
52 | + android:textColor="@color/textGreen" | |
53 | + android:textSize="@dimen/sp_16" /> | |
54 | + </LinearLayout> | |
55 | + | |
56 | + <LinearLayout | |
57 | + android:layout_width="match_parent" | |
58 | + android:layout_height="wrap_content" | |
59 | + android:layout_marginTop="10dp" | |
60 | + android:orientation="horizontal"> | |
61 | + | |
62 | + <TextView | |
63 | + android:id="@+id/name" | |
64 | + android:layout_width="wrap_content" | |
65 | + android:layout_height="wrap_content" | |
66 | + android:layout_weight="1" | |
67 | + android:text="沈小东 二年(2)班" /> | |
68 | + | |
69 | + <TextView | |
70 | + android:id="@+id/time" | |
71 | + android:layout_width="wrap_content" | |
72 | + android:layout_height="wrap_content" | |
73 | + android:layout_weight="1" | |
74 | + android:gravity="right" | |
75 | + android:text="2018-03-13 18:30" /> | |
76 | + </LinearLayout> | |
77 | + | |
78 | + </LinearLayout> | |
79 | + | |
80 | + | |
81 | + </LinearLayout> | |
82 | + | |
83 | +</LinearLayout> | ... | ... |