handle panorama event clicks + disable fullscreen by default
This commit is contained in:
parent
7ab78101c0
commit
cf07b918de
1 changed files with 7 additions and 2 deletions
|
@ -5,6 +5,7 @@ import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
import android.widget.RelativeLayout
|
import android.widget.RelativeLayout
|
||||||
|
import com.google.vr.sdk.widgets.pano.VrPanoramaEventListener
|
||||||
import com.google.vr.sdk.widgets.pano.VrPanoramaView
|
import com.google.vr.sdk.widgets.pano.VrPanoramaView
|
||||||
import com.simplemobiletools.commons.extensions.beVisible
|
import com.simplemobiletools.commons.extensions.beVisible
|
||||||
import com.simplemobiletools.commons.extensions.toast
|
import com.simplemobiletools.commons.extensions.toast
|
||||||
|
@ -19,7 +20,7 @@ import kotlinx.android.synthetic.main.activity_panorama.*
|
||||||
open class PanoramaActivity : SimpleActivity() {
|
open class PanoramaActivity : SimpleActivity() {
|
||||||
private val CARDBOARD_DISPLAY_MODE = 3
|
private val CARDBOARD_DISPLAY_MODE = 3
|
||||||
|
|
||||||
private var isFullScreen = true
|
private var isFullScreen = false
|
||||||
private var isExploreEnabled = true
|
private var isExploreEnabled = true
|
||||||
|
|
||||||
public override fun onCreate(savedInstanceState: Bundle?) {
|
public override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
@ -28,7 +29,6 @@ open class PanoramaActivity : SimpleActivity() {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_panorama)
|
setContentView(R.layout.activity_panorama)
|
||||||
supportActionBar?.hide()
|
supportActionBar?.hide()
|
||||||
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_FULLSCREEN
|
|
||||||
(cardboard.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
|
(cardboard.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
|
||||||
(explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
|
(explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
|
||||||
|
|
||||||
|
@ -82,6 +82,11 @@ open class PanoramaActivity : SimpleActivity() {
|
||||||
loadImageFromBitmap(bitmap, options)
|
loadImageFromBitmap(bitmap, options)
|
||||||
setFlingingEnabled(true)
|
setFlingingEnabled(true)
|
||||||
setPureTouchTracking(true)
|
setPureTouchTracking(true)
|
||||||
|
setEventListener(object : VrPanoramaEventListener() {
|
||||||
|
override fun onClick() {
|
||||||
|
handleClick()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// add custom buttons so we can position them and toggle visibility as desired
|
// add custom buttons so we can position them and toggle visibility as desired
|
||||||
setFullscreenButtonEnabled(false)
|
setFullscreenButtonEnabled(false)
|
||||||
|
|
Loading…
Reference in a new issue