From 66480f401476d974f903465289830342028185ec Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 17 Sep 2016 20:39:13 +0200 Subject: some bug fixes in FullScreenMessageActivity * set fullscreen via theme * adjust brightness during onPause, onResume --- src/main/AndroidManifest.xml | 1 + .../messenger/ui/ShowFullscreenMessageActivity.java | 16 +++++----------- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'src/main') diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 7a6201974..4298baf40 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -221,6 +221,7 @@ diff --git a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java index 5aef4b112..bca5ee183 100644 --- a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java @@ -34,7 +34,7 @@ import uk.co.senab.photoview.PhotoViewAttacher; public class ShowFullscreenMessageActivity extends Activity { - Integer oldOrientation = getRequestedOrientation(); + Integer oldOrientation; PhotoView mImage; FullscreenVideoLayout mVideo; ImageView mFullscreenbutton; @@ -47,20 +47,12 @@ public class ShowFullscreenMessageActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + oldOrientation = getRequestedOrientation(); + WindowManager.LayoutParams layout = getWindow().getAttributes(); layout.screenBrightness = 1; getWindow().setAttributes(layout); - getWindow().requestFeature(Window.FEATURE_ACTION_BAR); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); - getActionBar().hide(); - if (Build.VERSION.SDK_INT < 16) { - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FULLSCREEN); - } else { - View decorView = getWindow().getDecorView(); - int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; - decorView.setSystemUiVisibility(uiOptions); - } setContentView(R.layout.activity_fullscreen_message); mImage = (PhotoView) findViewById(R.id.message_image_view); mVideo = (FullscreenVideoLayout) findViewById(R.id.message_video_view); @@ -208,6 +200,8 @@ public class ShowFullscreenMessageActivity extends Activity { protected void onResume() { WindowManager.LayoutParams layout = getWindow().getAttributes(); layout.screenBrightness = 1; + getWindow().setAttributes(layout); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); mVideo.setShouldAutoplay(true); super.onResume(); } -- cgit v1.2.3