Commit 8bc0d070 by chengxiuhong

test main

parent 7614348f
......@@ -10,7 +10,12 @@ import com.oo.eye.bean.EyeHistroyBean;
public class EyeConfig {
public static final String EYE_SETTING_KEY = "eye_setting_key";
public static final String EYE_SETTING_KEY = "eye_setting_key";//小数法/五分法
public static final String EYE_DISTANCE_SETTING_KEY = "eye_distance_setting_key";//测试距离
public static final String EYE_DIRECTION_SETTING_KEY = "eye_direction_setting_key";//C字视标
public static final String EYE_WAIT_SETTING_KEY = "eye_setting_wait_key";//测视等待时长
public static final String EYE_REPORT_SETTING_KEY = "eye_report_setting_key";//检视报告
public static final String EYE_HELP_SETTING_KEY = "eye_setting_help_key";//测视帮助
private boolean isNetData = false;
......
......@@ -38,8 +38,36 @@ public class EyeSettingActivity extends BaseActivity {
RadioGroup mGroupHelp;
@BindView(R.id.about_lay_show)
RelativeLayout mAboutLayShow;
private int selectId;
@BindView(R.id.checkbox_decimal)
RadioButton mCheckboxDecimal;
@BindView(R.id.checkbox_number5)
RadioButton mCheckboxNumber5;
@BindView(R.id.checkbox_distance5)
RadioButton mCheckboxDistance5;
@BindView(R.id.checkbox_distance2)
RadioButton mCheckboxDistance2;
@BindView(R.id.checkbox_direction4)
RadioButton mCheckboxDirection4;
@BindView(R.id.checkbox_direction8)
RadioButton mCheckboxDirection8;
@BindView(R.id.checkbox_wait_3)
RadioButton mCheckboxWait3;
@BindView(R.id.checkbox_wait_5)
RadioButton mCheckboxWait5;
@BindView(R.id.checkbox_wait_8)
RadioButton mCheckboxWait8;
@BindView(R.id.checkbox_wait_10)
RadioButton mCheckboxWait10;
@BindView(R.id.checkbox_wait_no)
RadioButton mCheckboxWaitNo;
@BindView(R.id.checkbox_report)
RadioButton mCheckboxReport;
@BindView(R.id.checkbox_report_print)
RadioButton mCheckboxReportPrint;
@BindView(R.id.checkbox_help)
RadioButton mCheckboxHelp;
@BindView(R.id.checkbox_close_help)
RadioButton mCheckboxCloseHelp;
@Override
protected int getLayoutId() {
......@@ -60,15 +88,165 @@ public class EyeSettingActivity extends BaseActivity {
@Override
protected void init() {
selectId = PreferencesUtils.getInt(EyeConfig.EYE_SETTING_KEY, selectId);
for (int i = 0; i < mGroupDecimal.getChildCount(); i++) {
RadioButton rb = (RadioButton) mGroupDecimal.getChildAt(i);
if (rb.isChecked()) {
//txtSex.setText(rb.getText());
int selectId = PreferencesUtils.getInt(EyeConfig.EYE_SETTING_KEY, 1);
switch (selectId) {
case 0:
mCheckboxDecimal.setChecked(true);
break;
case 1:
mCheckboxNumber5.setChecked(true);
break;
}
//几分之
mGroupDecimal.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.checkbox_decimal:
PreferencesUtils.putInt(EyeConfig.EYE_SETTING_KEY, 0);
break;
case R.id.checkbox_number5:
PreferencesUtils.putInt(EyeConfig.EYE_SETTING_KEY, 5);
break;
}
}
});
//测试距离
int distance = PreferencesUtils.getInt(EyeConfig.EYE_DISTANCE_SETTING_KEY, 5);
switch (distance) {
case 2:
mCheckboxDistance2.setChecked(true);
break;
case 5:
mCheckboxDistance5.setChecked(true);
break;
}
mGroupDistance.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.checkbox_distance2:
PreferencesUtils.putInt(EyeConfig.EYE_DISTANCE_SETTING_KEY, 2);
break;
case R.id.checkbox_distance5:
PreferencesUtils.putInt(EyeConfig.EYE_DISTANCE_SETTING_KEY, 5);
break;
}
}
});
//C字视标
int direction = PreferencesUtils.getInt(EyeConfig.EYE_DIRECTION_SETTING_KEY, 4);
switch (direction) {
case 4:
mCheckboxDirection4.setChecked(true);
break;
case 8:
mCheckboxDirection8.setChecked(true);
break;
}
mGroupDirection.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.checkbox_direction4:
PreferencesUtils.putInt(EyeConfig.EYE_DIRECTION_SETTING_KEY, 4);
break;
case R.id.checkbox_direction8:
PreferencesUtils.putInt(EyeConfig.EYE_DIRECTION_SETTING_KEY, 8);
break;
}
}
});
//测视等待时长
int wait = PreferencesUtils.getInt(EyeConfig.EYE_WAIT_SETTING_KEY, 5);
switch (wait) {
case 3:
mCheckboxWait3.setChecked(true);
break;
case 5:
mCheckboxWait5.setChecked(true);
break;
case 8:
mCheckboxWait8.setChecked(true);
break;
case 10:
mCheckboxWait10.setChecked(true);
break;
case 0:
mCheckboxWaitNo.setChecked(true);
break;
}
mGroupWait.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.checkbox_wait_3:
PreferencesUtils.putInt(EyeConfig.EYE_WAIT_SETTING_KEY, 3);
break;
case R.id.checkbox_wait_5:
PreferencesUtils.putInt(EyeConfig.EYE_WAIT_SETTING_KEY, 5);
break;
case R.id.checkbox_wait_8:
PreferencesUtils.putInt(EyeConfig.EYE_WAIT_SETTING_KEY, 8);
break;
case R.id.checkbox_wait_10:
PreferencesUtils.putInt(EyeConfig.EYE_WAIT_SETTING_KEY, 10);
break;
case R.id.checkbox_wait_no:
PreferencesUtils.putInt(EyeConfig.EYE_WAIT_SETTING_KEY, 0);
break;
}
}
});
//检视报告
int report = PreferencesUtils.getInt(EyeConfig.EYE_REPORT_SETTING_KEY, 0);
switch (report) {
case 0:
mCheckboxReport.setChecked(true);
break;
case 1:
mCheckboxReportPrint.setChecked(true);
break;
}
mGroupReport.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.checkbox_report:
PreferencesUtils.putInt(EyeConfig.EYE_REPORT_SETTING_KEY, 0);
break;
case R.id.checkbox_report_print:
PreferencesUtils.putInt(EyeConfig.EYE_REPORT_SETTING_KEY, 1);
break;
}
}
});
//测视帮助
int help = PreferencesUtils.getInt(EyeConfig.EYE_HELP_SETTING_KEY, 0);
switch (help) {
case 0:
mCheckboxHelp.setChecked(true);
break;
case 1:
mCheckboxCloseHelp.setChecked(true);
break;
}
mGroupHelp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.checkbox_help:
PreferencesUtils.putInt(EyeConfig.EYE_HELP_SETTING_KEY, 0);
break;
case R.id.checkbox_close_help:
PreferencesUtils.putInt(EyeConfig.EYE_HELP_SETTING_KEY, 1);
break;
}
}
});
}
@Override
......@@ -78,8 +256,16 @@ public class EyeSettingActivity extends BaseActivity {
ButterKnife.bind(this);
}
@OnClick(R.id.about_lay)
public void onClick() {
mAboutLayShow.setVisibility(View.VISIBLE);
@OnClick({R.id.about_lay, R.id.close_lay})
public void onClick(View view) {
switch (view.getId()) {
case R.id.about_lay:
mAboutLayShow.setVisibility(View.VISIBLE);
break;
case R.id.close_lay:
mAboutLayShow.setVisibility(View.INVISIBLE);
break;
}
}
}
......@@ -162,6 +162,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="55dip"
android:layout_toRightOf="@+id/checkbox_decimal"
android:button="@drawable/checkbox"
android:paddingLeft="@dimen/sp_10"
......@@ -198,7 +199,8 @@
android:layout_centerVertical="true"
android:button="@drawable/checkbox"
android:paddingLeft="@dimen/sp_10"
android:text="小数法(1.0)"
android:text="5米(推荐)"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -245,6 +247,7 @@
android:button="@drawable/checkbox"
android:paddingLeft="@dimen/sp_10"
android:text="4个方向(快捷)"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -298,6 +301,7 @@
android:id="@+id/checkbox_wait_5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_35"
android:layout_toRightOf="@+id/checkbox_wait_3"
......@@ -375,6 +379,7 @@
android:layout_centerVertical="true"
android:button="@drawable/checkbox"
android:paddingLeft="@dimen/sp_10"
android:text="电子报告单"
android:textColor="@color/text_color"
android:textSize="@dimen/sp_18" />
......@@ -418,6 +423,7 @@
android:id="@+id/checkbox_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:button="@drawable/checkbox"
android:paddingLeft="@dimen/sp_10"
......@@ -447,17 +453,40 @@
</RelativeLayout>
<RelativeLayout
android:visibility="invisible"
android:id="@+id/about_lay_show"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e0000000">
android:background="#e0000000"
android:visibility="gone">
<LinearLayout
android:id="@+id/close_lay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:orientation="horizontal"
android:padding="@dimen/dp_20">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/close" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_6"
android:text="关闭"
android:textColor="@color/white"
android:textSize="@dimen/sp_15" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/dp_80"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_80"
android:orientation="vertical">
<ImageView
......@@ -505,12 +534,13 @@
android:layout_gravity="center_vertical"
android:src="@drawable/wingright" />
</LinearLayout>
<TextView
android:layout_marginTop="@dimen/dp_40"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_100"
android:layout_marginRight="@dimen/dp_100"
android:layout_marginTop="@dimen/dp_40"
android:text="北京星辰万有科技有限公司30多年来始终致力于视力保护研究工作,拥有多项专利领先技术,在视力保护科研领域获得不可撼动的地位。公司多年来持续与同仁医院多位专家密切合作,研究出大量科研成果。现将眼肌训练模式应用于高科技产品VR中,迭代出最新产品SeeX学视VR,带您走入教育3.0时代。"
android:textColor="@color/white"
android:textSize="20sp" />
......
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