diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java | 12 | ||||
-rw-r--r-- | src/main/res/values/strings.xml | 2 | ||||
-rw-r--r-- | src/main/res/xml/preferences.xml | 5 |
3 files changed, 17 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()); } diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 3b14c23a4..526f92c80 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -759,4 +759,6 @@ <string name="presence_offline">Offline</string> <string name="block_stranger">Block stranger</string> <string name="block_entire_domain">Block entire domain</string> + <string name="pref_use_auto_rotate_summary">Rotate images and videos in fullscreen to fit screensize</string> + <string name="pref_use_auto_rotate">rotate media in fullscreen</string> </resources> diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index 70b28c999..dd5dab37d 100644 --- a/src/main/res/xml/preferences.xml +++ b/src/main/res/xml/preferences.xml @@ -33,6 +33,11 @@ android:key="use_max_brightness" android:summary="@string/pref_use_max_brightness_summary" android:title="@string/pref_use_max_brightness" /> + <CheckBoxPreference + android:defaultValue="true" + android:key="use_auto_rotate" + android:summary="@string/pref_use_auto_rotate_summary" + android:title="@string/pref_use_auto_rotate" /> </PreferenceScreen> <!--Notifications--> <PreferenceScreen |