Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SEProject
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kishore Kumar
SEProject
Commits
fe330511
Commit
fe330511
authored
8 years ago
by
melvinabraham
Browse files
Options
Downloads
Patches
Plain Diff
Fixes
#1
parent
902f1fff
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/com/mapps/seproject/CameraFragment.java
+11
-6
11 additions, 6 deletions
app/src/main/java/com/mapps/seproject/CameraFragment.java
app/src/main/res/layout/fragment_camera.xml
+4
-5
4 additions, 5 deletions
app/src/main/res/layout/fragment_camera.xml
with
15 additions
and
11 deletions
app/src/main/java/com/mapps/seproject/CameraFragment.java
+
11
−
6
View file @
fe330511
...
...
@@ -3,6 +3,7 @@ package com.mapps.seproject;
import
android.app.Fragment
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.media.Image
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Environment
;
...
...
@@ -27,13 +28,13 @@ public class CameraFragment extends Fragment {
private
Uri
file
;
static
final
int
REQUEST_IMAGE_CAPTURE
=
1
;
ImageView
mImageV
iew
;
View
v
iew
;
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
// Inflate the layout for this fragment
View
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_camera
,
container
,
false
);
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_camera
,
container
,
false
);
return
view
;
...
...
@@ -63,13 +64,21 @@ public class CameraFragment extends Fragment {
@Override
public
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
ImageView
mImageView
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
imageView
);
if
(
requestCode
==
REQUEST_IMAGE_CAPTURE
&&
resultCode
==
RESULT_OK
)
{
Bundle
extras
=
data
.
getExtras
();
Bitmap
imageBitmap
=
(
Bitmap
)
extras
.
get
(
"data"
);
if
(
imageBitmap
==
null
){
// No image was taken
}
else
{
mImageView
.
setImageBitmap
(
imageBitmap
);
}
}
}
...
...
@@ -95,10 +104,6 @@ public class CameraFragment extends Fragment {
@Override
public
void
onStart
(){
super
.
onStart
();
...
...
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/fragment_camera.xml
+
4
−
5
View file @
fe330511
...
...
@@ -5,11 +5,10 @@
android:layout_height=
"match_parent"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:srcCompat=
"@drawable/googleg_standard_color_18"
android:id=
"@+id/imageView"
android:layout_centerVertical=
"true"
android:layout_width=
"match_parent"
android:layout_height=
"300dp"
android:layout_alignParentStart=
"true"
android:layout_marginStart=
"13dp"
/>
android:layout_marginStart=
"13dp"
app:srcCompat=
"@drawable/googleg_standard_color_18"
/>
</RelativeLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment