handle panorama Cardboard and Explore click listeners

This commit is contained in:
tibbi 2018-07-03 21:23:21 +02:00
parent 9614bd07c2
commit 7ab78101c0

View file

@ -17,7 +17,10 @@ import com.simplemobiletools.gallery.helpers.PATH
import kotlinx.android.synthetic.main.activity_panorama.*
open class PanoramaActivity : SimpleActivity() {
private val CARDBOARD_DISPLAY_MODE = 3
private var isFullScreen = true
private var isExploreEnabled = true
public override fun onCreate(savedInstanceState: Bundle?) {
useDynamicTheme = false
@ -29,6 +32,16 @@ open class PanoramaActivity : SimpleActivity() {
(cardboard.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
(explore.layoutParams as RelativeLayout.LayoutParams).bottomMargin = navigationBarHeight
cardboard.setOnClickListener {
panorama_view.displayMode = CARDBOARD_DISPLAY_MODE
}
explore.setOnClickListener {
isExploreEnabled = !isExploreEnabled
panorama_view.setPureTouchTracking(isExploreEnabled)
explore.setImageResource(if (isExploreEnabled) R.drawable.ic_explore else R.drawable.ic_explore_off)
}
handlePermission(PERMISSION_WRITE_STORAGE) {
if (it) {
checkIntent()