Commit bfc2a9e6 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

screen orientation for photo viewer

parent 9f75c250
package com.biganto.visual.roompark.conductor.dialogs.change_handler package com.biganto.visual.roompark.conductor.dialogs.change_handler
import android.content.pm.ActivityInfo
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
...@@ -32,6 +33,8 @@ class PhotoDialogController : Controller { ...@@ -32,6 +33,8 @@ class PhotoDialogController : Controller {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View {
val view = inflater.inflate(getLayoutId(), container, false) val view = inflater.inflate(getLayoutId(), container, false)
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
args.getString(PHOTO_URL_KEY)?.let { args.getString(PHOTO_URL_KEY)?.let {
val photoView = view.findViewById<PhotoView>(R.id.photo_frame) val photoView = view.findViewById<PhotoView>(R.id.photo_frame)
Glide.with(photoView) Glide.with(photoView)
...@@ -50,6 +53,7 @@ class PhotoDialogController : Controller { ...@@ -50,6 +53,7 @@ class PhotoDialogController : Controller {
fun getLayoutId() = R.layout.photo_viewer fun getLayoutId() = R.layout.photo_viewer
override fun handleBack(): Boolean { override fun handleBack(): Boolean {
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
return router.popCurrentController() return router.popCurrentController()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment