diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoActivity.kt index 771f895a6..ef309a26d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoActivity.kt @@ -7,7 +7,4 @@ class PhotoActivity : PhotoVideoActivity() { PhotoVideoActivity.mIsVideo = false super.onCreate(savedInstanceState) } - - override fun systemUiVisibilityChanged(visibility: Int) { - } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index b4b393df7..2fda7d2a0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -359,6 +359,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View updateActionbarTitle() updatePagerItems() invalidateOptionsMenu() + checkOrientation() } mCurrAsyncTask!!.execute() } @@ -384,6 +385,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View scanPath(mDirectory) {} } + private fun checkOrientation() { + if (config.autoRotateScreen) { + val res = getCurrentFile().getResolution() + } + } + override fun fragmentClicked() { mIsFullScreen = !mIsFullScreen if (mIsFullScreen) { @@ -426,6 +433,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View updateActionbarTitle() mRotationDegrees = 0f supportInvalidateOptionsMenu() + checkOrientation() } override fun onPageScrollStateChanged(state: Int) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 32a4d89d8..9124af1f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -41,7 +41,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mDuration = 0 lateinit var mView: View - lateinit var mMedium: Medium + lateinit var medium: Medium companion object { private val TAG = VideoFragment::class.java.simpleName @@ -51,7 +51,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { mView = inflater.inflate(R.layout.pager_video_item, container, false) - mMedium = arguments.getSerializable(MEDIUM) as Medium + medium = arguments.getSerializable(MEDIUM) as Medium if (savedInstanceState != null) { mCurrTime = savedInstanceState.getInt(PROGRESS) } @@ -209,7 +209,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee try { mMediaPlayer = MediaPlayer().apply { - setDataSource(context, Uri.parse(mMedium.path)) + setDataSource(context, Uri.parse(medium.path)) setDisplay(mSurfaceHolder) setOnCompletionListener { videoCompleted() } setOnVideoSizeChangedListener({ mediaPlayer, width, height -> setVideoSize() })