From 7ab78101c09d5fd0a938103ac5f11203dc612789 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 3 Jul 2018 21:23:21 +0200 Subject: [PATCH] handle panorama Cardboard and Explore click listeners --- .../gallery/activities/PanoramaActivity.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt index 231dc1cea..852dc5c8c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PanoramaActivity.kt @@ -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()