Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import android.util.Log
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.view.WindowManager
import android.webkit.MimeTypeMap
import android.widget.Toast
import androidx.core.app.ShareCompat
Expand Down Expand Up @@ -155,6 +156,11 @@ class ViewMediaActivity : BaseActivity(), HasAndroidInjector, ViewImageFragment.
window.sharedElementEnterTransition.removeListener(this)
}
})

// Prevent this activity from dimming or sleeping the screen if it is playing video or audio
if (attachments!![binding.viewPager.currentItem].attachment.type != Attachment.Type.IMAGE) {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
Expand Down