Commit 4020ba34 by 徐丛奇

ooooo

parents c3dde5bb 4e83b2ee
......@@ -16,7 +16,6 @@
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
......@@ -39,18 +38,15 @@
android:launchMode="singleTop"></activity>
<activity
android:name="com.oo.eye.activity.BeforeEyeTestActivity"
android:launchMode="singleTop"
android:screenOrientation="landscape" />
<activity
android:name="com.oo.eye.activity.EyeTestActivity"
android:screenOrientation="landscape" />
<activity
android:name="com.oo.eye.activity.EyeTestHistroyActivity"
android:screenOrientation="landscape" />
<activity
android:name="com.oo.eye.activity.EyeTestStatisticsActivity"
android:launchMode="singleTop"
android:screenOrientation="landscape" />
<activity
android:name="com.oo.eye.activity.EyeSettingActivity"
android:launchMode="singleTop"
android:screenOrientation="landscape" />
</application>
......
......@@ -11,6 +11,7 @@ import android.widget.TextView;
import com.app.baselibrary.base.common.BaseActivity;
import com.app.baselibrary.commonUtil.BDttsUtils;
import com.app.baselibrary.commonUtil.CheckUtil;
import com.app.baselibrary.commonUtil.LogUtil;
import com.app.baselibrary.commonUtil.PreferencesUtils;
import com.oo.eye.EyeConfig;
......@@ -88,6 +89,8 @@ public class EyeTestActivity extends BaseActivity {
private long mLastOnKeyTime = -1;
private boolean isStartTest = false;
private boolean isKeyDwon = false;
private long totalTime = 5000;
private long intervalTime = 1000;
......@@ -145,9 +148,9 @@ public class EyeTestActivity extends BaseActivity {
nameText.setText("");
}
if(index < mStudentList.size()-1){
mNextText.setVisibility(View.VISIBLE);
mNextText.setText("放弃当前,跳到下一位");
}else{
mNextText.setVisibility(View.GONE);
mNextText.setText("结束测试");
}
continueTest();
}
......@@ -158,6 +161,7 @@ public class EyeTestActivity extends BaseActivity {
* @param isNewTest true 代表测试的第一只眼 代表左眼 false代表测量另一只眼 右眼
*/
private void resetView(final boolean isNewTest) {
isKeyDwon = false;
mLevelIndex = -1;
isSecondTest = !isNewTest;
String eye = isNewTest ? "右" : "左";
......@@ -197,7 +201,6 @@ public class EyeTestActivity extends BaseActivity {
}
}
mLevelIndex = Eye.getIndexByValue(e, true) - 1;
mEyeText.setText(""+e);
nextE(true);
}
}.start();
......@@ -215,36 +218,37 @@ public class EyeTestActivity extends BaseActivity {
* @param e
*/
private void drewE(E e) {
int angle = 0;
LogUtil.e("getDirect:"+e.getDirect());
eImageView1.setPivotX(eImageView1.getWidth()/2);
eImageView1.setPivotY(eImageView1.getHeight()/2);//支点在图片中心
switch (e.getDirect()){
case TOP:
eImageView1.setRotation(0);
angle = 0;
break;
case RIGHT_TOP:
eImageView1.setRotation(45);
angle = 45;
break;
case RIGHT:
eImageView1.setRotation(90);
angle = 90;
break;
case RIGHT_BOTTOM:
eImageView1.setRotation(135);
angle = 135;
break;
case BOTTOM:
eImageView1.setRotation(180);
angle = 180;
break;
case LEFT_BOTTOM:
eImageView1.setRotation(225);
angle = 225;
break;
case LEFT:
eImageView1.setRotation(270);
angle = 270;
break;
case LEFT_TOP:
eImageView1.setRotation(315);
angle = 315;
break;
}
eImageView1.setImageResource(Eye.getBitmapRid(e.getLevel(),mDistance));
eImageView1.destroyDrawingCache();
eImageView1.setImageBitmap(Eye.getBitmap(this,e.getLevel(),mDistance,angle));
isKeyDwon = true;
}
/**
......@@ -351,16 +355,27 @@ public class EyeTestActivity extends BaseActivity {
* 下一个E字标
*/
private void nextE(boolean isNextLine) {
if (isNextLine) {
mLevelIndex++;
mLocation = 0;
} else {
mLocation++;
}
try {
if (isNextLine) {
mLevelIndex++;
mLocation = 0;
} else {
mLocation++;
}
mSelectE = mList.get(mLevelIndex).get(mLocation);
mEyeText_.setText(""+(mLocation+1));
drewE(mSelectE);
mSelectE = mList.get(mLevelIndex).get(mLocation);
String levelByIndex = "4.0";
if (mGroupDecimal == EYE_SETTING_5) {
levelByIndex = "" + Eye.getLevelByIndex(mSelectE.getLevel(), mDistance == EyeConfig.EYE_DISTANCE_5);
} else {
levelByIndex = "" + Eye.get2LevelByIndex(mSelectE.getLevel(), mDistance == EyeConfig.EYE_DISTANCE_5);
}
mEyeText.setText(levelByIndex);
mEyeText_.setText("" + (mLocation + 1));
drewE(mSelectE);
}catch (Exception e){
e.printStackTrace();
}
}
/**
......@@ -423,8 +438,8 @@ public class EyeTestActivity extends BaseActivity {
//如果错误次数超过一半 (默认位置时上一行没有数据时候)回退一行
if (errorCount > verifyErrorCount) {
//如果上一行数据不为空 结束测试
if (mLevelIndex == 0 || (mCollect.containsKey(mLevelIndex - 1) &&
mCollect.get(mLevelIndex - 1) != null && mCollect.get(mLevelIndex - 1).size() > 0)) {
if (mLevelIndex == 0 ||
(mCollect.containsKey(mLevelIndex - 1) && !CheckUtil.isEmpty(mCollect.get(mLevelIndex - 1)))) {
showResult();
return;
} else {
......@@ -481,9 +496,9 @@ public class EyeTestActivity extends BaseActivity {
String nextName = "";
if (next < mStudentList.size()) {
isShow = true;
}else{
nextName = mStudentList.get(next).getRealname();
}
mAfterTestDialog = new AfterTestDialog.Builder(EyeTestActivity.this,R.style.style_common_dialog)
.setLeftEye(""+mLeftEye)
.setRightEye(""+mRightEye)
......@@ -514,38 +529,39 @@ public class EyeTestActivity extends BaseActivity {
return true;
}
mLastOnKeyTime = currentTime;
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_UP:
userChoose(TOP);
return true;
case KeyEvent.KEYCODE_DPAD_DOWN:
userChoose(BOTTOM);
return true;
case KeyEvent.KEYCODE_DPAD_LEFT:
userChoose(LEFT);
return true;
case KeyEvent.KEYCODE_DPAD_RIGHT:
userChoose(RIGHT);
return true;
case KeyEvent.KEYCODE_MOVE_HOME:
userChoose(LEFT_TOP);
return true;
case KeyEvent.KEYCODE_MOVE_END:
userChoose(LEFT_BOTTOM);
return true;
case KeyEvent.KEYCODE_PAGE_UP:
userChoose(RIGHT_TOP);
return true;
case KeyEvent.KEYCODE_PAGE_DOWN:
userChoose(RIGHT_BOTTOM);
return true;
case KeyEvent.KEYCODE_NUMPAD_ENTER://遥控中间键
//用户点击返回键:
userChooseError();
return true;
if(isKeyDwon) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_UP:
userChoose(TOP);
return true;
case KeyEvent.KEYCODE_DPAD_DOWN:
userChoose(BOTTOM);
return true;
case KeyEvent.KEYCODE_DPAD_LEFT:
userChoose(LEFT);
return true;
case KeyEvent.KEYCODE_DPAD_RIGHT:
userChoose(RIGHT);
return true;
case KeyEvent.KEYCODE_MOVE_HOME:
userChoose(LEFT_TOP);
return true;
case KeyEvent.KEYCODE_MOVE_END:
userChoose(LEFT_BOTTOM);
return true;
case KeyEvent.KEYCODE_PAGE_UP:
userChoose(RIGHT_TOP);
return true;
case KeyEvent.KEYCODE_PAGE_DOWN:
userChoose(RIGHT_BOTTOM);
return true;
case KeyEvent.KEYCODE_NUMPAD_ENTER://遥控中间键
//用户点击返回键:
userChooseError();
return true;
}
}
return true;
}
return super.dispatchKeyEvent(event);
}
......@@ -571,7 +587,15 @@ public class EyeTestActivity extends BaseActivity {
@Override
public boolean onTouchEvent(MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_DOWN){
userChooseError();
//两次点击大于1秒
long currentTime = System.currentTimeMillis();
if (mLastOnKeyTime > 0 && currentTime - mLastOnKeyTime < 500) {
return true;
}
mLastOnKeyTime = currentTime;
if(isKeyDwon) {
userChooseError();
}
}
return super.onTouchEvent(event);
......
......@@ -15,6 +15,9 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import com.app.baselibrary.base.common.BaseActivity;
import com.app.baselibrary.commonUtil.CheckUtil;
import com.app.baselibrary.commonUtil.ToastUtil;
import com.oo.eye.EyeConfig;
import com.oo.eye.R;
import com.oo.eye.adapter.MorePeopleAdapter;
import com.oo.eye.adapter.PopuAdapter;
......@@ -61,6 +64,8 @@ public class MorePeopleTestActivity extends BaseActivity {
LinearLayout mSeleteAreaLay;
@BindView(R.id.key_test)
EditText mKeyTest;
private List<StudentBean> mStudentBeans;
private MorePeopleAdapter mPeopleAdapter;
@Override
protected int getLayoutId() {
......@@ -70,13 +75,17 @@ public class MorePeopleTestActivity extends BaseActivity {
@Override
protected void init() {
mRecycleView.setLayoutManager(new LinearLayoutManager(this));
List<StudentBean> list = new ArrayList<>();
mStudentBeans = new ArrayList<>();
for (int i = 0; i < 10; i++) {
StudentBean studentBean = new StudentBean();
studentBean.setRealname("测试"+i);
list.add(studentBean);
studentBean.setNumber("2016010"+i);
studentBean.setClasses("动车组"+i);
studentBean.setBirthday("2011010"+i);
mStudentBeans.add(studentBean);
}
mRecycleView.setAdapter(new MorePeopleAdapter(list, this));
mPeopleAdapter = new MorePeopleAdapter(mStudentBeans, this);
mRecycleView.setAdapter(mPeopleAdapter);
}
@Override
......@@ -85,7 +94,7 @@ public class MorePeopleTestActivity extends BaseActivity {
ButterKnife.bind(this);
}
@OnClick({R.id.selete_area_lay,R.id.selete_lay, R.id.selete1_lay, R.id.do_search, R.id.begin_test})
@OnClick({R.id.selete_area_lay, R.id.selete_lay, R.id.selete1_lay, R.id.do_search, R.id.begin_test})
public void onClick(View view) {
switch (view.getId()) {
case R.id.selete_area_lay:
......@@ -100,8 +109,20 @@ public class MorePeopleTestActivity extends BaseActivity {
case R.id.do_search:
break;
case R.id.begin_test:
Intent intent = new Intent(this, TestListActivity.class);
startActivity(intent);
List<StudentBean> beanList = new ArrayList<>();
List<StudentBean> list = mPeopleAdapter.getList();
for (StudentBean bean : list) {
if (bean.isChick()) {
beanList.add(bean);
}
}
if(!CheckUtil.isEmpty(beanList)) {
EyeConfig.getInstance().setStudents(beanList);
Intent intent = new Intent(this, TestListActivity.class);
startActivity(intent);
}else{
ToastUtil.showLongMessage("请选择测试人员");
}
break;
}
}
......@@ -128,7 +149,7 @@ public class MorePeopleTestActivity extends BaseActivity {
ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明
popupWindow.setBackgroundDrawable(cd);
ListView listView = (ListView) conview.findViewById(R.id.list_view);
listView.setAdapter(new PopuAdapter(this));
listView.setAdapter(new PopuAdapter(this,null));
int[] location = new int[2];
view.getLocationOnScreen(location);
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
......
package com.oo.eye.activity;
import android.graphics.drawable.ColorDrawable;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.app.baselibrary.base.common.BaseActivity;
import com.oo.eye.EyeConfig;
import com.oo.eye.R;
import com.oo.eye.adapter.PopuAdapter;
import com.oo.eye.bean.StudentBean;
import java.util.ArrayList;
......@@ -20,6 +27,21 @@ import butterknife.OnClick;
public class SinglePeopleTestActivity extends BaseActivity {
@BindView(R.id.begin_test)
TextView mBeginTest;
@BindView(R.id.selete_area_tv)
TextView mSeleteAreaTv;
@BindView(R.id.selete_area_lay)
LinearLayout mSeleteAreaLay;
@BindView(R.id.test_order)
TextView mOrderText;
@BindView(R.id.test_group)
TextView mGroupText;
@BindView(R.id.test_name)
TextView mNameText;
@BindView(R.id.test_birthday)
TextView mBirthdayText;
private StudentBean mStudentBean;
@Override
protected int getLayoutId() {
......@@ -28,16 +50,58 @@ public class SinglePeopleTestActivity extends BaseActivity {
@Override
protected void init() {
mStudentBean = new StudentBean();
mStudentBean.setRealname("范特西");
mStudentBean.setNumber("20160101");
mStudentBean.setClasses("动车组");
mStudentBean.setBirthday("20110101");
updateData();
}
private void updateData(){
mOrderText.setText(mStudentBean.getNumber());
mGroupText.setText(mStudentBean.getClasses());
mNameText.setText(mStudentBean.getRealname());
mBirthdayText.setText(mStudentBean.getBirthday());
}
@OnClick(R.id.begin_test)
public void onClick() {
ArrayList<StudentBean> list = new ArrayList<>();
StudentBean student = new StudentBean();
student.setRealname("游客");
list.add(student);
EyeConfig.getInstance().setStudents(list);
startActivity(BeforeEyeTestActivity.class);
@OnClick({R.id.selete_area_lay, R.id.do_search, R.id.begin_test})
public void onClick(View view) {
switch (view.getId()) {
case R.id.selete_area_lay:
showPopWindow();
break;
case R.id.do_search:
break;
case R.id.begin_test:
ArrayList<StudentBean> list = new ArrayList<>();
list.add(mStudentBean);
EyeConfig.getInstance().setStudents(list);
startActivity(BeforeEyeTestActivity.class);
break;
}
}
private void showPopWindow() {
try {
View conview = View.inflate(this, R.layout.popu_list, null);
PopupWindow popupWindow = new PopupWindow(conview, RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
popupWindow.setFocusable(true);
popupWindow.setOutsideTouchable(true);
ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明
popupWindow.setBackgroundDrawable(cd);
ListView listView = (ListView) conview.findViewById(R.id.list_view);
listView.setAdapter(new PopuAdapter(this,null));
int[] location = new int[2];
mSeleteAreaLay.getLocationOnScreen(location);
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
conview.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int xoff = -(conview.getMeasuredWidth() / 2 - mSeleteAreaLay.getWidth() / 2);
popupWindow.showAsDropDown(mSeleteAreaLay, xoff, 0);
} catch (Exception e) {
e.printStackTrace();
}
}
}
......@@ -7,11 +7,11 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import com.app.baselibrary.base.common.BaseActivity;
import com.oo.eye.EyeConfig;
import com.oo.eye.R;
import com.oo.eye.adapter.TestListAdapter;
import com.oo.eye.bean.StudentBean;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
......@@ -38,17 +38,13 @@ public class TestListActivity extends BaseActivity {
@Override
protected void init() {
mRecycleView.setLayoutManager(new LinearLayoutManager(this));
List<StudentBean> list = new ArrayList<>();
for (int i = 0; i < 10; i++) {
StudentBean chartsBean = new StudentBean();
list.add(chartsBean);
}
List<StudentBean> list = EyeConfig.getInstance().getStudents();
mRecycleView.setAdapter(new TestListAdapter(list, this));
}
@OnClick(R.id.begin_test)
public void onClick() {
Intent intent=new Intent(this,TestResurtListActivity.class);
Intent intent=new Intent(this,EyeTestActivity.class);
startActivity(intent);
}
}
......@@ -132,7 +132,7 @@ public class TestResurtListActivity extends BaseActivity {
ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明
popupWindow.setBackgroundDrawable(cd);
ListView listView = (ListView) conview.findViewById(R.id.list_view);
listView.setAdapter(new PopuAdapter(this));
listView.setAdapter(new PopuAdapter(this,null));
int[] location = new int[2];
view.getLocationOnScreen(location);
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
......
package com.oo.eye.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.app.baselibrary.recycler.adapter.BaseRecyclerViewAdapter;
import com.app.baselibrary.recycler.itemholder.ItemViewHolder;
import com.oo.eye.R;
import com.oo.eye.bean.ChartsBean;
import com.oo.eye.bean.StudentBean;
import java.util.List;
......@@ -33,11 +33,23 @@ public class MorePeopleAdapter extends BaseRecyclerViewAdapter<StudentBean, Item
}
@Override
public void onBindViewHolder(ItemViewHolder holder, int position) {
public void onBindViewHolder(ItemViewHolder holder, final int position) {
final StudentBean studentBean = mList.get(position);
TextView orderText = (TextView) holder.itemView.findViewById(R.id.test_order);
orderText.setText(studentBean.getNumber());
TextView groupText = (TextView) holder.itemView.findViewById(R.id.test_group);
groupText.setText(studentBean.getClasses());
TextView nameText = (TextView) holder.itemView.findViewById(R.id.test_name);
nameText.setText(studentBean.getRealname());
TextView birthdayText = (TextView) holder.itemView.findViewById(R.id.test_birthday);
birthdayText.setText(studentBean.getBirthday());
ImageView imageView = (ImageView) holder.itemView.findViewById(R.id.chick_iv);
imageView.setImageResource(studentBean.isChick() ? R.drawable.select2_sel : R.drawable.select2_nor);
holder.itemView.findViewById(R.id.choice_lay).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
studentBean.setChick(!studentBean.isChick());
notifyDataSetChanged();
}
});
}
......@@ -45,6 +57,6 @@ public class MorePeopleAdapter extends BaseRecyclerViewAdapter<StudentBean, Item
@Override
public int getItemCount() {
return 10;
return mList.size();
}
}
......@@ -10,6 +10,10 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.oo.eye.R;
import com.oo.eye.bean.PopuBean;
import java.util.ArrayList;
import java.util.List;
/**
* Date : 2018/8/31.
......@@ -18,9 +22,15 @@ import com.oo.eye.R;
public class PopuAdapter extends BaseAdapter {
private Context mContext;
public PopuAdapter(Context context){
mContext=context;
private List<PopuBean> mBeanList = new ArrayList<>();
public PopuAdapter(Context context, List<PopuBean> beans) {
mContext = context;
if (beans != null) {
mBeanList = beans;
}
}
@Override
public int getCount() {
return 6;
......@@ -42,7 +52,14 @@ public class PopuAdapter extends BaseAdapter {
View view = inflater.inflate(R.layout.item_popu_more, null);
final TextView textView = (TextView) view.findViewById(R.id.name_tv);
ImageView imageView = (ImageView) view.findViewById(R.id.choice_tv);
// PopuBean bean=mBeanList.get(position);
// if (bean.isChick()){
// imageView.setVisibility(View.VISIBLE);
// imageView.setImageResource(R.drawable.selectitem);
// }else {
// imageView.setVisibility(View.INVISIBLE);
// }
// textView.setText(data[position]);
return view;
return view;
}
}
......@@ -3,11 +3,11 @@ package com.oo.eye.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;
import com.app.baselibrary.recycler.adapter.BaseRecyclerViewAdapter;
import com.app.baselibrary.recycler.itemholder.ItemViewHolder;
import com.oo.eye.R;
import com.oo.eye.bean.ChartsBean;
import com.oo.eye.bean.StudentBean;
import java.util.List;
......@@ -17,8 +17,9 @@ import java.util.List;
* Author: cxh
*/
public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean,ItemViewHolder>{
public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean, ItemViewHolder> {
private final LayoutInflater mInflater;
public TestListAdapter(List<StudentBean> list, Context context) {
super(list, context);
mInflater = LayoutInflater.from(mContext);
......@@ -31,12 +32,20 @@ public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean,ItemVie
@Override
public void onBindViewHolder(ItemViewHolder holder, int position) {
final StudentBean studentBean = mList.get(position);
TextView orderText = (TextView) holder.itemView.findViewById(R.id.test_order);
orderText.setText(studentBean.getNumber());
TextView groupText = (TextView) holder.itemView.findViewById(R.id.test_group);
groupText.setText(studentBean.getClasses());
TextView nameText = (TextView) holder.itemView.findViewById(R.id.test_name);
nameText.setText(studentBean.getRealname());
TextView birthdayText = (TextView) holder.itemView.findViewById(R.id.test_birthday);
birthdayText.setText(studentBean.getBirthday());
}
@Override
public int getItemCount() {
return 10;
return mList.size();
}
}
package com.oo.eye.bean;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import com.app.baselibrary.bean.BaseBean;
import com.app.baselibrary.commonUtil.DensityUtil;
import com.app.baselibrary.commonUtil.LogUtil;
import com.oo.eye.EyeConfig;
import com.oo.eye.R;
......@@ -456,6 +460,17 @@ public class Eye extends BaseBean {
return DensityUtil.px2dip(level);
}
public static Bitmap getBitmap(Context context,int level,int distance,int angle){
Bitmap bitmap = ((BitmapDrawable)context.getResources().getDrawable(getBitmapRid(level,distance))).getBitmap();
LogUtil.e("width:"+bitmap.getWidth()+"----height:"+bitmap.getHeight());
int width = bitmap.getWidth();
int height = bitmap.getHeight();
Matrix matrix = new Matrix();
matrix.setRotate(angle);
Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
return resizedBitmap;
}
public static int getBitmapRid(int level,int distance){
int rid = R.drawable.p5c14;
switch (distance){
......
package com.oo.eye.bean;
import com.app.baselibrary.bean.BaseBean;
/**
* Date : 2018/9/4.
* Author: cxh
*/
public class PopuBean extends BaseBean {
private String name;
private boolean isChick;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isChick() {
return isChick;
}
public void setChick(boolean chick) {
isChick = chick;
}
}
......@@ -20,6 +20,16 @@ public class StudentBean extends BaseBean {
private String url;
private String pid;
private int distance;//测量距离
private boolean isChick;
private String birthday;
public boolean isChick() {
return isChick;
}
public void setChick(boolean chick) {
isChick = chick;
}
public String getSid() {
return sid;
......@@ -125,6 +135,14 @@ public class StudentBean extends BaseBean {
this.distance = distance;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public StudentBean copy(){
StudentBean student = new StudentBean();
student.setSid(this.sid);
......@@ -140,6 +158,7 @@ public class StudentBean extends BaseBean {
student.setLeft_eye(this.left_eye);
student.setRight_eye(this.right_eye);
student.setDistance(this.distance);
student.setBirthday(this.birthday);
return student;
}
......
......@@ -4,7 +4,6 @@ import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import com.app.baselibrary.commonUtil.CheckUtil;
......@@ -49,7 +48,6 @@ public class AfterTestDialog extends Dialog{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY);
setContentView(R.layout.dialog_after_eye_test);
initView();
}
......@@ -89,12 +87,26 @@ public class AfterTestDialog extends Dialog{
}else{
mNextName.setVisibility(View.GONE);
}
mUsername_tv.setText(userName);
mUsername_tv.setText("姓 名:"+userName);
mLeftEye.setText(lefteye);
mRightEye.setText(righteye);
mTestTime.setText(mSimpleDateFormat.format(mDate));
}
// @Override
// public void show() {
// super.show();
// /**
// * 设置宽度全屏,要设置在show的后面
// */
// WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
// layoutParams.gravity = Gravity.BOTTOM;
// layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
// layoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
// getWindow().getDecorView().setPadding(0, 0, 0, 0);
// getWindow().setAttributes(layoutParams);
// }
public interface AfterTestListener {
public void onFinish();
public void onContinue();
......
app/src/main/res/drawable-xhdpi/p5c12.png

977 Bytes | W: | H:

app/src/main/res/drawable-xhdpi/p5c12.png

878 Bytes | W: | H:

app/src/main/res/drawable-xhdpi/p5c12.png
app/src/main/res/drawable-xhdpi/p5c12.png
app/src/main/res/drawable-xhdpi/p5c12.png
app/src/main/res/drawable-xhdpi/p5c12.png
  • 2-up
  • Swipe
  • Onion skin
app/src/main/res/drawable-xhdpi/p5c13.png

785 Bytes | W: | H:

app/src/main/res/drawable-xhdpi/p5c13.png

697 Bytes | W: | H:

app/src/main/res/drawable-xhdpi/p5c13.png
app/src/main/res/drawable-xhdpi/p5c13.png
app/src/main/res/drawable-xhdpi/p5c13.png
app/src/main/res/drawable-xhdpi/p5c13.png
  • 2-up
  • Swipe
  • Onion skin
app/src/main/res/drawable-xhdpi/p5c14.png

594 Bytes | W: | H:

app/src/main/res/drawable-xhdpi/p5c14.png

498 Bytes | W: | H:

app/src/main/res/drawable-xhdpi/p5c14.png
app/src/main/res/drawable-xhdpi/p5c14.png
app/src/main/res/drawable-xhdpi/p5c14.png
app/src/main/res/drawable-xhdpi/p5c14.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -38,10 +38,8 @@
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="放弃当前,跳到下一位"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_16"
android:visibility="gone"/>
android:textSize="@dimen/sp_16"/>
<RelativeLayout
android:id="@+id/rl_eye_test_center1"
android:layout_width="match_parent"
......
......@@ -20,44 +20,73 @@
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_70"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search" />
<LinearLayout
android:id="@+id/selete_area_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="horizontal">
<EditText
android:id="@+id/key_test"
android:layout_width="140dip"
<TextView
android:id="@+id/selete_area_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_6"
android:background="@null"
android:hint="输入学员编号后4位"
android:textColorHint="@color/hint_text_color"
android:textSize="@dimen/sp_16" />
android:text="黄冈校区22323"
android:textColor="@color/white"
android:textSize="@dimen/sp_18" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="@dimen/dp_1"
android:background="@color/hint_text_color"></View>
<ImageView
android:id="@+id/selete_area_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_6"
android:src="@drawable/more" />
</LinearLayout>
<TextView
android:id="@+id/do_search"
<LinearLayout
android:layout_marginLeft="@dimen/dp_20"
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" />
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="@+id/key_test"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_6"
android:background="@null"
android:hint="输入学员编号后4位"
android:textColorHint="@color/hint_text_color"
android:textSize="@dimen/sp_16" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="@dimen/dp_1"
android:background="@color/hint_text_color"></View>
</LinearLayout>
<TextView
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" />
</LinearLayout>
</LinearLayout>
<LinearLayout
......
......@@ -165,7 +165,7 @@
android:layout_marginTop="@dimen/dp_12"
android:background="@drawable/after_btn_bg"
android:gravity="center"
android:text="生成测试队列"
android:text="开始测试"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/line_color"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<RelativeLayout
android:layout_width="600dp"
android:layout_height="400dp"
android:background="@color/line_color">
<LinearLayout
android:id="@+id/main_lay"
android:layout_width="400dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_centerInParent="true"
android:background="@color/white"
android:orientation="vertical"
android:padding="@dimen/dp_20">
android:orientation="vertical">
<TextView
android:id="@+id/tv_after_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_20"
android:text="视力检测报告单"
android:textColor="@color/text_color"
......@@ -33,11 +25,9 @@
android:id="@+id/tv_after_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_after_title"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_22"
android:gravity="center"
android:text="姓 名: 游客11"
android:textColor="@color/text_color"
android:textSize="16dp" />
......@@ -45,8 +35,8 @@
android:id="@+id/test_result_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_after_name"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:orientation="horizontal">
<TextView
......@@ -64,7 +54,6 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:gravity="center"
android:text="5.1"
android:textStyle="bold"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_28" />
......@@ -84,42 +73,38 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:gravity="center"
android:text="5.1"
android:textStyle="bold"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_28" />
</LinearLayout>
<TextView
android:id="@+id/tv_after_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/test_result_lay"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_8"
android:gravity="center"
android:text="检测时间:"
android:textColor="@color/text_color"
android:textSize="16dp" />
<TextView
android:id="@+id/tv_after_time_value"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/test_result_lay"
android:layout_toRightOf="@+id/tv_after_time"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_8"
android:gravity="center"
android:text="2018-09-09 13:21:55"
android:textColor="@color/text_color"
android:textSize="16dp" />
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_8">
<TextView
android:id="@+id/tv_after_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="检测时间:"
android:textColor="@color/text_color"
android:textSize="16dp" />
<TextView
android:id="@+id/tv_after_time_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:gravity="center"
android:textColor="@color/text_color"
android:textSize="16dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_after_time"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:layout_marginTop="25dp">
<TextView
......@@ -152,18 +137,17 @@
android:textColor="@color/white"
android:textSize="15dp" />
</LinearLayout>
</RelativeLayout>
<TextView
android:layout_centerHorizontal="true"
android:layout_below="@+id/main_lay"
android:visibility="invisible"
android:id="@+id/tv_nest_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_20"
android:gravity="center"
android:text="下一位: 游客11"
android:textColor="@color/white"
android:textSize="18dp" />
<TextView
android:layout_gravity="center_horizontal"
android:id="@+id/tv_nest_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center"
android:textColor="@color/text_color"
android:textSize="18dp" />
<View
android:layout_width="wrap_content"
android:layout_height="20dp"/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -23,7 +23,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="2016010101"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -45,7 +44,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="A组"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -67,7 +65,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="欧晓迪"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -89,7 +86,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="20160101"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......
......@@ -20,10 +20,11 @@
android:background="@color/line_color"></View>
<ImageView
android:id="@+id/chick_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/select2_sel" />
android:src="@drawable/select2_nor" />
</RelativeLayout>
<RelativeLayout
......@@ -42,7 +43,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="2016010101"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -64,7 +64,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="A组"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -86,7 +85,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="欧晓迪"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -108,7 +106,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="20160101"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......
......@@ -44,14 +44,22 @@ public abstract class BaseRecyclerViewAdapter<T, VH extends RecyclerView.ViewHol
* 父类的构造方法
*/
public BaseRecyclerViewAdapter(List<T> list) {
appendToList(list);
setList(list);
}
public BaseRecyclerViewAdapter(List<T> list, Context context) {
appendToList(list);
setList(list);
mContext = context;
}
public void setList(List<T> list){
if(list != null){
this.mList = list;
}else{
mList.clear();
}
}
/**
* 返回数据源集合
*
......
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