mirror of
https://github.com/nextcloud/android.git
synced 2024-12-20 16:02:01 +03:00
Fixes #456
This commit is contained in:
parent
db090eff0c
commit
8b6d441b6a
2 changed files with 14 additions and 10 deletions
|
@ -31,10 +31,9 @@
|
|||
android:id="@+id/top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#000000"
|
||||
tools:context=".ui.fragment.PreviewImageFragment" >
|
||||
android:background="#000000">
|
||||
|
||||
<ProgressBar
|
||||
<ProgressBar
|
||||
android:id="@+id/progressWheel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -45,13 +44,13 @@
|
|||
|
||||
<third_parties.michaelOrtiz.TouchImageViewCustom
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/zero"
|
||||
android:layout_centerInParent="true"
|
||||
android:contentDescription="@string/preview_image_description"
|
||||
android:src="@drawable/image_fail" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -150,17 +150,19 @@ public class PreviewImageFragment extends FileFragment {
|
|||
View view = inflater.inflate(R.layout.preview_image_fragment, container, false);
|
||||
mImageView = (TouchImageViewCustom) view.findViewById(R.id.image);
|
||||
mImageView.setVisibility(View.GONE);
|
||||
mImageView.setOnClickListener(new OnClickListener() {
|
||||
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
((PreviewImageActivity) getActivity()).toggleFullScreen();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
mMessageView = (TextView)view.findViewById(R.id.message);
|
||||
mMessageView.setVisibility(View.GONE);
|
||||
mProgressWheel = (ProgressBar)view.findViewById(R.id.progressWheel);
|
||||
mProgressWheel.setVisibility(View.VISIBLE);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -441,8 +443,10 @@ public class PreviewImageFragment extends FileFragment {
|
|||
Log_OC.e(TAG, "File could not be loaded as a bitmap: " + storagePath);
|
||||
break;
|
||||
} else {
|
||||
// Rotate image, obeying exif tag.
|
||||
result = BitmapUtils.rotateImage(result, storagePath);
|
||||
if (ocFile.getFileName().endsWith("jpg") || ocFile.getFileName().endsWith("jpeg")) {
|
||||
// Rotate image, obeying exif tag.
|
||||
result = BitmapUtils.rotateImage(result, storagePath);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (OutOfMemoryError e) {
|
||||
|
@ -508,6 +512,7 @@ public class PreviewImageFragment extends FileFragment {
|
|||
Log_OC.d(TAG, "Showing image with resolution " + bitmap.getWidth() + "x" +
|
||||
bitmap.getHeight());
|
||||
|
||||
|
||||
if (result.ocFile.getMimetype().equalsIgnoreCase("image/png")) {
|
||||
Drawable backrepeat = getResources().getDrawable(R.drawable.backrepeat);
|
||||
imageView.setBackground(backrepeat);
|
||||
|
|
Loading…
Reference in a new issue