aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-05-29 19:33:15 +0200
committerChristian Schneppe <christian@pix-art.de>2016-05-29 19:33:15 +0200
commitaba7c2ea2f996db05efd8cf9867c3544b2521f2c (patch)
tree5d05fa93d9236d27e074633df008484dfad88431 /src/main/java
parent04ceeec4b302a23f14d73e4d6e479ebf28145c8e (diff)
let screen on while playing videos or showing images
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java b/src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java
index d32279300..9befd1dea 100644
--- a/src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ShowFullscreenMessageActivity.java
@@ -35,11 +35,12 @@ public class ShowFullscreenMessageActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
WindowManager.LayoutParams layout = getWindow().getAttributes();
layout.screenBrightness = 1;
getWindow().setAttributes(layout);
- super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
+ getWindow().addFlags(layout.FLAG_KEEP_SCREEN_ON);
getActionBar().hide();
setContentView(R.layout.activity_fullscreen_message);
mImage = (PhotoView) findViewById(R.id.message_image_view);
@@ -116,6 +117,7 @@ public class ShowFullscreenMessageActivity extends Activity {
WindowManager.LayoutParams layout = getWindow().getAttributes();
layout.screenBrightness = -1;
getWindow().setAttributes(layout);
+ getWindow().clearFlags(layout.FLAG_KEEP_SCREEN_ON);
super.onStop();
}
} \ No newline at end of file