diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-03-24 18:17:05 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-03-24 18:17:05 +0100 |
commit | e2da73cf6faaa4f292df1852140b95d84728d038 (patch) | |
tree | fa04a9611111cc6c5b98a3f9b146f6610b323139 /src/main/java/de/pixart/messenger | |
parent | 0e15f9f4b39db73b3bd733577bd3872f3f95d95c (diff) |
make auto media rotation in fullscreen configurable
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java index 673124357..26921c136 100644 --- a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java @@ -141,7 +141,9 @@ public class ShowFullscreenMessageActivity extends Activity { width = options.outWidth; rotation = getRotation(Uri.parse("file://" + file.getAbsolutePath())); Log.d(Config.LOGTAG, "Image height: " + height + ", width: " + width + ", rotation: " + rotation); - rotateScreen(width, height, rotation); + if (useAutoRotateScreen()) { + rotateScreen(width, height, rotation); + } final PhotoViewAttacher mAttacher = new PhotoViewAttacher(mImage); mImage.setVisibility(View.VISIBLE); try { @@ -168,7 +170,9 @@ public class ShowFullscreenMessageActivity extends Activity { width = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)); rotation = Integer.valueOf(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION)); Log.d(Config.LOGTAG, "Video height: " + height + ", width: " + width + ", rotation: " + rotation); - rotateScreen(width, height, rotation); + if (useAutoRotateScreen()) { + rotateScreen(width, height, rotation); + } try { mVideo.setVisibility(View.VISIBLE); mVideo.setVideoURI(uri); @@ -256,6 +260,10 @@ public class ShowFullscreenMessageActivity extends Activity { return getPreferences().getBoolean("use_max_brightness", true); } + public boolean useAutoRotateScreen() { + return getPreferences().getBoolean("use_auto_rotate", true); + } + protected SharedPreferences getPreferences() { return PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); } |