Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
IBMS
/
nativeview
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
608ebbf0
authored
Feb 21, 2022
by
huangzhicong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加对最大录音时长的限制,规范化对录音返回结果的处理函数
parent
8e557287
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/src/main/java/com/maxrocky/nativeview/fragment/MainFragment.kt
+1
-1
app/src/main/java/com/maxrocky/nativeview/fragment/RecorderBottomSheet.kt
+2
-2
No files found.
app/src/main/java/com/maxrocky/nativeview/fragment/MainFragment.kt
View file @
608ebbf0
...
...
@@ -45,7 +45,7 @@ class MainFragment : Fragment() {
savedInstanceState
:
Bundle
?
):
View
?
{
setFragmentResultListener
(
RecorderBottomSheet
.
REQUEST_KEY
)
{
requestKey
,
bundle
->
val
(
uri
,
path
)
=
RecorderBottomSheet
.
getRe
ques
t
(
bundle
)
val
(
uri
,
path
)
=
RecorderBottomSheet
.
getRe
sul
t
(
bundle
)
recordAudioContract
.
onResult
(
uri
,
path
)
Log
.
d
(
TAG
,
"$requestKey, uri: $uri"
)
}
...
...
app/src/main/java/com/maxrocky/nativeview/fragment/RecorderBottomSheet.kt
View file @
608ebbf0
...
...
@@ -40,7 +40,7 @@ class RecorderBottomSheet : BottomSheetDialogFragment() {
fun
createRecorderBundle
(
maxDuration
:
Int
):
Bundle
=
Bundle
().
apply
{
putInt
(
ARG_MAX_DURATION
,
maxDuration
)
}
fun
getRe
ques
t
(
bundle
:
Bundle
):
Pair
<
Uri
?,
String
?>
=
fun
getRe
sul
t
(
bundle
:
Bundle
):
Pair
<
Uri
?,
String
?>
=
Pair
(
bundle
.
getParcelable
(
request_uri
),
bundle
.
getString
(
request_path
))
}
...
...
@@ -94,7 +94,7 @@ class RecorderBottomSheet : BottomSheetDialogFragment() {
start
=
view
.
findViewById
(
R
.
id
.
start
)
var
maxDuration
=
arguments
?.
getInt
(
ARG_MAX_DURATION
)
if
(
maxDuration
==
null
||
maxDuration
==
0
)
{
if
(
maxDuration
==
null
||
maxDuration
==
0
||
maxDuration
>
DEFAULT_MAX_RECORD_TIME
)
{
maxDuration
=
DEFAULT_MAX_RECORD_TIME
}
// 显示的录音限制时长不包含最大值,因此需要-1
...
...
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