Commit 4020ba34 by 徐丛奇

ooooo

parents c3dde5bb 4e83b2ee
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
android:screenOrientation="landscape"> android:screenOrientation="landscape">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
...@@ -39,18 +38,15 @@ ...@@ -39,18 +38,15 @@
android:launchMode="singleTop"></activity> android:launchMode="singleTop"></activity>
<activity <activity
android:name="com.oo.eye.activity.BeforeEyeTestActivity" android:name="com.oo.eye.activity.BeforeEyeTestActivity"
android:launchMode="singleTop"
android:screenOrientation="landscape" /> android:screenOrientation="landscape" />
<activity <activity
android:name="com.oo.eye.activity.EyeTestActivity" android:name="com.oo.eye.activity.EyeTestActivity"
android:screenOrientation="landscape" /> android:launchMode="singleTop"
<activity
android:name="com.oo.eye.activity.EyeTestHistroyActivity"
android:screenOrientation="landscape" />
<activity
android:name="com.oo.eye.activity.EyeTestStatisticsActivity"
android:screenOrientation="landscape" /> android:screenOrientation="landscape" />
<activity <activity
android:name="com.oo.eye.activity.EyeSettingActivity" android:name="com.oo.eye.activity.EyeSettingActivity"
android:launchMode="singleTop"
android:screenOrientation="landscape" /> android:screenOrientation="landscape" />
</application> </application>
......
...@@ -11,6 +11,7 @@ import android.widget.TextView; ...@@ -11,6 +11,7 @@ import android.widget.TextView;
import com.app.baselibrary.base.common.BaseActivity; import com.app.baselibrary.base.common.BaseActivity;
import com.app.baselibrary.commonUtil.BDttsUtils; import com.app.baselibrary.commonUtil.BDttsUtils;
import com.app.baselibrary.commonUtil.CheckUtil;
import com.app.baselibrary.commonUtil.LogUtil; import com.app.baselibrary.commonUtil.LogUtil;
import com.app.baselibrary.commonUtil.PreferencesUtils; import com.app.baselibrary.commonUtil.PreferencesUtils;
import com.oo.eye.EyeConfig; import com.oo.eye.EyeConfig;
...@@ -88,6 +89,8 @@ public class EyeTestActivity extends BaseActivity { ...@@ -88,6 +89,8 @@ public class EyeTestActivity extends BaseActivity {
private long mLastOnKeyTime = -1; private long mLastOnKeyTime = -1;
private boolean isStartTest = false; private boolean isStartTest = false;
private boolean isKeyDwon = false;
private long totalTime = 5000; private long totalTime = 5000;
private long intervalTime = 1000; private long intervalTime = 1000;
...@@ -145,9 +148,9 @@ public class EyeTestActivity extends BaseActivity { ...@@ -145,9 +148,9 @@ public class EyeTestActivity extends BaseActivity {
nameText.setText(""); nameText.setText("");
} }
if(index < mStudentList.size()-1){ if(index < mStudentList.size()-1){
mNextText.setVisibility(View.VISIBLE); mNextText.setText("放弃当前,跳到下一位");
}else{ }else{
mNextText.setVisibility(View.GONE); mNextText.setText("结束测试");
} }
continueTest(); continueTest();
} }
...@@ -158,6 +161,7 @@ public class EyeTestActivity extends BaseActivity { ...@@ -158,6 +161,7 @@ public class EyeTestActivity extends BaseActivity {
* @param isNewTest true 代表测试的第一只眼 代表左眼 false代表测量另一只眼 右眼 * @param isNewTest true 代表测试的第一只眼 代表左眼 false代表测量另一只眼 右眼
*/ */
private void resetView(final boolean isNewTest) { private void resetView(final boolean isNewTest) {
isKeyDwon = false;
mLevelIndex = -1; mLevelIndex = -1;
isSecondTest = !isNewTest; isSecondTest = !isNewTest;
String eye = isNewTest ? "右" : "左"; String eye = isNewTest ? "右" : "左";
...@@ -197,7 +201,6 @@ public class EyeTestActivity extends BaseActivity { ...@@ -197,7 +201,6 @@ public class EyeTestActivity extends BaseActivity {
} }
} }
mLevelIndex = Eye.getIndexByValue(e, true) - 1; mLevelIndex = Eye.getIndexByValue(e, true) - 1;
mEyeText.setText(""+e);
nextE(true); nextE(true);
} }
}.start(); }.start();
...@@ -215,36 +218,37 @@ public class EyeTestActivity extends BaseActivity { ...@@ -215,36 +218,37 @@ public class EyeTestActivity extends BaseActivity {
* @param e * @param e
*/ */
private void drewE(E e) { private void drewE(E e) {
int angle = 0;
LogUtil.e("getDirect:"+e.getDirect()); LogUtil.e("getDirect:"+e.getDirect());
eImageView1.setPivotX(eImageView1.getWidth()/2);
eImageView1.setPivotY(eImageView1.getHeight()/2);//支点在图片中心
switch (e.getDirect()){ switch (e.getDirect()){
case TOP: case TOP:
eImageView1.setRotation(0); angle = 0;
break; break;
case RIGHT_TOP: case RIGHT_TOP:
eImageView1.setRotation(45); angle = 45;
break; break;
case RIGHT: case RIGHT:
eImageView1.setRotation(90); angle = 90;
break; break;
case RIGHT_BOTTOM: case RIGHT_BOTTOM:
eImageView1.setRotation(135); angle = 135;
break; break;
case BOTTOM: case BOTTOM:
eImageView1.setRotation(180); angle = 180;
break; break;
case LEFT_BOTTOM: case LEFT_BOTTOM:
eImageView1.setRotation(225); angle = 225;
break; break;
case LEFT: case LEFT:
eImageView1.setRotation(270); angle = 270;
break; break;
case LEFT_TOP: case LEFT_TOP:
eImageView1.setRotation(315); angle = 315;
break; break;
} }
eImageView1.setImageResource(Eye.getBitmapRid(e.getLevel(),mDistance)); eImageView1.destroyDrawingCache();
eImageView1.setImageBitmap(Eye.getBitmap(this,e.getLevel(),mDistance,angle));
isKeyDwon = true;
} }
/** /**
...@@ -351,6 +355,7 @@ public class EyeTestActivity extends BaseActivity { ...@@ -351,6 +355,7 @@ public class EyeTestActivity extends BaseActivity {
* 下一个E字标 * 下一个E字标
*/ */
private void nextE(boolean isNextLine) { private void nextE(boolean isNextLine) {
try {
if (isNextLine) { if (isNextLine) {
mLevelIndex++; mLevelIndex++;
mLocation = 0; mLocation = 0;
...@@ -359,8 +364,18 @@ public class EyeTestActivity extends BaseActivity { ...@@ -359,8 +364,18 @@ public class EyeTestActivity extends BaseActivity {
} }
mSelectE = mList.get(mLevelIndex).get(mLocation); mSelectE = mList.get(mLevelIndex).get(mLocation);
mEyeText_.setText(""+(mLocation+1)); 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); drewE(mSelectE);
}catch (Exception e){
e.printStackTrace();
}
} }
/** /**
...@@ -423,8 +438,8 @@ public class EyeTestActivity extends BaseActivity { ...@@ -423,8 +438,8 @@ public class EyeTestActivity extends BaseActivity {
//如果错误次数超过一半 (默认位置时上一行没有数据时候)回退一行 //如果错误次数超过一半 (默认位置时上一行没有数据时候)回退一行
if (errorCount > verifyErrorCount) { if (errorCount > verifyErrorCount) {
//如果上一行数据不为空 结束测试 //如果上一行数据不为空 结束测试
if (mLevelIndex == 0 || (mCollect.containsKey(mLevelIndex - 1) && if (mLevelIndex == 0 ||
mCollect.get(mLevelIndex - 1) != null && mCollect.get(mLevelIndex - 1).size() > 0)) { (mCollect.containsKey(mLevelIndex - 1) && !CheckUtil.isEmpty(mCollect.get(mLevelIndex - 1)))) {
showResult(); showResult();
return; return;
} else { } else {
...@@ -481,9 +496,9 @@ public class EyeTestActivity extends BaseActivity { ...@@ -481,9 +496,9 @@ public class EyeTestActivity extends BaseActivity {
String nextName = ""; String nextName = "";
if (next < mStudentList.size()) { if (next < mStudentList.size()) {
isShow = true; isShow = true;
}else{
nextName = mStudentList.get(next).getRealname(); nextName = mStudentList.get(next).getRealname();
} }
mAfterTestDialog = new AfterTestDialog.Builder(EyeTestActivity.this,R.style.style_common_dialog) mAfterTestDialog = new AfterTestDialog.Builder(EyeTestActivity.this,R.style.style_common_dialog)
.setLeftEye(""+mLeftEye) .setLeftEye(""+mLeftEye)
.setRightEye(""+mRightEye) .setRightEye(""+mRightEye)
...@@ -514,6 +529,7 @@ public class EyeTestActivity extends BaseActivity { ...@@ -514,6 +529,7 @@ public class EyeTestActivity extends BaseActivity {
return true; return true;
} }
mLastOnKeyTime = currentTime; mLastOnKeyTime = currentTime;
if(isKeyDwon) {
switch (event.getKeyCode()) { switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_UP:
userChoose(TOP); userChoose(TOP);
...@@ -545,7 +561,7 @@ public class EyeTestActivity extends BaseActivity { ...@@ -545,7 +561,7 @@ public class EyeTestActivity extends BaseActivity {
return true; return true;
} }
return true; }
} }
return super.dispatchKeyEvent(event); return super.dispatchKeyEvent(event);
} }
...@@ -571,8 +587,16 @@ public class EyeTestActivity extends BaseActivity { ...@@ -571,8 +587,16 @@ public class EyeTestActivity extends BaseActivity {
@Override @Override
public boolean onTouchEvent(MotionEvent event) { public boolean onTouchEvent(MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_DOWN){ if(event.getAction() == MotionEvent.ACTION_DOWN){
//两次点击大于1秒
long currentTime = System.currentTimeMillis();
if (mLastOnKeyTime > 0 && currentTime - mLastOnKeyTime < 500) {
return true;
}
mLastOnKeyTime = currentTime;
if(isKeyDwon) {
userChooseError(); userChooseError();
} }
}
return super.onTouchEvent(event); return super.onTouchEvent(event);
} }
......
...@@ -15,6 +15,9 @@ import android.widget.RelativeLayout; ...@@ -15,6 +15,9 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.app.baselibrary.base.common.BaseActivity; 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.R;
import com.oo.eye.adapter.MorePeopleAdapter; import com.oo.eye.adapter.MorePeopleAdapter;
import com.oo.eye.adapter.PopuAdapter; import com.oo.eye.adapter.PopuAdapter;
...@@ -61,6 +64,8 @@ public class MorePeopleTestActivity extends BaseActivity { ...@@ -61,6 +64,8 @@ public class MorePeopleTestActivity extends BaseActivity {
LinearLayout mSeleteAreaLay; LinearLayout mSeleteAreaLay;
@BindView(R.id.key_test) @BindView(R.id.key_test)
EditText mKeyTest; EditText mKeyTest;
private List<StudentBean> mStudentBeans;
private MorePeopleAdapter mPeopleAdapter;
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
...@@ -70,13 +75,17 @@ public class MorePeopleTestActivity extends BaseActivity { ...@@ -70,13 +75,17 @@ public class MorePeopleTestActivity extends BaseActivity {
@Override @Override
protected void init() { protected void init() {
mRecycleView.setLayoutManager(new LinearLayoutManager(this)); mRecycleView.setLayoutManager(new LinearLayoutManager(this));
List<StudentBean> list = new ArrayList<>(); mStudentBeans = new ArrayList<>();
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
StudentBean studentBean = new StudentBean(); StudentBean studentBean = new StudentBean();
studentBean.setRealname("测试"+i); 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 @Override
...@@ -85,7 +94,7 @@ public class MorePeopleTestActivity extends BaseActivity { ...@@ -85,7 +94,7 @@ public class MorePeopleTestActivity extends BaseActivity {
ButterKnife.bind(this); 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) { public void onClick(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.selete_area_lay: case R.id.selete_area_lay:
...@@ -100,8 +109,20 @@ public class MorePeopleTestActivity extends BaseActivity { ...@@ -100,8 +109,20 @@ public class MorePeopleTestActivity extends BaseActivity {
case R.id.do_search: case R.id.do_search:
break; break;
case R.id.begin_test: case R.id.begin_test:
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); Intent intent = new Intent(this, TestListActivity.class);
startActivity(intent); startActivity(intent);
}else{
ToastUtil.showLongMessage("请选择测试人员");
}
break; break;
} }
} }
...@@ -128,7 +149,7 @@ public class MorePeopleTestActivity extends BaseActivity { ...@@ -128,7 +149,7 @@ public class MorePeopleTestActivity extends BaseActivity {
ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明 ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明
popupWindow.setBackgroundDrawable(cd); popupWindow.setBackgroundDrawable(cd);
ListView listView = (ListView) conview.findViewById(R.id.list_view); 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]; int[] location = new int[2];
view.getLocationOnScreen(location); view.getLocationOnScreen(location);
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效 // popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
......
package com.oo.eye.activity; 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 android.widget.TextView;
import com.app.baselibrary.base.common.BaseActivity; import com.app.baselibrary.base.common.BaseActivity;
import com.oo.eye.EyeConfig; import com.oo.eye.EyeConfig;
import com.oo.eye.R; import com.oo.eye.R;
import com.oo.eye.adapter.PopuAdapter;
import com.oo.eye.bean.StudentBean; import com.oo.eye.bean.StudentBean;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -20,6 +27,21 @@ import butterknife.OnClick; ...@@ -20,6 +27,21 @@ import butterknife.OnClick;
public class SinglePeopleTestActivity extends BaseActivity { public class SinglePeopleTestActivity extends BaseActivity {
@BindView(R.id.begin_test) @BindView(R.id.begin_test)
TextView mBeginTest; 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 @Override
protected int getLayoutId() { protected int getLayoutId() {
...@@ -28,16 +50,58 @@ public class SinglePeopleTestActivity extends BaseActivity { ...@@ -28,16 +50,58 @@ public class SinglePeopleTestActivity extends BaseActivity {
@Override @Override
protected void init() { 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) @OnClick({R.id.selete_area_lay, R.id.do_search, R.id.begin_test})
public void onClick() { 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<>(); ArrayList<StudentBean> list = new ArrayList<>();
StudentBean student = new StudentBean(); list.add(mStudentBean);
student.setRealname("游客");
list.add(student);
EyeConfig.getInstance().setStudents(list); EyeConfig.getInstance().setStudents(list);
startActivity(BeforeEyeTestActivity.class); 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; ...@@ -7,11 +7,11 @@ import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.app.baselibrary.base.common.BaseActivity; import com.app.baselibrary.base.common.BaseActivity;
import com.oo.eye.EyeConfig;
import com.oo.eye.R; import com.oo.eye.R;
import com.oo.eye.adapter.TestListAdapter; import com.oo.eye.adapter.TestListAdapter;
import com.oo.eye.bean.StudentBean; import com.oo.eye.bean.StudentBean;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import butterknife.BindView; import butterknife.BindView;
...@@ -38,17 +38,13 @@ public class TestListActivity extends BaseActivity { ...@@ -38,17 +38,13 @@ public class TestListActivity extends BaseActivity {
@Override @Override
protected void init() { protected void init() {
mRecycleView.setLayoutManager(new LinearLayoutManager(this)); mRecycleView.setLayoutManager(new LinearLayoutManager(this));
List<StudentBean> list = new ArrayList<>(); List<StudentBean> list = EyeConfig.getInstance().getStudents();
for (int i = 0; i < 10; i++) {
StudentBean chartsBean = new StudentBean();
list.add(chartsBean);
}
mRecycleView.setAdapter(new TestListAdapter(list, this)); mRecycleView.setAdapter(new TestListAdapter(list, this));
} }
@OnClick(R.id.begin_test) @OnClick(R.id.begin_test)
public void onClick() { public void onClick() {
Intent intent=new Intent(this,TestResurtListActivity.class); Intent intent=new Intent(this,EyeTestActivity.class);
startActivity(intent); startActivity(intent);
} }
} }
...@@ -132,7 +132,7 @@ public class TestResurtListActivity extends BaseActivity { ...@@ -132,7 +132,7 @@ public class TestResurtListActivity extends BaseActivity {
ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明 ColorDrawable cd = new ColorDrawable(0x00ffffff);// 背景颜色全透明
popupWindow.setBackgroundDrawable(cd); popupWindow.setBackgroundDrawable(cd);
ListView listView = (ListView) conview.findViewById(R.id.list_view); 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]; int[] location = new int[2];
view.getLocationOnScreen(location); view.getLocationOnScreen(location);
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效 // popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
......
package com.oo.eye.adapter; package com.oo.eye.adapter;
import android.content.Context; import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.app.baselibrary.recycler.adapter.BaseRecyclerViewAdapter; import com.app.baselibrary.recycler.adapter.BaseRecyclerViewAdapter;
import com.app.baselibrary.recycler.itemholder.ItemViewHolder; import com.app.baselibrary.recycler.itemholder.ItemViewHolder;
import com.oo.eye.R; import com.oo.eye.R;
import com.oo.eye.bean.ChartsBean;
import com.oo.eye.bean.StudentBean; import com.oo.eye.bean.StudentBean;
import java.util.List; import java.util.List;
...@@ -33,11 +33,23 @@ public class MorePeopleAdapter extends BaseRecyclerViewAdapter<StudentBean, Item ...@@ -33,11 +33,23 @@ public class MorePeopleAdapter extends BaseRecyclerViewAdapter<StudentBean, Item
} }
@Override @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() { holder.itemView.findViewById(R.id.choice_lay).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
studentBean.setChick(!studentBean.isChick());
notifyDataSetChanged();
} }
}); });
} }
...@@ -45,6 +57,6 @@ public class MorePeopleAdapter extends BaseRecyclerViewAdapter<StudentBean, Item ...@@ -45,6 +57,6 @@ public class MorePeopleAdapter extends BaseRecyclerViewAdapter<StudentBean, Item
@Override @Override
public int getItemCount() { public int getItemCount() {
return 10; return mList.size();
} }
} }
...@@ -10,6 +10,10 @@ import android.widget.ImageView; ...@@ -10,6 +10,10 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.oo.eye.R; import com.oo.eye.R;
import com.oo.eye.bean.PopuBean;
import java.util.ArrayList;
import java.util.List;
/** /**
* Date : 2018/8/31. * Date : 2018/8/31.
...@@ -18,9 +22,15 @@ import com.oo.eye.R; ...@@ -18,9 +22,15 @@ import com.oo.eye.R;
public class PopuAdapter extends BaseAdapter { public class PopuAdapter extends BaseAdapter {
private Context mContext; private Context mContext;
public PopuAdapter(Context context){ private List<PopuBean> mBeanList = new ArrayList<>();
mContext=context;
public PopuAdapter(Context context, List<PopuBean> beans) {
mContext = context;
if (beans != null) {
mBeanList = beans;
} }
}
@Override @Override
public int getCount() { public int getCount() {
return 6; return 6;
...@@ -42,6 +52,13 @@ public class PopuAdapter extends BaseAdapter { ...@@ -42,6 +52,13 @@ public class PopuAdapter extends BaseAdapter {
View view = inflater.inflate(R.layout.item_popu_more, null); View view = inflater.inflate(R.layout.item_popu_more, null);
final TextView textView = (TextView) view.findViewById(R.id.name_tv); final TextView textView = (TextView) view.findViewById(R.id.name_tv);
ImageView imageView = (ImageView) view.findViewById(R.id.choice_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]); // textView.setText(data[position]);
return view; return view;
} }
......
...@@ -3,11 +3,11 @@ package com.oo.eye.adapter; ...@@ -3,11 +3,11 @@ package com.oo.eye.adapter;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView;
import com.app.baselibrary.recycler.adapter.BaseRecyclerViewAdapter; import com.app.baselibrary.recycler.adapter.BaseRecyclerViewAdapter;
import com.app.baselibrary.recycler.itemholder.ItemViewHolder; import com.app.baselibrary.recycler.itemholder.ItemViewHolder;
import com.oo.eye.R; import com.oo.eye.R;
import com.oo.eye.bean.ChartsBean;
import com.oo.eye.bean.StudentBean; import com.oo.eye.bean.StudentBean;
import java.util.List; import java.util.List;
...@@ -17,8 +17,9 @@ import java.util.List; ...@@ -17,8 +17,9 @@ import java.util.List;
* Author: cxh * Author: cxh
*/ */
public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean,ItemViewHolder>{ public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean, ItemViewHolder> {
private final LayoutInflater mInflater; private final LayoutInflater mInflater;
public TestListAdapter(List<StudentBean> list, Context context) { public TestListAdapter(List<StudentBean> list, Context context) {
super(list, context); super(list, context);
mInflater = LayoutInflater.from(mContext); mInflater = LayoutInflater.from(mContext);
...@@ -31,12 +32,20 @@ public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean,ItemVie ...@@ -31,12 +32,20 @@ public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean,ItemVie
@Override @Override
public void onBindViewHolder(ItemViewHolder holder, int position) { 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 @Override
public int getItemCount() { public int getItemCount() {
return 10; return mList.size();
} }
} }
package com.oo.eye.bean; package com.oo.eye.bean;
import android.content.Context; 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.bean.BaseBean;
import com.app.baselibrary.commonUtil.DensityUtil; import com.app.baselibrary.commonUtil.DensityUtil;
import com.app.baselibrary.commonUtil.LogUtil;
import com.oo.eye.EyeConfig; import com.oo.eye.EyeConfig;
import com.oo.eye.R; import com.oo.eye.R;
...@@ -456,6 +460,17 @@ public class Eye extends BaseBean { ...@@ -456,6 +460,17 @@ public class Eye extends BaseBean {
return DensityUtil.px2dip(level); 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){ public static int getBitmapRid(int level,int distance){
int rid = R.drawable.p5c14; int rid = R.drawable.p5c14;
switch (distance){ 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 { ...@@ -20,6 +20,16 @@ public class StudentBean extends BaseBean {
private String url; private String url;
private String pid; private String pid;
private int distance;//测量距离 private int distance;//测量距离
private boolean isChick;
private String birthday;
public boolean isChick() {
return isChick;
}
public void setChick(boolean chick) {
isChick = chick;
}
public String getSid() { public String getSid() {
return sid; return sid;
...@@ -125,6 +135,14 @@ public class StudentBean extends BaseBean { ...@@ -125,6 +135,14 @@ public class StudentBean extends BaseBean {
this.distance = distance; this.distance = distance;
} }
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public StudentBean copy(){ public StudentBean copy(){
StudentBean student = new StudentBean(); StudentBean student = new StudentBean();
student.setSid(this.sid); student.setSid(this.sid);
...@@ -140,6 +158,7 @@ public class StudentBean extends BaseBean { ...@@ -140,6 +158,7 @@ public class StudentBean extends BaseBean {
student.setLeft_eye(this.left_eye); student.setLeft_eye(this.left_eye);
student.setRight_eye(this.right_eye); student.setRight_eye(this.right_eye);
student.setDistance(this.distance); student.setDistance(this.distance);
student.setBirthday(this.birthday);
return student; return student;
} }
......
...@@ -4,7 +4,6 @@ import android.app.Dialog; ...@@ -4,7 +4,6 @@ import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.WindowManager;
import android.widget.TextView; import android.widget.TextView;
import com.app.baselibrary.commonUtil.CheckUtil; import com.app.baselibrary.commonUtil.CheckUtil;
...@@ -49,7 +48,6 @@ public class AfterTestDialog extends Dialog{ ...@@ -49,7 +48,6 @@ public class AfterTestDialog extends Dialog{
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY);
setContentView(R.layout.dialog_after_eye_test); setContentView(R.layout.dialog_after_eye_test);
initView(); initView();
} }
...@@ -89,12 +87,26 @@ public class AfterTestDialog extends Dialog{ ...@@ -89,12 +87,26 @@ public class AfterTestDialog extends Dialog{
}else{ }else{
mNextName.setVisibility(View.GONE); mNextName.setVisibility(View.GONE);
} }
mUsername_tv.setText(userName); mUsername_tv.setText("姓 名:"+userName);
mLeftEye.setText(lefteye); mLeftEye.setText(lefteye);
mRightEye.setText(righteye); mRightEye.setText(righteye);
mTestTime.setText(mSimpleDateFormat.format(mDate)); 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 interface AfterTestListener {
public void onFinish(); public void onFinish();
public void onContinue(); 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 @@ ...@@ -38,10 +38,8 @@
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="放弃当前,跳到下一位"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_16" android:textSize="@dimen/sp_16"/>
android:visibility="gone"/>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_eye_test_center1" android:id="@+id/rl_eye_test_center1"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -20,6 +20,34 @@ ...@@ -20,6 +20,34 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_70" android:layout_marginTop="@dimen/dp_70"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/selete_area_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/selete_area_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="黄冈校区22323"
android:textColor="@color/white"
android:textSize="@dimen/sp_18" />
<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>
<LinearLayout
android:layout_marginLeft="@dimen/dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -59,6 +87,7 @@ ...@@ -59,6 +87,7 @@
android:textColor="@color/indicator_color" android:textColor="@color/indicator_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
</LinearLayout> </LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
android:background="@drawable/after_btn_bg" android:background="@drawable/after_btn_bg"
android:gravity="center" android:gravity="center"
android:text="生成测试队列" android:text="开始测试"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/sp_16" /> android:textSize="@dimen/sp_16" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="600dp"
android:layout_height="match_parent" android:layout_height="400dp"
android:background="@color/line_color" android:background="@color/line_color">
android:paddingBottom="@dimen/activity_vertical_margin" <LinearLayout
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<RelativeLayout
android:id="@+id/main_lay" android:id="@+id/main_lay"
android:layout_width="400dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:background="@color/white" android:background="@color/white"
android:orientation="vertical" android:orientation="vertical">
android:padding="@dimen/dp_20">
<TextView <TextView
android:id="@+id/tv_after_title" android:id="@+id/tv_after_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_20" android:layout_marginTop="@dimen/dp_20"
android:text="视力检测报告单" android:text="视力检测报告单"
android:textColor="@color/text_color" android:textColor="@color/text_color"
...@@ -33,11 +25,9 @@ ...@@ -33,11 +25,9 @@
android:id="@+id/tv_after_name" android:id="@+id/tv_after_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tv_after_title"
android:layout_marginLeft="@dimen/dp_30" android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_22" android:layout_marginTop="@dimen/dp_22"
android:gravity="center" android:gravity="center"
android:text="姓 名: 游客11"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="16dp" /> android:textSize="16dp" />
...@@ -45,8 +35,8 @@ ...@@ -45,8 +35,8 @@
android:id="@+id/test_result_lay" android:id="@+id/test_result_lay"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tv_after_name"
android:layout_marginLeft="@dimen/dp_30" android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
...@@ -64,7 +54,6 @@ ...@@ -64,7 +54,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8"
android:gravity="center" android:gravity="center"
android:text="5.1"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_28" /> android:textSize="@dimen/sp_28" />
...@@ -84,19 +73,20 @@ ...@@ -84,19 +73,20 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8"
android:gravity="center" android:gravity="center"
android:text="5.1"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_28" /> android:textSize="@dimen/sp_28" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_8">
<TextView <TextView
android:id="@+id/tv_after_time" android:id="@+id/tv_after_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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:gravity="center"
android:text="检测时间:" android:text="检测时间:"
android:textColor="@color/text_color" android:textColor="@color/text_color"
...@@ -106,20 +96,15 @@ ...@@ -106,20 +96,15 @@
android:id="@+id/tv_after_time_value" android:id="@+id/tv_after_time_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_8"
android:gravity="center" android:gravity="center"
android:text="2018-09-09 13:21:55"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="16dp" /> android:textSize="16dp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tv_after_time" android:layout_gravity="center_horizontal"
android:layout_centerHorizontal="true"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginTop="25dp"> android:layout_marginTop="25dp">
<TextView <TextView
...@@ -152,18 +137,17 @@ ...@@ -152,18 +137,17 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="15dp" /> android:textSize="15dp" />
</LinearLayout> </LinearLayout>
</RelativeLayout>
<TextView <TextView
android:layout_centerHorizontal="true" android:layout_gravity="center_horizontal"
android:layout_below="@+id/main_lay"
android:visibility="invisible"
android:id="@+id/tv_nest_name" android:id="@+id/tv_nest_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30" android:layout_marginTop="20dp"
android:layout_marginTop="@dimen/dp_20"
android:gravity="center" android:gravity="center"
android:text="下一位: 游客11" android:textColor="@color/text_color"
android:textColor="@color/white"
android:textSize="18dp" /> android:textSize="18dp" />
<View
android:layout_width="wrap_content"
android:layout_height="20dp"/>
</LinearLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="2016010101"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -45,7 +44,6 @@ ...@@ -45,7 +44,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="A组"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -67,7 +65,6 @@ ...@@ -67,7 +65,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="欧晓迪"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -89,7 +86,6 @@ ...@@ -89,7 +86,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="20160101"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
......
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
android:background="@color/line_color"></View> android:background="@color/line_color"></View>
<ImageView <ImageView
android:id="@+id/chick_iv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:src="@drawable/select2_sel" /> android:src="@drawable/select2_nor" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
...@@ -42,7 +43,6 @@ ...@@ -42,7 +43,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="2016010101"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="A组"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -86,7 +85,6 @@ ...@@ -86,7 +85,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="欧晓迪"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
...@@ -108,7 +106,6 @@ ...@@ -108,7 +106,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="20160101"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" /> android:textSize="@dimen/sp_18" />
......
...@@ -44,14 +44,22 @@ public abstract class BaseRecyclerViewAdapter<T, VH extends RecyclerView.ViewHol ...@@ -44,14 +44,22 @@ public abstract class BaseRecyclerViewAdapter<T, VH extends RecyclerView.ViewHol
* 父类的构造方法 * 父类的构造方法
*/ */
public BaseRecyclerViewAdapter(List<T> list) { public BaseRecyclerViewAdapter(List<T> list) {
appendToList(list); setList(list);
} }
public BaseRecyclerViewAdapter(List<T> list, Context context) { public BaseRecyclerViewAdapter(List<T> list, Context context) {
appendToList(list); setList(list);
mContext = context; 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