Improve full-screen image viewer gestures
This commit is contained in:
@@ -10,6 +10,7 @@ import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
@@ -48,7 +49,15 @@ class ImageViewerDialogFragment : DialogFragment() {
|
||||
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
|
||||
setBackgroundDrawable(ColorDrawable(Color.BLACK))
|
||||
WindowCompat.setDecorFitsSystemWindows(this, false)
|
||||
addFlags(android.view.WindowManager.LayoutParams.FLAG_SECURE)
|
||||
statusBarColor = Color.TRANSPARENT
|
||||
navigationBarColor = Color.TRANSPARENT
|
||||
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
attributes = attributes.apply {
|
||||
layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
||||
}
|
||||
addFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||
}
|
||||
hideSystemControls()
|
||||
loadImage(requireArguments().getString(ARGUMENT_IMAGE_ID)!!)
|
||||
|
||||
Reference in New Issue
Block a user