Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-client-android
Commits
06f01c17
Commit
06f01c17
authored
8 years ago
by
Thibault Wittemberg
Browse files
Options
Downloads
Patches
Plain Diff
vcard: Avatar is now saved before cropping it
Change-Id: I1f56df2580b79d35576e8f56c7440f5ef546ec13 Tuleap:
#1125
parent
1fa8c062
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
ring-android/app/src/main/java/cx/ring/client/HomeActivity.java
+0
-1
0 additions, 1 deletion
...ndroid/app/src/main/java/cx/ring/client/HomeActivity.java
ring-android/app/src/main/java/cx/ring/views/MenuHeaderView.java
+5
-6
5 additions, 6 deletions
...droid/app/src/main/java/cx/ring/views/MenuHeaderView.java
with
5 additions
and
7 deletions
ring-android/app/src/main/java/cx/ring/client/HomeActivity.java
+
0
−
1
View file @
06f01c17
...
@@ -591,7 +591,6 @@ public class HomeActivity extends AppCompatActivity implements LocalService.Call
...
@@ -591,7 +591,6 @@ public class HomeActivity extends AppCompatActivity implements LocalService.Call
case
REQUEST_CODE_PHOTO:
case
REQUEST_CODE_PHOTO:
if
(
resultCode
==
RESULT_OK
&&
data
!=
null
){
if
(
resultCode
==
RESULT_OK
&&
data
!=
null
){
fMenuHead
.
updatePhoto
((
Bitmap
)
data
.
getExtras
().
get
(
"data"
));
fMenuHead
.
updatePhoto
((
Bitmap
)
data
.
getExtras
().
get
(
"data"
));
}
}
break
;
break
;
case
REQUEST_CODE_GALLERY:
case
REQUEST_CODE_GALLERY:
...
...
This diff is collapsed.
Click to expand it.
ring-android/app/src/main/java/cx/ring/views/MenuHeaderView.java
+
5
−
6
View file @
06f01c17
...
@@ -27,7 +27,6 @@ import android.content.DialogInterface;
...
@@ -27,7 +27,6 @@ import android.content.DialogInterface;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.drawable.BitmapDrawable
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.provider.MediaStore
;
import
android.provider.MediaStore
;
import
android.support.v4.app.ActivityCompat
;
import
android.support.v4.app.ActivityCompat
;
...
@@ -91,6 +90,7 @@ public class MenuHeaderView extends FrameLayout {
...
@@ -91,6 +90,7 @@ public class MenuHeaderView extends FrameLayout {
@BindView
(
R
.
id
.
user_name
)
@BindView
(
R
.
id
.
user_name
)
TextView
mUserName
;
TextView
mUserName
;
private
Bitmap
mSourcePhoto
;
private
ImageView
mProfilePhoto
;
private
ImageView
mProfilePhoto
;
private
VCard
mVCardProfile
;
private
VCard
mVCardProfile
;
...
@@ -158,8 +158,8 @@ public class MenuHeaderView extends FrameLayout {
...
@@ -158,8 +158,8 @@ public class MenuHeaderView extends FrameLayout {
}
}
public
void
updatePhoto
(
Bitmap
image
)
{
public
void
updatePhoto
(
Bitmap
image
)
{
image
=
CropImageUtils
.
cropImageToCircle
(
image
)
;
mSourcePhoto
=
image
;
mProfilePhoto
.
setImageBitmap
(
image
);
mProfilePhoto
.
setImageBitmap
(
CropImageUtils
.
cropImageToCircle
(
image
)
)
;
}
}
private
void
initViews
()
{
private
void
initViews
()
{
...
@@ -249,10 +249,9 @@ public class MenuHeaderView extends FrameLayout {
...
@@ -249,10 +249,9 @@ public class MenuHeaderView extends FrameLayout {
}
}
mVCardProfile
.
setFormattedName
(
new
FormattedName
(
username
));
mVCardProfile
.
setFormattedName
(
new
FormattedName
(
username
));
if
(
mProfilePhoto
.
getDrawable
()
!=
ResourcesCompat
.
getDrawable
(
getResources
(),
R
.
drawable
.
ic_contact_picture
,
null
))
{
if
(
mSourcePhoto
!=
null
&&
mProfilePhoto
.
getDrawable
()
!=
ResourcesCompat
.
getDrawable
(
getResources
(),
R
.
drawable
.
ic_contact_picture
,
null
))
{
Bitmap
bmp
=
((
BitmapDrawable
)
mProfilePhoto
.
getDrawable
()).
getBitmap
();
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
bmp
.
compress
(
Bitmap
.
CompressFormat
.
PNG
,
100
,
stream
);
mSourcePhoto
.
compress
(
Bitmap
.
CompressFormat
.
PNG
,
100
,
stream
);
Photo
photo
=
new
Photo
(
stream
.
toByteArray
(),
ImageType
.
PNG
);
Photo
photo
=
new
Photo
(
stream
.
toByteArray
(),
ImageType
.
PNG
);
mVCardProfile
.
removeProperties
(
Photo
.
class
);
mVCardProfile
.
removeProperties
(
Photo
.
class
);
mVCardProfile
.
addPhoto
(
photo
);
mVCardProfile
.
addPhoto
(
photo
);
...
...
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