From 958e4f6aa5f2bb83d0a3771eae1dc4016efb873f Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 22 Jul 2023 10:48:36 +0200 Subject: [PATCH] Fix issue #904 - Avoid sleep mode for media activity --- .../app/fedilab/android/mastodon/activities/MediaActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java index e5fe75917..5e9b2e1e6 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java @@ -32,6 +32,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.Window; +import android.view.WindowManager; import android.widget.Toast; import androidx.annotation.NonNull; @@ -103,6 +104,7 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); ActivityCompat.postponeEnterTransition(MediaActivity.this); binding = ActivityMediaPagerBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot());