Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huangzhicong
/
SmartCanteen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f3e363a8
authored
Mar 18, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配天波机器的按键调节音量(目前发现无法弹出音量调节框)
parent
7431b771
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
app/src/main/java/com/bgycc/smartcanteen/activity/MainActivity.java
+4
-2
No files found.
app/src/main/java/com/bgycc/smartcanteen/activity/MainActivity.java
View file @
f3e363a8
...
@@ -415,16 +415,18 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
...
@@ -415,16 +415,18 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
LogUtils
.
i
(
TAG
,
"按键KeyCode: "
+
keyCode
);
LogUtils
.
i
(
TAG
,
"按键KeyCode: "
+
keyCode
);
switch
(
keyCode
)
{
switch
(
keyCode
)
{
case
KeyEvent
.
KEYCODE_PAGE_UP
:
case
KeyEvent
.
KEYCODE_PAGE_UP
:
case
KeyEvent
.
KEYCODE_NUMPAD_ADD
:
audioManager
.
adjustStreamVolume
(
audioManager
.
adjustStreamVolume
(
AudioManager
.
STREAM_SYSTEM
,
AudioManager
.
STREAM_SYSTEM
,
AudioManager
.
ADJUST_RAISE
,
AudioManager
.
ADJUST_RAISE
,
AudioManager
.
FLAG_SHOW_UI
);
AudioManager
.
FLAG_
PLAY_SOUND
|
AudioManager
.
FLAG_
SHOW_UI
);
break
;
break
;
case
KeyEvent
.
KEYCODE_PAGE_DOWN
:
case
KeyEvent
.
KEYCODE_PAGE_DOWN
:
case
KeyEvent
.
KEYCODE_NUMPAD_SUBTRACT
:
audioManager
.
adjustStreamVolume
(
audioManager
.
adjustStreamVolume
(
AudioManager
.
STREAM_SYSTEM
,
AudioManager
.
STREAM_SYSTEM
,
AudioManager
.
ADJUST_LOWER
,
AudioManager
.
ADJUST_LOWER
,
AudioManager
.
FLAG_SHOW_UI
);
AudioManager
.
FLAG_
PLAY_SOUND
|
AudioManager
.
FLAG_
SHOW_UI
);
break
;
break
;
}
}
return
super
.
onKeyDown
(
keyCode
,
event
);
return
super
.
onKeyDown
(
keyCode
,
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