diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-09-17 20:39:13 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-09-17 20:39:13 +0200 |
commit | 66480f401476d974f903465289830342028185ec (patch) | |
tree | 44991b13639402c1ab1acde534d481f739ed6782 /src/main | |
parent | 61b7e83316adc2e341fa80adbda6a6ba27f11ba0 (diff) |
some bug fixes in FullScreenMessageActivity
* set fullscreen via theme
* adjust brightness during onPause, onResume
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java | 16 |
2 files changed, 6 insertions, 11 deletions
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 @@ </activity> <activity android:name="de.pixart.messenger.ui.ShowFullscreenMessageActivity" + android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="orientation|screenSize" android:hardwareAccelerated="true"> </activity> 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(); } |