fix #979, properly handle fullscreen mode toggling at panorama view

This commit is contained in:
tibbi 2018-10-04 20:13:16 +02:00
parent 49cf6a4ff6
commit 27a0bcdd1f
2 changed files with 17 additions and 1 deletions

View file

@ -43,7 +43,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:4.8.7' implementation 'com.simplemobiletools:commons:4.8.8'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.android.support:multidex:1.0.3' implementation 'com.android.support:multidex:1.0.3'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -1,12 +1,15 @@
package com.simplemobiletools.gallery.activities package com.simplemobiletools.gallery.activities
import android.annotation.TargetApi
import android.content.res.Configuration import android.content.res.Configuration
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.BitmapFactory import android.graphics.BitmapFactory
import android.graphics.Color import android.graphics.Color
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.Window import android.view.Window
import android.view.WindowManager
import android.widget.RelativeLayout import android.widget.RelativeLayout
import com.google.vr.sdk.widgets.pano.VrPanoramaEventListener import com.google.vr.sdk.widgets.pano.VrPanoramaEventListener
import com.google.vr.sdk.widgets.pano.VrPanoramaView import com.google.vr.sdk.widgets.pano.VrPanoramaView
@ -14,6 +17,8 @@ import com.simplemobiletools.commons.extensions.beVisible
import com.simplemobiletools.commons.extensions.showErrorToast import com.simplemobiletools.commons.extensions.showErrorToast
import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.helpers.isLollipopPlus
import com.simplemobiletools.commons.helpers.isPiePlus
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.extensions.*
import com.simplemobiletools.gallery.helpers.PATH import com.simplemobiletools.gallery.helpers.PATH
@ -32,6 +37,12 @@ open class PanoramaActivity : SimpleActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_panorama) setContentView(R.layout.activity_panorama)
supportActionBar?.hide() supportActionBar?.hide()
if (isPiePlus()) {
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
}
setupButtonMargins() setupButtonMargins()
cardboard.setOnClickListener { cardboard.setOnClickListener {
@ -54,6 +65,7 @@ open class PanoramaActivity : SimpleActivity() {
} }
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
panorama_view.resumeRendering() panorama_view.resumeRendering()
@ -61,6 +73,10 @@ open class PanoramaActivity : SimpleActivity() {
if (config.blackBackground) { if (config.blackBackground) {
updateStatusbarColor(Color.BLACK) updateStatusbarColor(Color.BLACK)
} }
if (isLollipopPlus()) {
window.statusBarColor = resources.getColor(R.color.circle_black_background)
}
} }
override fun onPause() { override fun onPause() {