This commit is contained in:
Mario Danic 2017-01-19 13:44:51 +01:00 committed by AndyScherzinger
parent db090eff0c
commit 8b6d441b6a
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 14 additions and 10 deletions

View file

@ -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"

View file

@ -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);