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
b5f913af
Commit
b5f913af
authored
Sep 13, 2018
by
chengxiuhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test main
parent
69a08f3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletions
+24
-1
EyeSettingActivity.java
app/src/main/java/com/oo/eye/activity/EyeSettingActivity.java
+24
-1
No files found.
app/src/main/java/com/oo/eye/activity/EyeSettingActivity.java
View file @
b5f913af
package
com
.
oo
.
eye
.
activity
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.widget.RadioButton
;
import
android.widget.RadioGroup
;
import
android.widget.RelativeLayout
;
import
com.app.baselibrary.base.common.BaseActivity
;
import
com.app.baselibrary.commonUtil.LogUtil
;
import
com.app.baselibrary.commonUtil.PreferencesUtils
;
import
com.oo.eye.EyeConfig
;
import
com.oo.eye.R
;
...
...
@@ -241,7 +243,7 @@ public class EyeSettingActivity extends BaseActivity {
});
}
@OnClick
({
R
.
id
.
back_iv
,
R
.
id
.
about_lay
,
R
.
id
.
close_lay
})
@OnClick
({
R
.
id
.
back_iv
,
R
.
id
.
about_lay
,
R
.
id
.
close_lay
})
public
void
onClick
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
back_iv
:
...
...
@@ -255,4 +257,25 @@ public class EyeSettingActivity extends BaseActivity {
break
;
}
}
private
long
mLastOnKeyTime
=
-
1
;
@Override
public
boolean
dispatchKeyEvent
(
KeyEvent
event
)
{
if
(
event
.
getAction
()
==
KeyEvent
.
ACTION_UP
)
{
//两次点击大于1秒
long
currentTime
=
System
.
currentTimeMillis
();
if
(
mLastOnKeyTime
>
0
&&
currentTime
-
mLastOnKeyTime
<
500
)
{
return
true
;
}
mLastOnKeyTime
=
currentTime
;
LogUtil
.
e
(
"---查看按键对应的数字---"
+
event
.
getKeyCode
());
switch
(
event
.
getKeyCode
())
{
case
KeyEvent
.
KEYCODE_DEL
:
//返回键
finish
();
return
true
;
}
}
return
super
.
dispatchKeyEvent
(
event
);
}
}
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