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
ab01fcba
Commit
ab01fcba
authored
Aug 29, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix other pics
parent
11747c03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
src/main/java/com/common/activity/TakePhotoActivity.java
+17
-6
No files found.
src/main/java/com/common/activity/TakePhotoActivity.java
View file @
ab01fcba
...
...
@@ -38,8 +38,16 @@ import com.common.widget.TopBar;
*/
public
class
TakePhotoActivity
extends
BaseActivity
{
public
enum
PhotoType
{
KTP
,
WORK_CARD
KTP
(
"ktp_img.jpg"
),
WORK_CARD
(
"work_card_img.jpg"
),
OTHERS_IMG
(
"others_img.jpg"
);
private
String
img_path
;
PhotoType
(
String
path
)
{
img_path
=
path
;
}
}
public
static
void
startForResult
(
FragmentActivity
activity
,
int
requestCode
,
PhotoType
type
,
@DrawableRes
int
previewMask
,
@DrawableRes
int
shootBtnImg
,
EasyActivityResult
.
OnResultListener
result
)
{
...
...
@@ -51,13 +59,12 @@ public class TakePhotoActivity extends BaseActivity {
new
EasyActivityResult
(
activity
).
startForResult
(
intent
,
requestCode
,
result
);
}
PhotoType
photoType
;
ImageView
btnCapture
;
ImageView
maskImv
;
Button
mbtnCancel
;
CameraView
cameraView
;
public
static
String
KTP_IMAGE
=
"ktp_img.jpg"
;
@Override
public
boolean
useTopBar
()
{
...
...
@@ -99,8 +106,12 @@ public class TakePhotoActivity extends BaseActivity {
if
(
TextUtils
.
equals
(
type
,
PhotoType
.
KTP
.
name
()))
{
TrackEventHelper
.
logEvent
(
TrackEvent
.
Click
.
KTP_SHOT
);
findViewById
(
R
.
id
.
imageview_id_frame
).
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
TextUtils
.
equals
(
type
,
PhotoType
.
WORK_CARD
.
name
())){
photoType
=
PhotoType
.
KTP
;
}
else
if
(
TextUtils
.
equals
(
type
,
PhotoType
.
WORK_CARD
.
name
()))
{
TrackEventHelper
.
logEvent
(
TrackEvent
.
Click
.
WORK_CARD_SHOT
);
photoType
=
PhotoType
.
WORK_CARD
;
}
else
{
photoType
=
PhotoType
.
OTHERS_IMG
;
}
UIHelper
.
bindClickListener
(
new
OnNoShakeClickListener
()
{
...
...
@@ -119,7 +130,7 @@ public class TakePhotoActivity extends BaseActivity {
// setResult(RESULT_OK);
// finish();
File
image
=
FileUtils
.
getImageFile
(
getApplicationContext
(),
KTP_IMAGE
);
File
image
=
FileUtils
.
getImageFile
(
getApplicationContext
(),
photoType
.
img_path
);
if
(!
image
.
exists
())
{
image
.
mkdir
();
}
...
...
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