Baseflow / Baseflow/PhotoView

Image height not displaying properly

Open
#642 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
18.8k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

Hello!

My images are not displaying properly. It fits fine with width, but the height just doesn't change at all.

This is my code and this is how it shows the image for me.

This is the custom xml to display the image

`


`

This is it being implemented

` TextView textviewUsername, textviewUserEmail;
CircleImageView profilePic;
byte[] decodedString = Base64.decode(SharedPrefManager.getInstance(this).getUser().getPhoto(),
Base64.DEFAULT);
Bitmap bmpProfilePic = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_profile);

profilePic = findViewById(R.id.imgProfilePic);
profilePic.setImageBitmap(bmpProfilePic);

profilePic.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(UserProfile.this);
View mView = getLayoutInflater().inflate(R.layout.photo_view, null);
PhotoView photoView = mView.findViewById(R.id.imageZoom);
photoView.setImageBitmap(bmpProfilePic);
mBuilder.setView(mView);
AlertDialog mDialog = mBuilder.create();
mDialog.show();
}
});`

And this is the result of the image

![2018-09-13 14_02_51-android emulator - pixel_2_api_23_5554](https://user-images.githubusercontent.com/17991500/45503610-bc12f280-b75d-11e8-8c01-27a55ca70586.png)
![2018-09-13 14_02_32-android emulator - pixel_2_api_23_5554](https://user-images.githubusercontent.com/17991500/45503611-bcab8900-b75d-11e8-87aa-a510e35ca5a7.png)

Could you help me, please?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.