handle panorama Cardboard and Explore click listeners
This commit is contained in:
parent
9614bd07c2
commit
7ab78101c0
1 changed files with 13 additions and 0 deletions
|
@ -17,7 +17,10 @@ import com.simplemobiletools.gallery.helpers.PATH
|
||||||
import kotlinx.android.synthetic.main.activity_panorama.*
|
import kotlinx.android.synthetic.main.activity_panorama.*
|
||||||
|
|
||||||
open class PanoramaActivity : SimpleActivity() {
|
open class PanoramaActivity : SimpleActivity() {
|
||||||
|
private val CARDBOARD_DISPLAY_MODE = 3
|
||||||
|
|
||||||
private var isFullScreen = true
|
private var isFullScreen = true
|
||||||
|
private var isExploreEnabled = true
|
||||||
|
|
||||||
public override fun onCreate(savedInstanceState: Bundle?) {
|
public override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
useDynamicTheme = false
|
useDynamicTheme = false
|
||||||
|
@ -29,6 +32,16 @@ open class PanoramaActivity : SimpleActivity() {
|
||||||
(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
|
||||||
|
|
||||||
|
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) {
|
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||||
if (it) {
|
if (it) {
|
||||||
checkIntent()
|
checkIntent()
|
||||||
|
|
Loading…
Reference in a new issue