Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haihang
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐丛奇
haihang
Commits
3daae609
Commit
3daae609
authored
Aug 29, 2018
by
chengxiuhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test main
parent
a298da3f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
208 additions
and
245 deletions
+208
-245
AfterEyeTestActivity.java
app/src/main/java/com/oo/eye/activity/AfterEyeTestActivity.java
+54
-129
BeforeEyeTestActivity.java
app/src/main/java/com/oo/eye/activity/BeforeEyeTestActivity.java
+74
-64
EyeTestActivity.java
app/src/main/java/com/oo/eye/activity/EyeTestActivity.java
+2
-2
SinglePeopleTestActivity.java
app/src/main/java/com/oo/eye/activity/SinglePeopleTestActivity.java
+1
-0
guide.png
app/src/main/res/drawable-hdpi/guide.png
+0
-0
copy.png
app/src/main/res/drawable-xxhdpi/copy.png
+0
-0
after_btn_bg.xml
app/src/main/res/drawable/after_btn_bg.xml
+2
-2
circle_white_bg.xml
app/src/main/res/drawable/circle_white_bg.xml
+2
-0
activity_after_eye_test.xml
app/src/main/res/layout/activity_after_eye_test.xml
+0
-0
activity_before_eye_test.xml
app/src/main/res/layout/activity_before_eye_test.xml
+53
-31
activity_eye_test.xml
app/src/main/res/layout/activity_eye_test.xml
+0
-0
activity_eye_test_main.xml
app/src/main/res/layout/activity_eye_test_main.xml
+8
-8
activity_morepeople.xml
app/src/main/res/layout/activity_morepeople.xml
+4
-3
activity_singletest.xml
app/src/main/res/layout/activity_singletest.xml
+4
-3
activity_testresult.xml
app/src/main/res/layout/activity_testresult.xml
+4
-3
No files found.
app/src/main/java/com/oo/eye/activity/AfterEyeTestActivity.java
View file @
3daae609
package
com
.
oo
.
eye
.
activity
;
package
com
.
oo
.
eye
.
activity
;
import
android.bluetooth.BluetoothAdapter
;
import
android.os.Bundle
;
import
android.os.BatteryManager
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.TextClock
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.app.baselibrary.base.common.BaseActivity
;
import
com.app.baselibrary.base.common.BaseActivity
;
...
@@ -21,49 +18,38 @@ import com.oo.eye.bean.EyeHistroyBean;
...
@@ -21,49 +18,38 @@ import com.oo.eye.bean.EyeHistroyBean;
import
com.oo.eye.manager.DaemonSender
;
import
com.oo.eye.manager.DaemonSender
;
import
com.oo.eye.mvp.PresenterFactory
;
import
com.oo.eye.mvp.PresenterFactory
;
import
com.oo.eye.mvp.contract.EyeTestContract
;
import
com.oo.eye.mvp.contract.EyeTestContract
;
import
com.oo.seex.sys_state.Config
;
import
com.oo.seex.sys_state.StateListener
;
import
com.oo.seex.sys_state.state.bean.BaseState
;
import
com.oo.seex.sys_state.state.bean.BatteryState
;
import
com.oo.seex.sys_state.state.bean.BluetoothState
;
import
com.oo.seex.sys_state.state.bean.WifiState
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
butterknife.OnClick
;
/**
/**
*/
*/
public
class
AfterEyeTestActivity
extends
BaseActivity
implements
StateListener
,
EyeTestContract
.
View
{
public
class
AfterEyeTestActivity
extends
BaseActivity
implements
EyeTestContract
.
View
{
@BindView
(
R
.
id
.
tv_after_title
)
TextView
mTvAfterTitle
;
@BindView
(
R
.
id
.
tv_after_name
)
TextView
mTvAfterName
;
@BindView
(
R
.
id
.
tv_after_time
)
TextView
mTvAfterTime
;
@BindView
(
R
.
id
.
tv_after_save
)
TextView
mTvAfterSave
;
@BindView
(
R
.
id
.
tv_after_give_up
)
TextView
mTvAfterGiveUp
;
@BindView
(
R
.
id
.
tv_after_result_left
)
TextView
mTvAfterResultLeft
;
@BindView
(
R
.
id
.
tv_after_result_right
)
TextView
mTvAfterResultRight
;
private
EyeTestContract
.
Presenter
mPresenter
;
private
EyeTestContract
.
Presenter
mPresenter
;
@BindView
(
R2
.
id
.
system_time_tv
)
TextClock
mSystemTimeTv
;
@BindView
(
R2
.
id
.
bluetooth_img
)
ImageView
mBluetoothImg
;
@BindView
(
R2
.
id
.
wifi_img
)
ImageView
mWifiImg
;
@BindView
(
R2
.
id
.
battery_img
)
ImageView
mBatteryImg
;
@BindView
(
R2
.
id
.
battery_tv
)
TextView
mBatteryTv
;
@BindView
(
R2
.
id
.
tv_after_lift
)
TextView
mLiftTv
;
@BindView
(
R2
.
id
.
tv_after_name
)
TextView
mNameTv
;
@BindView
(
R2
.
id
.
tv_after_result
)
TextView
mResultTv
;
private
EyeHistroyBean
mEyeTestBean
;
private
EyeHistroyBean
mEyeTestBean
;
private
double
mLeftEye
;
private
double
mLeftEye
;
private
double
mRightEye
;
private
double
mRightEye
;
private
int
mLeftLine
;
private
int
mLeftLine
;
private
int
mRightLine
;
private
int
mRightLine
;
@Override
@Override
protected
int
getLayoutId
()
{
protected
int
getLayoutId
()
{
return
R
.
layout
.
activity_after_eye_test
;
return
R
.
layout
.
activity_after_eye_test
;
...
@@ -74,37 +60,36 @@ public class AfterEyeTestActivity extends BaseActivity implements StateListener,
...
@@ -74,37 +60,36 @@ public class AfterEyeTestActivity extends BaseActivity implements StateListener,
PresenterFactory
.
createEyeTestPresenter
(
this
);
PresenterFactory
.
createEyeTestPresenter
(
this
);
DaemonSender
.
closeEyeTest
(
this
);
DaemonSender
.
closeEyeTest
(
this
);
mEyeTestBean
=
EyeConfig
.
getInstance
().
getCuurentBean
();
mEyeTestBean
=
EyeConfig
.
getInstance
().
getCuurentBean
();
if
(
mEyeTestBean
==
null
)
{
if
(
mEyeTestBean
==
null
)
{
mEyeTestBean
=
new
EyeHistroyBean
();
mEyeTestBean
=
new
EyeHistroyBean
();
mEyeTestBean
.
setType
(
2
);
mEyeTestBean
.
setType
(
2
);
}
}
mLeftEye
=
getIntent
().
getDoubleExtra
(
"leftEye"
,
0
);
mLeftEye
=
getIntent
().
getDoubleExtra
(
"leftEye"
,
0
);
mRightEye
=
getIntent
().
getDoubleExtra
(
"rightEye"
,
0
);
mRightEye
=
getIntent
().
getDoubleExtra
(
"rightEye"
,
0
);
mLeftLine
=
getIntent
().
getIntExtra
(
"leftLine"
,
0
);
mLeftLine
=
getIntent
().
getIntExtra
(
"leftLine"
,
0
);
mRightLine
=
getIntent
().
getIntExtra
(
"rightLine"
,
0
);
mRightLine
=
getIntent
().
getIntExtra
(
"rightLine"
,
0
);
if
(
mEyeTestBean
!=
null
&&
mEyeTestBean
.
getLeft_eye
()
>
0
&&
mEyeTestBean
.
getRight_eye
()
>
0
)
{
if
(
mEyeTestBean
!=
null
&&
mEyeTestBean
.
getLeft_eye
()
>
0
&&
mEyeTestBean
.
getRight_eye
()
>
0
)
{
double
left
=
CalculateUtils
.
sub
(
mLeftEye
,
mEyeTestBean
.
getLeft_eye
(),
1
);
double
left
=
CalculateUtils
.
sub
(
mLeftEye
,
mEyeTestBean
.
getLeft_eye
(),
1
);
double
right
=
CalculateUtils
.
sub
(
mRightEye
,
mEyeTestBean
.
getRight_eye
(),
1
);
double
right
=
CalculateUtils
.
sub
(
mRightEye
,
mEyeTestBean
.
getRight_eye
(),
1
);
int
count
=
(
int
)
CalculateUtils
.
add
(
CalculateUtils
.
mul
(
left
,
10
,
1
),
int
count
=
(
int
)
CalculateUtils
.
add
(
CalculateUtils
.
mul
(
left
,
10
,
1
),
CalculateUtils
.
mul
(
right
,
10
,
1
),
1
);
CalculateUtils
.
mul
(
right
,
10
,
1
),
1
);
String
text
=
"少于1"
;
String
text
=
"少于1"
;
if
(
count
>
0
){
if
(
count
>
0
)
{
text
=
count
+
""
;
text
=
count
+
""
;
}
}
mLiftTv
.
setText
(
getString
(
R
.
string
.
after_eye_test_prompt1
,
""
+
text
));
}
}
else
{
mTvAfterName
.
setText
(
getString
(
R
.
string
.
after_eye_test_name
,
EyeConfig
.
getInstance
().
getName
())
mLiftTv
.
setText
(
getString
(
R
.
string
.
after_eye_test_prompt2
));
+
"(用户"
+
SnUtils
.
getSN
()
+
")"
);
}
int
selectId
=
PreferencesUtils
.
getInt
(
EyeConfig
.
EYE_SETTING_KEY
,
0
);
mNameTv
.
setText
(
getString
(
R
.
string
.
after_eye_test_name
,
EyeConfig
.
getInstance
().
getName
())
+
"(用户"
+
SnUtils
.
getSN
()+
")"
);
int
selectId
=
PreferencesUtils
.
getInt
(
EyeConfig
.
EYE_SETTING_KEY
,
0
);
String
text
=
String
.
valueOf
(
mLeftEye
)
+
" | "
+
String
.
valueOf
(
mRightEye
);
String
text
=
String
.
valueOf
(
mLeftEye
)
+
" | "
+
String
.
valueOf
(
mRightEye
);
if
(
selectId
==
1
)
{
if
(
selectId
==
1
)
{
text
=
String
.
valueOf
(
Eye
.
transformSmall
(
mLeftEye
))
+
" | "
text
=
String
.
valueOf
(
Eye
.
transformSmall
(
mLeftEye
))
+
" | "
+
String
.
valueOf
(
Eye
.
transformSmall
(
mRightEye
));
+
String
.
valueOf
(
Eye
.
transformSmall
(
mRightEye
));
}
}
mResultTv
.
setText
(
getString
(
R
.
string
.
after_eye_test_result
,
text
));
mTvAfterResultLeft
.
setText
(
mLeftEye
+
""
);
mTvAfterResultRight
.
setText
(
mRightEye
+
""
);
}
}
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
NibiruUtils
.
switchVR
(
false
);
NibiruUtils
.
switchVR
(
false
);
...
@@ -117,101 +102,41 @@ public class AfterEyeTestActivity extends BaseActivity implements StateListener,
...
@@ -117,101 +102,41 @@ public class AfterEyeTestActivity extends BaseActivity implements StateListener,
}
}
@OnClick
(
R2
.
id
.
tv_after_save
)
@OnClick
(
R2
.
id
.
tv_after_save
)
void
onClickSave
(
View
view
)
{
void
onClickSave
(
View
view
)
{
mPresenter
.
postEyeTestData
(
this
,
SnUtils
.
getSN
(),
mPresenter
.
postEyeTestData
(
this
,
SnUtils
.
getSN
(),
mLeftEye
,
mRightEye
,
mLeftLine
,
mRightLine
);
mLeftEye
,
mRightEye
,
mLeftLine
,
mRightLine
);
}
}
@OnClick
(
R2
.
id
.
tv_after_give_up
)
@OnClick
(
R2
.
id
.
tv_after_give_up
)
void
onClickGiveUp
(
View
view
)
{
void
onClickGiveUp
(
View
view
)
{
finish
();
finish
();
}
}
public
void
setPresenter
(
EyeTestContract
.
Presenter
presenter
)
{
public
void
setPresenter
(
EyeTestContract
.
Presenter
presenter
)
{
mPresenter
=
presenter
;
mPresenter
=
presenter
;
}
}
public
void
postEyeTestDataSuccee
()
{
public
void
postEyeTestDataSuccee
()
{
mEyeTestBean
.
setLeft_eye
(
mLeftEye
);
mEyeTestBean
.
setLeft_eye
(
mLeftEye
);
mEyeTestBean
.
setRight_eye
(
mRightEye
);
mEyeTestBean
.
setRight_eye
(
mRightEye
);
mEyeTestBean
.
setLeft_line
(
mLeftLine
);
mEyeTestBean
.
setLeft_line
(
mLeftLine
);
mEyeTestBean
.
setRight_line
(
mRightLine
);
mEyeTestBean
.
setRight_line
(
mRightLine
);
EyeConfig
.
getInstance
().
setCuurentBean
(
mEyeTestBean
);
EyeConfig
.
getInstance
().
setCuurentBean
(
mEyeTestBean
);
if
(
EyeConfig
.
getInstance
().
getInitBean
()
==
null
)
{
if
(
EyeConfig
.
getInstance
().
getInitBean
()
==
null
)
{
EyeConfig
.
getInstance
().
setInitBean
(
mEyeTestBean
);
EyeConfig
.
getInstance
().
setInitBean
(
mEyeTestBean
);
}
}
ToastUtil
.
showLongMessage
(
"数据保存成功"
);
ToastUtil
.
showLongMessage
(
"数据保存成功"
);
finish
();
finish
();
}
}
public
void
postEyeTestDataFail
(
String
msg
){
public
void
postEyeTestDataFail
(
String
msg
)
{
ToastUtil
.
showLongMessage
(
"数据保存失败,请重试"
);
ToastUtil
.
showLongMessage
(
"数据保存失败,请重试"
);
}
}
@Override
@Override
public
void
onSysStateChange
(
int
flag
,
BaseState
state
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
switch
(
flag
)
{
super
.
onCreate
(
savedInstanceState
);
case
Config
.
FLAG_BATTERY_STATE
:
// TODO: add setContentView(...) invocation
BatteryState
batteryState
=
(
BatteryState
)
state
;
ButterKnife
.
bind
(
this
);
if
(
mBatteryTv
!=
null
)
mBatteryTv
.
setText
(
batteryState
.
getLevel
()
+
"%"
);
if
(
batteryState
.
getStatus
()
==
BatteryManager
.
BATTERY_STATUS_CHARGING
)
{
mBatteryImg
.
setImageResource
(
R
.
mipmap
.
power_1
);
}
else
{
if
(
batteryState
.
getLevel
()
<
20
)
{
mBatteryImg
.
setImageResource
(
R
.
mipmap
.
power_4
);
}
else
if
(
batteryState
.
getLevel
()
<
80
)
{
mBatteryImg
.
setImageResource
(
R
.
mipmap
.
power_3
);
}
else
{
mBatteryImg
.
setImageResource
(
R
.
mipmap
.
power_2
);
}
}
break
;
case
Config
.
FLAG_BLUETOOTH_STATE
:
BluetoothState
bluetoothState
=
(
BluetoothState
)
state
;
mBluetoothImg
.
setVisibility
(
View
.
VISIBLE
);
switch
(
bluetoothState
.
getState
())
{
case
BluetoothAdapter
.
STATE_ON
:
mBluetoothImg
.
setImageResource
(
R
.
mipmap
.
bluetooth_1
);
break
;
case
BluetoothAdapter
.
STATE_OFF
:
mBluetoothImg
.
setVisibility
(
View
.
GONE
);
break
;
case
BluetoothAdapter
.
STATE_TURNING_OFF
:
mBluetoothImg
.
setImageResource
(
R
.
mipmap
.
bluetooth_2
);
break
;
case
BluetoothAdapter
.
STATE_TURNING_ON
:
mBluetoothImg
.
setImageResource
(
R
.
mipmap
.
bluetooth_2
);
break
;
}
break
;
case
Config
.
FLAG_TIME_STATE
:
break
;
case
Config
.
FLAG_WIFI_STATE
:
WifiState
wifiState
=
(
WifiState
)
state
;
mWifiImg
.
setImageResource
(
R
.
mipmap
.
wifi_4
);
mWifiImg
.
setVisibility
(
wifiState
.
isOpen
()
?
View
.
VISIBLE
:
View
.
GONE
);
if
(
wifiState
.
isOpen
())
{
if
(!
wifiState
.
isConnect
())
{
mWifiImg
.
setImageResource
(
R
.
mipmap
.
wifi_3
);
}
else
{
switch
(
wifiState
.
getStrength
())
{
case
0
:
case
1
:
case
2
:
mWifiImg
.
setImageResource
(
R
.
mipmap
.
wifi_2
);
break
;
case
3
:
case
4
:
mWifiImg
.
setImageResource
(
R
.
mipmap
.
wifi_1
);
break
;
}
}
}
break
;
}
}
}
}
}
app/src/main/java/com/oo/eye/activity/BeforeEyeTestActivity.java
View file @
3daae609
...
@@ -5,9 +5,11 @@ import android.content.Context;
...
@@ -5,9 +5,11 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.content.IntentFilter
;
import
android.net.ConnectivityManager
;
import
android.net.ConnectivityManager
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
com.app.baselibrary.base.common.BaseActivity
;
import
com.app.baselibrary.base.common.BaseActivity
;
import
com.app.baselibrary.commonUtil.LogUtil
;
import
com.app.baselibrary.commonUtil.LogUtil
;
...
@@ -18,6 +20,7 @@ import com.oo.eye.manager.DaemonSender;
...
@@ -18,6 +20,7 @@ import com.oo.eye.manager.DaemonSender;
import
com.oo.eye.manager.OOMsg
;
import
com.oo.eye.manager.OOMsg
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
butterknife.OnClick
;
...
@@ -26,17 +29,15 @@ import butterknife.OnClick;
...
@@ -26,17 +29,15 @@ import butterknife.OnClick;
public
class
BeforeEyeTestActivity
extends
BaseActivity
{
public
class
BeforeEyeTestActivity
extends
BaseActivity
{
@BindView
(
R2
.
id
.
ll_before_eye_start1
)
@BindView
(
R
.
id
.
ll_before_eye_start1
)
LinearLayout
startLayout1
;
RelativeLayout
mLlBeforeEyeStart1
;
@BindView
(
R
.
id
.
ll_before_eye_prepare1
)
@BindView
(
R2
.
id
.
ll_before_eye_prepare1
)
LinearLayout
mLlBeforeEyePrepare1
;
LinearLayout
prepareLayout1
;
// private DaemonReceiver mDaemonReceiver;
private
DaemonReceiver
mDaemonReceiver
;
private
ActionReceiver
mActionReceiver
;
private
ActionReceiver
mActionReceiver
;
private
Handler
mHandler
;
private
Handler
mHandler
;
@Override
@Override
protected
int
getLayoutId
()
{
protected
int
getLayoutId
()
{
...
@@ -46,8 +47,8 @@ public class BeforeEyeTestActivity extends BaseActivity {
...
@@ -46,8 +47,8 @@ public class BeforeEyeTestActivity extends BaseActivity {
@Override
@Override
protected
void
init
()
{
protected
void
init
()
{
mHandler
=
new
Handler
();
mHandler
=
new
Handler
();
mDaemonReceiver
=
new
DaemonReceiver
();
//
mDaemonReceiver = new DaemonReceiver();
mDaemonReceiver
.
registerScreenActionReceiver
(
this
);
//
mDaemonReceiver.registerScreenActionReceiver(this);
mActionReceiver
=
new
ActionReceiver
();
mActionReceiver
=
new
ActionReceiver
();
mActionReceiver
.
registerScreenActionReceiver
(
this
);
mActionReceiver
.
registerScreenActionReceiver
(
this
);
DaemonSender
.
startEyeTest
(
this
);
DaemonSender
.
startEyeTest
(
this
);
...
@@ -63,65 +64,73 @@ public class BeforeEyeTestActivity extends BaseActivity {
...
@@ -63,65 +64,73 @@ public class BeforeEyeTestActivity extends BaseActivity {
protected
void
onDestroy
()
{
protected
void
onDestroy
()
{
super
.
onDestroy
();
super
.
onDestroy
();
DaemonSender
.
closeEyeTestMotor
(
this
);
DaemonSender
.
closeEyeTestMotor
(
this
);
if
(
mDaemonReceiver
!=
null
)
{
// if (mDaemonReceiver != null)
{
mDaemonReceiver
.
unRegisterScreenActionReceiver
(
this
);
//
mDaemonReceiver.unRegisterScreenActionReceiver(this);
}
//
}
if
(
mActionReceiver
!=
null
)
{
if
(
mActionReceiver
!=
null
)
{
mActionReceiver
.
unRegisterScreenActionReceiver
(
this
);
mActionReceiver
.
unRegisterScreenActionReceiver
(
this
);
}
}
}
}
@OnClick
(
R2
.
id
.
tv_eye_test_start1
)
@OnClick
(
R2
.
id
.
tv_eye_test_start1
)
public
void
click
(
View
view
)
{
public
void
click
(
View
view
)
{
startLayou
t1
.
setVisibility
(
View
.
GONE
);
mLlBeforeEyeStar
t1
.
setVisibility
(
View
.
GONE
);
prepareLayout
1
.
setVisibility
(
View
.
VISIBLE
);
mLlBeforeEyePrepare
1
.
setVisibility
(
View
.
VISIBLE
);
speak
(
"调节测视距离,请等待"
);
speak
(
"调节测视距离,请等待"
);
DaemonSender
.
startEyeTestMotor
(
this
);
// DaemonSender.startEyeTestMotor(this);
// Intent intent2 = new Intent(BeforeEyeTestActivity.this,EyeTestActivity.class);
// startActivity(intent2);
// finish();
}
public
class
DaemonReceiver
extends
BroadcastReceiver
{
private
boolean
isRegisterReceiver
=
false
;
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
if
(
intent
!=
null
){
int
type
=
intent
.
getIntExtra
(
OOMsg
.
ARG_SEEX_ACTION
,
0
);
switch
(
type
){
case
OOMsg
.
EYE_TEST_MOTOR_FINISH
:
mHandler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
Intent
intent2
=
new
Intent
(
BeforeEyeTestActivity
.
this
,
EyeTestActivity
.
class
);
Intent
intent2
=
new
Intent
(
BeforeEyeTestActivity
.
this
,
EyeTestActivity
.
class
);
startActivity
(
intent2
);
startActivity
(
intent2
);
finish
();
finish
();
}
}
},
1000
);
break
;
}
}
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
registerScreenActionReceiver
(
Context
mContext
)
{
super
.
onCreate
(
savedInstanceState
);
if
(!
isRegisterReceiver
)
{
// TODO: add setContentView(...) invocation
isRegisterReceiver
=
true
;
ButterKnife
.
bind
(
this
);
}
IntentFilter
filter
=
new
IntentFilter
();
filter
.
addAction
(
OOMsg
.
OO_INTENT_ACTION
);
// public class DaemonReceiver extends BroadcastReceiver {
mContext
.
registerReceiver
(
DaemonReceiver
.
this
,
filter
);
// private boolean isRegisterReceiver = false;
}
//
}
// @Override
// public void onReceive(Context context, Intent intent) {
public
void
unRegisterScreenActionReceiver
(
Context
mContext
)
{
// if (intent != null) {
if
(
isRegisterReceiver
)
{
// int type = intent.getIntExtra(OOMsg.ARG_SEEX_ACTION, 0);
isRegisterReceiver
=
false
;
// switch (type) {
mContext
.
unregisterReceiver
(
DaemonReceiver
.
this
);
// case OOMsg.EYE_TEST_MOTOR_FINISH:
}
// mHandler.postDelayed(new Runnable() {
}
// @Override
}
// public void run() {
// Intent intent2 = new Intent(BeforeEyeTestActivity.this, EyeTestActivity.class);
// startActivity(intent2);
// finish();
// }
// }, 1000);
// break;
// }
//
// }
//
// }
//
// public void registerScreenActionReceiver(Context mContext) {
// if (!isRegisterReceiver) {
// isRegisterReceiver = true;
//
// IntentFilter filter = new IntentFilter();
// filter.addAction(OOMsg.OO_INTENT_ACTION);
// mContext.registerReceiver(DaemonReceiver.this, filter);
// }
// }
//
// public void unRegisterScreenActionReceiver(Context mContext) {
// if (isRegisterReceiver) {
// isRegisterReceiver = false;
// mContext.unregisterReceiver(DaemonReceiver.this);
// }
// }
// }
class
ActionReceiver
extends
BroadcastReceiver
{
class
ActionReceiver
extends
BroadcastReceiver
{
...
@@ -134,11 +143,11 @@ public class BeforeEyeTestActivity extends BaseActivity {
...
@@ -134,11 +143,11 @@ public class BeforeEyeTestActivity extends BaseActivity {
LogUtil
.
e
(
TAG
,
"action..."
+
action
);
LogUtil
.
e
(
TAG
,
"action..."
+
action
);
if
(
action
.
equals
(
Intent
.
ACTION_SCREEN_OFF
))
{
if
(
action
.
equals
(
Intent
.
ACTION_SCREEN_OFF
))
{
//如果,灭屏,就进行暂停操作。
//如果,灭屏,就进行暂停操作。
startLayou
t1
.
setVisibility
(
View
.
VISIBLE
);
mLlBeforeEyeStar
t1
.
setVisibility
(
View
.
VISIBLE
);
prepareLayout
1
.
setVisibility
(
View
.
GONE
);
mLlBeforeEyePrepare
1
.
setVisibility
(
View
.
GONE
);
}
else
if
(
action
.
equals
(
Intent
.
ACTION_SCREEN_ON
))
{
}
else
if
(
action
.
equals
(
Intent
.
ACTION_SCREEN_ON
))
{
startLayou
t1
.
setVisibility
(
View
.
VISIBLE
);
mLlBeforeEyeStar
t1
.
setVisibility
(
View
.
VISIBLE
);
prepareLayout
1
.
setVisibility
(
View
.
GONE
);
mLlBeforeEyePrepare
1
.
setVisibility
(
View
.
GONE
);
}
}
}
}
...
@@ -164,8 +173,9 @@ public class BeforeEyeTestActivity extends BaseActivity {
...
@@ -164,8 +173,9 @@ public class BeforeEyeTestActivity extends BaseActivity {
}
}
}
}
}
}
private
void
speak
(
String
text
){
DaemonSender
.
sendDBTTS
(
this
,
text
);
private
void
speak
(
String
text
)
{
DaemonSender
.
sendDBTTS
(
this
,
text
);
}
}
...
...
app/src/main/java/com/oo/eye/activity/EyeTestActivity.java
View file @
3daae609
...
@@ -42,7 +42,7 @@ public class EyeTestActivity extends BaseActivity{
...
@@ -42,7 +42,7 @@ public class EyeTestActivity extends BaseActivity{
private
E
mSelectE
;
private
E
mSelectE
;
@BindView
(
R2
.
id
.
rl_eye_test_center_time1
)
@BindView
(
R2
.
id
.
rl_eye_test_center_time1
)
Linear
Layout
timeLayout1
;
Relative
Layout
timeLayout1
;
@BindView
(
R2
.
id
.
tv_eye_test_center_time1
)
@BindView
(
R2
.
id
.
tv_eye_test_center_time1
)
TextView
timeText1
;
TextView
timeText1
;
...
@@ -59,7 +59,7 @@ public class EyeTestActivity extends BaseActivity{
...
@@ -59,7 +59,7 @@ public class EyeTestActivity extends BaseActivity{
View
maskView2
;
View
maskView2
;
@BindView
(
R2
.
id
.
rl_eye_test_center_time2
)
@BindView
(
R2
.
id
.
rl_eye_test_center_time2
)
Linear
Layout
timeLayout2
;
Relative
Layout
timeLayout2
;
@BindView
(
R2
.
id
.
tv_eye_test_center_time2
)
@BindView
(
R2
.
id
.
tv_eye_test_center_time2
)
TextView
timeText2
;
TextView
timeText2
;
...
...
app/src/main/java/com/oo/eye/activity/SinglePeopleTestActivity.java
View file @
3daae609
...
@@ -38,5 +38,6 @@ public class SinglePeopleTestActivity extends BaseActivity {
...
@@ -38,5 +38,6 @@ public class SinglePeopleTestActivity extends BaseActivity {
@OnClick
(
R
.
id
.
begin_test
)
@OnClick
(
R
.
id
.
begin_test
)
public
void
onClick
()
{
public
void
onClick
()
{
startActivity
(
BeforeEyeTestActivity
.
class
);
}
}
}
}
app/src/main/res/drawable-
x
hdpi/guide.png
→
app/src/main/res/drawable-hdpi/guide.png
View file @
3daae609
File moved
app/src/main/res/drawable-xhdpi/copy.png
→
app/src/main/res/drawable-x
x
hdpi/copy.png
View file @
3daae609
File moved
app/src/main/res/drawable/after_btn_bg.xml
View file @
3daae609
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_pressed=
"true"
>
<item
android:state_pressed=
"true"
>
<shape>
<shape>
<solid
android:color=
"
@color/gray_white
"
/>
<solid
android:color=
"
#205B64
"
/>
<corners
android:radius=
"@dimen/dp_4"
/>
<corners
android:radius=
"@dimen/dp_4"
/>
</shape>
</shape>
</item>
</item>
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<item>
<item>
<shape>
<shape>
<solid
android:color=
"@color/
gray_white
"
/>
<solid
android:color=
"@color/
e_test_color
"
/>
<corners
android:radius=
"@dimen/dp_4"
/>
<corners
android:radius=
"@dimen/dp_4"
/>
</shape>
</shape>
</item>
</item>
...
...
app/src/main/res/drawable/circle_white_bg.xml
View file @
3daae609
...
@@ -8,4 +8,5 @@
...
@@ -8,4 +8,5 @@
<size
android:width=
"50dp"
<size
android:width=
"50dp"
android:height=
"50dp"
/>
android:height=
"50dp"
/>
<stroke
android:color=
"@color/text_color"
android:width=
"1px"
></stroke>
</shape>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_after_eye_test.xml
View file @
3daae609
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_before_eye_test.xml
View file @
3daae609
...
@@ -2,65 +2,87 @@
...
@@ -2,65 +2,87 @@
<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=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/line_color"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:paddingTop=
"@dimen/activity_vertical_margin"
android:paddingBottom=
"@dimen/activity_vertical_margin"
android:paddingBottom=
"@dimen/activity_vertical_margin"
android:paddingLeft=
"@dimen/activity_horizontal_margin"
android:paddingLeft=
"@dimen/activity_horizontal_margin"
android:paddingRight=
"@dimen/activity_horizontal_margin"
android:paddingRight=
"@dimen/activity_horizontal_margin"
android:background=
"@drawable/etest_bg_default"
>
android:paddingTop=
"@dimen/activity_vertical_margin"
>
<RelativeLayout
android:id=
"@+id/ll_before_eye_start1"
android:layout_width=
"346dp"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:background=
"@color/white"
android:orientation=
"vertical"
android:padding=
"@dimen/dp_20"
>
<TextView
<TextView
android:id=
"@+id/tv_before_eye_top1
"
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_marginTop=
"60dp"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:text=
"@string/before_eye_test_prepare"
android:layout_marginTop=
"@dimen/dp_20"
android:textColor=
"@color/white"
android:text=
"根据C视标开口方向
android:textSize=
"16dp"
/>
点击键盘相应按键"
android:textColor=
"@color/text_color"
android:textSize=
"@dimen/sp_24"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_before_eye_start1
"
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_before_eye_top1"
android:layout_below=
"@+id/tv_after_title"
android:layout_marginTop=
"29dp"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:gravity=
"center"
android:layout_centerVertical=
"true"
android:orientation=
"vertical"
>
android:layout_margin=
"@dimen/dp_20"
android:orientation=
"horizontal"
>
<Text
View
<Image
View
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:lineSpacingExtra=
"3dp"
android:src=
"@drawable/copy"
/>
android:gravity=
"center"
android:text=
"@string/before_eye_test_prompt"
<ImageView
android:textColor=
"@color/white"
android:layout_marginLeft=
"@dimen/dp_20"
android:textSize=
"16dp"
/>
android:layout_gravity=
"center_vertical"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/guide"
/>
<ImageView
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"@dimen/dp_20"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/key"
/>
</LinearLayout>
<TextView
<TextView
android:id=
"@+id/tv_eye_test_start1"
android:id=
"@+id/tv_eye_test_start1"
android:layout_width=
"120dp"
android:layout_width=
"120dip"
android:layout_height=
"50dp"
android:layout_height=
"@dimen/dp_40"
android:layout_marginTop=
"13dp"
android:layout_below=
"@+id/test_result_lay"
android:layout_centerHorizontal=
"true"
android:layout_marginLeft=
"@dimen/dp_22"
android:background=
"@drawable/after_btn_bg"
android:clickable=
"true"
android:clickable=
"true"
android:focusable=
"true"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"@string/before_eye_test_start_btn"
android:text=
"开始测试"
android:textColor=
"@color/e_test_color"
android:textColor=
"@color/white"
android:textSize=
"16dp"
android:textSize=
"15dp"
/>
android:background=
"@drawable/white_bg"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_before_eye_prepare1"
android:id=
"@+id/ll_before_eye_prepare1"
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_before_eye_top1
"
android:layout_
centerInParent=
"true
"
android:layout_marginTop=
"50dp"
android:layout_marginTop=
"50dp"
android:layout_centerHorizontal=
"true"
android:gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:visibility=
"gone"
>
android:visibility=
"gone"
>
...
@@ -68,11 +90,11 @@
...
@@ -68,11 +90,11 @@
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:lineSpacingExtra=
"@dimen/dp_6"
android:gravity=
"center"
android:gravity=
"center"
android:lineSpacingExtra=
"@dimen/dp_6"
android:text=
"@string/eye_test_prepare"
android:text=
"@string/eye_test_prepare"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"22dp"
/>
android:textSize=
"22dp"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/layout/activity_eye_test.xml
View file @
3daae609
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_eye_test_main.xml
View file @
3daae609
...
@@ -95,6 +95,8 @@
...
@@ -95,6 +95,8 @@
android:layout_width=
"0dip"
android:layout_width=
"0dip"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:clickable=
"true"
android:focusable=
"true"
android:background=
"@drawable/white_bg"
android:background=
"@drawable/white_bg"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -108,8 +110,6 @@
...
@@ -108,8 +110,6 @@
<TextView
<TextView
android:layout_width=
"@dimen/dimen_130"
android:layout_width=
"@dimen/dimen_130"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:clickable=
"true"
android:focusable=
"true"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"单人测试"
android:text=
"单人测试"
android:textColor=
"@color/e_test_color"
android:textColor=
"@color/e_test_color"
...
@@ -124,6 +124,8 @@
...
@@ -124,6 +124,8 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"20dp"
android:layout_marginLeft=
"20dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:clickable=
"true"
android:focusable=
"true"
android:background=
"@drawable/white_bg"
android:background=
"@drawable/white_bg"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -138,8 +140,6 @@
...
@@ -138,8 +140,6 @@
android:id=
"@+id/tv_eye_test_histroy"
android:id=
"@+id/tv_eye_test_histroy"
android:layout_width=
"@dimen/dimen_130"
android:layout_width=
"@dimen/dimen_130"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:clickable=
"true"
android:focusable=
"true"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"多人测试"
android:text=
"多人测试"
android:textColor=
"@color/e_test_color"
android:textColor=
"@color/e_test_color"
...
@@ -150,6 +150,8 @@
...
@@ -150,6 +150,8 @@
<LinearLayout
<LinearLayout
android:id=
"@+id/lin_eye_test_statistics"
android:id=
"@+id/lin_eye_test_statistics"
android:layout_width=
"0dip"
android:layout_width=
"0dip"
android:clickable=
"true"
android:focusable=
"true"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"20dp"
android:layout_marginLeft=
"20dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
@@ -166,8 +168,6 @@
...
@@ -166,8 +168,6 @@
<TextView
<TextView
android:layout_width=
"@dimen/dimen_130"
android:layout_width=
"@dimen/dimen_130"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:clickable=
"true"
android:focusable=
"true"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"临时测试"
android:text=
"临时测试"
android:textColor=
"@color/e_test_color"
android:textColor=
"@color/e_test_color"
...
@@ -181,6 +181,8 @@
...
@@ -181,6 +181,8 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"20dp"
android:layout_marginLeft=
"20dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:clickable=
"true"
android:focusable=
"true"
android:background=
"@drawable/white_bg"
android:background=
"@drawable/white_bg"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -194,8 +196,6 @@
...
@@ -194,8 +196,6 @@
<TextView
<TextView
android:layout_width=
"@dimen/dimen_130"
android:layout_width=
"@dimen/dimen_130"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:clickable=
"true"
android:focusable=
"true"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"结果报表"
android:text=
"结果报表"
android:textColor=
"@color/e_test_color"
android:textColor=
"@color/e_test_color"
...
...
app/src/main/res/layout/activity_morepeople.xml
View file @
3daae609
...
@@ -78,13 +78,14 @@
...
@@ -78,13 +78,14 @@
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<EditText
<EditText
android:layout_width=
"120dip"
android:id=
"@+id/key_test"
android:layout_width=
"140dip"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_6"
android:layout_marginLeft=
"@dimen/dp_6"
android:background=
"@null"
android:background=
"@null"
android:hint=
"
按关键词查找
"
android:hint=
"
输入学员编号后4位
"
android:textColorHint=
"@color/hint_text_color"
android:textColorHint=
"@color/hint_text_color"
android:textSize=
"@dimen/sp_1
8
"
/>
android:textSize=
"@dimen/sp_1
6
"
/>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/activity_singletest.xml
View file @
3daae609
...
@@ -34,13 +34,14 @@
...
@@ -34,13 +34,14 @@
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<EditText
<EditText
android:layout_width=
"120dip"
android:id=
"@+id/key_test"
android:layout_width=
"140dip"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_6"
android:layout_marginLeft=
"@dimen/dp_6"
android:background=
"@null"
android:background=
"@null"
android:hint=
"
按关键词查找
"
android:hint=
"
输入学员编号后4位
"
android:textColorHint=
"@color/hint_text_color"
android:textColorHint=
"@color/hint_text_color"
android:textSize=
"@dimen/sp_1
8
"
/>
android:textSize=
"@dimen/sp_1
6
"
/>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/activity_testresult.xml
View file @
3daae609
...
@@ -115,13 +115,14 @@
...
@@ -115,13 +115,14 @@
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<EditText
<EditText
android:layout_width=
"120dip"
android:id=
"@+id/key_test"
android:layout_width=
"140dip"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_6"
android:layout_marginLeft=
"@dimen/dp_6"
android:background=
"@null"
android:background=
"@null"
android:hint=
"
按关键词查找
"
android:hint=
"
输入学员编号后4位
"
android:textColorHint=
"@color/hint_text_color"
android:textColorHint=
"@color/hint_text_color"
android:textSize=
"@dimen/sp_1
8
"
/>
android:textSize=
"@dimen/sp_1
6
"
/>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment