Commit ea32ec66 by 徐丛奇

Merge branch 'master' of git.iouou.cn:xucongqi/haihang

parents 5480d6e2 32109e6a
......@@ -27,7 +27,7 @@ public class EyeConfig {
private List<StudentBean> mStudents;
public static String TEST_SCHOOL_ID = "84";
public static String TEST_SCHOOL_ID = "81";
private static EyeConfig instance = new EyeConfig();
......
package com.oo.eye.activity;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
......@@ -31,6 +33,7 @@ import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import rx.android.schedulers.AndroidSchedulers;
......@@ -49,12 +52,16 @@ public class SinglePeopleTestActivity extends BaseActivity {
@BindView(R.id.recycle_view)
RecyclerView mRecycleView;
@BindView(R.id.progress)
RelativeLayout mProgress;
@BindView(R.id.key_test)
EditText mKeyTest;
private List<StudentBean> mStudentBeans;
private SinglePeopleAdapter mPeopleAdapter;
private SearchParamBean mSearchParamBean = new SearchParamBean();
private SchoolBean mSchoolBean;
private PopuAdapter mPopuAdapter;
private List<PopuBean> mAreaList = new ArrayList<>();
@Override
protected int getLayoutId() {
return R.layout.activity_singletest;
......@@ -66,16 +73,9 @@ public class SinglePeopleTestActivity extends BaseActivity {
mSearchParamBean.setSchoolId(EyeConfig.TEST_SCHOOL_ID);
mRecycleView.setLayoutManager(new LinearLayoutManager(this));
mStudentBeans = new ArrayList<>();
for (int i = 0; i < 10; i++) {
StudentBean mStudentBean = new StudentBean();
mStudentBean.setRealname("范特西" + i);
mStudentBean.setNumber("20160101" + i);
mStudentBean.setClasses("动车组" + i);
mStudentBean.setBirthday("20110101" + i);
mStudentBeans.add(mStudentBean);
}
mPeopleAdapter = new SinglePeopleAdapter(mStudentBeans, this);
mRecycleView.setAdapter(mPeopleAdapter);
search();//
}
@OnClick({R.id.back_iv, R.id.selete_area_lay, R.id.do_search, R.id.begin_test})
......@@ -85,7 +85,9 @@ public class SinglePeopleTestActivity extends BaseActivity {
finish();
break;
case R.id.selete_area_lay:
if (!CheckUtil.isNull(mSchoolBean)) {
if (!CheckUtil.isEmpty(mAreaList)) {
showPopWindow(mAreaList);
} else if (!CheckUtil.isNull(mSchoolBean)) {
setAreaData();
} else {
EyeDataManager.getInstance().getSchoolInfo(EyeConfig.TEST_SCHOOL_ID)
......@@ -97,7 +99,7 @@ public class SinglePeopleTestActivity extends BaseActivity {
mSchoolBean = schoolBeanOldResponse.getResultData();
if (!CheckUtil.isNull(mSchoolBean)) {
setAreaData();
}else {
} else {
ToastUtil.showMessage("暂无数据");
}
}
......@@ -111,6 +113,7 @@ public class SinglePeopleTestActivity extends BaseActivity {
}
break;
case R.id.do_search:
mSearchParamBean.setStudentId(mKeyTest.getText().toString());
search();
break;
case R.id.begin_test:
......@@ -129,11 +132,16 @@ public class SinglePeopleTestActivity extends BaseActivity {
List<GradeBean> gradeBeans = mSchoolBean.getGradeList();
if (!CheckUtil.isEmpty(gradeBeans)) {
List<PopuBean> popuBeans = new ArrayList<>();
PopuBean all = new PopuBean();
all.setName("全部学校");
all.setChick(true);
popuBeans.add(all);
for (GradeBean gradeBean : gradeBeans) {
PopuBean popuBean = new PopuBean();
popuBean.setName(gradeBean.getName());
popuBeans.add(popuBean);
}
mAreaList = popuBeans;
showPopWindow(popuBeans);
} else {
ToastUtil.showMessage("暂无数据");
......@@ -164,8 +172,17 @@ public class SinglePeopleTestActivity extends BaseActivity {
for (PopuBean popuBean : popuBeans) {
popuBean.setChick(false);
}
popuBeans.get(position).setChick(true);
PopuBean popuBean = popuBeans.get(position);
popuBean.setChick(true);
mPopuAdapter.notifyDataSetChanged();
if (popuBean.getName().equals("全部学校")) {
mSearchParamBean.setGrade("");
} else {
mSearchParamBean.setGrade(popuBean.getName());
}
mSearchParamBean.setStudentId("");
mSeleteAreaTv.setText(popuBean.getName());
search();
}
});
} catch (Exception e) {
......@@ -177,19 +194,33 @@ public class SinglePeopleTestActivity extends BaseActivity {
* 搜索
*/
private void search() {
mProgress.setVisibility(View.VISIBLE);
EyeDataManager.getInstance().getStudents(mSearchParamBean.getParams())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new RxCallback<OldResponseImpl<List<StudentBean>>>() {
@Override
protected void onSuccess(OldResponseImpl<List<StudentBean>> listOldResponse) {
if (listOldResponse != null && listOldResponse.getData() != null) {
mProgress.setVisibility(View.GONE);
mPeopleAdapter.clear();
mPeopleAdapter.appendToListAndNotify(listOldResponse.getData());
} else {
ToastUtil.showMessage("暂无数据");
}
}
@Override
protected void onError(int errorCode, String errorMessage) {
mProgress.setVisibility(View.GONE);
ToastUtil.showMessage(errorMessage);
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
}
......@@ -62,4 +62,7 @@ public class PopuAdapter extends BaseAdapter {
textView.setText(bean.getName());
return view;
}
public List<PopuBean> getBeanList(){
return mBeanList;
}
}
......@@ -27,7 +27,7 @@ public class SinglePeopleAdapter extends BaseRecyclerViewAdapter<StudentBean, It
public SinglePeopleAdapter(List<StudentBean> list, Context context) {
super(list, context);
if(!CheckUtil.isEmpty(mList)){
if (!CheckUtil.isEmpty(mList)) {
lastSelectBean = mList.get(0);
lastSelectBean.setChick(true);
}
......@@ -59,25 +59,25 @@ public class SinglePeopleAdapter extends BaseRecyclerViewAdapter<StudentBean, It
holder.itemView.findViewById(R.id.choice_lay).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
StudentBean bean = null;
for (int i = 0; i < mList.size(); i++) {
if (position == i) {
bean = mList.get(i);
bean.setChick(true);
}
StudentBean bean = null;
for (int i = 0; i < mList.size(); i++) {
if (position == i) {
bean = mList.get(i);
bean.setChick(true);
}
if(!bean.getNumber().equals(lastSelectBean.getNumber())) {
lastSelectBean.setChick(false);
lastSelectBean = bean;
}
notifyDataSetChanged();
}
});
}
if (!bean.getNumber().equals(lastSelectBean.getNumber())) {
lastSelectBean.setChick(false);
lastSelectBean = bean;
}
notifyDataSetChanged();
}
});
}
@Override
public int getItemCount () {
return 10;
}
@Override
public int getItemCount() {
return mList != null ? mList.size() : 0;
}
}
......@@ -2,6 +2,8 @@ package com.oo.eye.bean;
import com.app.baselibrary.bean.BaseBean;
import java.util.List;
/**
* Date : 2018/9/4.
* Author: cxh
......@@ -11,6 +13,26 @@ public class PopuBean extends BaseBean {
private String name;
private boolean isChick;
public String getClassId() {
return classId;
}
public void setClassId(String classId) {
this.classId = classId;
}
private String classId;
public List<ClassBean> getClassBeans() {
return mClassBeans;
}
public void setClassBeans(List<ClassBean> classBeans) {
mClassBeans = classBeans;
}
private List<ClassBean> mClassBeans;
public String getName() {
return name;
}
......
......@@ -34,6 +34,6 @@ public interface EyeApiService {
/**
* 获取学生信息
*/
@GET(NetConfig.GET_SCHOOL)
@GET(NetConfig.CLASS_STUDENT)
Observable<OldResponseImpl<List<StudentBean>>> getStudents(@QueryMap Map<String ,String> params);
}
......@@ -24,10 +24,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_60"
android:layout_marginTop="@dimen/dp_40"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:paddingBottom="@dimen/dp_6"
android:paddingTop="@dimen/dp_20"
android:id="@+id/selete_area_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -49,7 +51,9 @@
android:src="@drawable/more" />
</LinearLayout>
<LinearLayout
android:layout_marginLeft="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:paddingTop="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:id="@+id/selete_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -59,7 +63,7 @@
android:id="@+id/selete_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="未测试"
android:text="全部"
android:textColor="@color/white"
android:textSize="@dimen/sp_18" />
<ImageView
......@@ -72,7 +76,9 @@
<LinearLayout
android:id="@+id/selete1_lay"
android:layout_marginLeft="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:paddingTop="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
......@@ -93,12 +99,16 @@
</LinearLayout>
<ImageView
android:layout_marginLeft="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:paddingTop="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search" />
<LinearLayout
android:paddingBottom="@dimen/dp_6"
android:paddingTop="@dimen/dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
......@@ -121,10 +131,13 @@
</LinearLayout>
<TextView
android:paddingBottom="@dimen/dp_6"
android:paddingTop="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:paddingRight="@dimen/dp_20"
android:id="@+id/do_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:text="查询"
android:textColor="@color/indicator_color"
android:textSize="@dimen/sp_18" />
......@@ -133,7 +146,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_95"
android:layout_marginTop="@dimen/dp_90"
android:background="@color/white"></LinearLayout>
<LinearLayout
......@@ -278,5 +291,16 @@
android:layout_height="match_parent"
android:layout_above="@+id/begin_test"
android:layout_below="@+id/ddd"></android.support.v7.widget.RecyclerView>
<RelativeLayout
android:id="@+id/progress"
android:layout_below="@+id/ddd"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#60000000">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -3,12 +3,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/e_test_color">
<ImageView
android:id="@+id/back_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_12"
android:src="@drawable/back" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -24,11 +26,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_60"
android:layout_marginTop="@dimen/dp_40"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/selete_area_lay"
android:paddingTop="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
......@@ -50,26 +55,33 @@
</LinearLayout>
<LinearLayout
android:layout_marginLeft="@dimen/dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:layout_marginLeft="@dimen/dp_20"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:paddingBottom="@dimen/dp_6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search" />
<LinearLayout
android:paddingBottom="@dimen/dp_6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:inputType="number"
android:digits="@string/filter_vcode"
android:id="@+id/key_test"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:layout_marginLeft="@dimen/dp_6"
android:background="@null"
android:hint="输入学员编号后4位"
......@@ -87,7 +99,9 @@
android:id="@+id/do_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:paddingRight="@dimen/dp_20"
android:text="查询"
android:textColor="@color/indicator_color"
android:textSize="@dimen/sp_18" />
......@@ -97,7 +111,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_95"
android:layout_marginTop="@dimen/dp_90"
android:background="@color/white"></LinearLayout>
<LinearLayout
......@@ -108,6 +122,7 @@
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="@dimen/dp_12">
<RelativeLayout
android:layout_width="@dimen/item_dimen_2"
android:layout_height="@dimen/dp_40"
......@@ -118,21 +133,24 @@
android:layout_width="1px"
android:layout_height="match_parent"
android:background="@color/line_color"></View>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="选择"
android:layout_centerInParent="true"
android:text="选择"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18"
android:textStyle="bold" />
<View
android:layout_alignParentRight="true"
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/line_color"></View>
</RelativeLayout>
<RelativeLayout
android:layout_width="@dimen/item_dimen_5"
android:layout_height="@dimen/dp_40"
......@@ -221,6 +239,7 @@
android:background="@color/line_color"></View>
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/begin_test"
android:layout_width="110dip"
......@@ -234,6 +253,7 @@
android:text="开始测试"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recycle_view"
android:layout_width="match_parent"
......@@ -241,4 +261,16 @@
android:layout_above="@+id/begin_test"
android:layout_below="@+id/ddd"></android.support.v7.widget.RecyclerView>
<RelativeLayout
android:id="@+id/progress"
android:layout_below="@+id/ddd"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#60000000">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -22,6 +22,8 @@
android:id="@+id/title_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_20"
android:paddingRight="@dimen/dp_20"
android:text="结果报表"
android:textColor="@color/indicator_light_color"
android:textSize="24sp"
......@@ -31,12 +33,14 @@
android:layout_width="1px"
android:layout_height="@dimen/dp_20"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/white" />
<TextView
android:id="@+id/title_2"
android:paddingLeft="@dimen/dp_20"
android:paddingRight="@dimen/dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="临时报表"
......@@ -63,13 +67,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_60"
android:layout_marginTop="@dimen/dp_40"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/selete_area_lay"
android:layout_width="wrap_content"
android:paddingTop="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:layout_height="wrap_content"
android:orientation="horizontal">
......@@ -90,10 +97,12 @@
</LinearLayout>
<LinearLayout
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:id="@+id/selete_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:orientation="horizontal">
<TextView
......@@ -113,11 +122,13 @@
</LinearLayout>
<LinearLayout
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:visibility="gone"
android:id="@+id/selete1_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:orientation="horizontal">
<TextView
......@@ -137,10 +148,12 @@
</LinearLayout>
<LinearLayout
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:id="@+id/selete2_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:orientation="horizontal">
<ImageView
......@@ -148,7 +161,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/select3_sel" />
android:src="@drawable/select3_nor" />
<TextView
android:id="@+id/selete2_tv"
......@@ -162,12 +175,16 @@
</LinearLayout>
<ImageView
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:src="@drawable/search" />
<LinearLayout
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
......@@ -190,10 +207,12 @@
</LinearLayout>
<TextView
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:id="@+id/do_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20"
android:text="查询"
android:textColor="@color/indicator_color"
android:textSize="@dimen/sp_18" />
......@@ -202,7 +221,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_95"
android:layout_marginTop="@dimen/dp_90"
android:background="@color/white"></LinearLayout>
<LinearLayout
......@@ -358,5 +377,16 @@
android:layout_height="match_parent"
android:layout_below="@+id/ddd"
android:layout_marginBottom="@dimen/dp_20"></android.support.v7.widget.RecyclerView>
<RelativeLayout
android:id="@+id/progress"
android:layout_below="@+id/ddd"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#60000000">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -38,4 +38,5 @@
<string name="histroy_soure_input">用户录入</string>
<string name="histroy_soure_calculate">自动计算</string>
<string name="start">开始</string>
<string name="filter_vcode">0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</string>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment