Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
69e26f9c
Commit
69e26f9c
authored
Feb 26, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加advance活体
parent
16a69b13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/main/java/com/common/activity/TakePhotoActivity.java
+7
-4
No files found.
src/main/java/com/common/activity/TakePhotoActivity.java
View file @
69e26f9c
...
...
@@ -14,6 +14,7 @@ import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
import
java.io.File
;
import
tech.starwin.R
;
import
com.common.base.BaseActivity
;
import
tech.starwin.impl.OnNoShakeClickListener
;
...
...
@@ -23,6 +24,7 @@ import tech.starwin.utils.context_utils.ActivityJumper;
import
tech.starwin.utils.context_utils.EasyActivityResult
;
import
tech.starwin.utils.ui_utils.QMUIHelper
;
import
tech.starwin.utils.ui_utils.UIHelper
;
import
com.common.widget.CameraView
;
import
com.common.widget.TopBar
;
...
...
@@ -69,8 +71,9 @@ public class TakePhotoActivity extends BaseActivity {
TopBar
topBar
=
findViewById
(
R
.
id
.
activity_take_photo_topbar
);
topBar
.
setStatusBarHeight
(
QMUIStatusBarHelper
.
getStatusbarHeight
(
this
));
topBar
.
toolBar
().
addLeftBackImageButton
().
setOnClickListener
(
v
->
finish
());
QMUIHelper
.
getTopbarCustomizer
().
madeTopBar
(
topBar
);
topBar
.
toolBar
().
setTitle
(
R
.
string
.
text_take_photo
);
QMUIHelper
.
getTopbarCustomizer2
().
madeTopBar
(
topBar
);
QMUIHelper
.
getTopbarCustomizer2
().
initTopBar
(
topBar
,
this
);
btnCapture
=
findViewById
(
R
.
id
.
button_shoot
);
mbtnCancel
=
findViewById
(
R
.
id
.
button_cancel
);
...
...
@@ -103,13 +106,13 @@ public class TakePhotoActivity extends BaseActivity {
}
File
file
=
BitmapUtils
.
saveBitmapToSDCard
(
bitmap
,
image
,
100
);
if
(
file
==
null
)
{
if
(
file
==
null
)
{
setResult
(
RESULT_CANCELED
);
finish
();
return
;
}
//如果图片过大,则压缩
long
size
=
FileUtils
.
getFileSize
(
file
)/
1024
;
long
size
=
FileUtils
.
getFileSize
(
file
)
/
1024
;
if
(
FileUtils
.
getFileSize
(
file
)
/
1024
>
1024
)
{
int
quality
=
(
int
)
(
100
*
(
1024
f
/
size
));
file
=
BitmapUtils
.
saveBitmapToSDCard
(
bitmap
,
image
,
quality
);
...
...
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