Fix issue #904 - Avoid sleep mode for media activity

This commit is contained in:
Thomas 2023-07-22 10:48:36 +02:00
parent 0daee80325
commit 958e4f6aa5

View file

@ -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());